on 05-12-2011 11:21 PM
Experts,
I am loading classification data for Material into BW.
We have 40 classification characteristics and the applications downstream to BW need to see the code and text for these objects side by side.
We are employing a direct update DSO where we have a ZTEXT_xxx infoobject for each ZCLASSIFICATION_xxx code infoobject.
We populate this via routine in APD. Routine is something like
LOOP AT it_source INTO ls_source.
SELECT SINGLE TXTMD INTO ls_target-ZTEXT_001 from /BIC/TZCLASS_001
where /BIC/ZCLASS_001 = ls_source-/BIC/ZCLASS_001.
SELECT SINGLE TXTMD INTO ls_target-ZTEXT_002 from /BIC/TZCLASS_062
where /BIC/ZCLASS_062 = ls_source-/BIC/ZCLASS_062.
We do this for all 40 objects. Is there a better way to write this code?
Thanks,
Buffer data from transparent tables before LOOP into internal tables.
Within the LOOP read just internal tables instead of transparent tables.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
here is the sample code.
data: itab1 type table of /BIC/TZCLASS_001,
wa_itab1 type /BIC/TZCLASS_001,
create similar set of internal table and work area for other classfication infoobjects.
SELECT * from /BIC/TZCLASS_001 into itab1
for all entries in lt_source
where /BIC/ZCLASS_001 = lt_source-/BIC/ZCLASS_001.
write similar SELECT statement for other classifcation infoobjects.
LOOP AT it_source INTO ls_source.
READ itab1 into wa_itab1 with key BIC/ZCLASS_001 = lt_source-/BIC/ZCLASS_001.
if sy-subrc eq 0.
ls_target-ZTEXT_001 = wa_itab1-TXTMD.
endif.
write similar READ statement for other classification infoobjects.
ENDLOOP.
--- Thanks
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.