04-10-2008 8:44 AM
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.
04-10-2008 9:15 AM
Hi Venkat,
Do u want output like this ?
Thanks,
Venkat.O
Afton chemicals 10000 as105
mumbai 20000 as106
400078 30000 as107
40000 as108
50000 as109
04-10-2008 8:48 AM
Hi,
I think you should remove the statement :
on change of..........
endon.
Hope this helps.
Reward if helpful.
Regards,
Sipra
04-10-2008 9:03 AM
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
04-10-2008 9:15 AM
Hi Venkat,
Do u want output like this ?
Thanks,
Venkat.O
Afton chemicals 10000 as105
mumbai 20000 as106
400078 30000 as107
40000 as108
50000 as109
04-10-2008 9:41 AM
Venkat rao,
Check the sample program for your case. It solves your problem
Regards,
Venkat.O,
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.
04-10-2008 10:08 AM