cancel
Showing results for 
Search instead for 
Did you mean: 

efficient ABAP Code Analysis Process Designer

Former Member
0 Kudos

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,

Accepted Solutions (1)

Accepted Solutions (1)

MartinMaruskin
Active Contributor
0 Kudos

Buffer data from transparent tables before LOOP into internal tables.

Within the LOOP read just internal tables instead of transparent tables.

Former Member
0 Kudos

Thanks Martin,

Could you give a sample code for my current code example?

Former Member
0 Kudos

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

Answers (0)