Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

report

Former Member
0 Likes
876

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
858

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

10 REPLIES 10
Read only

Former Member
0 Likes
858

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

Read only

Former Member
0 Likes
859

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

Read only

Former Member
0 Likes
858

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

Read only

Former Member
0 Likes
858

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.

Read only

Former Member
0 Likes
858

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

Read only

Former Member
0 Likes
858

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

Read only

GauthamV
Active Contributor
0 Likes
858

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.

Read only

Former Member
0 Likes
858

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.

Read only

0 Likes
858

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

Read only

Former Member
0 Likes
858

Use 'AT NEW' event... Use the write statement with the required offset.