i) Go to the CI_EKPODB table from the Se11 transaction code and add new field with the Append Structure button.
ii) After activating the created Append Structure, the field will be added to the CI_EKPODB table.
CLEAR ex_data.
CHECK NOT im_ebelp IS INITIAL.
READ TABLE gt_data INTO ex_data WITH TABLE KEY mandt = sy-mandt
ebeln = im_ebeln
ebelp = im_ebelp.
IF NOT sy-subrc IS INITIAL.
SELECT SINGLE fiscal_year FROM ekpo INTO @DATA(lv_fiscal)
WHERE ebeln EQ @im_ebeln AND ebelp EQ @im_ebelp.
ex_data-mandt = sy-mandt.
ex_data-ebeln = im_ebeln.
ex_data-ebelp = im_ebelp.
ex_data-fiscal_year = lv_fiscal.
INSERT ex_data INTO TABLE gt_data.
ENDIF.
ZUD_FISCAL_YEAR_ST = im_dynp_data.
ex_dynp_data = ZUD_FISCAL_YEAR_ST.
DATA: ls_data LIKE LINE OF gt_data.
FIELD-SYMBOLS: <data> LIKE LINE OF gt_data.
CHECK NOT im_data-ebelp IS INITIAL.
IF NOT im_physical_delete_request IS INITIAL.
DELETE TABLE gt_data WITH TABLE KEY mandt = sy-mandt
ebeln = im_data-ebeln
ebelp = im_data-ebelp.
ELSE.
READ TABLE gt_data ASSIGNING <data> WITH TABLE KEY
mandt = sy-mandt
ebeln = im_data-ebeln
ebelp = im_data-ebelp.
IF sy-subrc IS INITIAL.
<data>-fiscal_year = im_data-fiscal_year.
ELSE.
ls_data = im_data.
ls_data-mandt = sy-mandt.
INSERT ls_data INTO TABLE gt_data.
ENDIF.
ENDIF.
DATA: ls_subscriber LIKE LINE OF re_subscribers.
CHECK im_application = 'PO'.
CHECK im_element = 'ITEM'.
CLEAR re_subscribers[].
ls_subscriber-name = subscreen1.
ls_subscriber-dynpro = '0002'.
ls_subscriber-program = 'SAPLZMEPOBADIEX'.
ls_subscriber-struct_name = 'ZUD_FISCAL_YEAR_ST'.
ls_subscriber-label = 'Fiscal Year'.
ls_subscriber-position = 24.
ls_subscriber-height = 7.
APPEND ls_subscriber TO re_subscribers.
FIELD-SYMBOLS: <mapping> LIKE LINE OF ch_mapping.
LOOP AT ch_mapping ASSIGNING <mapping>.
CASE <mapping>-fieldname.
WHEN 'FISCAL_YEAR'.
<mapping>-metafield = mmmfd_cust_08.
ENDCASE.
ENDLOOP.
DATA: l_item TYPE REF TO if_purchase_order_item_mm,
ls_mepoitem TYPE mepoitem,
ls_customer TYPE ZUD_FISCAL_Y_T.
CASE im_name.
WHEN subscreen1.
mmpur_dynamic_cast l_item im_model.
CHECK NOT l_item IS INITIAL.
ls_mepoitem = l_item->get_data( ).
CALL FUNCTION 'ZMEPOBADIEX_GET_DATA'
EXPORTING
im_ebeln = ls_mepoitem-ebeln
im_ebelp = ls_mepoitem-ebelp
IMPORTING
ex_data = ls_customer.
MOVE-CORRESPONDING ls_mepoitem TO dynp_data_pbo.
MOVE ls_customer-fiscal_year TO dynp_data_pbo-fiscal_year.
WHEN OTHERS.
ENDCASE.
CASE im_name.
WHEN subscreen1.
CALL FUNCTION 'ZMEPOBADIEX_PUSH'
EXPORTING
im_dynp_data = dynp_data_pbo.
WHEN OTHERS.
ENDCASE.
CASE im_name.
WHEN subscreen1.
CALL FUNCTION 'ZMEPOBADIEX_POP'
IMPORTING
ex_dynp_data = dynp_data_pai.
IF dynp_data_pai NE dynp_data_pbo.
re_changed = mmpur_yes.
ENDIF.
WHEN OTHERS.
ENDCASE.
DATA: l_item TYPE REF TO if_purchase_order_item_mm,
ls_mepoitem TYPE mepoitem,
ls_customer TYPE ZUD_FISCAL_Y_T.
CASE im_name.
WHEN subscreen1.
mmpur_dynamic_cast l_item im_model.
CHECK NOT l_item IS INITIAL.
ls_mepoitem = l_item->get_data( ).
IF dynp_data_pbo-fiscal_year NE dynp_data_pai-fiscal_year.
CALL FUNCTION 'ZMEPOBADIEX_GET_DATA'
EXPORTING
im_ebeln = ls_mepoitem-ebeln
im_ebelp = ls_mepoitem-ebelp
IMPORTING
ex_data = ls_customer.
ls_customer-fiscal_year = dynp_data_pai-fiscal_year.
CALL FUNCTION 'ZMEPOBADIEX_SET_DATA'
EXPORTING
im_data = ls_customer.
MOVE dynp_data_pai-fiscal_year TO ls_mepoitem-fiscal_year.
CALL METHOD l_item->set_data
EXPORTING
im_data = ls_mepoitem .
ENDIF.
WHEN OTHERS.
ENDCASE.
DATA: l_changeable TYPE mmpur_bool.
FIELD-SYMBOLS:<fs_f> LIKE LINE OF ch_fieldselection.
l_changeable = im_header->is_changeable( ).
READ TABLE ch_fieldselection ASSIGNING <fs_f> WITH TABLE KEY metafield = mmmfd_cust_08.
IF sy-subrc = 0.
IF l_changeable = 'X'.
<fs_f>-fieldstatus = '.'.
ELSE.
<fs_f>-fieldstatus = '*'.
ENDIF.
ENDIF.
DATA: lwa_mepoitem TYPE mepoitem.
DATA ls_ekpo TYPE uekpo.
DATA ls_eban TYPE eban.
DATA lt_eban TYPE TABLE OF eban.
DATA: gt_conn TYPE TABLE OF toav0,
gt_conn_av TYPE TABLE OF toav0,
gs_conn TYPE toav0,
gs_toa01 TYPE toa01,
lw_banfn TYPE banfn.
CALL METHOD im_item->get_data
RECEIVING
re_data = lwa_mepoitem.
SELECT SINGLE fiscal_year FROM ZUD_FISCAL_Y_T
INTO @lwa_mepoitem-fiscal_year
WHERE ebeln = @lwa_mepoitem-ebeln
AND ebelp = @lwa_mepoitem-ebelp.
IF sy-subrc EQ 0 AND lwa_mepoitem-fiscal_year IS NOT INITIAL.
CALL METHOD im_item->set_data
EXPORTING
im_data = lwa_mepoitem.
ENDIF.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
4 | |
2 | |
2 | |
2 | |
2 | |
2 | |
1 | |
1 | |
1 | |
1 |