Code: Alles auswählen.
REPORT ZOSSTEST.
types:
BEGIN OF gt_object,
objnr TYPE prps-objnr,
END OF gt_object,
gt_object_tab TYPE SORTED TABLE OF gt_object
WITH UNIQUE KEY objnr INITIAL SIZE 0,
BEGIN OF gt_cosx,
wrttp TYPE co_wrttp,
END OF gt_cosx,
gt_cosx_tab TYPE STANDARD TABLE OF gt_cosx
WITH DEFAULT KEY INITIAL SIZE 0.
parameters:
P_star radiobutton group 01 default 'X',
P_wrttp radiobutton group 01.
data:
gtab_object type gt_object_tab,
lv_object like line of gtab_object.
start-of-selection.
lv_object-objnr = 'PR00101517'.
insert lv_object into table gtab_object.
perform select_cosx using gtab_object[].
FORM select_cosx USING value(lp_object_tab) TYPE gt_object_tab.
DATA:
ltab_cosx TYPE gt_cosx_tab,
lv_feld type char10.
if p_star = 'X'.
lv_feld = '*'.
else.
lv_feld = 'WRTTP'.
endif.
SELECT (lv_feld)
INTO CORRESPONDING FIELDS OF TABLE ltab_cosx[]
FROM coss
FOR ALL ENTRIES IN lp_object_tab[]
WHERE lednr = '00'
AND objnr = lp_object_tab-objnr
AND wrttp = '04'
AND versn = '000'
AND vrgng = 'KAMV'
AND beknz = 'H'.
write:
/ 'Anzahl DS:',sy-dbcnt.
endform. " select_cosx
Code: Alles auswählen.
data: ta type SORTED TABLE OF but000
WITH UNIQUE KEY partner INITIAL SIZE 0,
ls like line of ta,
tb TYPE STANDARD TABLE OF BUT021
WITH DEFAULT KEY INITIAL SIZE 0.
ls-partner = '<<NR>>'.
insert ls into table ta.
DATA:
lv_feld type char10.
lv_feld = '*'.
* lv_feld = 'ADDRNUMBER'.
SELECT (lv_feld)
INTO CORRESPONDING FIELDS OF TABLE tb[]
FROM but021
FOR ALL ENTRIES IN ta[]
WHERE XDFADU = 'X'
and partner = ta-partner.
write:
/ 'Anzahl DS:',sy-dbcnt.
break-point.