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: 

output display problem in alignment

Former Member
0 Kudos

i am displaying vendor wise purchase register details in my output i have many line items per each vendor.

i want to display vendor wise line items.

suppose AFTON CHEMICALS is coming 10 times in the output i want to display this with all line items.

example..

NAME AMOUNT BILLNO

AFTON CHEMICALS 10000 AS105

MUMBAI

400078

AFTON CHEMICALS 20000 AS106

MUMBAI

400078

AFTON CHEMICALS 30000 AS107

MUMBAI

400078

AFTON CHEMICALS 40000 AS108

MUMBAI

400078

AFTON CHEMICALS 50000 AS109

MUMBAI

400078

but now i am getting output as below.

AFTON CHEMICALS

MUMBAI

400078

10000 AS105

20000 AS106

30000 AS107

40000 AS108

50000 AS109

I want to display above output as below

AFTON CHEMICALS 10000 AS105

MUMBAI 20000 AS106

400078 30000 AS107

40000 AS108

50000 AS109

i have written code as following

loop at output.

on change of output-name1.

write:/output-name1,

/output-name2,

/output-ort01,

/output-pstlz.

endon.

write:/ output-amout, output-billno.

Pls suggest me how to display my line items infront of the name1 as i said above.

Pls suggest me its very urgent.

1 ACCEPTED SOLUTION

venkat_o
Active Contributor
0 Kudos

Hi Venkat, Do u want output like this ?

Afton chemicals   10000 as105
mumbai            20000 as106
400078            30000 as107
                  40000 as108
                  50000 as109
Thanks, Venkat.O

5 REPLIES 5

Former Member
0 Kudos

Hi,

I think you should remove the statement :

on change of..........

endon.

Hope this helps.

Reward if helpful.

Regards,

Sipra

Former Member
0 Kudos

Hi,

Use control break statements

AT NEW <field name>

<field name> is nothing but the field which containg the value AFTON CHEMICALS

THIS WILL SOLVE UR PROBLEM

reward if helpful

raam

venkat_o
Active Contributor
0 Kudos

Hi Venkat, Do u want output like this ?

Afton chemicals   10000 as105
mumbai            20000 as106
400078            30000 as107
                  40000 as108
                  50000 as109
Thanks, Venkat.O

venkat_o
Active Contributor
0 Kudos

Venkat rao, Check the sample program for your case. It solves your problem

REPORT zvenkat_test2.

DATA:
      BEGIN OF itab OCCURS 0,
         name1 TYPE char25,
         name2 TYPE char25,
         ort01 TYPE char25,
         pstlz TYPE char25,
         amt   TYPE p0008-bet01,
         billno TYPE i,
       END OF itab.
DO 10 TIMES.
  itab-name1 = 'AFTON'.
  itab-name2 = 'CHEMICALS'.
  itab-ort01 = 'Bombay'.
  itab-pstlz = '400078'.
  itab-amt   = 2000 + sy-index.
  itab-billno = sy-index + 1.
  APPEND itab.
  CLEAR itab.
ENDDO.

LOOP AT itab .
  ON CHANGE OF itab-name1." OR itab-name2 OR itab-ort01 OR itab-pstlz.
    RESERVE 4 LINES. """Check this
    WRITE:/ itab-name1,
          / itab-name2,
          / itab-ort01,
          / itab-pstlz.
    BACK.                   """Check this
  ENDON.
  WRITE: /30 itab-amt, itab-billno.
ENDLOOP.
Regards, Venkat.O,

Former Member
0 Kudos

yes i want output same as u send to me.