DATA: msg_text(80) TYPE c, "Message text
itab_spa TYPE STANDARD TABLE OF rfc_spagpa,
wa_spa TYPE rfc_spagpa.
* Fill out parameters
wa_spa-parid = 'AUN'.
wa_spa-parval = '1234567890'. "Fill sales order number
APPEND wa_spa TO itab_spa.
* Create a new session
* Asynchronous call to Transaction VA03 -->
CALL FUNCTION 'ABAP4_CALL_TRANSACTION' STARTING NEW TASK 'SORD'
DESTINATION 'NONE'
EXPORTING
tcode = 'VA03'
SKIP_SCREEN = 'X'
* MODE_VAL = 'A'
* UPDATE_VAL = 'A'
* IMPORTING
* SUBRC =
TABLES
* USING_TAB =
SPAGPA_TAB = itab_spa
* MESS_TAB =
EXCEPTIONS
CALL_TRANSACTION_DENIED = 1
TCODE_INVALID = 2
OTHERS = 3
.
IF sy-subrc NE 0.
WRITE: msg_text.
ELSE.
WRITE: 'Call transaction successful'.
ENDIF.
No comments:
Post a Comment