Code: Alles auswählen.
DATA BEGIN OF selection_data.
DATA: i_werk TYPE werks,
i_pernr TYPE pernr_d,
i_start TYPE ru_isdd,
i_end TYPE ru_iedd.
DATA END OF selection_data.
DATA: lt_bdcdata TYPE TABLE OF bdcdata,
ls_bdcdata TYPE bdcdata,
lt_messages TYPE TABLE OF bapiret2,
lv_return TYPE bapiret2,
lt_return_tab TYPE TABLE OF bapiret2.
...
me->prepare_bdc_data(
EXPORTING
i_werk = selection_data-i_werk
i_pernr = selection_data-i_pernr
i_start = selection_data-i_start
i_end = selection_data-i_end
CHANGING
ct_bdcdata = lt_bdcdata ).
CALL TRANSACTION 'ZPPWAGE' USING lt_bdcdata
MODE 'N'
UPDATE 'S'
MESSAGES INTO lt_return_tab.
LOOP AT lt_return_tab INTO lv_return.
WRITE: / lv_return-message.
ENDLOOP.
Code: Alles auswählen.
METHOD prepare_bdc_data.
DATA: ls_bdcdata TYPE bdcdata.
CLEAR ls_bdcdata.
ls_bdcdata-program = 'Z_PP_WAGE'.
ls_bdcdata-dynpro = '1000'.
ls_bdcdata-dynbegin = 'X'.
APPEND ls_bdcdata TO ct_bdcdata.
CLEAR ls_bdcdata.
ls_bdcdata-fnam = 'BDC_OKCODE'.
ls_bdcdata-fval = '/00'.
APPEND ls_bdcdata TO ct_bdcdata.
CLEAR ls_bdcdata.
ls_bdcdata-fnam = 'PLANT'.
ls_bdcdata-fval = i_werk.
APPEND ls_bdcdata TO ct_bdcdata.
CLEAR ls_bdcdata.
ls_bdcdata-fnam = 'EMPLOYEE_NO'.
ls_bdcdata-fval = i_pernr.
APPEND ls_bdcdata TO ct_bdcdata.
CLEAR ls_bdcdata.
ls_bdcdata-fnam = 'LOGIN_DATE'.
ls_bdcdata-fval = i_start.
APPEND ls_bdcdata TO ct_bdcdata.
CLEAR ls_bdcdata.
ls_bdcdata-fnam = 'LOGOUT_DATE'.
ls_bdcdata-fval = i_end.
APPEND ls_bdcdata TO ct_bdcdata.
ENDMETHOD.
Code: Alles auswählen.
ct_bdcdata = VALUE #( ( program = 'Z_PP_WAGE'
dynpro = '1000'
dynbegin = 'X' )
( fnam = 'BDC_OKCODE'
fval = '/00' )
( fnam = 'PLANT'
fval = i_werk )
( fnam = 'EMPLOYEE_NO'
fval = i_pernr )
( fnam = 'LOGIN_DATE'
fval = i_start )
( fnam = 'LOGOUT_DATE'
fval = 'i_end' ) ).
Für mich schaut das sehr nach dem Code aus, den der Transaktionsrecorder verwendet. 1:1 aus BDCRECX1_S kopiert.DeathAndPain hat geschrieben: ↑28.10.2024 21:07Des von vor 20 Jahren so programmiert. Ich frage mich immer, warum die Leute heute immer noch so programmieren. Lernt ihr das noch so? Oder bist Du noch von der alten Schule? Ich würde das wirklich gerne wissen.