‎2008 May 29 7:22 AM
Hi All,
my requirement is like this:
order no item no
5000 01
5000 02
5000 03
i want to eliminate the repetition of order no for each item no. i want it to be like this:
5000 01
02
03
helpful answers will be rewarded.
Regards
prashanth
‎2008 May 29 7:28 AM
1. if the Problem is while displaying the data in classical report then,
use the Event - AT NEW <itab-var>.
ENDAT.
2. if the report is of ALV use AT NEW event and move the data according to the needed output to another itab.
Reward me if its useful.
Regards,
Nagulan
‎2008 May 29 7:27 AM
Hi,
You can try like this :
loop at it_ordrs.
at new order.
move it_ordrs-order to lv_order.
lv_flag = 'X'.
endat.
if lv_flag = '' and lv_order = it_ordrs-order.
clear it_ordrs-order.
modify it_ordrs transporting order.
endif.
clear lv_flag.
endloop.
Regards,
Himanshu Verma
‎2008 May 29 7:28 AM
1. if the Problem is while displaying the data in classical report then,
use the Event - AT NEW <itab-var>.
ENDAT.
2. if the report is of ALV use AT NEW event and move the data according to the needed output to another itab.
Reward me if its useful.
Regards,
Nagulan
‎2008 May 29 7:28 AM
Hi,
Create an another internal table of same type as previous one and then sort the previous internal table on the basis of order no and item no.
Now loop into prvious internal table and and move the desired content into the new internal table .
Thanks
‎2008 May 29 7:28 AM
Hi prashanth,
r u displaying ur output in alv OR
is it normal output?
if it is alv.........sort the fields which ever u want into a table and then pass that table to table display FM.
if ur not clear let me know.......i will send u code.
Regards,
kk.
‎2008 May 29 7:28 AM
Hi Prasanth,
According to me, i guess 5000 is one field and 01, 02 ,03 are the line items, if this is the case you can make use of AT NEW statement and fill 5000 value alone under AT NEW statement and the line items u can fill it outside AT NEW.
Reward points if helpful.
Regards,
Asha
‎2008 May 29 7:28 AM
HI do this
loop at itab.
l_orderno = itab-orderno.
if old_ordno = l_orderno.
itab-oredrno = ' '.
modify iatb index sy-tabix.
else.
old_ordno = l_orderno.
endif.
endloop.
Regards
Aditya
‎2008 May 29 7:29 AM
hi,
if u r using alv then use u can achive using sort statement.
sort ur internal table by order then it will giv according to ur requirement.
‎2008 May 29 7:34 AM
Hi,
Code like......
LOOP AT ITAB.
AT NEW ORDERNO.
NEWPAGE.
WRITE..............
ENDAT.
WRITE................
ENDLOOP.
Dont forget to to SORT the ITAB before LOOP. Its the requirement if U r using CONTROL BREAK events.
Reward all Helpful Answers,
Thanks.
‎2008 May 29 7:38 AM
hi
check the following code
data : begin of itab occurs 0,
f1(5),
f2(5),
end of itab.
itab-f1 = 5000.
itab-f2 = 01.
append itab.
itab-f1 = 5000.
itab-f2 = 02.
append itab.
itab-f1 = 5000.
itab-f2 = 03.
append itab.
sort itab by f1.
loop at itab.
on change of itab-f1.
write 😕 itab-f1,
itab-f2.
else.
clear itab-f1.
write 😕 itab-f1,
itab-f2.
endon.
endloop.
reward if helpful
prasanth
‎2008 May 29 7:42 AM
Use 'AT NEW' event... Use the write statement with the required offset.