Processing and modifying outbound JIT calls

Broadcast from jit.sap.sd/processing-outbound:

As I’ve said before – user-defined actions for JIT outbound can be implemented into BAdI interface IF_EX_JITO_ACTION (BAdI JITO_ACTION).

Below you can find JIT-action ZSDJ, which added into call control flow and doing next things with component groups, selected in JITOM transaction and accumulated in system structure JITODIACO_CT:
– a popup window with two input fields DATE and TIME
– converting these DATE and TIME into TIMESTAMP
– updates required planned date and time of selected component groups (JITODIACO_CT).

method IF_EX_JITO_ACTION~CUSTOMER_ACTION.
 
if action_iv = 'ZSDJ'.
 
 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 = 'Укажите дату:'.
 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 = 'Укажите время:'.
 append lt_fields to ivals.
 
 call function 'POPUP_GET_VALUES'
  exporting
   popup_title = 'Запланированная дата потребности'
  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.
 
endif.
 
endmethod.

Schreibe einen Kommentar



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