Thursday, November 22, 2007

ABAP Code in eCATT Editor

Description
ABAP code can be inserted in the eCATT editor. Here the interaction of eCATT import/export parameters with ABAP code happens only via eCATT Variable parameters. So before the ABAP-ENDABAP block, have the required values in the Variable parameters. And then use these eCATT Variable parameters in ABAP block. During the ABAP-ENDABAP block, the eCATT Variable parameters can interact with local variable of ABAP block. After the ENDABAP command, these eCATT Variable parameters having values from ABAP code can be passed to next Import parameters.
Transaction is SECATT.
The scenario taken here is of SU01 transaction code. For the given user ID, the initials are added via recording. So Initials is import parameters. Once the recording is done, the same initial value is passed to ADRP table to get the first name of the person via ABAP code.

/* ABAP Code in eCATT Editor */
*------------------------------------------------*.* Step 1:* Record SU01 transactionSAPGUI ( SU01_50_STEP_3 ).* Parameterize the 'Initials' as Import Parameter.SAPGUI ( SU01_100_STEP_4 ).SAPGUI ( SU01_50_STEP_4 ).SAPGUI ( S000_40_STEP_2 ).*------------------------------------------------*.* Step 2:* Pass Import Parameter value into Variable ParameterL_IV_INI = P_IV_INITIALS.*------------------------------------------------*.* Step 3:* ABAP-ENDABAP block from 'Pattern' button of application* toolbar to get the first name from the ADRP table by* passing the Initials as inputABAP. TABLES: ADRP. DATA: WA_ADRP TYPE ADRP. SELECT SINGLE * INTO WA_ADRP FROM ADRP WHERE INITIALS = L_IV_INI.* Pass the local variable of ABAP block to Variable Parameter of eCATT L_IV_NAME_FIRST = WA_ADRP-NAME_FIRST.ENDABAP.*------------------------------------------------*.* Step 4:LOG ( L_IV_NAME_FIRST ).*------------------------------------------------*./* ABAP Code in eCATT Editor */
*------------------------------------------------*.*

Step 1:* Record SU01 transactionSAPGUI ( SU01_50_STEP_3 ).* Parameterize the 'Initials' as Import Parameter.SAPGUI ( SU01_100_STEP_4 ).SAPGUI ( SU01_50_STEP_4 ).
SAPGUI ( S000_40_STEP_2 ).*------------------------------------------------*.*

Step 2:* Pass Import Parameter value into Variable ParameterL_IV_INI = P_IV_INITIALS.*------------------------------------------------*.*

Step 3:* ABAP-ENDABAP block from 'Pattern' button of application* toolbar to get the first name from the ADRP table by* passing the Initials as inputABAP. TABLES: ADRP. DATA: WA_ADRP TYPE ADRP. SELECT SINGLE * INTO WA_ADRP FROM ADRP WHERE INITIALS = L_IV_INI.* Pass the local variable of ABAP block to Variable Parameter of eCATT L_IV_NAME_FIRST = WA_ADRP-NAME_FIRST.ENDABAP.*------------------------------------------------*.*
Step 4:LOG ( L_IV_NAME_FIRST ).*------------------------------------------------*.

No comments:

Blog Archive