This ABAP code below will demonstrate you how to call transaction code QA01to create an inspection plan data.
Data: itab_bdc like BDCDATA occurs 0 with header line,
itab_SPAGPA like RFC_SPAGPA occurs 0 with header line ,
itab_messTab like BDCMSGCOLL occurs 0 with header line.
Data: d_sysubrc like sy-subrc.
CALL FUNCTION ‘ABAP4_CALL_TRANSACTION’
EXPORTING
TCODE = ‘QA01′
SKIP_SCREEN = ‘ ‘
MODE_VAL = ‘A’
UPDATE_VAL = ‘A’
IMPORTING
SUBRC = d_sysubrc
TABLES
USING_TAB = itab_bdc
SPAGPA_TAB = itab_SPAGPA
MESS_TAB = itab_messTab
EXCEPTIONS
CALL_TRANSACTION_DENIED = 1
TCODE_INVALID = 2
OTHERS = 3
.
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
When you execute the program, you will see that it opened the Transaction QA01 just like the picture below.
Post a Comment