Hi
This is possible with COntrol Break Stamnts\Check below Code for example..
DATA: BEGIN OF line,
carrid TYPE sbook-carrid,
connid TYPE sbook-connid,
fldate TYPE sbook-fldate,
custtype TYPE sbook-custtype,
class TYPE sbook-class,
bookid TYPE sbook-bookid,
END OF line.
DATA itab LIKE SORTED TABLE OF line WITH UNIQUE KEY table_line.
SELECT carrid connid fldate custtype class bookid
FROM sbook INTO CORRESPONDING FIELDS OF TABLE itab.
LOOP AT itab INTO line.
AT FIRST.
WRITE / 'List of Bookings'.
ULINE.
ENDAT.
AT NEW carrid.
WRITE: / 'Carrid:', line-carrid.
ENDAT.
AT NEW connid.
WRITE: / 'Connid:', line-connid.
ENDAT.
AT NEW fldate.
WRITE: / 'Fldate:', line-fldate.
ENDAT.
AT NEW custtype.
WRITE: / 'Custtype:', line-custtype.
ENDAT.
WRITE: / line-bookid, line-class.
AT END OF class.
ULINE.
ENDAT.
ENDLOOP.
Hope it helps.
Praveen
hi,
U can Use 'AT' Function for checking Sum.. I'l give you a piece of code. Check to it..
Display the table T with sub-totals:
TYPES: BEGIN OF T_TYPE, CODE(4), SALES TYPE P, DISCOUNT TYPE P, END OF T_TYPE. DATA: T TYPE STANDARD TABLE OF T_TYPE WITH NON-UNIQUE DEFAULT KEY INITIAL SIZE 100, WA_T TYPE T_TYPE. ... LOOP AT T INTO WA_T. AT FIRST. SUM. WRITE: /4 'Grand Total:', 20 WA_T-SALES, 40 WA_T-DISCOUNT. ULINE. SKIP. ENDAT. WRITE: / WA_T-CODE, 20 WA_T-SALES, 40 WA_T-DISCOUNT. AT END OF CODE. SUM. WRITE: / WA_T-CODE, 10 'Total:', 20 WA_T-SALES, 40 WA_T-DISCOUNT. SKIP. ENDAT. ENDLOOP
Hi Dude,
Here is the answer for you Query,
If you have the same ZSSS text in coumln 1 and amount value in column 2,to add this amount value ,use collect statement as below:
loop at itab.
collect itab.
endloop.
loop at itab.
write: itab-amount."Contains the sum
endloop.
Regards,
Lakshmanan
Add comment