Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Update Transparent Tables

Hello,

1) I've created a transparent table

2) Transparent table is loaded by running a SELECT including tables (e.g.: R/3's VTTK, VTPA)

3) Updates must be done on transparent table data, so I need to loop at table, make field updates according some specific criteria

4) A CURSOR fetches data into another structure / CURSOR must be based on transparent table

I would like to know how to complete step n°3), I mean, loop at transparent table, update fields record by record, etc.. Are used table types fine?

Hope you could help. Thanks!

Bernardo

Former Member
Former Member replied

Bernardo,

Assuming FLD1, FLD2 & FLD3 are the keys of the transparent table z_transptabl, try it like this:

loop at it_interloc into wa_interloc.
 wa_interloc-ZINTIND = '0007'.
 update z_transptabl 
      set ZINTIND = wa_interloc-ZINTIND
      where FLD1  = wa_interloc-FLD1
      and   FLD2  = wa_interloc-FLD2
      and   FLD3  = wa_interloc-FLD3.
 if sy-subrc ne 0.
* your error handling goes here...
 endif.
endloop.

Hope this helps.

Cheers,

Sougata.

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question