How to append ALV grid output to LIST output

Hi,
I am working with Basis AUDIT MANUAL report for which i have to integrate around 50 standard transactions (SM37,SM35...etc) output and make it into one single report.
On execution of my report i have to get all the 50 transaction outputs sequentially.
Some standard transactions have ALV list display output and some have GRID display.I can able to append only list outputs by submit program and exporting list to memory.
Please suggest me how to get Alv grid output in midst of list output.
Regards
Kalpana.

You should post your question to the ABAP forum:
ABAP Development

Similar Messages

  • How to download alv grid output(with field catalog) into excel file format

    Hi all,
    How to download alv grid output(with field catalogs) into excel file format and same file has to download to application server.
    Please help.
    Regards,
    Satya.

    Hi,
    On list where alv is displayed, select export icon( green color -> ),select spread sheet.
    This will display records in Excel sheet.

  • How to send ALV Grid report to Email?

    hai all,
    How to send ALV Grid report to Email.
    please its very urgent.....

    Hi,
    when u run the Alv, u will button 'Mail Recepiant' in tool bar.When u click it and enter to new screen, go to the Recipient Tab(down) enter ur maild id and click 'Send' button on tool bar.
    or.
    if u want to send the Alv content to mail id thru prg, go thru the following code.
                              TABLES
    TABLES: BSID. " Accounting: Secondary Index for Customers.
                              TYPE-POOLS
    TYPE-POOLS: SLIS.
                              INTERNAL TABLES
        Internal table to hold Customer data.
    DATA: BEGIN OF TB_BSID OCCURS 0,
            BUKRS   LIKE BSID-BUKRS,    " Company code
            KUNNR   LIKE BSID-KUNNR,    " Customer number
            AUGDT   LIKE BSID-AUGDT,    " Clearing Date
            BLDAT   LIKE BSID-BLDAT,    " Doc date in document
            SHKZG   LIKE BSID-SHKZG,    " Debit/credit indicator
            DMBTR   LIKE BSID-DMBTR,    " Amount in local currency
            ZFBDT   LIKE BSID-ZFBDT,    " Baseline date for due date calc
            ZBD1T   LIKE BSID-ZBD1T,    " Cash discount days 1
            ZBD2T   LIKE BSID-ZBD2T,    " Cash discount days 2
            ZBD3T   LIKE BSID-ZBD3T,    " Net Payment Terms Period
            REBZG   LIKE BSID-REBZG,    " No Of the Inv the Tran Belongs to
            REBZT   LIKE BSID-REBZT,    " Follow-On Document Type
          END OF TB_BSID.
        Internal table to hold Open Items.
    DATA: TB_BSID_OPEN LIKE TABLE OF TB_BSID WITH HEADER LINE.
        Internal table to hold Cleared Items.
    DATA: TB_BSAD_CLEAR LIKE TABLE OF TB_BSID WITH HEADER LINE.
        Internal table to hold General Data in Customer Master
    DATA: BEGIN OF TB_KNA1 OCCURS 0,
            KUNNR LIKE KNA1-KUNNR,      " Customer Number
            NAME1 LIKE KNA1-NAME1,      " Name Line 1
            TELF1 LIKE KNA1-TELF1,      " Telephone Number
            ADRNR LIKE KNA1-ADRNR,      " Address
          END OF TB_KNA1.
        Internal table to hold Customer Master (Company Code)
    DATA: BEGIN OF TB_KNB1 OCCURS 0,
            KUNNR LIKE KNB1-KUNNR,     " Customer Number
            BUKRS LIKE KNB1-BUKRS,     " Company code
            ERDAT LIKE KNB1-ERDAT,     " Rec Created Date
            ZAMIB LIKE KNB1-ZAMIB,     " DMS Managed Indicator
          END OF TB_KNB1.
        Internal table to hold Final Output Data
    DATA: BEGIN OF TB_FINAL OCCURS 0,
            KUNNR           LIKE KNA1-KUNNR, " Customer Number
            NAME1           LIKE KNA1-NAME1, " Name Line 1
            ADDRESS1(25)    TYPE C,          " Address line 1
            ADDRESS2(25)    TYPE C,          " Address line 2
            ADDRESS3(25)    TYPE C,          " Address line 3
            ADDRESS4(25)    TYPE C,          " Address line 4
            PHONE           LIKE KNA1-TELF1, " Telephone Number
            DAYS_SLOW(3)    TYPE C,          " Days Slow
            LAST_DATE(8)    TYPE C,          " Date of Last Invoice
            AVG(4)          TYPE C,          " Average Days to Pay
            CURRENT(10)     TYPE N,          " Current
            AVG_1_30(10)    TYPE N,          " 1-30 past due
            AVG_31_60(10)   TYPE N,          " 31-60 past due
            AVG_61_90(10)   TYPE N,          " 61-90 past due
            AVG_90G(10)     TYPE N,          " 90+ past due
          END OF TB_FINAL.
         ALV Internal tables
    DATA : TB_FIELDCAT       TYPE SLIS_T_FIELDCAT_ALV,  " Field Catalog
           TB_EVENTS         TYPE SLIS_T_EVENT,         " ALV Events
           TB_COMMENTS       TYPE SLIS_T_LISTHEADER.    " Comment
        Internal tables for the sending mail data
    DATA: TB_OBJPACK  TYPE SOPCKLSTI1 OCCURS 2  WITH HEADER LINE,
          TB_OBJHEAD  TYPE SOLISTI1   OCCURS 1  WITH HEADER LINE,
          TB_OBJTXT   TYPE SOLISTI1   OCCURS 10 WITH HEADER LINE,
          TB_RECLIST  TYPE SOMLRECI1  OCCURS 5  WITH HEADER LINE,
          TB_OBJBIN   LIKE SOLISTI1   OCCURS 0  WITH HEADER LINE,
          TB_DOC_CHNG TYPE SODOCCHGI1.
        Internal table to get mail Receivers Address
    DATA: TB_ZRECEIVE LIKE YSMTP_ADDRESS OCCURS 0 WITH HEADER LINE.
                               STRUCTURES
    DATA: X_SADR            TYPE SADR,                 " For Address
          X_FIELDCAT        TYPE SLIS_FIELDCAT_ALV,    " For Field Catalog
          X_LAYOUT          TYPE SLIS_LAYOUT_ALV,      " For Layout
          X_EVENTS          TYPE SLIS_ALV_EVENT,       " For Events
          X_COMMENTS        TYPE SLIS_LISTHEADER,      " For Comments
          X_ADDR1_SEL       LIKE ADDR1_SEL,            " For Address
          WA_FAEDE          TYPE FAEDE.                " For FAEDE struct
                               VARIABLES
    DATA: G_REPID        LIKE SY-REPID,             " Prog ID
          G_DAYS_SLOW(3) TYPE N,                    " Days Slow
          G_OPEN         TYPE I,                    " Counter
          G_AVG(4)       TYPE C,                    " Avg Days
          G_COUNT        TYPE I,                    " Counter
          G_TITLE        TYPE SOLISTI1-LINE,        " Description
          G_TAB_LINES    TYPE SY-TABIX,             " Internal data count
          G_REC_COUNT    TYPE I,                    " Total records
          G_CURR_BAL     TYPE N,                    " Account balance
          G_FILE_NAME    LIKE EDI_PATH-PTHNAM.      " Output File Name
                               CONSTANTS
    CONSTANTS: C_D            TYPE C VALUE 'D',     " Account type
               C_X            TYPE C VALUE 'X',     " Check Value
               C_0(4)         TYPE N VALUE '0.00',  " Constant for char
               C_1(2)         TYPE C VALUE '01',    " Posting key const
               C_H            TYPE C VALUE 'H',     " For Commenet-Type
               C_TXT(3)       TYPE N VALUE 'TXT',   " File type
               C_RAW(3)       TYPE C VALUE 'RAW',   " File type
               C_DELIMITER    TYPE X VALUE '09',    " ASCII CODE LINE
               C_TOP_OF_PAGE  TYPE SLIS_FORMNAME VALUE 'TOP_OF_PAGE',
               C_INTERFACE    TYPE YWFSALOFFICNOTIF-INTERFACE_ID VALUE 'AP',
               C_FILENAME(20) TYPE N VALUE 'TEXT.TXT'," File name
               C_TITLE(30)    TYPE N VALUE 'Z21614_DB_CREDIT_AGENCY',
               C_Z001 TYPE RF035-RASID VALUE 'Z001'." Net 30/60/90/120/150
                               SELECTION SCREEN.
    Selection Screen for Selection Criteria.
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-T01.
    SELECT-OPTIONS:  S_BUKRS FOR  BSID-BUKRS OBLIGATORY,    " Company Code
                     S_BLDAT FOR  BSID-BLDAT," OBLIGATORY,  " Doc Date
                     S_KUNNR FOR  BSID-KUNNR,               " Cust No
                     S_ZUONR FOR  BSID-ZUONR.               " Assignment
    PARAMETERS:      P_GRACE(2)   TYPE N OBLIGATORY,        " Grace Days
                     P_ZAMIB LIKE KNB1-ZAMIB AS CHECKBOX.   " DMS Indicator
    SELECTION-SCREEN END OF BLOCK B1.
    Selection Screen for Output Options.
    SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-T02.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN POSITION 01.
    PARAMETERS: P_REPORT RADIOBUTTON GROUP R1.             " Report Only
    SELECTION-SCREEN COMMENT 5(25) TEXT-016.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN POSITION 01.
    PARAMETERS: P_DOWN RADIOBUTTON GROUP R1.               " Dwnld to Unix
    SELECTION-SCREEN COMMENT 5(25) TEXT-017.
    SELECTION-SCREEN POSITION 30.
    PARAMETERS: P_FILE LIKE FILENAME-FILEINTERN DEFAULT
                                 'Z21614_DB_CREDIT_AGENCY'. " File Name
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN END OF BLOCK B2.
    Selection Screen for E-mail.
    SELECTION-SCREEN BEGIN OF BLOCK B3 WITH FRAME TITLE TEXT-T03.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN POSITION 01.
    PARAMETERS: P_EMAIL AS CHECKBOX.                        " E-mail
    SELECTION-SCREEN COMMENT 5(25) TEXT-018.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN END OF BLOCK B3.
                               INITIALIZATION
    INITIALIZATION.
      G_REPID = SY-REPID.
                   AT SELECTION SCREEN.                                  *
    AT SELECTION-SCREEN.
    Validation of selection screen entries
    perform validate_data.
                               START-OF-SELECTION
    START-OF-SELECTION.
    Select Data from Customer Master (Company Code)
      PERFORM SELECT_KNB1.
    Select Custmer Open Items.
      PERFORM SELECT_CUSTOMER_OPEN_ITEMS.
    Select Custmer Cleared Items.
      PERFORM SELECT_CUSTOMER_CLEARED_ITEMS.
    Select General Data in Customer Master
      PERFORM SELECT_KNA1.
    Populate Final Output Data.
      PERFORM POPULATE_TB_FINAL.
                       End of selection                                  *
    END-OF-SELECTION.
    If both display report and send email is checked
      IF P_REPORT = C_X AND P_EMAIL  = C_X.
        MESSAGE E999 WITH
          'Select One Among Report Only & Send E-mail'(023).
    When Radiobutton for Email or if the program is run background
      ELSEIF ( P_EMAIL = C_X OR SY-BATCH = C_X ).
      To send the mail
        PERFORM SEND_EMAIL.
      ELSEIF P_REPORT = C_X .
      To display the Final Output data using ALV's
        PERFORM DISPLAY_ALV_REPORT.
      ENDIF.
    Transfering data to file when downloading to Unix
      IF P_DOWN = C_X.
        IF G_REC_COUNT IS INITIAL.
          MESSAGE I999 WITH
            'No Records Found For Selection Criteria'(024).
          EXIT.
        ELSE.
          IF NOT G_FILE_NAME IS INITIAL.
          Trasefering data to file
            PERFORM TRANSFER_DATA_FILE.
          Interface Audit report
            PERFORM WRITE_REPORT.
          ENDIF.
        ENDIF.
      ENDIF.
                              F O R M S
    *&      Form  VALIDATE_DATA
          Validating selection-screen entries
    FORM VALIDATE_DATA.
    Local variables
      DATA : L_BUKRS LIKE BSEG-BUKRS,          " For Company Code
             L_KUNNR LIKE BSEG-KUNNR.          " For Customer Number
    Validate the Company code.
      SELECT SINGLE BUKRS
        INTO L_BUKRS
        FROM T001
       WHERE BUKRS IN S_BUKRS.
      IF SY-SUBRC <> 0.
        MESSAGE E999 WITH 'Enter valid Company Code'(025).
      ENDIF.
    Validate the Customer number
      IF NOT S_KUNNR[] IS INITIAL.
        SELECT SINGLE KUNNR
          INTO L_KUNNR
          FROM KNA1
         WHERE KUNNR IN S_KUNNR.
        IF SY-SUBRC <> 0.
          MESSAGE E999 WITH 'Enter valid Customer Number'(026).
        ENDIF.
      ENDIF.
    ENDFORM.                    " VALIDATE_DATA
    *&      Form  SELECT_KNB1
          Select Data from Customer Master (Company Code)
    FORM SELECT_KNB1 .
      CLEAR: TB_KNB1,
             TB_KNB1[].
      SELECT KUNNR
             BUKRS
             ERDAT
             ZAMIB
             FROM KNB1
             INTO TABLE TB_KNB1
             WHERE BUKRS IN S_BUKRS
               AND KUNNR IN S_KUNNR.
      IF SY-SUBRC = 0.
      Sort TB_KNB1 by Customer no & Rec Created Date
        SORT TB_KNB1 BY KUNNR ERDAT DESCENDING.
      ENDIF.
    ENDFORM.                    " SELECT_KNB1
    *&      Form  SELECT_CUSTOMER_OPEN_ITEMS
          Select Custmer Open Items.
    FORM SELECT_CUSTOMER_OPEN_ITEMS .
      CLEAR: TB_BSID,
             TB_BSID[].
      SELECT  A~BUKRS
              B~KUNNR
              B~AUGDT
              B~BLDAT
              B~SHKZG
              B~DMBTR
              B~ZFBDT
              B~ZBD1T
              B~ZBD2T
              B~ZBD3T
              B~REBZG
              B~REBZT
         INTO TABLE TB_BSID
         FROM BKPF AS A JOIN BSID AS B
           ON ABUKRS = BBUKRS
          AND ABELNR = BBELNR
          AND AGJAHR = BGJAHR
        WHERE A~BUKRS IN S_BUKRS
          AND A~BLDAT IN S_BLDAT
          AND B~KUNNR IN S_KUNNR
          AND B~ZUONR IN S_ZUONR
          AND B~BSCHL = C_1.
      IF SY-SUBRC = 0.
      DMS Managed Indicator  = ‘X’.
        IF P_ZAMIB = C_X.
          LOOP AT TB_KNB1 WHERE ZAMIB = SPACE.
            DELETE TB_BSID WHERE BUKRS = TB_KNB1-BUKRS
                             AND KUNNR = TB_KNB1-KUNNR.
          ENDLOOP.
        ENDIF.
      Transfering Open Items from TB_BSID to TB_BSID_OPEN
        TB_BSID_OPEN[] = TB_BSID[].
      ENDIF.
    ENDFORM.                    " SELECT_CUSTOMER_OPEN_ITEMS
    *&      Form  SELECT_CUSTOMER_CLEARED_ITEMS
          Select Custmer Cleared Items.
    FORM SELECT_CUSTOMER_CLEARED_ITEMS .
      CLEAR: TB_BSAD_CLEAR,
             TB_BSAD_CLEAR[].
      SELECT   A~BUKRS
               B~KUNNR
               B~AUGDT
               B~BLDAT
               B~SHKZG
               B~DMBTR
               B~ZFBDT
               B~ZBD1T
               B~ZBD2T
               B~ZBD3T
               B~REBZG
               B~REBZT
          INTO TABLE TB_BSAD_CLEAR
          FROM BKPF AS A JOIN BSAD AS B
            ON ABUKRS = BBUKRS
          AND  ABELNR = BBELNR
          AND  AGJAHR = BGJAHR
         WHERE A~BUKRS IN S_BUKRS
           AND A~BLDAT IN S_BLDAT
           AND B~KUNNR IN S_KUNNR
           AND B~ZUONR IN S_ZUONR
           AND B~BSCHL = C_1.
      IF SY-SUBRC = 0.
      DMS Managed Indicator = ‘X’.
        IF P_ZAMIB = C_X.
          LOOP AT TB_KNB1 WHERE ZAMIB = SPACE.
            DELETE TB_BSID WHERE BUKRS = TB_KNB1-BUKRS
                             AND KUNNR = TB_KNB1-KUNNR.
          ENDLOOP.
        ENDIF.
      Sort TB_BSID_CLEAR by Customer number
        SORT TB_BSAD_CLEAR BY KUNNR.
      ENDIF.
    Append lines of TB_BSID_CLEAR to table TB_BSID
      APPEND LINES OF TB_BSAD_CLEAR TO TB_BSID.
    Sort TB_BSID by Cust num AND Doc date in document
      SORT TB_BSID BY KUNNR BLDAT.
    ENDFORM.                    " SELECT_CUSTOMER_CLEARED_ITEMS
    *&      Form  SELECT_KNA1
          Select General Data in Customer Master
    FORM SELECT_KNA1.
      CLEAR: TB_KNA1,
             TB_KNA1[].
      SELECT  KUNNR
              NAME1
              TELF1
              ADRNR
         INTO TABLE TB_KNA1
         FROM KNA1
        WHERE KUNNR IN S_KUNNR.
      IF SY-SUBRC <> 0.
      ENDIF.
    ENDFORM.                    " SELECT_KNA1
    *&      Form  POPULATE_TB_FINAL
          Populate Final Output Data.
    FORM POPULATE_TB_FINAL.
    Local variable
      DATA: L_DAYS_SLOW(3) TYPE N.       " Days Slow
      CLEAR: TB_FINAL,
             TB_FINAL[].
      LOOP AT TB_KNA1.
      Move-corresponding TB_KNA1 to TB_FINAL.
        TB_FINAL-KUNNR = TB_KNA1-KUNNR.  " Customer Number
        TB_FINAL-NAME1 = TB_KNA1-NAME1.  " Name Line 1
        TB_FINAL-PHONE = TB_KNA1-TELF1.  " Telephone Number
      To get Customer Address.
        PERFORM GET_CUSTOMER_ADDRESS.
      To get Date of Last Invoice.
        READ TABLE TB_BSID WITH KEY KUNNR = TB_KNA1-KUNNR.
        IF SY-SUBRC = 0.
          TB_FINAL-LAST_DATE = TB_BSID-BLDAT.
        ENDIF.
      To get past due and current details.
        PERFORM GET_PAST_DUE_CURRENT.
      To get Days Slow.
        CLEAR WA_FAEDE .
        LOOP AT TB_BSID_OPEN WHERE KUNNR = TB_KNA1-KUNNR.
          WA_FAEDE-SHKZG = TB_BSID-SHKZG.
          WA_FAEDE-ZFBDT = TB_BSID-ZFBDT.
          WA_FAEDE-ZBD1T = TB_BSID-ZBD1T.
          WA_FAEDE-ZBD2T = TB_BSID-ZBD2T.
          WA_FAEDE-ZBD3T = TB_BSID-ZBD3T.
          WA_FAEDE-REBZG = TB_BSID-REBZG.
          WA_FAEDE-REBZT = TB_BSID-REBZT.
          WA_FAEDE-KOART = C_D.
        To Determine Due Date.
          CALL FUNCTION 'DETERMINE_DUE_DATE'
               EXPORTING
                    I_FAEDE                    = WA_FAEDE
               IMPORTING
                    E_FAEDE                    = WA_FAEDE
               EXCEPTIONS
                    ACCOUNT_TYPE_NOT_SUPPORTED = 1
                    OTHERS                     = 2.
          IF SY-SUBRC <> 0.
            CLEAR WA_FAEDE.
            MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                  WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
          ENDIF.
          CLEAR: L_DAYS_SLOW.
          L_DAYS_SLOW = SY-DATUM - WA_FAEDE-NETDT - P_GRACE.
          G_DAYS_SLOW = G_DAYS_SLOW + ABS( L_DAYS_SLOW ).
          G_OPEN      = G_OPEN + 1.
        ENDLOOP.
        IF G_OPEN IS INITIAL.
          TB_FINAL-DAYS_SLOW = G_DAYS_SLOW / G_OPEN.  " Days Slow
        ENDIF.
      To get Average days to Pay.
        PERFORM GET_AVG_DAYS_PAY.
      Calculating total records .
        G_REC_COUNT = G_REC_COUNT + 1.
        APPEND TB_FINAL.
        CLEAR  TB_FINAL.
      ENDLOOP.
    Current account balance.
      G_CURR_BAL   = TB_FINAL-CURRENT + TB_FINAL-AVG_1_30  +
                                        TB_FINAL-AVG_31_60 +
                                        TB_FINAL-AVG_61_90 +
                                        TB_FINAL-AVG_90G   .
    ENDFORM.                    " POPULATE_TB_FINAL
    *&      Form  GET_PAST_DUE_CURRENT
          To get past due and current details.
    FORM GET_PAST_DUE_CURRENT.
        Local Varaibles.
      DATA: L_RF035_SFAE1 TYPE RF035-SFAE1,
            L_RF035_SFAE2 TYPE RF035-SFAE2,
            L_RF035_SFAE3 TYPE RF035-SFAE3,
            L_RF035_SFAE4 TYPE RF035-SFAE4,
            L_RF035_SFAE5 TYPE RF035-SFAE5,
            L_RF035_SFAE6 TYPE RF035-SFAE6,
            L_RF035_SFAEL TYPE RF035-SFAEL,
            L_RF035_SNFA1 TYPE RF035-SNFA1,
            L_RF035_SNFA2 TYPE RF035-SNFA2,
            L_RF035_SNFA3 TYPE RF035-SNFA3,
            L_RF035_SNFA4 TYPE RF035-SNFA4,
            L_RF035_SNFA5 TYPE RF035-SNFA5,
            L_RF035_SNFA6 TYPE RF035-SNFA6,
            L_RF035_SNFAE TYPE RF035-SNFAE.
      LOOP AT TB_KNB1 WHERE KUNNR = TB_KNA1-KUNNR.
        CALL FUNCTION 'CUSTOMER_DUE_DATE_ANALYSIS'
             EXPORTING
                  BUKRS          = TB_KNB1-BUKRS
                KKBER          = ' '
                  KUNNR          = TB_KNB1-KUNNR
                  RASID          = C_Z001
             IMPORTING
                  SFAE1          = L_RF035_SFAE1
                  SFAE2          = L_RF035_SFAE2
                  SFAE3          = L_RF035_SFAE3
                  SFAE4          = L_RF035_SFAE4
                  SFAE5          = L_RF035_SFAE5
                  SFAE6          = L_RF035_SFAE6
                  SFAEL          = L_RF035_SFAEL
                  SNFA1          = L_RF035_SNFA1
                  SNFA2          = L_RF035_SNFA2
                  SNFA3          = L_RF035_SNFA3
                  SNFA4          = L_RF035_SNFA4
                  SNFA5          = L_RF035_SNFA5
                  SNFA6          = L_RF035_SNFA6
                  SNFAE          = L_RF035_SNFAE
             EXCEPTIONS
                  INVALID_RASTER = 1
                  NO_OPEN_ITEMS  = 2
                  OTHERS         = 3
        IF SY-SUBRC = 0.
          TB_FINAL-AVG_1_30  = TB_FINAL-AVG_1_30  + L_RF035_SFAE1.
          TB_FINAL-AVG_31_60 = TB_FINAL-AVG_31_60 + L_RF035_SFAE2.
          TB_FINAL-AVG_61_90 = TB_FINAL-AVG_61_90 + L_RF035_SFAE3.
          TB_FINAL-AVG_90G   = TB_FINAL-AVG_90G   + L_RF035_SFAE4
                                                  + L_RF035_SFAE5
                                                  + L_RF035_SFAE6.
          TB_FINAL-CURRENT  = TB_FINAL-CURRENT    + L_RF035_SNFAE.
        ELSE.
          MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                  WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
      ENDLOOP.
    ENDFORM.                    " GET_PAST_DUE_CURRENT
    *&      Form  GET_CUSTOMER_ADDRESS
          To get Customer Address.
    FORM GET_CUSTOMER_ADDRESS.
      X_ADDR1_SEL-ADDRNUMBER = TB_KNA1-ADRNR.
      CALL FUNCTION 'ADDR_GET'
           EXPORTING
                ADDRESS_SELECTION = X_ADDR1_SEL
           IMPORTING
                SADR              = X_SADR
           EXCEPTIONS
                PARAMETER_ERROR   = 1
                ADDRESS_NOT_EXIST = 2
                VERSION_NOT_EXIST = 3
                INTERNAL_ERROR    = 4
                OTHERS            = 5.
      IF SY-SUBRC <> 0.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      ADDRESS LINE 1.
      TB_FINAL-ADDRESS1 = X_SADR-STRAS.
      ADDRESS LINE 2.
      CONCATENATE X_SADR-PFACH 'CODE' X_SADR-PSTL2 INTO TB_FINAL-ADDRESS2
                                                      SEPARATED BY SPACE.
      ADDRESS LINE 3.
      CONCATENATE  X_SADR-ORT01 X_SADR-ORT02 ',' X_SADR-REGIO X_SADR-PSTLZ
                                INTO TB_FINAL-ADDRESS3 SEPARATED BY SPACE.
      ADDRESS LINE 4.
      TB_FINAL-ADDRESS4 = X_SADR-LAND1.
    ENDFORM.                    " GET_CUSTOMER_ADDRESS
    *&      Form  GET_AVG_DAYS_PAY
          To get Average days to Pay.
    FORM GET_AVG_DAYS_PAY.
    *Local variable
      DATA: L_DAYS TYPE N .                            " Number of Days
      LOOP AT TB_BSAD_CLEAR WHERE KUNNR = TB_KNA1-KUNNR.
        L_DAYS  = TB_BSAD_CLEAR-AUGDT - TB_BSAD_CLEAR-BLDAT.
        G_AVG   = G_AVG + L_DAYS.
        G_COUNT = G_COUNT + 1.
      ENDLOOP.
      IF NOT G_COUNT IS INITIAL.
        TB_FINAL-AVG = G_AVG / G_COUNT. " Average days to Pay.
      ENDIF.
    ENDFORM.                    " GET_AVG_DAYS_PAY
    *&      Form  DISPLAY_ALV_REPORT
          text
    FORM DISPLAY_ALV_REPORT.
    For Populating Field Catalog.
      PERFORM RPT_BUILD_FIELDCATLOG.
    For Modifying Field Catalog.
      PERFORM RPT_MODIFY_FIELDCATLOG.
    For TOP_OF_PAGE Event.
      PERFORM RPT_GET_EVENTS.
    For Displaying Output in Grid Format.
      PERFORM RPT_GRID_DISPLAY.
    ENDFORM.                    " DISPLAY_ALV_REPORT
    *&      Form  RPT_BUILD_FIELDCATLOG
          text
    FORM RPT_BUILD_FIELDCATLOG.
    To build the Field Catlog.
      DATA : L_TABNAME TYPE SLIS_TABNAME.  " Table Name
      L_TABNAME = 'TB_FINAL'.
      REFRESH : TB_FIELDCAT.
      CLEAR   : TB_FIELDCAT.
      CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
           EXPORTING
                I_PROGRAM_NAME         = G_REPID
                I_INTERNAL_TABNAME     = L_TABNAME
                I_INCLNAME             = G_REPID
           CHANGING
                CT_FIELDCAT            = TB_FIELDCAT
           EXCEPTIONS
                INCONSISTENT_INTERFACE = 1
                PROGRAM_ERROR          = 2
                OTHERS                 = 3.
      IF SY-SUBRC <> 0.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDFORM.                    " RPT_BUILD_FIELDCATLOG
    *&      Form  RPT_MODIFY_FIELDCATLOG
          text
    FORM RPT_MODIFY_FIELDCATLOG.
    Getting the Header Text for the Coloumns
      DATA : L_TABIX LIKE SY-TABIX,            " Index
             L_DDICTXT TYPE C  VALUE 'L'.      " Flag
    Getting the Header Text for the Coloumns
      LOOP AT TB_FIELDCAT INTO X_FIELDCAT.
        CLEAR L_TABIX.
        L_TABIX = SY-TABIX.
        CASE X_FIELDCAT-FIELDNAME.
          WHEN 'KUNNR'.                                   " Customer Number
            X_FIELDCAT-SELTEXT_L = 'Customer Number'(001).
            X_FIELDCAT-DDICTXT   =  L_DDICTXT.
          WHEN 'NAME1'.                                   " Name Line 1
            X_FIELDCAT-SELTEXT_L = 'Name'(002).
            X_FIELDCAT-DDICTXT   =  L_DDICTXT.
          WHEN 'ADDRESS1'.                                " Address line 1
            X_FIELDCAT-SELTEXT_L = 'Address 1'(003).
            X_FIELDCAT-DDICTXT   =  L_DDICTXT.
          WHEN 'ADDRESS2'.                                " Address line 2
            X_FIELDCAT-SELTEXT_L = 'Address 2'(004).
            X_FIELDCAT-DDICTXT   =  L_DDICTXT.
          WHEN 'ADDRESS3'.                                " Address line 3
            X_FIELDCAT-SELTEXT_L = 'Address 3'(005).
            X_FIELDCAT-DDICTXT   =  L_DDICTXT.
          WHEN 'ADDRESS4'.                                " Address line 4
            X_FIELDCAT-SELTEXT_L = 'Address 4'(006).
            X_FIELDCAT-DDICTXT   =  L_DDICTXT.
          WHEN 'PHONE'.                                   " Telephone Number
            X_FIELDCAT-SELTEXT_L = 'Telephone Number'(007).
            X_FIELDCAT-DDICTXT   =  L_DDICTXT.
          WHEN 'DAYS_SLOW'.                               " Days Slow
            X_FIELDCAT-SELTEXT_L = 'Days Slow'(008).
            X_FIELDCAT-DDICTXT      =  L_DDICTXT.
          WHEN 'LAST_DATE'.                         " Date of Last Invoice
            X_FIELDCAT-SELTEXT_L = 'Date of Last Invoice'(009).
            X_FIELDCAT-DDICTXT   =  L_DDICTXT.
          WHEN 'AVG'.                               " Average Days to Pay
            X_FIELDCAT-SELTEXT_L = 'Average Days to Pay'(010).
            X_FIELDCAT-DDICTXT   =  L_DDICTXT.
          WHEN 'CURRENT'.                  " Current
            X_FIELDCAT-SELTEXT_L = 'Aging Category 1'(011).
            X_FIELDCAT-DDICTXT   =  L_DDICTXT.
          WHEN 'AVG_1_30'.                  " 1-30 past due
            X_FIELDCAT-SELTEXT_L = 'Aging Category 2'(012).
            X_FIELDCAT-DDICTXT   =  L_DDICTXT.
          WHEN 'AVG_31_60'.                  " 31-60 past due
            X_FIELDCAT-SELTEXT_L = 'Aging Category 3'(013).
            X_FIELDCAT-DDICTXT   =  L_DDICTXT.
          WHEN 'AVG_61_90'.                  " 61-90 past due
            X_FIELDCAT-SELTEXT_L = 'Aging Category 4'(014).
            X_FIELDCAT-DDICTXT   =  L_DDICTXT.
          WHEN 'AVG_90G'.                  " 90+ past due
            X_FIELDCAT-SELTEXT_L = 'Aging Category 5'(015).
            X_FIELDCAT-DDICTXT   =  L_DDICTXT.
        ENDCASE.
        MODIFY TB_FIELDCAT FROM X_FIELDCAT INDEX L_TABIX.
      ENDLOOP.
    ENDFORM.                    " RPT_MODIFY_FIELDCATLOG
    *&      Form  RPT_GET_EVENTS
          text
    FORM RPT_GET_EVENTS.
      DATA : L_TABIX TYPE SY-TABIX.                " Index
      CLEAR   : TB_EVENTS,
                TB_EVENTS[].
    To get the events from this function module
    for ALV display
      CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
           EXPORTING
                I_LIST_TYPE     = 0
           IMPORTING
                ET_EVENTS       = TB_EVENTS
           EXCEPTIONS
                LIST_TYPE_WRONG = 1
                OTHERS          = 2.
      IF SY-SUBRC <> 0.
        MESSAGE I999 WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    Modifing Top of Page event
      READ TABLE TB_EVENTS WITH KEY NAME = SLIS_EV_TOP_OF_PAGE
                          INTO X_EVENTS.
      IF SY-SUBRC = 0.
        CLEAR L_TABIX.
        L_TABIX = SY-TABIX.
        X_EVENTS-FORM = C_TOP_OF_PAGE.
        MODIFY TB_EVENTS FROM X_EVENTS INDEX L_TABIX.
        CLEAR  X_EVENTS.
      ENDIF.
    ENDFORM.                    " RPT_GET_EVENTS
    *&      Form  TOP_OF_PAGE
          Top Of Page for the ALV format
    FORM  TOP_OF_PAGE.
      REFRESH TB_COMMENTS.
    For heading
      CLEAR   X_COMMENTS.
      X_COMMENTS-TYP  = C_H.
      X_COMMENTS-INFO = 'D&B Credit Agency Interface'(019).
      APPEND X_COMMENTS TO TB_COMMENTS.
    This module outputs formatted simple header information at TOP-OF-PAGE
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
           EXPORTING
                IT_LIST_COMMENTARY = TB_COMMENTS.
    ENDFORM.                          " TOP_OF_PAGE
    *&      Form  RPT_GRID_DISPLAY
          text
    FORM RPT_GRID_DISPLAY.
    Layout Settings
      CLEAR X_LAYOUT.
      X_LAYOUT-ZEBRA = 'X'.
      X_LAYOUT-COLWIDTH_OPTIMIZE = C_X.
      X_LAYOUT-NO_COLHEAD        = SPACE.
    To Display the Output in ALV Format
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
           EXPORTING
                I_CALLBACK_PROGRAM = G_REPID
                IS_LAYOUT          = X_LAYOUT
                IT_FIELDCAT        = TB_FIELDCAT
                IT_EVENTS          = TB_EVENTS
           TABLES
                T_OUTTAB           = TB_FINAL
           EXCEPTIONS
                PROGRAM_ERROR      = 1
                OTHERS             = 2.
      IF SY-SUBRC <> 0.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    ENDFORM.                    " RPT_GRID_DISPLAY
    *&      Form  SEND_EMAIL
          text
    -->  p1        text
    <--  p2        text
    FORM SEND_EMAIL.
    Prepare the mail
      PERFORM SEND_MAIL USING C_INTERFACE.
    Sending the mail to Receivers
      PERFORM SENDING_MAIL.
    ENDFORM.                    " SEND_EMAIL
    *&      Form  SEND_MAIL
         Sending the Mail
    FORM SEND_MAIL USING  P_C_INTERFACE TYPE YWFSALOFFICNOTIF-INTERFACE_ID.
    Populating Report name
      G_TITLE = C_TITLE.
      PERFORM POPULATE_EMAIL_REF_DATA USING G_TITLE.
      IF NOT G_REC_COUNT IS INITIAL.
      To populate the data to table tb_objbin
        PERFORM POPULATE_DATA_OBJBIN.
      To get the attached file for the mail
        CLEAR G_TAB_LINES.
        DESCRIBE TABLE TB_OBJBIN LINES G_TAB_LINES.
        TB_OBJHEAD = C_FILENAME.
        APPEND TB_OBJHEAD.
        CLEAR TB_OBJHEAD.
      Creation of the entry for the mail
        TB_OBJPACK-TRANSF_BIN = C_X.
        TB_OBJPACK-HEAD_START = C_1.
        TB_OBJPACK-HEAD_NUM   = C_1.
        TB_OBJPACK-BODY_START = C_1.
        TB_OBJPACK-BODY_NUM   = G_TAB_LINES.
        TB_OBJPACK-DOC_TYPE   = C_TXT.
        TB_OBJPACK-OBJ_NAME   = G_REPID.
        TB_OBJPACK-OBJ_DESCR  = 'Interface Audit Report'(020).
        TB_OBJPACK-DOC_SIZE   = G_TAB_LINES * 255.
        APPEND TB_OBJPACK.
      ENDIF.
    ENDFORM.                    " SEND_MAIL
    *&      Form  SENDING_MAIL
    FORM SENDING_MAIL.
    Function Module to send mail along with attached file
      CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
           EXPORTING
                DOCUMENT_DATA              = TB_DOC_CHNG
           TABLES
                PACKING_LIST               = TB_OBJPACK
                OBJECT_HEADER              = TB_OBJHEAD
                CONTENTS_BIN               = TB_OBJBIN
                CONTENTS_TXT               = TB_OBJTXT
                RECEIVERS                  = TB_RECLIST
           EXCEPTIONS
                TOO_MANY_RECEIVERS         = 1
                DOCUMENT_NOT_SENT          = 2
                DOCUMENT_TYPE_NOT_EXIST    = 3
                OPERATION_NO_AUTHORIZATION = 4
                PARAMETER_ERROR            = 5
                X_ERROR                    = 6
                ENQUEUE_ERROR              = 7
                OTHERS                     = 8.
      CASE SY-SUBRC.
        WHEN 0.
          MESSAGE S999 WITH 'Mail has been sucessfully sent'(029).
        WHEN 1.
          MESSAGE S999 WITH 'Too Many Parameters'(030).
        WHEN 2.
          MESSAGE S999 WITH 'Doc Could Not Be Sent'(031).
        WHEN 4.
          MESSAGE S999 WITH 'No Authority To Send'(032).
        WHEN 99.
          MESSAGE S999 WITH 'Error While Sending'(033).
      ENDCASE.
    ENDFORM.                    " SENDING_MAIL
    *&      Form  POPULATE_EMAIL_REF_DATA
       Poplulating the body of the mail
    FORM POPULATE_EMAIL_REF_DATA USING TEXT TYPE SOLISTI1-LINE.
    Setting up Mail Subject
      TB_DOC_CHNG-OBJ_DESCR = 'Interface Audit Report'(020).
    Populating body of the mail
      TB_OBJTXT-LINE = 'Interface Audit Report'(020).
      APPEND TB_OBJTXT.
      CLEAR: TB_OBJTXT.
      DESCRIBE TABLE TB_OBJTXT LINES G_TAB_LINES.
      READ TABLE TB_OBJTXT INDEX G_TAB_LINES.
    *To determine the document size
    TB_DOC_CHNG-DOC_SIZE = ( G_TAB_LINES - 1 ) * 255 + STRLEN( TB_OBJTXT ).
    Creation of the entry for the Mail Contents
      CLEAR TB_OBJPACK-TRANSF_BIN.
      TB_OBJPACK-HEAD_START = C_1.
      TB_OBJPACK-HEAD_NUM = C_0.
      TB_OBJPACK-BODY_START = C_1.
      TB_OBJPACK-BODY_NUM = G_TAB_LINES.
      TB_OBJPACK-DOC_TYPE = C_RAW.
      APPEND TB_OBJPACK.
    ENDFORM.                    " POPULATE_EMAIL_REF_DATA
    *&      Form  POPULATE_DATA_OBJBIN
          Populating table for file attachment

  • How to use ALV Grid?

    Hi,
    I am totally new to ALV Grids. Could you give a full example of creating a ALV Grid with 2 columns, thinking there is a internal table itab with itab-col1 & itab-col2. Please start from initialising variables and onwards.
    Thanks,
    Kishan

    Hi,
    Simple example of how to implement an ALV grid
    Note that this example uses table ZSFLIGHT. The table is equivalent to the table SFLIGHT.
    Steps:
    1.        Create an executable program (Report)
    2.        Create a screen (100) and place a custom container named ALV_CONTAINER on the screen
    3.        Create a Pushbutton. Give it the text Exit and the functioncode EXIT
    REPORT sapmz_hf_alv_grid .
    TABLES: zsflight.
    G L O B A L   I N T E R N  A L   T A B L E S
    DATA: gi_sflight TYPE STANDARD TABLE OF sflight.
    G L O B A L   D A T A
    DATA: ok_code LIKE sy-ucomm,
    g_wa_sflight LIKE sflight.
    Declare reference variables to the ALV grid and the container
    DATA:
    go_grid             TYPE REF TO cl_gui_alv_grid,
    go_custom_container TYPE REF TO cl_gui_custom_container.
    S T A R T - O F - S E L E C T I O N.
    START-OF-SELECTION.
    SET SCREEN '100'.
    *&      Module  USER_COMMAND_0100  INPUT
    MODULE user_command_0100 INPUT.
    CASE ok_code.
    WHEN 'EXIT'.
    LEAVE TO SCREEN 0.
    ENDCASE.
    ENDMODULE.                 " USER_COMMAND_0100  INPUT
    *&      Module  STATUS_0100  OUTPUT
    MODULE status_0100 OUTPUT.
    Create objects
    IF go_custom_container IS INITIAL.
    CREATE OBJECT go_custom_container
    EXPORTING container_name = 'ALV_CONTAINER'.
    CREATE OBJECT go_grid
    EXPORTING
      i_parent = go_custom_container.
    PERFORM load_data_into_grid.
    ENDIF.
    ENDMODULE.                 " STATUS_0100  OUTPUT
    *&      Form  load_data_into_grid
    FORM load_data_into_grid.
    Read data from table SFLIGHT
    SELECT *
    FROM zsflight
    INTO TABLE gi_sflight.
    Load data into the grid and display them
    CALL METHOD go_grid->set_table_for_first_display
    EXPORTING i_structure_name = 'SFLIGHT'
    CHANGING  it_outtab        = gi_sflight.
    ENDFORM.                    " load_data_into_grid
    Allow the user to save and reuse the layout
    A button can be shown on the grid toolbar, allowing the user to save and reuse a layout. The button looks like this: 
    See also example in SAP standard program BCALV_GRID_09.
    To do this use the parameters IS_VARIANT and I_SAVE of the set_table_for_first_display method. Note that the IS_VARIANT
    parameter must have the structure DISVARIANT.
    The I_SAVE "Options for saving layouts" parameter can have the following values:
    ·        U Only user specific layouts can be saved
    ·        X Only global layouts can be saved
    ·        A Both user specific and global layouts can be saved
    ·        Space Layouts can not be saved
    Add the following code to the example:
    FORM load_data_into_grid.
    DATA:
      For parameter IS_VARIANT
    l_layout TYPE disvariant.
    Code..........    
    Load data into the grid and display them
    l_layout-report = sy-repid.
    CALL METHOD go_grid->set_table_for_first_display
    EXPORTING i_structure_name = 'SFLIGHT'
         is_variant       = l_layout
         i_save           = 'A'
    CHANGING  it_outtab        = gi_
    Integrate user defined functions in the grid toolbar
    Possibilities:
    ·        Replace existing functions in the toolbar or context men with user defined functions
    ·        Add new functions to the toolbar or context menu
    Note that the whole toolbar can be removed using the IT_TOOLBAR_EXCLUDING parameter of the set_table_for_first_display
    method.
    See also example in SAP standard program BCALV_GRID_05
    1) To get access to the icons insert the following statement in the top of the program:
    TYPE-POOLS: icon.
    2) To allow the declaration of o_event_receiver before the lcl_event_receiver class is defined, declare it as deferred in the start of
    the program
    To allow the declaration of o_event_receiver before the lcl_event_receiver class is defined, declare it as deferred in the
    start of the program
    CLASS lcl_event_receiver DEFINITION DEFERRED.
    3) Declare reference to the event handler class
    DATA:
    o_event_receiver TYPE REF TO lcl_event_receiver.
    4) Class for event receiver. This class adds the new button to the toolbar and handles the event when the button is pushed
    CLASS lcl_event_receiver DEFINITION.
    PUBLIC SECTION.
    METHODS:
    handle_toolbar FOR EVENT toolbar OF cl_gui_alv_grid
    IMPORTING
    e_object e_interactive,
    handle_user_command FOR EVENT user_command OF cl_gui_alv_grid
    IMPORTING e_ucomm.
    ENDCLASS.
          CLASS lcl_event_receiver IMPLEMENTATION
    CLASS lcl_event_receiver IMPLEMENTATION.
    METHOD handle_toolbar.
    Event handler method for event toolbar.
    CONSTANTS:
    Constants for button type
    c_button_normal           TYPE i VALUE 0,
    c_menu_and_default_button TYPE i VALUE 1,
    c_menu                    TYPE i VALUE 2,
    c_separator               TYPE i VALUE 3,
    c_radio_button            TYPE i VALUE 4,
    c_checkbox                TYPE i VALUE 5,
    c_menu_entry              TYPE i VALUE 6.
    DATA:
    ls_toolbar  TYPE stb_button.
      Append seperator to the normal toolbar
    CLEAR ls_toolbar.
    MOVE c_separator TO ls_toolbar-butn_type..
    APPEND ls_toolbar TO e_object->mt_toolbar.
      Append a new button that to the toolbar. Use E_OBJECT of
      event toolbar. E_OBJECT is of type CL_ALV_EVENT_TOOLBAR_SET.
      This class has one attribute MT_TOOLBAR which is of table type
      TTB_BUTTON. The structure is STB_BUTTON
    CLEAR ls_toolbar.
    MOVE 'CHANGE'        TO ls_toolbar-function.
    MOVE  icon_change    TO ls_toolbar-icon.
    MOVE 'Change flight' TO ls_toolbar-quickinfo.
    MOVE 'Change'        TO ls_toolbar-text.
    MOVE ' '             TO ls_toolbar-disabled.
    APPEND ls_toolbar    TO e_object->mt_toolbar.
    ENDMETHOD.
    METHOD handle_user_command.
      Handle own functions defined in the toolbar
    CASE e_ucomm.
    WHEN 'CHANGE'.
    LEAVE TO SCREEN 0.
    ENDCASE.
    ENDMETHOD.
    ENDCLASS.
    5) In the PBO module, crate object for event handler and set handler
    CREATE OBJECT o_event_receiver.
    SET HANDLER o_event_receiver->handle_user_command FOR go_grid.
    SET HANDLER o_event_receiver->handle_toolbar FOR go_grid.
    6) In the PBO module after the CALL METHOD go_grid->set_table_for_first_display, raise event
    toolbar to show the modified toolbar
    CALL METHOD go_grid->set_toolbar_interactive.
    Set focus to the grid
    After CALL METHOD go_grid->set_table_for_first_display insert the following statement:
    CALL METHOD cl_gui_control=>set_focus EXPORTING control = go_grid.
    Set the title of the grid
    Fill the grid_title field of structure lvc_s_layo.
    Note that the structure lvc_s_layo can be used for to customize the grid appearance in many ways.
    DATA:
    ALV control: Layout structure
    gs_layout TYPE lvc_s_layo.
    Set grid title
    gs_layout-grid_title = 'Flights'.
    CALL METHOD go_grid->set_table_for_first_display
       EXPORTING i_structure_name = 'SFLIGHT'
                               is_layout               = gs_layout
       CHANGING   it_outtab               = gi_sflight.
    Customize the appearence of the grid
    The structure lvc_s_layo contains fields for setting graphical properties, displaying exceptions, calculating totals and enabling specific
    interaction options.
    Fill the apporpiate fields of structure lvc_s_layo and insert it as a parameter in the CALL METHOD
    go_grid->set_table_for_first_display. See the example under Set the title of the grid.
    If you want to change apperance after list output, use the methods get_frontend_layout and set_frontend_layout.
    Examples of fields in structure lvc_s_layo:
    GRID_TITLE Setting the title of the grid
    SEL_MODE. Selection mode, determines how rows can be selected. Can have the following values:
    ·        A Multiple columns, multiple rows with selection buttons.
    ·        B Simple selection, listbox, Single row/column
    ·        C Multiple rows without buttons
    ·        D Multiple rows with buttons and select all ICON
    Setting and getting selected rows (Columns) and read line contents
    You can read which rows of the grid that has been selected, and dynamic select rows of the grid using methods get_selected_rows
    and set_selected_rows. There are similar methods for columns.
    Note that the grid table always has the rows in the same sequence as displayed in the grid, thus you can use the index of the selected
    row(s) to read the information in the rows from the table. In the examples below the grid table is named gi_sflight.
    Data declaration:
    DATA:
    Internal table for indexes of selected rows
    gi_index_rows TYPE lvc_t_row,
    Information about 1 row
    g_selected_row LIKE lvc_s_row.
    Example 1: Reading index of selected row(s) and using it to read the grid table
    CALL METHOD go_grid->get_selected_rows
    IMPORTING
    et_index_rows = gi_index_rows.
    DESCRIBE TABLE gi_index_rows LINES l_lines.
    IF l_lines = 0.
    CALL FUNCTION 'POPUP_TO_DISPLAY_TEXT'
    EXPORTING
         textline1 = 'You must choose a valid line'.
    EXIT.
    ENDIF.
    LOOP AT gi_index_rows INTO g_selected_row.
    READ TABLE gi_sflight INDEX g_selected_row-index INTO g_wa_sflight.
    ENDIF.
    ENDLOOP.
    Example 2: Set selected row(s).
    DESCRIBE TABLE gi_index_rows LINES l_lines.
    IF l_lines > 0.
    CALL METHOD go_grid->set_selected_rows
    exporting
    it_index_rows = gi_index_rows.
    ENDIF.
    Make an Exception field ( = Traffic lights)
    There can be defined a column in the grid for display of traffic lights. This field is of type Char 1, and can contain the following values:
    ·        1 Red
    ·        2 Yellow
    ·        3 Green
    The name of the traffic light field is supplied inh the gs_layout-excp_fname used by method set_table_for_first_display.
    Example
    TYPES: BEGIN OF st_sflight.
    INCLUDE STRUCTURE zsflight.
    TYPES:  traffic_light TYPE c.
    TYPES: END OF st_sflight.
    TYPES: tt_sflight TYPE STANDARD TABLE OF st_sflight.
    DATA: gi_sflight TYPE tt_sflight.
      Set the exception field of the table
    LOOP AT gi_sflight INTO g_wa_sflight.
    IF g_wa_sflight-paymentsum < 100000.
    g_wa_sflight-traffic_light = '1'.
    ELSEIF g_wa_sflight-paymentsum => 100000 AND
        g_wa_sflight-paymentsum < 1000000.
    g_wa_sflight-traffic_light = '2'.
    ELSE.
    g_wa_sflight-traffic_light = '3'.
    ENDIF.
    MODIFY gi_sflight FROM g_wa_sflight.
    ENDLOOP.
      Name of the exception field (Traffic light field)
    gs_layout-excp_fname = 'TRAFFIC_LIGHT'.
      Grid setup for first display
    CALL METHOD go_grid->set_table_for_first_display
    EXPORTING i_structure_name = 'SFLIGHT'
                         is_layout               = gs_layout
    CHANGING  it_outtab                 = gi_sflight.
    Color a line
    The steps for coloring a line i the grid is much the same as making a traffic light.
    To color a line the structure of the  table must include a  Char 4 field  for color properties
    TYPES: BEGIN OF st_sflight.
    INCLUDE STRUCTURE zsflight.
          Field for line color
    types:  line_color(4) type c.
    TYPES: END OF st_sflight.
    TYPES: tt_sflight TYPE STANDARD TABLE OF st_sflight.
    DATA: gi_sflight TYPE tt_sflight.
    Loop trough the table to set the color properties of each line. The color properties field is
    Char 4 and the characters is set as follows:
    Char 1 = C = This is a color property
    Char 2 = 6 = Color code (1 - 7)
    Char 3 = Intensified on/of = 1 = on
    Char 4 = Inverse display = 0 = of
    LOOP AT gi_sflight INTO g_wa_sflight.
    IF g_wa_sflight-paymentsum < 100000.
    g_wa_sflight-line_color    = 'C610'.
    ENDIF.
    MODIFY gi_sflight FROM g_wa_sflight.
    ENDLOOP.
    Name of the color field
    gs_layout-info_fname = 'LINE_COLOR'.
    Grid setup for first display
    CALL METHOD go_grid->set_table_for_first_display
    EXPORTING i_structure_name = 'SFLIGHT'
                        is_layout                = gs_layout
    CHANGING  it_outtab                 = gi_sflight.
    Refresh grid display
    Use the grid method REFRESH_TABLE_DISPLAY
    Example:
    CALL METHOD go_grid->refresh_table_display.
    Complete code for the ALV grid example
    This example shows and ALV grid with flights. After selecting a line a change button can be pushed to display a change screen. After
    the changes have been saved, the ALV grid screen is displayed again, and the grid is updated with the changes.
    The example shows:
    ·        How to setup the ALV grid
    ·        How to ste focus to the grid
    ·        How to set the title of the grid
    ·        How to allow a user to save and reuse a grid layout (Variant)
    ·        How to customize the ALV grid toolbar
    ·        Refresh the grid
    ·        Set and get row selection and read line contents
    ·        Make and exception field (Traffic light)
    ·        Coloring a line
    Steps:
    ·        Create screen 100 with the ALV grid. Remember to include an exit button
    ·        Add a change button to the ALV grid toolbar
    ·        Create screen 200 the Change screen
    The screens: 
    The code:
    REPORT sapmz_hf_alv_grid .
    Type pool for icons - used in the toolbar
    TYPE-POOLS: icon.
    TABLES: zsflight.
    To allow the declaration of o_event_receiver before the
    lcl_event_receiver class is defined, decale it as deferred in the
    start of the program
    CLASS lcl_event_receiver DEFINITION DEFERRED.
    G L O B A L   I N T E R N  A L   T A B L E S
    *DATA: gi_sflight TYPE STANDARD TABLE OF sflight.
    To include a traffic light and/or color a line the structure of the
    table must include fields for the traffic light and/or the color
    TYPES: BEGIN OF st_sflight.
      INCLUDE STRUCTURE zsflight.
          Field for traffic light
    TYPES:  traffic_light TYPE c.
          Field for line color
    types:  line_color(4) type c.
    TYPES: END OF st_sflight.
    TYPES: tt_sflight TYPE STANDARD TABLE OF st_sflight.
    DATA: gi_sflight TYPE tt_sflight.
    G L O B A L   D A T A
    DATA: ok_code         LIKE sy-ucomm,
        Work area for internal table
    g_wa_sflight    TYPE st_sflight,
        ALV control: Layout structure
    gs_layout       TYPE lvc_s_layo.
    Declare reference variables to the ALV grid and the container
    DATA:
    go_grid             TYPE REF TO cl_gui_alv_grid,
    go_custom_container TYPE REF TO cl_gui_custom_container,
    o_event_receiver    TYPE REF TO lcl_event_receiver.
    DATA:
    Work area for screen 200
    g_screen200 LIKE zsflight.
    Data for storing information about selected rows in the grid
    DATA:
    Internal table
    gi_index_rows TYPE lvc_t_row,
    Information about 1 row
    g_selected_row LIKE lvc_s_row.
    C L A S S E S
    CLASS lcl_event_receiver DEFINITION.
    PUBLIC SECTION.
    METHODS:
    handle_toolbar FOR EVENT toolbar OF cl_gui_alv_grid
    IMPORTING
       e_object e_interactive,
    handle_user_command FOR EVENT user_command OF cl_gui_alv_grid
    IMPORTING e_ucomm.
    ENDCLASS.
          CLASS lcl_event_receiver IMPLEMENTATION
    CLASS lcl_event_receiver IMPLEMENTATION.
    METHOD handle_toolbar.
    Event handler method for event toolbar.
    CONSTANTS:
    Constants for button type
    c_button_normal           TYPE i VALUE 0,
    c_menu_and_default_button TYPE i VALUE 1,
    c_menu                    TYPE i VALUE 2,
    c_separator               TYPE i VALUE 3,
    c_radio_button            TYPE i VALUE 4,
    c_checkbox                TYPE i VALUE 5,
    c_menu_entry              TYPE i VALUE 6.
    DATA:
      ls_toolbar  TYPE stb_button.
      Append seperator to the normal toolbar
    CLEAR ls_toolbar.
    MOVE c_separator TO ls_toolbar-butn_type..
    APPEND ls_toolbar TO e_object->mt_toolbar.
      Append a new button that to the toolbar. Use E_OBJECT of
      event toolbar. E_OBJECT is of type CL_ALV_EVENT_TOOLBAR_SET.
      This class has one attribute MT_TOOLBAR which is of table type
      TTB_BUTTON. The structure is STB_BUTTON
    CLEAR ls_toolbar.
    MOVE 'CHANGE'        TO ls_toolbar-function.
    MOVE  icon_change    TO ls_toolbar-icon.
    MOVE 'Change flight' TO ls_toolbar-quickinfo.
    MOVE 'Change'        TO ls_toolbar-text.
    MOVE ' '             TO ls_toolbar-disabled.
    APPEND ls_toolbar    TO e_object->mt_toolbar.
    ENDMETHOD.
    METHOD handle_user_command.
      Handle own functions defined in the toolbar
    CASE e_ucomm.
    WHEN 'CHANGE'.
      PERFORM change_flight.
           LEAVE TO SCREEN 0.
    ENDCASE.
    ENDMETHOD.
    ENDCLASS.
    S T A R T - O F - S E L E C T I O N.
    START-OF-SELECTION.
    SET SCREEN '100'.
    *&      Module  USER_COMMAND_0100  INPUT
    MODULE user_command_0100 INPUT.
    CASE ok_code.
    WHEN 'EXIT'.
    LEAVE TO SCREEN 0.
    ENDCASE.
    ENDMODULE.                 " USER_COMMAND_0100  INPUT
    *&      Module  STATUS_0100  OUTPUT
    MODULE status_0100 OUTPUT.
    DATA:
      For parameter IS_VARIANT that is sued to set up options for storing
      the grid layout as a variant in method set_table_for_first_display
    l_layout TYPE disvariant,
      Utillity field
    l_lines TYPE i.
    After returning from screen 200 the line that was selected before
    going to screen 200, should be selected again. The table gi_index_rows
    was the output table from the GET_SELECTED_ROWS method in form
    CHANGE_FLIGHT
    DESCRIBE TABLE gi_index_rows LINES l_lines.
    IF l_lines > 0.
    CALL METHOD go_grid->set_selected_rows
      EXPORTING
        it_index_rows = gi_index_rows.
    CALL METHOD cl_gui_cfw=>flush.
    REFRESH gi_index_rows.
    ENDIF.
    Read data and create objects
    IF go_custom_container IS INITIAL.
      Read data from datbase table
    PERFORM get_data.
      Create objects for container and ALV grid
    CREATE OBJECT go_custom_container
    EXPORTING container_name = 'ALV_CONTAINER'.
    CREATE OBJECT go_grid
    EXPORTING
      i_parent = go_custom_container.
      Create object for event_receiver class
      and set handlers
    CREATE OBJECT o_event_receiver.
    SET HANDLER o_event_receiver->handle_user_command FOR go_grid.
    SET HANDLER o_event_receiver->handle_toolbar FOR go_grid.
      Layout (Variant) for ALV grid
    l_layout-report = sy-repid. "Layout fo report
    Setup the grid layout using a variable of structure lvc_s_layo
      Set grid title
    gs_layout-grid_title = 'Flights'.
      Selection mode - Single row without buttons
      (This is the default  mode
    gs_layout-sel_mode = 'B'.
      Name of the exception field (Traffic light field) and the color
      field + set the exception and color field of the table
    gs_layout-excp_fname = 'TRAFFIC_LIGHT'.
    gs_layout-info_fname = 'LINE_COLOR'.
    LOOP AT gi_sflight INTO g_wa_sflight.
    IF g_wa_sflight-paymentsum < 100000.
          Value of traffic light field
      g_wa_sflight-traffic_light = '1'.
          Value of color field:
          C = Color, 6=Color 1=Intesified on, 0: Inverse display off
      g_wa_sflight-line_color    = 'C610'.
    ELSEIF g_wa_sflight-paymentsum => 100000 AND
           g_wa_sflight-paymentsum < 1000000.
      g_wa_sflight-traffic_light = '2'.
    ELSE.
      g_wa_sflight-traffic_light = '3'.
    ENDIF.
    MODIFY gi_sflight FROM g_wa_sflight.
    ENDLOOP.
      Grid setup for first display
    CALL METHOD go_grid->set_table_for_first_display
    EXPORTING i_structure_name = 'SFLIGHT'
              is_variant       = l_layout
              i_save           = 'A'
              is_layout        = gs_layout
    CHANGING  it_outtab        = gi_sflight.
    *-- End of grid setup -
      Raise event toolbar to show the modified toolbar
    CALL METHOD go_grid->set_toolbar_interactive.
      Set focus to the grid. This is not necessary in this
      example as there is only one control on the screen
    CALL METHOD cl_gui_control=>set_focus EXPORTING control = go_grid.
    ENDIF.
    ENDMODULE.                 " STATUS_0100  OUTPUT
    *&      Module  USER_COMMAND_0200  INPUT
    MODULE user_command_0200 INPUT.
    CASE ok_code.
    WHEN 'EXIT200'.
    LEAVE TO SCREEN 100.
    WHEN'SAVE'.
    PERFORM save_changes.
    ENDCASE.
    ENDMODULE.                 " USER_COMMAND_0200  INPUT
    *&      Form  get_data
    FORM get_data.
    Read data from table SFLIGHT
    SELECT *
    FROM zsflight
    INTO TABLE gi_sflight.
    ENDFORM.                    " load_data_into_grid
    *&      Form  change_flight
    Reads the contents of the selected row in the grid, ans transfers
    the data to screen 200, where it can be changed and saved.
    FORM change_flight.
    DATA:l_lines TYPE i.
    REFRESH gi_index_rows.
    CLEAR   g_selected_row.
    Read index of selected rows
    CALL METHOD go_grid->get_selected_rows
    IMPORTING
    et_index_rows = gi_index_rows.
    Check if any row are selected at all. If not
    table  gi_index_rows will be empty
    DESCRIBE TABLE gi_index_rows LINES l_lines.
    IF l_lines = 0.
    CALL FUNCTION 'POPUP_TO_DISPLAY_TEXT'
       EXPORTING
            textline1 = 'You must choose a line'.
    EXIT.
    ENDIF.
    Read indexes of selected rows. In this example only one
    row can be selected as we are using gs_layout-sel_mode = 'B',
    so it is only ncessary to read the first entry in
    table gi_index_rows
    LOOP AT gi_index_rows INTO g_selected_row.
    IF sy-tabix = 1.
    READ TABLE gi_sflight INDEX g_selected_row-index INTO g_wa_sflight.
    ENDIF.
    ENDLOOP.
    Transfer data from the selected row to screenm 200 and show
    screen 200
    CLEAR g_screen200.
    MOVE-CORRESPONDING g_wa_sflight TO g_screen200.
    LEAVE TO SCREEN '200'.
    ENDFORM.                    " change_flight
    *&      Form  save_changes
    Changes made in screen 200 are written to the datbase table
    zsflight, and to the grid table gi_sflight, and the grid is
    updated with method refresh_table_display to display the changes
    FORM save_changes.
    DATA: l_traffic_light TYPE c.
    Update traffic light field
    Update database table
    MODIFY zsflight FROM g_screen200.
    Update grid table , traffic light field and color field.
    Note that it is necessary to use structure g_wa_sflight
    for the update, as the screen structure does not have a
    traffic light field
    MOVE-CORRESPONDING g_screen200 TO g_wa_sflight.
    IF g_wa_sflight-paymentsum < 100000.
    g_wa_sflight-traffic_light = '1'.
      C = Color, 6=Color 1=Intesified on, 0: Inverse display off
    g_wa_sflight-line_color    = 'C610'.
    ELSEIF g_wa_sflight-paymentsum => 100000 AND
       g_wa_sflight-paymentsum < 1000000.
    g_wa_sflight-traffic_light = '2'.
    clear g_wa_sflight-line_color.
    ELSE.
    g_wa_sflight-traffic_light = '3'.
    clear g_wa_sflight-line_color.
    ENDIF.
    MODIFY gi_sflight INDEX g_selected_row-index FROM g_wa_sflight.
    Refresh grid
    CALL METHOD go_grid->refresh_table_display.
    CALL METHOD cl_gui_cfw=>flush.
    LEAVE TO SCREEN '100'.
    ENDFORM.                    " save_changes
    rgds,
    latheesh

  • ALV grid to ABAP list

    Hi ,
    I am displaying data in ALV grid, using a button I am updating Production orders, if the order is successfully updated, i need to write the text" Order updated" to list.
    I am using statement leave to list processing .
    the text is dislayed in list but i am not able to go BACK to ALV grid or selection screen.
    How to navigate to list from ALV and from list to ALV.

    My gut tells me you won't be going for BAL_DSP_LOG_DISPLAY and stick to list.
    In which case check if you also use
    LEAVE TO LIST-PROCESSING AND RETURN TO SCREEN 0.
      LEAVE SCREEN.
    and to get back to your screen:
    LEAVE LIST-PROCESSING
    edit.
    And do you have a PF-status when you're in the list? One with a back button?

  • How to display ALV grid in a graphical display??

    Hello All,
    I want to display the ALV grid output in graphical format. I did not see any particular Function code or event in ALV for graphs. Hence I designed a PF status myself. But when I use the Function module "Graph_2D", it gives me an error.
    Can you guys suggest which is the best Function module to display the ALV output in graphical format?
    Regards,
    Abhishek
    P.S: Points will be awarded to the answers which will solve the issue

    This piece of code is giving graphical output , u can check it in ur machine.
    REPORT  ZSKC_GRAPH.
    data : begin of itab occurs 0,
            day type i,
            val type i,
           end   of itab.
    start-of-selection.
      do 5 times.
        clear itab.
        itab-day = sy-index.
        itab-val = sy-index + ( sy-index * sy-index ).
        append itab.
      enddo.
      CALL FUNCTION 'GRAPH_2D'
        TABLES
          DATA                     = itab
       EXCEPTIONS
         GUI_REFUSE_GRAPHIC       = 1
         OTHERS                   = 2
      IF SY-SUBRC <> 0.
    *    Give some message.
      ENDIF.
    You just pass ur internal table to this Function module - Do you need to display column captions etc ?? In that case you will have to use GRAPH_MATRIX_2D.

  • How to Destroy ALV Grid..

    Hi All..
    I am using the type-pools SLIS..is it possible to destroy an alv grid so that all the contents are deleted and i could fill it with the new contents.
    Thanks in Advance,
    rama

    Hi
    See this
    refreshing alv but how?
    Aditya

  • How to design ALV GRID with a column in NON-editable Mode and has F4 Help?

    Hello Friends,
      How to code for ALV GRID, which has a column that takes value only from F4 Help and does not accept any other user input?
    Can I have that column non-editable and yet has F4 Help?
    Please help ASAP.

    Hi,
      The examples in the mentioned programs do not suffice my problem.In these programs. They have made the cell non-editable but you cant even input value through F4 Help.
    I want to make a cell non-editable (which can be changed only through F4 Help), which do not accept user input.

  • How to make alv grid cell as image cell

    Dear All,
                  I want to create one alv report in abap.  Acutually i  need a output in report like machine number , machine name, model,
    finally i want to display the images in the last colum( cell )  corresponding to the machines for each row.  Machine no,name,model ..etc.. i fetched from the custom table. I maintaned the  machines images in se78.  Can any one help for this requirment..
    Thanks and Regards,
      Kavin

    in my opinion you will not be able to do that in a ALV grid
    the only way to do it is to build a HTML content and to display it into HTML viewer
    then the images should be loaded as mime objects (SMW0) and not as text elements (SE78)

  • How to Expand ALV Grid Total Width

    I have to display 1476 characters in an ALV grid and then the users will use what they need when creating a layout.
    Problem is ALV stops after displaying 1375 (or so) characters) - any parm or action to do this (maybe in the catalog setup sent to the program?  Thanks!

    Hi Scott
    This may be a restriction ALV Grid puts. My recommendation will be that, split some fields and generate more than one rows with the same key (you should then add a new key field which will hold line numbers specific to one definite key). When you sort with ALV Grid's sort option the keys will vertically merged (if you do not turn off this feature via layout or field catalog settings). I know this is not so pretty but ALV is not intended to show that kind of stuff.
    Regards
    *--Serdar <a href="https://www.sdn.sap.com:443http://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.sdn.businesscard.sdnbusinesscard?u=qbk%2bsag%2bjiw%3d">[ BC ]</a>

  • T-code for Delivery output/Invoice List output????

    what is the T-code to print the delivery output and Invoice  list output,appreciate your immediate reply.
    Thanks.
    Mohammed.

    Hi Mohammed,
    are you referring to the PO box in the sales order ? If yes, check with your driver program for the script output, there must be some condition which makes the shipping address print or not in the presence of PO box. You can know the script program by going to NACE t.code for the delivery output conditon LD00 in application V2 which is for shipping. Now coming to the availability of a change mode in your quality server, check with the basis team if you have authorization to go in the change mode or not.
    Hope it helps. Please reward is useful.
    Thanks & Regards
    Sadhu Kishore

  • ME9F - Change ALV Output to List output

    Hi all,
    Im using transaction ME9F which currently displays the output in ALV mode. How to change it to list mode ?
    I have checked the user parameters tab in Su3 but nothing seems to be there or is there any other parameter id that i should set in Su3 ?
    Also i cannot find any settings in the ME9F Menu to disable this.
    My requirement is i have to place a check in SECATT regarding this.
    Any ideas ?
    keshav

    Hi,
    I am unable to test ME9F right now but I have looked at RM06ENDR_ALV program and the user parameter is set on the code below:
    check the value returned  for users that executes alv and lists.
    * determine whether Grid Control should be used
      CALL FUNCTION 'GET_ACCESSIBILITY_MODE'
        IMPORTING
          accessibility = gf_use_grid
        EXCEPTIONS
          OTHERS        = 0.
      IF gf_use_grid IS INITIAL.
        GET PARAMETER ID 'ME_USE_GRID' FIELD gf_use_grid.
      ENDIF.

  • Error while downloading ALV grid o/p list  into local file

    Hello friends,
       I have developed an ALV report and desplaying it using
    'REUSE_ALV_GRID_DISPLAY, function module .While downloading the output list into excel format I am geeting an error "The current statement only supports character-type data objects.
    Error Analysis-
    In statement
       "STRLEN( obj )..."
    the argument "obj" can only take a character-type data object.
    In this case, the operand "obj" has the non-character type "P".
      I have set the import parameter i_save values as 'A'
    But still not able to download and facing the same error.
    Please help me out ....
    Thanking you....
    Regards,
    Rajesh Akarte
    Message was edited by:
            Rajesh Akarte

    Hi,
      following is the dump code..Is there any problem due to date and currency fields..?
    Error in ABAP application program.
    The current ABAP program "SAPLKKBL " had to be terminated because one of the
    statements could not be executed.
    038350       endif.
    038360       gs_out-hlplen = strlen( gs_out-hlpchar ).
    038370     elseif gs_fc-tech_form = 11.                              "INS TECH
    038380   *   Min. Ausgabelänge für ein Datum ist immer 8
    038390       if gs_fc-datatype = 'DATS'.                             "INS TECH
    038400         gs_out-hlplen = 8.                                    "INS TECH
    038410   *    Min. Ausgabelänge für eine Uhrzeit ist immer 6
    038420       elseif gs_fc-datatype = 'TIMS'.                         "INS TECH
    038430         gs_out-hlplen = 6.                                    "INS TECH
    038440       endif.                                                  "INS TECH
    038450     elseif gs_fc-tech_form = 1 or gs_fc-tech_form = 90.
    038460   *   Überführung int. in ext. Format via Konvertierungsexit
    038470       if not gs_fc-convexit is initial or                     "INS TECH
    038480          not gs_fc-inttype ca 'CN'.
    038490   *   elseif not gs_fc-convexit is initial.            "DEL TECH11
    038500         write Y9CK034230

  • How to change alv display to classic list

    Hello All,
    In ecc 6.0 server in all the tcodes the default display of data is in Alv tabular format, now i want to change to classic mode again.
    Can you suggest how to go abt it??
    Thanks,
    Sunny

    If the application still supports that you can switch back; however, many apps don't support that any more.
    I'm not aware of a "general switch" for everything...
    Markus

  • ALV grid display the subtotal not getting for one column at the output

    Hi,
    I am working one report ALV grid display and subtotal is not getting for one paricular coulumn.
    Eventhough that column has some values.
    So can anyone give the proper solution.
    Waiting quick response.
    Best Regards,
    Bansi

    Hi
    see this link .
    https://wiki.sdn.sap.com/wiki/display/ABAP/SUBTOTALinALV
    or try this program.
    REPORT zalv.
    DATA:
    t_sflight TYPE TABLE OF sflight,
    fs_sflight TYPE sflight.
    DATA:
    r_container TYPE REF TO cl_gui_custom_container,
    r_grid TYPE REF TO cl_gui_alv_grid.
    *FIELD CATALOG
    DATA:
    t_fcat TYPE lvc_t_fcat,
    fs_fcat TYPE lvc_s_fcat.
    *SORTING THE BASIC LIST
    DATA:
    t_sort TYPE lvc_t_sort,
    fs_sort TYPE lvc_s_sort.
    fs_fcat-fieldname = 'PRICE'.
    fs_fcat-do_sum = 'X'.
    APPEND fs_fcat TO t_fcat.
    fs_sort-spos ='1'.
    fs_sort-fieldname = 'CARRID'.
    fs_sort-down = 'X'.
    fs_sort-group = '*'.
    fs_sort-subtot = 'X'.
    APPEND fs_sort TO t_sort.
    SELECT * FROM sflight INTO TABLE t_sflight.
    CALL SCREEN 100.
    *& Module STATUS_0100 OUTPUT
    MODULE status_0100 OUTPUT.
    SET PF-STATUS 'SCREEN1'.
    SET TITLEBAR 'TITLE1'.ENDMODULE. " STATUS_0100 OUTPUT
    *& Module USER_COMMAND_0100 INPUT
    MODULE user_command_0100 INPUT.
    CASE sy-ucomm.
    WHEN 'BACK'.
    LEAVE TO SCREEN 0.
    ENDCASE.
    ENDMODULE. " USER_COMMAND_0100 INPUT
    **& Module HANDLER OUTPUT
    MODULE list OUTPUT.
    CREATE OBJECT r_container
    EXPORTING
    container_name = 'CONTAINER'.
    CREATE OBJECT r_grid
    EXPORTING
    i_parent = r_container.
    CALL METHOD r_grid->set_table_for_first_display
    EXPORTING
    i_structure_name = 'SFLIGHT'
    CHANGING
    it_fieldcatalog = t_fcat
    it_outtab = t_sflight
    it_sort = t_sort.
    ENDMODULE. "list OUTPUT
    Regards
    Hareesh Menon

Maybe you are looking for

  • How to synch my safari browser?

    Hi there, Daniel aka ZerolimitBoy here. I'm new here and have few questions... But first of all, let me thank you for the great work you're doing here. this is really a nice place to learn and to share... Well, I've just downloaded safari browser 5.1

  • Can NOT restart Oracle BI Presentation Server on Windows XP

    Oracle BI server 10.1.3.4.1 installed in Windows XP. I stop the Oracle BI Presentation server and Oracle BI server for some reason, and restart them. BI server start sucessfully, but Oracle BI Presentation server restart failed. Here is message I got

  • How can I restore my settings, etc. after update to Firefox 20 reset everything?

    Windows 7 Starter, Firefox 20; running from non-administrator account (possibly the cause of issues): I updated to Firefox 20, and everything was reset (i.e. homepage, bookmarks, passwords, addons). I searched online for solutions but it hasn't helpe

  • Illustrator CS5 w/ Mac OS X Mountain Lion

    Recently I've been experiencing issue with Illustrator where if I place an object on the artboard, I can rotate it using the mouse, I can select it using the mouse, but I cannot drag the object. The status bar at the bottom of the application window

  • Acrobat 8.0.0 for Mac loads all PDFs with no menu bar visible

    Hello, First time poster. I've searched for a similar post on these forums but did not find anything. Hopefully this is not a repost. I have a user on a MacBook Pro running Acrobat 8.0.0 with an odd issue. Anytime she double-clicks on a PDF file she