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

hoe to write quantity f under dates

Former Member
0 Likes
342

I have a itab having 4 field. I collect the itab for each date.

So for date 1 it collect as this.

Code no code text quantity date

1 A 3 1.10.2007

2 B 2 1.10.2007

1 B 4 2.10.2007

3 C 2 3.10.2007

1 A 3 2.10.2007

3 C 1 1.10.2007

SO WHEN I LOOP IT AS DATE IN CASE CONDITION LIKE WHEN ‘1 ’, WHEN ‘2’ LIKE THIS MY O/P IS COMING LIKE THIS.

1 2 3

-


A 3

B 2

B 4

C 2

A 3

C 1

BUT MY O/P SHOULD SHOULD COME LIKE THIS

1 2 3

-


A 3 3

B 2 4

C 1 2

SO HOW I WILL WRITE TO GET THE ABOVE O/P. PLEASE SEND BY LITTLE CODES.

I have a itab having 4 field. I collect the itab for each date.

So for date 1 it collect as this.

Code no code text quantity date

1 A 3 1.10.2007

2 B 2 1.10.2007

1 B 4 2.10.2007

3 C 2 3.10.2007

1 A 3 2.10.2007

3 C 1 1.10.2007

SO WHEN I LOOP IT AS DATE IN CASE CONDITION LIKE WHEN ‘1 ’, WHEN ‘2’ LIKE THIS MY O/P IS COMING LIKE THIS.

1 2 3

-


A 3

B 2

B 4

C 2

A 3

C 1

BUT MY O/P SHOULD SHOULD COME LIKE THIS

1 2 3

-


A 3 3

B 2 4

C 1 2

SO HOW I WILL WRITE TO GET THE ABOVE O/P. PLEASE SEND BY LITTLE CODES.

1 REPLY 1
Read only

Former Member
0 Likes
310

Hi,

Check the sample code..



*" Sort the internal table by CODE TEXT which is have the value A, B, C
SORT itab BY code_text.

DATA: v_flag TYPE xfeld.

LOOP AT ITAB INTO WA.

*" on change of the value..Print a new line.
   ON CHANGE OF WA-CODE_TEXT.
      SKIP.

*" Display the code text
      WRITE: wa-code_text.
     
   ENDON.

* display the quantity.
   WRITE: wa-quantity.


ENDLOOP.

THanks

Naren