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

help with this report

Former Member
0 Likes
453

hi to all sdners,

please with this report

1.control break report to display customer wise sales order item list including gross and net totals.

hi to all sdners,

please with this report

1.control break report to display customer wise sales order item list including gross and net totals.

2 REPLIES 2
Read only

Former Member
0 Likes
438

copy and paste ur code.

Read only

Former Member
0 Likes
438

Hi

See the sample code using Control break statements and do accordingly using the tables KN1,VBAK and VBAP

write a s single Join

select akunnr aname1

bvbeln bnetwr

cposnr cmatnr c~kwmeng

into table itab

from kna1 as a join vbak as b

on akunnr = bkunnr join vbap as c

on bvbeln = cvbeln

where a~kunnr in s_kunnr .

sort itab by kunnr.

loop at itab.

at new kunnr.

....

endat.

at end of kunnr.

sum.

..............

endat.

endloop.

All this AT NEW, AT FIRST, AT END OF and AT LAST are called control break statements of Internal tables and are used to calculate the TOTALS based on sertain key fields in that internal table

FIrst to use these statements the ITAB has to be sorted by the key fields on whcih you need the SUM of the fields.

Some time you will get * when mopving data from this int table to other table using these commands

so you have to use

READ TABLE ITAB INDEX SY-TABIX in AT..ENDAT..if you are using other fields between them

DATA: sflight_tab TYPE SORTED TABLE OF sflight

WITH UNIQUE KEY carrid connid fldate,

sflight_wa LIKE LINE OF sflight_tab.

SELECT *

FROM sflight

INTO TABLE sflight_tab.

LOOP AT sflight_tab INTO sflight_wa.

AT NEW connid.

WRITE: / sflight_wa-carrid,

sflight_wa-connid.

ULINE.

ENDAT.

WRITE: / sflight_wa-fldate,

sflight_wa-seatsocc.

AT END OF connid.

SUM.

ULINE.

WRITE: / 'Sum',

sflight_wa-seatsocc UNDER sflight_wa-seatsocc.

SKIP.

ENDAT.

AT END OF carrid.

SUM.

ULINE.

WRITE: / 'Carrier Sum',

sflight_wa-seatsocc UNDER sflight_wa-seatsocc.

NEW-PAGE.

ENDAT.

AT LAST.

SUM.

WRITE: / 'Overall Sum',

sflight_wa-seatsocc UNDER sflight_wa-seatsocc.

ENDAT.

ENDLOOP.

Regards

Anji