METHOD if_ex_me_change_outtab_cus~fill_outtab.
* When processing this source code, you activate the following functionality:
* The reporting transactions for purchasing documents provide three main views
* for display: basic list, delivery schedule, and account assignment. All
* three views contain a column "Material". If the material of a purchasing
* document item is a manufacturer part number (MPN) then this MPN is shown
* as "Material". The internal inventory managed material is not visible.
* The following source code replaces the MPN by the inventory managed material.
DATA: ls_ekpo TYPE ekpo,
lv_werks type EWERK,
lv_bstYP type EBSTYP.
FIELD-SYMBOLS: <fs_outtab> TYPE any,
<fs_ebeln> TYPE ebeln,
<fs_ebelp> TYPE ebelp,
<fs_ertwr> TYPE bbwert,
<fs_abskz> TYPE abskz,
<fs_werks> TYPE EWERK,
<fs_agmem> TYPE agmem,
<fs_material> TYPE matnr.
* check that a purchasing document view is displayed
CHECK im_struct_name EQ 'MMREQ_HISTORY'. "PO HISTORY for ITEM
* loop at the output table and assign a field symbol
LOOP AT ch_outtab ASSIGNING <fs_outtab>.
*-- assign the purchasing document number to a field symbol
ASSIGN COMPONENT 'EBELN' OF STRUCTURE <fs_outtab> TO <fs_ebeln>.
CHECK sy-subrc = 0.
*-- assign the purchasing document item number to a field symbol
ASSIGN COMPONENT 'EBELP' OF STRUCTURE <fs_outtab> TO <fs_ebelp>.
CHECK sy-subrc = 0.
ASSIGN COMPONENT 'WERKS' OF STRUCTURE <fs_outtab> TO <fs_werks>.
CHECK sy-subrc = 0.
* NEW 3 fields at PO history item level!
ASSIGN COMPONENT 'BRTWR' OF STRUCTURE <fs_outtab> TO <fs_ertwr>.
ASSIGN COMPONENT 'ABSKZ' OF STRUCTURE <fs_outtab> TO <fs_abskz>.
ASSIGN COMPONENT 'AGMEM' OF STRUCTURE <fs_outtab> TO <fs_agmem>.
" get Purchasing Document Category
clear lv_bstyp.
select single bstyp
into lv_bstyp
from ekko
where ebeln eq <fs_ebeln>.
* Restriction for IN* plant and 'RFQ' only!
if lv_bstyp eq 'A' and <fs_werks>+0(2) EQ 'IN'.
"populate those 3 added fields for ME53N at PO item history~!
SELECT SINGLE brtwr abskz agmem FROM ekpo
INTO ( <fs_ertwr>, <fs_abskz>, <fs_agmem> )
WHERE ebeln EQ <fs_ebeln>
AND ebelp EQ <fs_ebelp>.
endif.
ENDLOOP.
ENDMETHOD.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
5 | |
4 | |
3 | |
2 | |
2 | |
2 | |
2 | |
1 | |
1 | |
1 |