Application Development 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: 

condition

Former Member
0 Kudos
65

Hi to all experts.

My recuirement is.

Internal table a.

Doc no tax code amt

01 11 100

01 12 50

02 11 30

02 11 10

And output is

01 11 100

12 50

02 11 40

How I put codition.

How can I got this output.

Thanks in advance and reward also.

Regard : deep.

3 REPLIES 3

Former Member
0 Kudos
47

Hiii

loop at main internal table and then read the record line by line by passing the values in it.

eg

loop at itab.

itab-docno = ..

..

endloop.

Reward Points if helpful

Hitesh

Former Member
0 Kudos
47

Hi deep, just try the following

first sort the IT

loop at a.

on change of (field of 01 n 02).

write 😕 a-field name.

end on.

write: a-seconf field, a-thiird.

endloop.

Former Member
0 Kudos
47

Hi Deep,

Check this code.

types: begin of ty_tax,

docno type <docno>,

taxcode type <taxcode>,

amt type <amt>,

end of ty_tax.

data itab type standard table of ty_tax with header line.

data it_output type standard table of ty_tax with header line.

sort itab by docno taxcode.

loop at itab.

collect itab into it_output.

endloop.

sort it_ouput by docno taxcode.

loop at it_output.

write:/ it_output-docno , it_output-taxcode , it_output-amt.

endloop.

<b>Friendly Note:</b> You have many open threads and Plz close the threads if they are answered/solved and reward points to the people who are helping you by taking their valuable time apart from their regular activities.

Thanks,

Vinay