Skip to Content

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

how to read data AT END OF using two fields

Hi

i have a itab which have matnr , plant and many fields

i m using

AT END OF MATNR.
.............
ENDAT.

here condition on only MATNR

i want condition on PLANT also

so how i read this itab using MATNR and PLANT using AT END OF

thanks

Former Member
Former Member replied

Hi Prashant,

use the below logic for your requriement. control break statements work with one key fields.

for multiple key fields you have to use another logic.

use the below logic for your requirement

data : lv_matnr like mara-matnr,

lv_werks like marc-werks.

clear : lv_matnr , lv_werks.

loop at itab.

at first.

lv_matnr = itab-matnr.

lv_werks = itab-werks.

endat.

if lv_matnr ne itab-matnr and lv_werks ne itab-werks.

<write logic for your process>.

lv_matnr = itab-matnr.

lv_werks = itab-werks.

else.

<write logic for your process>.

endif.

endloop.

hope it shall be useful.

Regards

Santosh.

Edited by: Santosh Kumar on Apr 22, 2009 9:03 AM

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