Code: Alles auswählen.
Mein Coding:
DATA : BEGIN OF line,
doc_number TYPE /bi0/oidoc_number,
s_ord_item TYPE /bi0/ois_ord_item,
doc_categ TYPE /bi0/oidoc_categ,
item_categ TYPE /bi0/oiitem_categ,
refer_doc TYPE /bi0/oirefer_doc,
cml_cf_qty TYPE /bi0/oicml_cf_qty,
/bic/zcost_so TYPE /bic/oizcost_so,
END OF line.
DATA itab LIKE HASHED TABLE OF line WITH UNIQUE KEY doc_number
s_ord_item.
SELECT doc_number s_ord_item doc_categ item_categ refer_doc
cml_cf_qty cost
FROM /bic/azsdsoo0600
INTO line
WHERE item_categ = 'ZTAS' OR item_categ = 'G2N' OR item_categ = 'G2NN' OR item_categ = 'G2W'.
INSERT line INTO TABLE itab.
ENDSELECT.
BREAK-POINT.
SORT itab.
LOOP AT RESULT_PACKAGE ASSIGNING <result_fields>.
LOOP AT itab INTO line WHERE doc_number =
<result_fields>-refer_doc OR refer_doc = <result_fields>-refer_doc.
IF line-item_categ = 'ZTAS'.
<result_fields>-cml_cf_qty = line-cml_cf_qty.
<result_fields>-/bic/zcost_so = line-/bic/zcost_so.
IF line-doc_categ = 'K'.
<result_fields>-/bic/zcreditm = line-doc_number.
<result_fields>-/bic/zitemcat = line-item_categ.
ENDIF.
ENDLOOP.
ENDLOOP.
Code: Alles auswählen.
SELECT doc_number s_ord_item doc_categ item_categ refer_doc cml_cf_qty cost
FROM /bic/azsdsoo0600
INTO TABLE itab
WHERE item_categ IN ('ZTAS','G2N','G2NN','G2W').
Code: Alles auswählen.
SORT itab.