JIT action, mass change planned requirements date

BAdI interface IF_EX_JITO_ACTION.
JIT-action ZDAT creates popup window with date and time fields.

method if_ex_jito_action~customer_action.
"*********************************** jit.sap.sd, 09.2015"
" IMPORTING"
" REFERENCE(ACTION_IV) TYPE CJIT07-AKTION"
" REFERENCE(CHAINED_ACTION_IV) TYPE CHAR1 DEFAULT ' ' "
" REFERENCE(FRAME_ACTION_IV) TYPE CJIT07-AKTION OPTIONAL"
" EXPORTING"
" REFERENCE(STATUS_UPD_DONE_EV) TYPE CHAR1"
" CHANGING"
" REFERENCE(JITODIAHD_CT) TYPE JITODIAHD_TT OPTIONAL"
" REFERENCE(JITODIAIT_CT) TYPE JITODIAIT_TT"
" REFERENCE(JITODIACO_CT) TYPE JITODIACO_TT OPTIONAL"
" REFERENCE(JITOAD_CT) TYPE JITOAD_TT OPTIONAL"
" REFERENCE(JITO_IT_SPEC_CT) TYPE JITO_IT_SPEC_TT OPTIONAL"
" REFERENCE(ASYNC_POSTING_CV) TYPE CHAR1 DEFAULT ' ' "
" REFERENCE(MSSG_RET_CT) TYPE MSSG_RET_TT"
" REFERENCE(JITODATA_CS) TYPE JITODATA OPTIONAL"
" EXCEPTIONS"
" NO_ACTION_DONE"

case action_iv.

"**********************************"

when 'ZDAT'. "Geplantes Bedarfsdatum"
data: l_returncode(1) type c,
ivals type table of sval,
lt_fields type sval,
lv_foop type sval,
lv_xdate type datum,
lv_xtime type uzeit,
ls_jitodiaco type jitodiaco,
lv_timestamp type tzntstmps.

clear: lt_fields.
lt_fields-tabname = 'RKAUF'.
lt_fields-fieldname = 'TODATE'.
lt_fields-value = sy-datum.
lt_fields-field_obl = 'X'.
lt_fields-fieldtext = 'Set the date: '.
append lt_fields to ivals.

clear: lt_fields.
lt_fields-tabname = 'SFSRFW_TIMES'.
lt_fields-fieldname = 'CREATETIME'.
lt_fields-field_obl = 'X'.
lt_fields-value = sy-uzeit.
lt_fields-fieldtext = 'Set the time: '.
append lt_fields to ivals.

call function 'POPUP_GET_VALUES'
exporting
popup_title = 'Planned requirements date'
importing
returncode = l_returncode
tables
fields = ivals
exceptions
error_in_fields = 1
others = 2.

if l_returncode eq 'A' or sy-subrc <> 0.
" lv_error = 'X'."
exit.
else. " √ -ОК-!"
loop at ivals[] into lv_foop.
if lv_foop-fieldname eq 'TODATE'.
lv_xdate = lv_foop-value.
else.
lv_xtime = lv_foop-value.
endif.
endloop.

call function 'CONVERT_INTO_TIMESTAMP'
exporting
i_datlo = lv_xdate
i_timlo = lv_xtime
i_tzone = sy-zonlo
importing
e_timestamp = lv_timestamp.

if jitodiaco_ct[] is not initial.
loop at jitodiaco_ct into ls_jitodiaco.
update jitoit set rdate = lv_timestamp where outpo eq ls_jitodiaco-outpo and intst eq 'XX10'.
endloop.
endif.

endif.

"ZDAT"
endcase.
endmethod.

Schreibe einen Kommentar



All fields are required. Your email address will not be published.