Debug a finished batch job

To debug a finished batch job

  • Run tcode: SM37 and select for finished jobs.
  • Select the job.
  • In the command field, type JDBG and hit enter.
    Do not use /n or /o.

This will simulate the exact background scenario with the same selection screen values as used in the job. SY-BATCH will be set to ‘X’.

Access memory variables used by another program

Question: If a program (eg.: ZXYZ) calls a function module, can I access memory variables that are available in ZXYZ, but are not passed to the function module?

Answer:Yes!!!

Here is a sample code to access an internal IT_DATA from ZXYZ

===============
DATA: var_name(30) TYPE c VALUE ‘(ZXYZ)IT_DATA[]’.

TYPES: BEGIN OF st_data,
**** The same definition as IT_DATA in program
END OF st_data.

DATA: wa_data TYPE st_data.

FIELD-SYMBOLS: TYPE ANY TABLE.

ASSIGN (var_name) TO .

LOOP AT INTO wa_data.

WRITE : / wa_data.

ENDLOOP.

===============

About function groups and function modules

Function groups are containers for function modules. You cannot execute a function group. When you call an function module, the system loads the whole of its function group into the internal session of the calling program (if it has not already been loaded).

SAPL contains nothing but the INCLUDE statements for the following include programs:

LTOP. This contains the FUNCTION-POOL statement (equivalent for a function group of the REPORT or PROGRAM statement) and global data declarations for the entire function group.

LUXX. This contains further INCLUDE statements for the include programs LU01, LU02, … These includes contain the actual function modules.

The include programs LF01, LF02, … can contain the coding of subroutines that can be called with internal subroutine calls from all function modules of the group.

All of the function modules in a function group can access the global data of the group. For this reason, you should place all function modules that use the same data in a single function group. For example, if you have a set of function modules that all use the same internal table, you could place them in a function group containing the table definition in its global data.
Like executable programs (type 1) and module pools (type M), function groups can contain screens, selection screens, and lists. User input is processed either in dialog modules or in the corresponding event blocks in the main program of the function group. There are special include programs in which you can write this code. In this way, you can use function groups to encapsulate single screens or screen sequences.

Useful Function Modules

A list of useful function modules. However, some of these are not available in 4.7

  • BP_EVENT_RAISE
    Trigger an event from ABAP/4 program.
  • BP_JOBLOG_READ
    Fetch job log executions filling the structure TBTC5.
  • G_SET_GET_ALL_VALUES
    Fetch values from a set filling the structure RGSB4.
  • POPUP_TO_CONFIRM_LOSS_OF_DATA
    Create a dialog box in which you make a question whether the user wishes to perform a processing step with loss of data.
  • POPUP_TO_CONFIRM_STEP
    Create a dialog box in which you make a question whether the user wishes to perform the step.
  • POPUP_TO_CONFIRM_WITH_MESSAGE
    Create a dialog box in which you inform the user about a specific decision point during an action.
  • POPUP_TO_CONFIRM_WITH_VALUE
    Create a dialog box in which you make a question whether the user wishes to perform a processing step with a particular object.
  • POPUP_TO_DECIDE
    Create a dialog box in which you require the user between the two processing alternatives, or to cancel the action.
  • POPUP_TO_DECIDE_WITH_MESSAGE
    Create a dialog box in which you inform the user about a specific decision point via a diagnosis text.
  • POPUP_TO_DISPLAY_TEXT
    Create a dialog box in which you display a two-line message.
  • RFC_SYSTEM_INFO
    Fetch information from the current instance filling the structure FRCSI.
  • RS_SEND_MAIL_FOR_SPOOLLIST
    Send messages from ABAP/4 programs to SAPoffice. The structure SOLI may contain the message.
  • RZL_SLEEP
    Hang the current application from 1 to 5 seconds.
  • RZL_SUBMIT
    Submit a remote report.
  • SAPGUI_PROGRESS_INDICATOR
    Set progress indicator on the left lower corner of the current window.
  • SD_PRINT_TERMS_OF_PAYMENT
    Format terms of payment according to base line date and payment terms.
  • SO_WIND_SPOOL_LIST
    Browse printer spool numbers according to user informed.
  • SO_SPOOL_READ
    Fetch printer spool according to the spool number informed.
  • SO_USER_LIST_READ
    List of all users filling the structure SOUD3.
  • SPELL_AMOUNT
    Return the amount in words filling the structure SPELL.
  • TH_SAPREL
    Gather information from the current system including upgrade activities. It completes fields from the structure KKS03.
  • TH_SERVER_LIST
    Gather information of all instances filling the structure MSXXLIST.
  • TH_USER_LIST
    List of logged users filling the structure UINFO.
  • TH_USER_INFO
    Information about the current user. It completes fields from the structure KKS03.
  • TH_WPINFO
    List of work processes filling the structure WPINFO.
  • WS_UPLOAD
    Transfer files from the frontend to the application server.
  • WS_DOWNLOAD
    Transfer files from the application server to the frontend.
  • WS_EXCEL
    Download files at the frontend in excel format.
  • WS_EXECUTE
    Execute an external program on the presentation server.
  • WS_FILE_DELETE
    Delete file at the frontend.
  • WS_VOLUME_GET
    Get the label from a frontend device.
  • WS_MSG
    Create a dialog box in which you display an one-line message.
  • WB2_READ_CUSTOMER_NAME
    Get Customer names
  • HAZMAT_MATNR_GET_TEXT
    Get material description
  • MRM_DBTAB_KONV_READ
    Read table Konv
  • RV_ORDER_FLOW_INFORMATION
    Read Document flow
  • CATS_NUMERIC_INPUT_CHECK
    Check if a string is a number
  • RFC_GET_TABLE_ENTRIESRFC_READ_TABLE
    Read a table via RFC
  • SD_ARRANG_BILLING_DOCS_READ
    Read billing documents
Last modified: 2005/09/18 – / Author: phpwcms webmaster

User Interface Design Examples

  • Use transaction BIBS to view different examples of user interface design from SAP.
  • This transaction provides “Examples of the ergonomic interface setup” according to SAP.
  • There are numerous examples for screens, menus, prompts, messages and many more elements.

Table Relationships

Works in 46c – Not available in 4.7 x110

  • Run SE49 entering a transaction, program, function, etc.
  • Execute it and the screen will display table list grouped by actions performed.
  • Select table and then click the show code button to see how the transaction addresses the table.
  • Double click on the table and it takes you into SE12 where you see the DDIC description of the tabel, from there you can follow the menu for Utilities / table contents which takes you into SE16 (general table display).