ABAP Programs:Dynamic subtotals
REPORT ZSOURCE2304.
TABLES ACTFLI.
DATA MY_FLIGHTS LIKE ACTFLI OCCURS 10
WITH HEADER LINE.
DATA SUM_OCCUPIED_SEATS LIKE MY_FLIGHTS-SEATSOCC.
DATA COLUMN(30).
SELECT * FROM ACTFLI INTO TABLE MY_FLIGHTS
ORDER BY PRIMARY KEY.
LOOP AT MY_FLIGHTS.
WRITE: / MY_FLIGHTS-CARRID,
MY_FLIGHTS-CONNID,
MY_FLIGHTS-FLDATE.
ENDLOOP.
AT LINE-SELECTION.
* Display subtotals according to end user’s selection
GET CURSOR FIELD COLUMN.
SHIFT COLUMN UP TO ‘-’.
SHIFT COLUMN.
LOOP AT MY_FLIGHTS.
AT NEW (COLUMN).
NEW-PAGE.
WRITE / MY_FLIGHTS-CARRID.
CLEAR SUM_OCCUPIED_SEATS.
ENDAT.
ADD MY_FLIGHTS-SEATSOCC TO SUM_OCCUPIED_SEATS.
WRITE / MY_FLIGHTS-SEATSOCC.
AT END OF (COLUMN).
WRITE: / ‘Occupied seats total:’, SUM_OCCUPIED_SEATS.
ENDAT.
ENDLOOP.
If you like this post, you may as well like these too:
- ABAP Programs: Using a dynamic table name REPORT ZSOURCE1110.* Variables for later useDATA: TABLENAME(10), COUNT_ROWS TYPE I.* Setting the table name dynamicallyMOVE ‘CUSTOMERS’ TO TABLENAME.* Selecting dataSELECT COUNT( * ) FROM (TABLENAME) INTO COUNT_ROWS.WRITE: TABLENAME, COUNT_ROWS. ~...
- ABAP Programs: Dynamic read table command REPORT ZSOURCE2303. * Parameters for reading a single line, can be modified by the end user PARAMETERS: KEY1(10) DEFAULT ‘NAME’, VALUE1(25), KEY2 LIKE KEY1 DEFAULT ‘ID’, VALUE2 LIKE VALUE1. *...
- ABAP Programs:Dynamic Open SQL Commands: table name REPORT ZSOURCE2305. PARAMETERS TABLENAME(10) DEFAULT 'CUSTOMERS'. DATA COUNT_ROWS TYPE I. SELECT COUNT( * ) FROM (TABLENAME) INTO COUNT_ROWS. WRITE: TABLENAME, COUNT_ROWS. DATA WHERE_TAB(80) OCCURS 10 WITH HEADER LINE. APPEND 'name...
- ABAP Programs: Dynamic sort command with several sort criteria REPORT ZSOURCE2302. * Parameters for the sort criterion, can be modified by the end user PARAMETERS: COLUMN1(10) DEFAULT ‘NAME’, COLUMN2 LIKE COLUMN1 DEFAULT ‘ID’. * Declarations for later use TABLES...
- ABAP Program: Dynamic external perform (call back form) Here the two programs which are calling dynamically. REPORT ZSOURCE2309. PERFORM EXTFORM IN PROGRAM ZSOURCE2310 USING 'CALL_BACK_FORM' SY-CPROG. FORM CALL_BACK_FORM. WRITE / 'I am the call back form in ZSOURCE2309.'....
- ABAP: How to create a dynamic internal table and work area FIELD-SYMBOLS:<fs_table> TYPE STANDARD TABLE, <fs_table_wa> TYPE ANY. DATA: table_ref TYPE REF TO data, wa_ref TYPE REF TO data. DATA: l_structure TYPE dd02l-tabname value 'VBAP'. CREATE DATA table_ref TYPE STANDARD...
- ABAP Source Code: Syntax of ABAP/4 Programs 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 * Declaration...
- Dynamic Selection Screen ABAP Program using Dynamic Selection Screen ABAP Program with consists of the selection screen, which changes based on the user click on a radio button. The entire selection screen is...
- Dynamic ALV Generation Dynamic ALV Generation with data stored in table. Download the Complete Program on Dynamic ALV....
- Dynamic SQL in SAP Dynamic SQL in SAP – Download here(rapidshare)...
- ABAP Programs: Importing from the ABAP/4 Memory REPORT ZSOURCE1402. * Internal tables which will be imported DATA: ALL_CUSTOMERS LIKE CUSTOMERS OCCURS 100 WITH HEADER LINE, ALL_BOOKINGS LIKE BOOKINGS OCCURS 10 WITH HEADER LINE, NEW_BOOKINGS LIKE BOOKINGS OCCURS...
- ABAP Programs: Exporting to the ABAP/4 Memory REPORT ZSOURCE1401. * Work areas TABLES: CUSTOMERS, BOOKINGS. * Internal tables which will be exported DATA: ALL_CUSTOMERS LIKE CUSTOMERS OCCURS 100 WITH HEADER LINE, ALL_BOOKINGS LIKE BOOKINGS OCCURS 10 WITH...
- ABAP Programs: Using where clauses REPORT ZSOURCE1104.* Work areasTABLES: BOOKINGS, CUSTOMERS.* Internal tablesDATA CUSTOMER_ORDERS LIKE BOOKINGS OCCURS 100 WITH HEADER LINE.DATA ALL_CUSTOMERS LIKE CUSTOMERS OCCURS 100 WITH HEADER LINE.* Selecting data with a simple where...
- ABAP Programs: Using colors REPORT ZSOURCE0807. * Display the header using an appropriate color (grayish blue)WRITE ‘Header’ COLOR COL_HEADING. * Switch the standard colorFORMAT COLOR COL_TOTAL. * Make the color less brightWRITE / ‘total...
- Some Cool Programs in ABAP and the link is :- http://www.kabai.com/abaps/q.htm...



















Leave a Reply