Search This Blog

Thursday, May 7, 2020

Need for Customer Exits when User Exits were available

  • User Exits are subroutines.

  • In the earlier days for writing code inside a user exit, customer needed to register that object with SAP to obtain an access key and then write their own logic inside that subroutine, however this is not the case now.

  • Customer Exits are function modules with a custom include inside them.

Monday, May 4, 2020

Selection Screen Tabs in Executable Programs

Create Tab Strips in Executable Programs in ABAP :



Follow the below steps -

  • Declare the tabs as subscreens

Saturday, May 2, 2020

COMMIT inside a BADI Implementation

Commit work in BADI Implementation is not advisable as it can lead to process inconsistencies.

  • COMMIT WORK will end the Logical Unit of Work (LUW) and a new LUW will begin.

  • COMMIT WORK will clear/refresh the buffers.


Monday, April 27, 2020

Debugging a Background Job

  • In the Job Overview transaction SM37, select the job that has finished and enter jdbg in the command field. The Debugger will start. It will simulate the exact scenario with the same selection screen values, and the system variable SY-BATCH will be set to X (abap_true).


Differences between the Classic and the New ABAP Debugger

  • The new ABAP Debugger is executed in its own external mode, while the application which is being debugged (debuggee) uses a different mode. This is two tier architecture that is the new debugger is displayed in its own GUI window. The debuggee is inactive while the debugger is active and vice versa that is debugger remains available in inactive mode when the program displays its final output. The debugger does not close while the application which is being debugged is still alive.

Sunday, April 26, 2020

SAP Gateway Client /IWFND/GW_CLIENT Transaction Error - User no longer logged on

When trying to execute transaction /IWFND/GW_CLIENT or any other transactions in /IWFND/ namespace, many users get an error message 'User no longer logged on'.



It is believed that this problem is in older SAP GUI versions but as you can see in the image above, the error is there even in GUI version 760.

Solution

Tuesday, May 15, 2018

Append Structure and Include Structure

  • Append structures are used for enhancements that are not included in the standard. 

  • An append structure is a structure that is assigned exactly to one table or structure. 

  • There can be more than one append structure for a table or structure.

  • An Include structure can be assigned to many tables.

  • On adding fields to an include structure, all tables/structures, which contain that include structure, will be updated.

Tuesday, April 17, 2012

Question Marks '?????' in Menu Bar instead of Menu Names


If the menu bar displayed in your custom report or in any other sap screen is like the image above, try deleting the language specific run time objects (Load).

To delete language specific run time objects execute the report RSLANG20.This resets the language buffers and reloads them from the database.

To access certain information more quickly, the SAP System optimizes the information in database tables and internal buffers.
This information must be deleted after a language import or supplementation.The language transport tools delete the language load automatically after completing an import or supplementation action. However, database locks may prevent the load from being deleted. This report enables you to delete the load manually in this case.
This report does not cause errors in the system and can be restarted at any time. However, you may experience a short drop in performance after starting the report.

Use the check boxes to select which load types you want to delete.
To delete a language-specific load, you must enter a target language. You also have the option of deleting the load for all languages installed in the system.

For more information, you can check the source code of the program or see SAP Note 110910.

Thursday, March 29, 2012

Change Description of Transport Request

Description of an unreleased transport request can be changed in the following steps :
  • Go to transaction SE10
  • Select the request whose description needs to be changed and click on display or just double click on the tr number.
  • Now on the new screen click on change (Ctrl + F1).
  • Click on Properties Tab on the same screen.
  • The description of the tr can be seen in editable mode.
  • Change it as desired and click on Save button (Ctrl + S).



Please comment on the post if you find it useful, it will only take 2 seconds and will cost you nothing.

Tuesday, December 13, 2011

Simple steps to get Smartform output into PDF Format

Do the following:

  1. Print the smartform to the spool. 
  2. Note the spool number.
  3. Go to T-Code SE38 and execute the standard program  RSTXPDFT4 and download the PDF file by entering the spool number in the selection screen.

Friday, August 12, 2011

Sample Code to Lock / Unlock Program Editor


Program to Lock / Unlock program editor. The SAP Standard Table TRDIR has a field called EDTX which is basically the EDITOR lock field. Edit Lock facility is given in the PROGRAM ATTRIBUTES. The EDITOR LOCK is a check box given in the PROGRAM ATTRIBUTES. If this field is SET then the program gets locked and if this is Unchecked the program is unlocked.


If the EDITOR lock is ON then only the user who created the program can edit it.
REPORT  ZXXXX.
TABLES : TRDIR.

PARAMETERS : PROG_NAM LIKE TRDIR-NAME,
             EDTX 
LIKE TRDIR-EDTX.

SELECT SINGLE * FROM TRDIR WHERE NAME = PROG_NAM.

  
IF SY-SUBRC = 0.
    
IF TRDIR-EDTX = EDTX AND EDTX = ' '.
      
MESSAGE 'Already Unlocked' TYPE 'I'.
    
ELSEIF TRDIR-EDTX = EDTX AND EDTX = 'X'.
      
MESSAGE 'Already Locked' TYPE 'I'.
    
ELSE.
    TRDIR-EDTX = EDTX.
    
MODIFY TRDIR.
        
IF EDTX = ' '.
          
MESSAGE 'Program Successfully Unlocked' TYPE 'I'.
        
ELSE.
          
MESSAGE 'Program Successfully Locked' TYPE 'I'.
        
ENDIF.

    
ENDIF.
  
ELSE.
    
MESSAGE 'Program Not Found' TYPE 'I'.
  
ENDIF.



Upload Excel File Data using BDC

Sample Program to Upload MS Excel File data into SAP R/3 Using BDC
report ZXXXX
       
no standard page heading line-size 255.

include bdcrecx1.
TABLES : ZEMP.
DATA : ITAB TYPE STANDARD TABLE OF ZEMP WITH HEADER LINE,
G_XLDATA 
LIKE ALSMEX_TABLINE OCCURS 0 WITH HEADER LINE.
DATA: p_file LIKE ibipparms-path.
start-
of-selection.

*Function Module to fetch file from the presentation server
  
CALL FUNCTION 'F4_FILENAME'
    
EXPORTING
      program_name  = syst-cprog
      dynpro_number = syst-dynnr
      field_name    = 
'P_FILE'
    
IMPORTING
      file_name     = p_file.

*Function Module to upload excel file data to internal table
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
  
EXPORTING
    FILENAME                      = p_file
    I_BEGIN_COL                   = 
1
    I_BEGIN_ROW                   = 
1
    I_END_COL                     = 
100
    I_END_ROW                     = 
100
  
TABLES
    INTERN                        = G_XLDATA
          .
LOOP AT G_XLDATA.
  
CASE G_XLDATA-COL.
    
WHEN 1.
      ITAB-EMPID = G_XLDATA-
VALUE.
    
WHEN 2.
      ITAB-EMPNAME = G_XLDATA-
VALUE.
    
WHEN 3.
      ITAB-STREET = G_XLDATA-
VALUE.
    
WHEN 4.
      ITAB-CITY = G_XLDATA-
VALUE.
      
APPEND ITAB.
      
CLEAR ITAB.
  
ENDCASE.
 
ENDLOOP.


perform open_group.

LOOP AT ITAB.

perform bdc_dynpro      using 'ZRSCREEN1' '0100'.
perform bdc_field       using 'BDC_OKCODE'
                              
'=INSERT'.
perform bdc_field       using 'BDC_CURSOR'
                              
'ZEMP-CITY'.
perform bdc_field       using 'ZEMP-EMPID'
                              ITAB-EMPID.
perform bdc_field       using 'ZEMP-EMPNAME'
                              ITAB-EMPNAME.
perform bdc_field       using 'ZEMP-STREET'
                              ITAB-STREET.
perform bdc_field       using 'ZEMP-CITY'
                              ITAB-CITY.
perform bdc_dynpro      using 'ZRSCREEN1' '0100'.
perform bdc_field       using 'BDC_OKCODE'
                              
'/ELOGOUT'.
perform bdc_field       using 'BDC_CURSOR'
                              
'ZEMP-EMPID'.
perform bdc_field       using 'ZEMP-EMPID'
                              
'11'.
perform bdc_field       using 'ZEMP-EMPNAME'
                              
'JAMES SAWYER'.
perform bdc_field       using 'ZEMP-STREET'
                              
'B-100'.
perform bdc_field       using 'ZEMP-CITY'
                              
'SECTOR-100'.
perform bdc_transaction using 'ZRSCREEN1'.

ENDLOOP.
perform close_group.