‎2008 Jan 29 4:12 PM
hi experts,
i hav one internel table having 5 field werks,maktx,matnr,fkimg,kbetr..my requirement is as such that werk should come first..then corresponding to dat werk first material description shoul b displayed,and finally corresponding to dat matnr maktx fkimg kbetr should b displayed...plz help how to use control break statements related to this problem..output structure shoud d as follows..
PLANT1
mat desc1
matnr fkimg kbetr
mat desc2
matnr fkimg kbetr
PLANT2
mat desc2
matnr fkimg kbetr
mat desc2
matnr fkimg kbetr
I HOPE U UNDESTAND WAT I WAN TO SHOW.<REMOVED BY MODERATOR>
regards,
raman.
Edited by: Alvaro Tejada Galindo on Jan 29, 2008 11:20 AM
‎2008 Jan 29 4:25 PM
There are control break statements that you can use inside a LOOP. In this case you should use AT NEW werks. Have in mind that inside the AT NEW ... ENDAT the field WERKS will be filled with asterisqs (*****).
This sample code will help:
SORT itab BY werks ASCENDING.
LOOP AT itab.
lv_werks = itab-werks.
AT NEW werks.
WRITE /lv_werks.
ENDAT.
WRITE: / 'mat', maktx.
WRITE: / matnr fkimg kbetr
ENDLOOP.Note the use of lv_werks!