Code: Alles auswählen.
FORM call_transaction USING rf_agr_name LIKE agr_define-agr_name.
* local data
DATA:
" data for error messages when call of transaction
lt_message TYPE STANDARD TABLE OF bdcmsgcoll,
lf_mode TYPE c VALUE 'E'.
**********************************************************************
* delete all entries in table bdcdata (table for call of transaction)
REFRESH bdcdata.
* sets parameters before call of transaction
" code generated with batch-input recorder
PERFORM bdc_dynpro USING 'SAPLPRGN_TREE' '0121'.
PERFORM bdc_field USING 'BDC_CURSOR'
'AGR_NAME_NEU'.
PERFORM bdc_field USING 'BDC_OKCODE'
'=ANZE'.
PERFORM bdc_field USING 'AGR_NAME_NEU'
rf_agr_name.
* call transaction PFCG -> all parameters are set in int. table bdcdata
CALL TRANSACTION 'PFCG' USING bdcdata "#EC CI_CALLTA
" send message if error happens
MESSAGES INTO lt_message MODE lf_mode UPDATE 'L'.
ENDFORM. " CALL_TRANSACTION
Folgende Benutzer bedankten sich beim Autor black_adept für den Beitrag:
ABAP-Azubi