ALV Grid to display in Excel Format

Hi All,
When I am executing the report RFBILA00 in ALV grid and I want to display it in EXCEL. I could not able to do.
I have selected various options like selecting Views---Excel, but the excel sheet is opened but the values are not been displayed.
Can any one suggest any other way.
Thanks,
Srini

Hi,
it may sound a bit silly, but I have tried to replicate what you did, and managed to get a simple download.
- run RFBILA00, selet ALV gid control for list output
- wait for the report to appear on the screen
- go to the "List" option (upper left row)
- from the drop-down menu of the "List" option select "Export" and the "Spreadsheet"
- the system flags in information box, confirm this message
- after confirmation the system flags another information box, "Export list to XXL", select the "Table" option and confirm
- after confirmation wait for the next information box, confirm that you want "Microsoft Excel"
- wait a few seconds for the system to populate the upcoming spreadsheet
- save a copy of the spreadsheet in .xls-format.
Instead of spreadsheet you may want to consider to "Save to Local File" and then convert to spreadsheet format within "Excel" itself.
Hope this helps.
Kind regards,
Rudolf

Similar Messages

  • Alv grid layout display in 2 pages

    Hi All,
    I am presently working in ALV programming.
    The client requierment is "GL line items and summary sheet will be listed in separate pages."
    i am dispalying the output using ALV grid layout display.
    Can you please conform that how to write logic for summary sheet.that will display after the line items and also saparate page.
    Thanks,
    Sridhar

    Hi ,
          Use event END OF PAGE .
    Write a Form for end of page
    then do calcualtions.
    Reward if useful.

  • SAP ALV report scheduling background in excel format

    Hi Gurus,
    We are using SAP 4.7 and using different SAP reports.Now I want to send SAP ALV report in excel format directly from SAP in background.Now we send these reports in background weekly by using autimetic scheduling but this is PDF format.Now I want to change this pdf format to excel format.In SCOT T.Code I am able to find any excel format.Please help me out.
    I am waiting for your reply.
    Advance Thanks
    Nirmal

    > We are using SAP 4.7 and using different SAP reports.Now I want to send SAP ALV report in excel format directly from SAP in background.Now we send these reports in background weekly by using autimetic scheduling but this is PDF format.
    "Something" has to do the conversion to excel, it will not work without programming.
    If you display a grid the data is sent via OLE to the frontend where excel is started and displaying the data. If you run a program in the background there is no terminal connection and hence no excel and hence no conversion.
    What you can do is that you display the data as raw data and send it as attachment - but then people need to import and convert themselves.
    Markus

  • Error While ALV Grid is exported to Excel.

    Hi Experts,
    I get an error OBJECTS_NOT_CHARLIKE , while I try to download an ALV Grid , to an excel file using the standard icon Export  present on the ALV Grid.
    Regards.
    Edited by: sunitha j on May 19, 2009 1:15 PM

    This happens when your output list contains qty. or amount fields.
    To fix the error use sap table name instead of your internal table name while preparing field catalog.
    In case you are forced to use int. table name while preparing field catalog , add "quantity" field for qty figures and "currency" field for amount figures.
    Example :
    it_catalog-fieldname = 'MENGE'.
    it_catalog-quantity = 'NOS'.
    it_catalog-tabname = 'i_bseg'.
    it_catalog-seltext_s = 'Quantity'.
    APPEND it_catalog TO it_fieldcat.
    it_catalog-fieldname = 'DMBTR'.
    it_catalog-tabname = 'i_bseg'.
    it_catalog-seltext_s = 'Amount'.
    it_catalog-currency = 'INR'.
    APPEND it_catalog TO it_fieldcat.

  • Send ALV report as attachment in EXCEL format

    Hi SAP Guru,
    I had a report output as ALV format.
    Currently, when the background job ended, it would be send out to the recipent thru SAPconnect as PDF format using internet mailing address.
    I tried to search for a configuraiton for EXCEL output but there don;t seems to be any option availble.
    I can only choose from PDF/TEXT/HTM/PS in the output document type selection in SOST.
    How can I configure to allow the system to send out the ALV report to my recipent in EXCEL format instead of PDF or HTML?
    Thanks

    Hi,
    By Using OOPS Concept you can send ALV Output as Excel Format by using Class Interface: CL_BCS.
    Do some search on CL_BCS.
    There are some demo Program, sreach for BCS* on SE38.
    Thanks & Regards
    M Nair

  • Alv heading to display in excel

    Hi
    i have a problem ,
    i want 2 take print of body of alv with ALV header.
    while printing , only body is comin for print-out, not a header.
    guide me.
    points vil be rewarded

    write the header under the event top-fo-page and use listheader structure and also use FM ALV_commentary _write
    see following code for example
    http://sapprograms.blogspot.com/2008/04/alv-grid-display-report.html

  • ALV Grid - Columns Displays?

    Any way to display an ALV grid in different sections?
    Meaning, The top half of the report lines up columns differently then the bottom half of the report.
    For instance, The first two columns are always the same for all fields, but becuse the rest of the fields are not related to one another in any way the report breaks and displays te columns differently at a certain point in the output of the display?
                      Thank -You

    In the field catalog give the <b>emphasize</b>.
    For first 2 columns:
    ls_fcat-emphasize  = 'C310'.
    For all other columns:
      ls_fcat-emphasize  = 'C400'.
    These make the ALV columns in different colors.
    In case if u want to color a particular row or particular cell, do the below things:
    Assign  a variable celltab    TYPE lvc_t_styl, in the internal table which u dispaly the data.
    In the layout give,   wa_layout-stylefname = 'CELLTAB'.
    Modify the final internal table like this sample code:
      DATA : lt_celltab  TYPE lvc_t_styl,
             ls_celltab  TYPE lvc_s_styl.
      READ TABLE i_final_data INTO wa_final_data INDEX 1.
      ls_celltab-fieldname = 'LNG_TYPES'.
      ls_celltab-style = '00000060'.
      INSERT ls_celltab INTO TABLE lt_celltab.
      CLEAR ls_celltab.
      ls_celltab-fieldname = 'LNG_QUANTITY'.
      ls_celltab-style = '00003060'.
      INSERT ls_celltab INTO TABLE lt_celltab.
      CLEAR ls_celltab.
      ls_celltab-fieldname = 'NG_TYPES'.
      ls_celltab-style = '00000666'.
      INSERT ls_celltab INTO TABLE lt_celltab.
      CLEAR ls_celltab.
      ls_celltab-fieldname = 'NG_QUANTITY'.
      ls_celltab-style = '00000066'.
      INSERT ls_celltab INTO TABLE lt_celltab.
      CLEAR ls_celltab.
      wa_final_data-celltab[] = lt_celltab[].
      MODIFY i_final_data FROM wa_final_data INDEX 1.
      CLEAR: ls_celltab, lt_celltab, wa_final_data.
    Here   ls_celltab-style = '00003060' will make that particular cell in different color.
    Regards,
    Prakash.
    Message was edited by: Prakash Ramu

  • Printing Selection-Screen while printing ALV Grid output display

    Hi,
    I have a requirement wherein I want to print the Selection Screen also while printing the output in simple ALV grid Display.
    Currently when I print the ALV output report, only the header and the Body of the ALV is getting printed. But the requirement is that I also want to print Selection screen along with this.
    If anyone has faced a similar situation, plz let me know what needs to be done in order to print the selection screen also while printing the ALV report output.
    Rgds,
    Nitin

    Hi,
    You can use given function module to print your
    selection screen
    RS_REFRESH_FROM_SELECTOPTIONS
    >This will get Current contents of selection screen
    RS_LIST_SELECTION_TABLE
    >This will Generates list according to values in selection table(RSPARAMS)
    Sample
    CALL FUNCTION 'RS_REFRESH_FROM_SELECTOPTIONS'
           EXPORTING
                curr_report     = p_repid
           TABLES
                selection_table = it_int_tab
           EXCEPTIONS
                not_found       = 1
                no_report       = 2
                OTHERS          = 3.
      IF sy-subrc EQ 0.
        WRITE:1  'Selection Criteria'(i19),
             /1  sy-uline(18),
             /1  'Variant Name'(i21),
             23  sy-slset.
    *--  This function module lists the Selection Screen contents
        CALL FUNCTION 'RS_LIST_SELECTION_TABLE'
             EXPORTING
                  report        = p_repid
                  seltext       = 'X'
                  newpage       = space
             TABLES
                  sel_tab       = it_int_tab
             EXCEPTIONS
                  sel_tab_empty = 1
                  OTHERS        = 2.
    Mark all helpful answers

  • Problem with ALV Grid Not Displaying Data

    Hi Gurus,
    I have a report program, when i run it I display an output summary on ALV Grid, and when i click on each of the row in the output summary, I'm suppose to see the item detail of each record.
    This item detail is showing for some record and is not showing for some other records (when i use different selections). I debugged it and observed that the table populating the ALV grid actually has records in it. The ALV grid is not just displaying the records.
    I debugged the 2 examples (one showing record and the other not showing), I found out that nothing is different in the way they run till they populate the final internal record to passed to the ALV Grid.
    Please any suggestions on this:
    This is the function code for the ALV grid.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_program       = g_program_id
          i_callback_pf_status_set = c_detail_status
          i_callback_user_command  = c_detail_user_comm
          i_grid_title             = lv_grid_title
          is_layout                = w_detail_layout
          it_fieldcat              = i_detail_fieldcat
          it_sort                  = i_detail_sort
        TABLES
          t_outtab                 = i_faglflexa[]   "NEM - detail
        EXCEPTIONS
          program_error            = 1
          OTHERS                   = 2.
      IF sy-subrc <> 0.
        MESSAGE e064
          WITH sy-subrc.
    Function REUSE_ALV_GRID_DISPLAY failed on detail view SY-SUBRC = &
      ENDIF.

    This is the full code:
    ***INCLUDE ZFIGL_HYPERION_F01.
    *&      Form  open_files
    Open files used by the program.
    FORM open_files.
      OPEN DATASET p_fileot FOR OUTPUT IN TEXT MODE ENCODING DEFAULT
        MESSAGE g_message.
      IF sy-subrc <> 0.
        MESSAGE e056
          WITH g_message.
    Unable to open output file &
      ENDIF.
    ENDFORM.                    " open_files
    *&      Form  close_files
    Close files used by the program.
    FORM close_files.
      CLOSE DATASET p_fileot.
    ENDFORM.                    " close_files
    *&      Form  extract_data
    Extract data from database needed to generate output file and report.
    FORM extract_data.
    Get the required general ledger totals records.
      PERFORM get_faglflext_data.
    Derive any other necessary fields for I_FAGLFLEXT.
      PERFORM derive_add_fields_faglflext.
    Split records by fiscal period.
      PERFORM split_records_by_period.
    Summarize the detail records to allow for creation of the file and
    reporting.
      PERFORM summarize_records_by_period.
    Get the required general ledger actual line items records.
      PERFORM get_faglflexa_data.
    Derive any other necessary fields for I_FAGLFLEXA.
      PERFORM derive_add_fields_faglflexa.
    Sort the detail and summary output tables into key sequence.
      PERFORM sort_output_tables.
    ENDFORM.                    " extract_data
    *&      Form  process_data
    Create the requested file and report.
    FORM process_data.
    Create the local file if requested by the user or the month-end file
    at month-end.
      IF cb_test = c_not_selected.
        PERFORM create_pc_file.
      ELSEIF sy-uname = c_user_batch_admin.
        PERFORM create_output_file.
      ENDIF.
    Create the necessary tables for summary ALV report.
      PERFORM build_summary_layout.
      PERFORM build_summary_field_catalog.
      PERFORM build_summary_sort_table.
    Check to see that there is data in the summary output table.  If yes,
    generate report, if not, then give a message to the user.
      READ TABLE i_output_summary INDEX 1 TRANSPORTING NO FIELDS.
      IF sy-subrc <> 0.
        MESSAGE s062.
        STOP.
    No data extracted for selection criteria entered
      ENDIF.
    Generate the summary ALV report view.
      PERFORM generate_summary_alv_report.
    ENDFORM.                    " process_data
    *&      Form  verify_user_selections
    Verify data input by the user.
    FORM verify_user_selections.
      IF NOT p_ryear IS INITIAL.
        IF p_ryear < 2006 OR
           p_ryear > 2100.
          MESSAGE e057.
    Fiscal year is invalid
        ENDIF.
      ENDIF.
    If program is being run in a non-test mode and the user has left the
    fiscal year selection blank, display a error message.
      IF cb_test IS INITIAL AND
         p_ryear IS INITIAL.
        MESSAGE e058.
    A fiscal year must be entered when generating the file
      ENDIF.
    If program is being run in a non-test mode and the user has left the
    period selection blank, display a error message.
      IF cb_test IS INITIAL AND
         s_rpmax IS INITIAL.
        MESSAGE e132.
    A period must be entered when generating the file
      ENDIF.
      IF cb_test IS INITIAL AND
         p_lfile IS INITIAL.
        MESSAGE e071.
    Local filename is required when generating the file
      ENDIF.
    ****Basil Balogun's addition to include the hyperion acct in selection. (10/03/2007)***
      IF s_rhype IS NOT INITIAL.
        LOOP AT s_rhype.
          CLEAR r_hyper.
          r_hyper-sign = 'I'.
          r_hyper-option = 'CP'.
          CONCATENATE '' s_rhype-low '' INTO r_hyper-low.
          APPEND r_hyper.
        ENDLOOP.
        SELECT bukrs saknr hyper
               FROM zall_gl_hype INTO TABLE i_zall_gl
               WHERE hyper IN r_hyper.
        LOOP AT i_zall_gl INTO w_zall_gl.
          w_zall_gl1-saknr = w_zall_gl-saknr.
          w_zall_gl2-bukrs = w_zall_gl-bukrs.
          APPEND w_zall_gl1-saknr TO i_zall_gl1.
          APPEND w_zall_gl2-bukrs TO i_zall_gl2.
          CLEAR: w_zall_gl, w_zall_gl1, w_zall_gl2.
        ENDLOOP.
        SORT i_zall_gl1 BY saknr.
        SORT i_zall_gl2 BY bukrs.
        DELETE ADJACENT DUPLICATES FROM i_zall_gl1 COMPARING saknr.
        DELETE ADJACENT DUPLICATES FROM i_zall_gl2 COMPARING bukrs.
        IF s_racct IS INITIAL.
          LOOP AT i_zall_gl1 INTO w_zall_gl1.
            r_saknr-sign = 'I'.
            r_saknr-option = 'EQ'.
            r_saknr-low = w_zall_gl1.
            APPEND r_saknr.
            CLEAR r_saknr.
            CLEAR w_zall_gl1.
          ENDLOOP.
        ELSE.
          r_saknr[] = s_racct[].
        ENDIF.
        IF s_rbukrs IS INITIAL.
          LOOP AT i_zall_gl2 INTO w_zall_gl2.
            r_bukrs-sign = 'I'.
            r_bukrs-option = 'EQ'.
            r_bukrs-low = w_zall_gl2-bukrs.
            APPEND r_bukrs.
            CLEAR r_bukrs.
            CLEAR w_zall_gl2.
          ENDLOOP.
        ELSE.
          r_bukrs[] = s_rbukrs[].
        ENDIF.
      ELSE.
        r_saknr[] = s_racct[].
        r_bukrs[] = s_rbukrs[].
        SELECT bukrs saknr hyper
               FROM zall_gl_hype INTO TABLE i_zall_gl.
      ENDIF.
    ****Basil Balogun's addition to include the hyperion acct in selection. (10/03/2007)***
    ENDFORM.                    " verify_user_selections
    *&      Form  get_faglflext_data
    Get FAGLFLEXT (General Ledger: Totals) data from the database.
    FORM get_faglflext_data .
    Use the fiscal year for the selection, if it was populated by the
    user.
      IF NOT p_ryear IS INITIAL.
        SELECT ryear rldnr rvers racct rbukrs prctr rfarea kokrs segment
               zzsarea zzsareaim rassc hsl01 hsl02 hsl03 hsl04 hsl05 hsl06
               hsl07 hsl08 hsl09 hsl10 hsl11 hsl12 hsl13 hsl14 hsl15 hsl16
               hslvt
          INTO TABLE i_faglflext
          FROM faglflext
          WHERE rldnr = c_run_ledger    AND
                rbukrs IN r_bukrs       AND
                racct  IN r_saknr       AND
                rfarea IN s_rfarea      AND
                prctr  IN s_prctr       AND
                ryear  =  p_ryear       AND
                rvers  = c_run_version.
      ELSE.
        SELECT ryear rldnr rvers racct rbukrs prctr rfarea kokrs segment
             zzsarea zzsareaim rassc hsl01 hsl02 hsl03 hsl04 hsl05 hsl06
             hsl07 hsl08 hsl09 hsl10 hsl11 hsl12 hsl13 hsl14 hsl15 hsl16
             hslvt
        INTO TABLE i_faglflext
        FROM faglflext
        WHERE rldnr = c_run_ledger    AND
              rbukrs IN r_bukrs       AND
              racct  IN r_saknr       AND
              rfarea IN s_rfarea      AND
              prctr  IN s_prctr       AND
              rvers  = c_run_version.
      ENDIF.
    ENDFORM.                    " get_faglflext_data
    *&      Form  derive_add_fields_faglflext
    Derive additional fields needed for the I_FAGLFLEXT.
    FORM derive_add_fields_faglflext.
    Get needed company code and profit center data from the database.
      PERFORM get_t001_data.
      PERFORM get_t880_data.
      READ TABLE i_faglflext INDEX 1 TRANSPORTING NO FIELDS.
      IF sy-subrc = 0.
        PERFORM get_cepc_data.
      ENDIF.
      SORT i_zall_gl BY bukrs saknr.
      LOOP AT i_faglflext INTO w_faglflext.
    Get necessary company code data.
        READ TABLE i_t001 INTO w_t001
          WITH KEY bukrs = w_faglflext-rbukrs
                   BINARY SEARCH.
        IF sy-subrc <> 0.
          MESSAGE e059
            WITH w_faglflext-rbukrs.
    Company code & not found on table T001
        ENDIF.
    Determine the entity.
        PERFORM derive_entity USING w_t001-rcomp
                           CHANGING w_faglflext-entity.
    Determine the strategic segment.
        PERFORM derive_strategic_segment USING w_faglflext-rassc
                                               w_faglflext-prctr
                                      CHANGING w_faglflext-strat_seg
                                               w_faglflext-zzsareaim
                                               w_faglflext-zzsarea.
    Determine the strategic segment channel.
        PERFORM derive_strat_seg_chnl USING w_faglflext-rassc
                                            w_faglflext-prctr
                                   CHANGING w_faglflext-strat_seg_chnl.
    Determine the all item ID and all products.
        PERFORM derive_all_item_id USING w_t001-waers
                                CHANGING w_faglflext-all_item_id
                                         w_faglflext-all_products.
    Determine the all customers and all customers channel.
       PERFORM derive_all_customers_fields USING w_faglflext-strat_seg
    *w_faglflext-strat_seg_chnl
                                        CHANGING w_faglflext-all_cust
    *w_faglflext-all_cust_chnl.
    Determine the sub account using the company ID of the trading partner.
       PERFORM derive_sub_account USING w_faglflext-rassc
                               CHANGING w_faglflext-sub_acct.
        PERFORM derive_sub_account USING w_t001-rcomp
                                         w_faglflext-rassc
                           CHANGING w_faglflext-sub_acct.
    ****Begin Basil changes to include hyperion acct in selection (10/03/2007).
        READ TABLE i_zall_gl INTO w_zall_gl
                     WITH KEY bukrs = w_faglflext-rbukrs
                              saknr = w_faglflext-racct
                          BINARY SEARCH.
        IF sy-subrc = 0.
    ****End Basil changes to include hyperion acct in selection (10/03/2007).
    Determine the Hyperion account number from G/L account long text.
          PERFORM derive_hyperion_account USING w_faglflext-racct
                                                w_faglflext-rfarea
                                                "KMK5/22/06 ITR: 20592
                                                w_faglflext-sub_acct
                                                w_faglflext-rassc
                                                w_faglflext-prctr
                         CHANGING w_faglflext-hyperion_acct
                                  w_faglflext-reverse_sign "NEM8/21/06 ITR: 24286
                                  w_faglflext-balance_sheet "NEM8/21/06 ITR: 24286
                                  w_faglflext-zzsarea
                                  w_faglflext-zzsareaim
                                  w_faglflext-strat_seg.
        ENDIF.
    Determine the all customers and all customers channel.
        PERFORM derive_all_customers_fields USING w_faglflext-strat_seg
                                                  w_faglflext-strat_seg_chnl
                                         CHANGING w_faglflext-all_cust
                                                  w_faglflext-all_cust_chnl.
    Update i_FAGLFLEXT with the newly derive fields.
        MODIFY i_faglflext FROM w_faglflext
          TRANSPORTING entity
                       strat_seg
                       strat_seg_chnl
                       all_item_id
                       all_products
                       all_cust
                       all_cust_chnl
                       hyperion_acct
                       sub_acct
                       fiscal_period
                       zzsarea
                       zzsareaim
                       reverse_sign        "NEM8/21/06 ITR: 24286
                       balance_sheet.      "NEM8/21/06 ITR: 24286
      ENDLOOP.
      CHECK s_rhype IS NOT INITIAL.
      SORT s_rhype BY low.
      LOOP AT i_faglflext INTO w_faglflext.
        READ TABLE s_rhype WITH KEY low = w_faglflext-hyperion_acct.
        IF sy-subrc NE 0.
          CLEAR w_faglflext-hyperion_acct.
          MODIFY i_faglflext FROM w_faglflext.
        ENDIF.
      ENDLOOP.
      DELETE i_faglflext WHERE hyperion_acct IS INITIAL.
    ENDFORM.                    " derive_add_fields_faglflext
    *&      Form  derive_entity
    Derive the entity using the company code.
         -->RCOMP  - Company code.
         <--ENTITY - Entity
    FORM derive_entity USING rcomp  TYPE t_t001-rcomp
                    CHANGING entity TYPE t_faglflext-entity.
      CLEAR:
        entity.
    Get necessary global company code data.
      READ TABLE i_t880 INTO w_t880
        WITH KEY rcomp = rcomp
                 BINARY SEARCH.
      IF sy-subrc = 0.
        entity  = w_t880-name2+0(3).
        TRANSLATE entity TO UPPER CASE.
      ELSE.
        MESSAGE e060
          WITH w_t001-rcomp.
    Company code & not found on table T880
      ENDIF.
    ENDFORM.                    " derive_entity
    *&      Form  get_t001_data
    Get T001 (Company Codes) data from the database.
    FORM get_t001_data.
      SELECT bukrs waers rcomp
        INTO TABLE i_t001
        FROM t001
        CLIENT SPECIFIED
        WHERE mandt = sy-mandt.
      SORT i_t001 BY bukrs.
    ENDFORM.                    " get_t001_data
    *&      Form  get_t880_data
    Get T880 (Global Company Data (for KONS Ledger)) data from the
    database.
    FORM get_t880_data.
      SELECT rcomp name2
        INTO TABLE i_t880
        FROM t880
        CLIENT SPECIFIED
        WHERE mandt = sy-mandt.
      SORT i_t880 BY rcomp.
    ENDFORM.                    " get_t880_data
    *&      Form  derive_all_item_id
    Derive the all item ID from the company code currency key.
         -->WAERS       - Currency key.
         <--ALL_ITEM_ID - All item ID.
         <--ALL_ITEM_ID - All item ID.
    FORM derive_all_item_id USING waers        TYPE t_t001-waers
                         CHANGING all_item_id  TYPE t_faglflext-all_item_id
                                  all_products TYPE t_faglflext-all_products
      CLEAR:
        all_item_id.
    Populate all item ID.
      all_item_id = c_all_item_id.
      IF waers = c_us_dollars.
        REPLACE '*' WITH c_united_states INTO all_item_id.
      ELSE.
        REPLACE '*' WITH c_local         INTO all_item_id.
      ENDIF.
    Populate all products.
      all_products   = c_all_products.
      TRANSLATE all_products TO UPPER CASE.
    ENDFORM.                    " derive_all_item_id
    *&      Form  derive_all_customers_fields
    Derive the all customers and all customer channel fields from
    the strategic segment and strategic segment channel respectively.
         -->STRAT_SEG      - Strategic segment.
         -->STRAT_SEG_CHNL - Strategic segment channel.
         <--ALL_CUST       - All customers.
         <--ALL_CUST_CHNL  - All customers channel.
    FORM derive_all_customers_fields USING strat_seg      TYPE
    t_faglflext-strat_seg
                                           strat_seg_chnl TYPE
                                           t_faglflext-strat_seg_chnl
                                  CHANGING all_cust       TYPE
                                  t_faglflext-all_cust
                                           all_cust_chnl  TYPE
                                           t_faglflext-all_cust_chnl.
      CLEAR:
        all_cust,
        all_cust_chnl.
      all_cust        = strat_seg.
      all_cust+2(1)   = c_all_customers.
      TRANSLATE all_cust TO UPPER CASE.
      all_cust_chnl   = strat_seg_chnl.
      TRANSLATE all_cust_chnl TO UPPER CASE.
    ENDFORM.                    " derive_all_customers_fields
    *&      Form  derive_hyperion_account
    Read G/L account long text to get the Hyperion account number.
         -->RACCT         - SAP G/L account number.
         <--HYPERION_ACCT - Hyperion account number.
    FORM derive_hyperion_account USING racct         TYPE t_faglflext-racct
                                       farea         TYPE t_faglflext-rfarea
                                       "KMK5/22/06 ITR 20592
                                       sub_account   TYPE
                                       t_faglflext-sub_acct
                                       rassc         TYPE t_faglflext-rassc
                                       prctr         TYPE t_faglflext-prctr
                          CHANGING hyperion_acct TYPE t_faglflext-hyperion_acct
                                   reverse_sign  TYPE t_faglflext-reverse_sign "NEM8/21/06 ITR: 24286
                                   balance_sheet TYPE t_faglflext-balance_sheet "NEM8/21/06 ITR: 24286
                                   zzsarea       TYPE t_faglflext-zzsarea
                                   zzsareaim     TYPE t_faglflext-zzsareaim
                                   strat_seg     TYPE t_faglflext-strat_seg.
      DATA:
        lv_text_name          TYPE thead-tdname,
        l_strl                TYPE i VALUE 0,
        l_hyperion_acct(10),                       "KMK5/20/06 ITR 20527
        l_farea(10)           VALUE '0000000000',  "KMK5/22/06 ITR 20592
        l_balance_sheet(1),                        "NEM8/17/06 ITR 25792
        l_string              TYPE tline-tdline.   "NEM8/17/06 ITR 25792
      DATA: l_hyp_account_1 TYPE tline-tdline,
            l_hyp_account_2 TYPE tline-tdline,
            l_hyp_account_3 TYPE tline-tdline.
      reverse_sign = '1'.
      SELECT SINGLE bilkt xbilk
        FROM ska1
        INTO (l_hyperion_acct,l_balance_sheet)
        WHERE ktopl = c_global_tcoa
          AND   saknr = racct.
      balance_sheet = l_balance_sheet.
      l_string = w_zall_gl-hyper.
      SEARCH l_string FOR '-'.
      IF sy-subrc = '0'.
        reverse_sign = -1.
      ELSE.
        reverse_sign = 1.
      ENDIF.
      CHECK w_zall_gl-hyper IS NOT INITIAL.
      CLEAR: l_hyp_account_1, l_hyp_account_2, l_hyp_account_3.
      SPLIT w_zall_gl-hyper
        AT ';'
        INTO l_hyp_account_1 l_hyp_account_2 l_hyp_account_3.
      IF l_hyp_account_2 IS INITIAL.      " Only one hyperion account
        hyperion_acct = l_hyp_account_1+0(7).
        l_strl = STRLEN( hyperion_acct ) - 1.
        IF hyperion_acct+l_strl(1) EQ '1'.
          CLEAR sub_account.
          PERFORM repopulate_strategic_segment
            USING rassc prctr
            CHANGING strat_seg.
          zzsareaim = g_hold_sales_type.
          zzsarea = g_hold_sales_area.
        ENDIF.
      ELSE.                                " Two or more hyperion accounts
        IF sub_account > ''.
          hyperion_acct = l_hyp_account_2+0(7).
        ELSE.
          hyperion_acct = l_hyp_account_1+0(7).
        ENDIF.
      ENDIF.
      CLEAR: w_hyperion.
      w_hyperion-racct           = racct.
      w_hyperion-hyperion_acct   = hyperion_acct.
      w_hyperion-reverse_sign    = reverse_sign.
    ENDFORM.                    " derive_hyperion_account
    *&      Form  derive_sub_account
    Determine the sub account based on the company ID of the trading
    partner.
         -->RASSC    - Company ID of trading partner.
         <--SUB_ACCT - Sub account.
    *FORM derive_sub_account USING rassc    TYPE t_faglflext-rassc
                        CHANGING sub_acct TYPE t_faglflext-sub_acct.
    IF rassc IS INITIAL.
       CLEAR: sub_acct.
    ELSE.
       sub_acct  = rassc.
       TRANSLATE sub_acct TO UPPER CASE.
    ENDIF.
    *ENDFORM.                    " derive_sub_account
    FORM derive_sub_account USING rcomp  TYPE t_t001-rcomp
                                  rassc  TYPE t_faglflext-rassc
                    CHANGING sub_acct TYPE t_faglflext-sub_acct.
      IF rassc IS INITIAL.
        CLEAR: sub_acct.
      ELSE.
        READ TABLE i_t880 INTO w_t880
          WITH KEY rcomp = rassc
                   BINARY SEARCH.
        IF sy-subrc = 0.
          sub_acct  = w_t880-name2.
          TRANSLATE sub_acct TO UPPER CASE.
        ELSE.
       MESSAGE e060
         WITH w_t001-rcomp.
    Company code & not found on table T880
        ENDIF.
      ENDIF.
    ENDFORM.                    " derive_sub_account
    *&      Form  repopulate_strategic_segment
    Derive the strategic segment based on the company ID of the trading
    partner or the profit center.
         -->RASSC     - Company ID of trading partner.
         -->PRCTR     - Profit center.
         <--STRAT_SEG - Strategic segment.
    FORM repopulate_strategic_segment USING rassc     TYPE t_faglflext-rassc
                                        prctr     TYPE t_faglflext-prctr
                               CHANGING strat_seg TYPE t_faglflext-strat_seg
      DATA:
        lv_segment              TYPE cepc-segment.
      CLEAR:
        strat_seg.
    Find the valid profit center record.
      LOOP AT i_cepc INTO w_cepc
        WHERE prctr =  prctr    AND
              datab <= sy-datum AND
              datbi >= sy-datum.
    Pad segment with leading zeros if necessary.
        lv_segment      = w_cepc-segment.
        SHIFT lv_segment RIGHT DELETING TRAILING ' '.
        TRANSLATE lv_segment USING ' 0'.
    Get the segment name from FAGL_SEGMT (Master Data for Segments).
        SELECT SINGLE *
          FROM fagl_segmt
          WHERE langu   = sy-langu AND
                segment = lv_segment.
        IF sy-subrc = 0.
          strat_seg      = fagl_segmt-name+0(3).
          TRANSLATE strat_seg TO UPPER CASE.
        ENDIF.
      ENDLOOP.
    ENDFORM.                    "repopulate_strategic_segment
    " repopulate_strategic_segment&----
    *&      Form  derive_strategic_segment
    Derive the strategic segment based on the company ID of the trading
    partner or the profit center.
         -->RASSC     - Company ID of trading partner.
         -->PRCTR     - Profit center.
         <--STRAT_SEG - Strategic segment.
    FORM derive_strategic_segment USING rassc     TYPE t_faglflext-rassc
                                        prctr     TYPE t_faglflext-prctr
                               CHANGING strat_seg TYPE t_faglflext-strat_seg
                                        sales_type TYPE t_faglflext-zzsareaim
                                        sales_area TYPE t_faglflext-zzsarea.
      DATA:
        lv_segment              TYPE cepc-segment.
      CLEAR:
        strat_seg.
    *Hold values in Sales Type and Sales area before setting to default
    *values
    In case need to use them later
      g_hold_sales_type = sales_type.
      g_hold_sales_area = sales_area.
    If the company ID of the trading partner is populated, then set the
    strategic segment to a default value.
    And set Sales Type and Sales area to default values     **NEM 07/13/06
      IF NOT rassc IS INITIAL.
        strat_seg   = c_def_strat_seg.
        sales_type  = c_sales_type.
        sales_area  = c_sales_area.
        TRANSLATE strat_seg TO UPPER CASE.
        TRANSLATE sales_type TO UPPER CASE.
        TRANSLATE sales_area TO UPPER CASE.
        EXIT.
      ENDIF.
    Find the valid profit center record.
      LOOP AT i_cepc INTO w_cepc
        WHERE prctr =  prctr    AND
              datab <= sy-datum AND
              datbi >= sy-datum.
    Pad segment with leading zeros if necessary.
        lv_segment      = w_cepc-segment.
        SHIFT lv_segment RIGHT DELETING TRAILING ' '.
        TRANSLATE lv_segment USING ' 0'.
    Get the segment name from FAGL_SEGMT (Master Data for Segments).
        SELECT SINGLE *
          FROM fagl_segmt
          WHERE langu   = sy-langu AND
                segment = lv_segment.
        IF sy-subrc = 0.
          strat_seg      = fagl_segmt-name+0(3).
          TRANSLATE strat_seg TO UPPER CASE.
        ENDIF.
      ENDLOOP.
    ENDFORM.                    " derive_strategic_segment
    *&      Form  get_cepc_data
    Get CEPC (Profit Center Master Data Table) data from the database.
    FORM get_cepc_data.
      SELECT prctr datbi kokrs datab khinr segment
        INTO TABLE i_cepc
        FROM cepc
        FOR ALL ENTRIES IN i_faglflext
        WHERE prctr = i_faglflext-prctr.
      SORT i_cepc BY prctr datab.
    ENDFORM.                    " get_cepc_data
    *&      Form  derive_strat_seg_chnl
    Derive the strategic segment channel based on the company ID of the
    trading partner or the profit center area.
         -->RASSC          - Company ID of trading partner.
         -->PRCTR          - Profit center.
         <--STRAT_SEG_CHNL - Strategic segment channel.
    FORM derive_strat_seg_chnl USING rassc          TYPE t_faglflext-rassc
                                     prctr          TYPE t_faglflext-prctr
                            CHANGING strat_seg_chnl TYPE
                            t_faglflext-strat_seg_chnl.
      CLEAR:
        g_setclass,
        g_subclass,
        g_setname,
        strat_seg_chnl.
    If the company ID of the trading partner is populated, then set the
    strategic segment to a default value.
      IF NOT rassc IS INITIAL.
        strat_seg_chnl  = c_def_strat_seg_chnl.
        TRANSLATE strat_seg_chnl TO UPPER CASE.
        EXIT.
      ENDIF.
    Check for SETNAME = 2*** in setleaf table.
      PERFORM get_setleaf_data USING c_prctr_group
                                       prctr
                              CHANGING g_subrc.
      IF g_subrc NE c_no_record.
        PERFORM find_setleaf_record CHANGING g_subrc.
        SELECT SINGLE *
        FROM setheadert
        WHERE  setclass = g_setclass AND
               subclass = g_subclass AND
               setname  = g_setname  AND
               langu    = sy-langu.
        IF sy-subrc = 0.
          strat_seg_chnl    = setheadert-descript+0(2).
          TRANSLATE strat_seg_chnl TO UPPER CASE.
        ENDIF.
      ELSE.
    Find the valid profit center record.
        LOOP AT i_cepc INTO w_cepc
          WHERE prctr =  prctr    AND
                datab <= sy-datum AND
                datbi >= sy-datum.
    Get the correct SETNODE (Lower-level sets in sets) record.
          PERFORM get_setnode_data USING c_prctr_group
                                         w_cepc-khinr
                                CHANGING g_subrc.
          PERFORM find_setnode_record CHANGING g_subrc.
          IF g_subrc = c_no_record.
            EXIT.
          ENDIF.
    If an appropriate SETNODE record still has not been found, then
    keep looking.
          IF g_subrc = c_wrong_record.
            DO.
              PERFORM get_setnode_data USING c_prctr_group
                                             w_setnode-setname
                                    CHANGING g_subrc.
              PERFORM find_setnode_record CHANGING g_subrc.
              IF g_subrc = c_no_record OR
                 g_subrc = c_correct_record.
                EXIT.
              ENDIF.
            ENDDO.
          ENDIF.
    In the end, there was no SETNODE record to find.
          IF g_subrc = c_no_record.
            EXIT.
          ENDIF.
          SELECT SINGLE *
            FROM setheadert
            WHERE  setclass = g_setclass AND
                   subclass = g_subclass AND
                   setname  = g_setname  AND
                   langu    = sy-langu.
          IF sy-subrc = 0.
            strat_seg_chnl    = setheadert-descript+0(2).
            TRANSLATE strat_seg_chnl TO UPPER CASE.
          ENDIF.
        ENDLOOP.
      ENDIF.
    ENDFORM.                    " derive_strat_seg_chnl
    *&      Form  get_setnode_data
    Get SETNODE (Lower-level sets in sets) data from the database.
         -->SETCLASS   - Set class.
         -->SUBSETNAME - Subordinate set ID.
         <--SUBRC      - Return code.
    FORM get_setnode_data USING setclass   TYPE c
                                subsetname TYPE c
                       CHANGING subrc      TYPE sy-subrc.
      SELECT setclass subclass setname
        INTO TABLE i_setnode
        FROM setnode
        WHERE setclass   = c_prctr_group AND
              subsetname = subsetname.
      subrc  = sy-subrc.
    ENDFORM.                    " get_setnode_data
    *&      Form  get_setleaf_data
    Get SETLEAF (Values in Sets) data from the database.
         -->SETCLASS   - Set class.
         -->VALFROM    - Subordinate set ID.
         <--SUBRC      - Return code.
    FORM get_setleaf_data USING setclass   TYPE c
                                valfrom    TYPE c
                       CHANGING subrc      TYPE sy-subrc.
      subrc = c_correct_record.
      SELECT setclass setname valfrom subclass
        INTO TABLE i_setleaf
        FROM setleaf
        WHERE setclass   = c_prctr_group AND
              valfrom = valfrom AND
              setname GE '2000' AND
              setname LE '2999'.
      IF sy-subrc <> 0.
        subrc  = c_no_record.
        EXIT.
      ENDIF.
    ENDFORM.                    " get_setleaf_data
    *&      Form  find_setleaf_record
    Find the appropriate SETLEAF record.
         <--SUBRC      - Return code.
    FORM find_setleaf_record CHANGING subrc TYPE sy-subrc.
      subrc  = c_wrong_record.
    If no records were found during selection, then exit the routine.
      READ TABLE i_setleaf INDEX 1 TRANSPORTING NO FIELDS.
      IF sy-subrc <> 0.
        subrc  = c_no_record.
        EXIT.
      ENDIF.
    Check to see if one of the records has a setname in the 2000 series of
    numbers.
      LOOP AT i_setleaf INTO w_setleaf.
        g_setclass = w_setleaf-setclass.
        g_subclass = w_setleaf-subclass.
        g_setname  = w_setleaf-setname.
        subrc  = c_correct_record.
      ENDLOOP.
    ENDFORM.                    " find_setleaf_record
    *&      Form  find_setnode_record
    Find the appropriate SETNODE record.
         <--SUBRC      - Return code.
    FORM find_setnode_record CHANGING subrc TYPE sy-subrc.
      subrc  = c_wrong_record.
    If no records were found during selection, then exit the routine.
      READ TABLE i_setnode INDEX 1 TRANSPORTING NO FIELDS.
      IF sy-subrc <> 0.
        subrc  = c_no_record.
        EXIT.
      ENDIF.
    Check to see if one of the records has a setname in the 2000 series of
    numbers.
      LOOP AT i_setnode INTO w_setnode.
        IF w_setnode-setname+0(1) = c_valid_number.
          g_setclass = w_setnode-setclass.
          g_subclass = w_setnode-subclass.
          g_setname  = w_setnode-setname.
          subrc  = c_correct_record.
          EXIT.
        ENDIF.
      ENDLOOP.
    ENDFORM.                    " find_setnode_record
    *&      Form  split_records_by_period
    Split the i_FAGLFLEXT records by fiscal period.  This is necessary
    because all (16) fiscal periods are on one record.
    FORM split_records_by_period .
      REFRESH:
        i_output_detail.
      LOOP AT i_faglflext INTO w_faglflext.
    START OF CHANGES BY BAYAPV on 07/07/2007**********************
    *SELECT SINGLE BUKRS
          SAKNR
          XOPVW
          into w_skb1
          from skb1
          FOR ALL ENTRIES IN I_FAGLFLEXT
          where bukrs = w_faglflext-rbukrs
            and SAKNR = w_faglflext-racct.
    *IF w_skb1-XOPVW = 'X'.
    *SELECT BUKRS
          HKONT

  • Alv grid Should Display In Three Tabstrips

    Hi Experts,
           Could you please tell me how to display alv in three tabstrips using oops abap
    Best answer rewarded
    Regards
    Fareedas

    Follow the following code for the 3rd tabstrip (I have done it for 2).
    *& Report  ZTEST_READ_CLUSTER
    REPORT  ztest_read_cluster.
    TABLES: vbak, likp.
    TYPES: BEGIN OF types_vbak ,
           vbeln TYPE vbeln,
           vkorg TYPE vkorg,
           netwr TYPE netwr,
           END OF types_vbak,
           BEGIN OF types_likp ,
           vbeln TYPE vbeln_vl,
           vstel TYPE vstel,
           vkorg TYPE vkorg,
           netwr TYPE netwr,
           END OF types_likp.
    DATA: w_cntx_menu TYPE REF TO cl_rsdme_ui_context_menu_gen,
          t_vbak      TYPE STANDARD TABLE OF types_vbak,
          t_likp      TYPE STANDARD TABLE OF types_likp,
          w_sale      TYPE char01.
    CONSTANTS: c_check TYPE c VALUE 'X'.
    ** ALV relavent Data
    DATA: w_grid TYPE REF TO cl_gui_alv_grid,
          wl_ref_container TYPE REF TO cl_gui_custom_container,
          w_container      TYPE scrfname   VALUE 'C_CONTAINER',
          t_fcat TYPE lvc_t_fcat,
          t_sort TYPE lvc_t_sort.
    CONTROLS: c_tab TYPE TABSTRIP.
    DATA: c_dynnr TYPE sy-dynnr.
    SELECTION-SCREEN: BEGIN OF BLOCK b1 WITH FRAME TITLE text-011.
    SELECT-OPTIONS: s_vbeln FOR vbak-vbeln,
                    s_delvr FOR likp-vbeln.
    SELECTION-SCREEN: END OF BLOCK b1.
    START-OF-SELECTION.
      SELECT vbeln
             vkorg
             netwr
             FROM vbak INTO TABLE t_vbak
             WHERE vbeln IN s_vbeln.
      IF sy-subrc = 0.
        SORT t_vbak BY vbeln.
      ENDIF.
      SELECT vbeln
             vstel
             vkorg
             netwr
             FROM likp INTO TABLE t_likp
             WHERE vbeln IN s_delvr.
      IF sy-subrc = 0.
        SORT t_likp BY vbeln.
      ENDIF.
      CALL SCREEN '9001'.
    *&      Module  STATUS_9001  OUTPUT
    *       text
    MODULE status_9001 OUTPUT.
      SET PF-STATUS ' '.
      SET TITLEBAR 'MAIN'.
      IF c_tab-activetab IS INITIAL OR
         c_dynnr         IS INITIAL.
        c_tab-activetab = 'TAB1'.
        c_dynnr = '9002'.
      ENDIF.
    ENDMODULE.                 " STATUS_9001  OUTPUT
    *&      Module  USER_COMMAND_9001  INPUT
    *       text
    MODULE user_command_9001 INPUT.
      CASE sy-ucomm.
        WHEN 'BACK' OR
             '%EX'  OR
             'CANC'.
          SET SCREEN 0.
        WHEN 'TAB1'.
          c_dynnr = '9002'.
        WHEN 'TAB2'.
          c_tab-activetab = 'TAB2'.
          c_dynnr = '9003'.
        WHEN 'TAB3'.
          c_tab-activetab = 'TAB3'.
          c_dynnr = '9004'.
      ENDCASE.
    ENDMODULE.                 " USER_COMMAND_9001  INPUT
    *&      Module  STATUS_9002  OUTPUT
    *       text
    MODULE status_9002 OUTPUT.
    ** Create the Container
      CREATE OBJECT wl_ref_container
        EXPORTING
          container_name = w_container.
    ** Create the Grid object
      CREATE OBJECT w_grid
        EXPORTING
          i_parent          = wl_ref_container
        EXCEPTIONS
          error_cntl_create = 1
          error_cntl_init   = 2
          error_cntl_link   = 3
          error_dp_create   = 4
          OTHERS            = 5.
      CHECK sy-subrc = 0.
      PERFORM sub_fill_fcat_sale.
      CALL METHOD w_grid->set_table_for_first_display
        CHANGING
          it_outtab                     = t_vbak
          it_fieldcatalog               = t_fcat
        EXCEPTIONS
          invalid_parameter_combination = 1
          program_error                 = 2
          too_many_lines                = 3
          OTHERS                        = 4.
    ENDMODULE.                 " STATUS_9002  OUTPUT
    *&      Module  STATUS_9004  OUTPUT
    *       text
    MODULE status_9003 OUTPUT.
    ** Create the Container
      CREATE OBJECT wl_ref_container
        EXPORTING
          container_name = w_container.
    ** Create the Grid object
      CREATE OBJECT w_grid
        EXPORTING
          i_parent          = wl_ref_container
        EXCEPTIONS
          error_cntl_create = 1
          error_cntl_init   = 2
          error_cntl_link   = 3
          error_dp_create   = 4
          OTHERS            = 5.
      CHECK sy-subrc = 0.
      PERFORM sub_fill_fcat_delv.
      CALL METHOD w_grid->set_table_for_first_display
        CHANGING
          it_outtab                     = t_likp
          it_fieldcatalog               = t_fcat
        EXCEPTIONS
          invalid_parameter_combination = 1
          program_error                 = 2
          too_many_lines                = 3
          OTHERS                        = 4.
    ENDMODULE.                 " STATUS_9004  OUTPUT
    *&      Form  sub_fill_fcat
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM sub_fill_fcat_sale .
      DATA: wa_fcat TYPE lvc_s_fcat.
      REFRESH t_fcat.
      CLEAR wa_fcat.
      wa_fcat-row_pos   = 1.
      wa_fcat-fieldname = wa_fcat-rollname = 'VBELN'.
      APPEND wa_fcat TO t_fcat.
      CLEAR wa_fcat.
      wa_fcat-row_pos   = 2.
      wa_fcat-fieldname = wa_fcat-rollname = 'VKORG'.
      APPEND wa_fcat TO t_fcat.
      CLEAR wa_fcat.
      wa_fcat-row_pos   = 3.
      wa_fcat-fieldname = wa_fcat-rollname = 'NETWR'.
      APPEND wa_fcat TO t_fcat.
    ENDFORM.                    " sub_fill_fcat
    *&      Form  sub_fill_fcat_delv
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM sub_fill_fcat_delv .
      DATA: wa_fcat TYPE lvc_s_fcat.
      REFRESH t_fcat.
      CLEAR wa_fcat.
      wa_fcat-row_pos   = 1.
      wa_fcat-fieldname = 'VBELN'.
      wa_fcat-rollname  = 'VBELN_VL'.
      APPEND wa_fcat TO t_fcat.
      CLEAR wa_fcat.
      wa_fcat-row_pos   = 2.
      wa_fcat-fieldname = wa_fcat-rollname =  'VKORG'.
      APPEND wa_fcat TO t_fcat.
      CLEAR wa_fcat.
      wa_fcat-row_pos   = 3.
      wa_fcat-fieldname = wa_fcat-rollname =  'VSTEL'.
      APPEND wa_fcat TO t_fcat.
      CLEAR wa_fcat.
      wa_fcat-row_pos   = 4.
      wa_fcat-fieldname = wa_fcat-rollname =  'NETWR'.
      APPEND wa_fcat TO t_fcat.
    ENDFORM.                    " sub_fill_fcat_delv

  • ALV grid output issue to excel

    Hi Experts
    I have an ALV report which I want to Download to Excel( I am using excel 2003).
    When I veiw the report it apperars ok. Their are around 90 columns in the Report
    But when I  export the alv I found that some columns  are on the next line.  Is there any way to resolve this issue
    I want to  export in excel without creating  new rows of columns .
    Thanks
    Vikrant

    Hi,
    please tell your abaper to move  90 fields to intenal table & have a look below code.
    Here my internal table is i_downfinal.
    DATA: FULLPATH      TYPE STRING,
           FILENAME         TYPE STRING,
           PATH             TYPE STRING,
            USER_ACTION      TYPE I.
       encoding         TYPE ABAP_ENCODING.
        CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_SAVE_DIALOG
          EXPORTING
            WINDOW_TITLE         = 'File Download'
            DEFAULT_FILE_NAME    = 'C:\TEMP\zpmcs.xls'
            WITH_ENCODING        = 'X'
          CHANGING
            FILENAME             = FILENAME
            PATH                 = PATH
            FULLPATH             = FULLPATH
            USER_ACTION          = USER_ACTION
         FILE_ENCODING        = encoding
          EXCEPTIONS
            CNTL_ERROR           = 1
            ERROR_NO_GUI         = 2
            NOT_SUPPORTED_BY_GUI = 3
            OTHERS               = 4.
        IF SY-SUBRC <> 0.
          EXIT.
        ENDIF.
        IF USER_ACTION <> CL_GUI_FRONTEND_SERVICES=>ACTION_OK.
          EXIT.
        ENDIF.
        CALL FUNCTION 'GUI_DOWNLOAD'
          EXPORTING
            FILENAME                = FULLPATH
            FILETYPE                = 'DAT'
          TABLES
            DATA_TAB                = I_DOWNFINAL
          EXCEPTIONS
            FILE_WRITE_ERROR        = 1
            NO_BATCH                = 2
            GUI_REFUSE_FILETRANSFER = 3
            INVALID_TYPE            = 4
            NO_AUTHORITY            = 5
            UNKNOWN_ERROR           = 6
            HEADER_NOT_ALLOWED      = 7
            SEPARATOR_NOT_ALLOWED   = 8
            FILESIZE_NOT_ALLOWED    = 9
            HEADER_TOO_LONG         = 10
            DP_ERROR_CREATE         = 11
            DP_ERROR_SEND           = 12
            DP_ERROR_WRITE          = 13
            UNKNOWN_DP_ERROR        = 14
            ACCESS_DENIED           = 15
            DP_OUT_OF_MEMORY        = 16
            DISK_FULL               = 17
            DP_TIMEOUT              = 18
            FILE_NOT_FOUND          = 19
            DATAPROVIDER_EXCEPTION  = 20
            CONTROL_FLUSH_ERROR     = 21
            OTHERS                  = 22.
        IF SY-SUBRC <> 0.
          MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                  WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.

  • Regarding ALV ( To be displayed in Tree Format)

    Hi all,
    I am working on a ALV report which is to be displayed in Tree Structure . I found some demo programs within SAP .. but do we have an Alternative .. all those Demos use  OOPS concept .. Can this Report be done without using OOPS in ALV.
    Please Suggest.
    Thanks & Regards
    Srinivas

    Hi,
    This is a ALV Report with tree structure.
    report  zwmr_pick_status_report no standard page heading
                                    message-id zw.
    Type Pools                                                           *
    type-pools: icon, slis.
    Tables                                                               *
    tables: tvst,
            likp,
            t30b,
            vekp,
            zpallettr,
            zvantr.
    Types                                                                *
    types:
      begin of ty_data,
         lgtor       like likp-lgtor,             " door
         vbeln       like likp-vbeln,             " delivery
         wbstk       like vbuk-wbstk,             " Goods movement status
         kostk       like vbuk-kostk,             " Picking status
         posnr       like lips-posnr,             " item
         route       like likp-route,             " route
         wadat       like likp-wadat,             " goods issue date
         lvsta       like vbup-lvsta,             " warehouse status
         packvorschr like vekp-packvorschr,       " pack mnemonic
         exidv       like vekp-exidv,             " handling unit
         zpallet_no(10),  "like zpallettr-zpallet_no,   " pallet no
         zcount_check like zpallettr-zcount_check," count check flag
         zvan_no(10),     "like zvantr-zvan_no,         " van no
         zvan_print  like zvantr-zvan_print,      " van manifest print
         zeod_print  like zvantr-zeod_print,      " eod manifest print
         zzpackclass like vekp-zzpackclass,       " package class
         zzti        like vekp-zzti,              " T.I. value
      end of ty_data.
    Data                                                                 *
    ranges: r_del   for likp-vbeln,
            r_lgtor for likp-lgtor.
    ranges: r_vanno for zvantr-zvan_no,
            r_palno for zpallettr-zpallet_no.
    data: begin of number_range occurs 0,
             mark(1),
             id(3),
             num(10) type n,
             desc like zpalletmd-zdesc,
          end of number_range.
    data: t_disp_tab  type standard table of zpickdisp,
          t_data_tab  type ty_data  occurs 0 with header line,
          t_disp_head type standard table of zpickhead.
    data: w_numrnge like number_range,
          w_number(10) type n.
    data: t_likp     like likp      occurs 0 with header line,
          t_lips     like lips      occurs 0 with header line,
          t_vbuk     like vbuk      occurs 0 with header line,
          t_vbup     like vbup      occurs 0 with header line,
          t_vepo     like vepo      occurs 0 with header line,
          t_vekp     like vekp      occurs 0 with header line,
          t_vantr    like zvantr    occurs 0 with header line,
          t_pallettr like zpallettr occurs 0 with header line,
          w_likp     like likp,
          w_lips     like lips,
          w_vbuk     like vbuk,
          w_vbup     like vbup,
          w_vepo     like vepo,
          w_vekp     like vekp.
    ALV DATA *****
    data:
         g_grid             type ref to cl_gui_alv_grid,
         g_sort             type slis_t_sortinfo_alv,
         g_custom_container type ref to cl_gui_custom_container,
         g_layout           type slis_layout_alv,
         gt_fieldcat        type slis_t_fieldcat_alv,
         t_fldcat           like line of gt_fieldcat,
         g_keyinfo          type slis_keyinfo_alv,
         gt_events          type slis_t_event,
         gs_event           type slis_alv_event,
         w_sy_repid         like sy-repid.
    data: begin of seltab occurs 0.
            include structure rsparams.
    data: end of seltab.
    SYSTEM GENERATED TABLE CONTROL DATA ********
    DECLARATION OF TABLECONTROL 'TC_TABCON' ITSELF
    controls: tc_tabcon type tableview using screen 0100.
    LINES OF TABLECONTROL 'TC_TABCON'
    data:     g_tc_tabcon_lines  like sy-loopc.
    data:     ok_code like sy-ucomm.
    Constants                                                            *
    constants: c_data_class like klah-class value 'DG_DATA',
               c_mat_class  like rmclf-klart value '001',
               c_pack       like lips-mtart value 'VERP',
               c_a(1)            value 'A',
               c_b(1)            value 'B',
               c_c(1)            value 'C',
               c_yes(1)          value 'X',
               c_no(1)           value ' '.
    Selection screen                                                     *
    standard report select options block
    selection-screen begin of block a with frame title text-002.
    select-options:
      s_wadat for likp-wadat no-extension obligatory.  " Goods Issue Date
    *parameters:                                           "TR01-
    p_vstel like tvst-vstel obligatory. " Shipping Point "TR01-
    select-options:                                             "TR01+
      p_vstel for tvst-vstel.            " Shipping Point  "TR01+
    select-options:
      s_lfart for likp-lfart,            " Delivery type
      s_lgtor for t30b-lgtor,            " Door selection
      s_exidv for vekp-exidv,            " Handling Unit
      s_vbeln for likp-vbeln.            " Delivery
    parameters:
      p_exdata as checkbox.              " Show extra columns flag
    selection-screen end of block a.
    van/pallet specific select options block
    selection-screen begin of block b with frame title text-001.
    select-options:
      s_palno for zpallettr-zpallet_no, " no-extension,
      s_vanno for zvantr-zvan_no.       " no-extension.
    selection-screen end of block b.
    Value Request Events                                                 *
    at selection-screen on value-request for s_palno-low.
      clear: number_range, w_number .
      refresh number_range.
    select numbers and display pop up screen for selection
      perform select_pal_nos.
      s_palno-low = w_number.
    at selection-screen on value-request for s_palno-high.
      clear: number_range, w_number .
      refresh number_range.
    select numbers and display pop up screen for selection
      perform select_pal_nos.
      s_palno-high = w_number.
    at selection-screen on value-request for s_vanno-low.
      clear: number_range, w_number .
      refresh number_range.
    select numbers and display pop up screen for selection
      perform select_van_nos.
      s_vanno-low = w_number.
    at selection-screen on value-request for s_vanno-high.
      clear: number_range, w_number .
      refresh number_range.
    select numbers and display pop up screen for selection
      perform select_van_nos.
      s_vanno-high = w_number.
    At Selection Screen                                                  *
    at selection-screen.
      perform validate_selections.
    Initialization                                                       *
    initialization.
    Start of selection                                                   *
    start-of-selection.
    clear all data tables
      clear: t_likp,
             t_lips,
             t_vbuk,
             t_vbup,
             t_vepo,
             t_vantr,
             t_pallettr,
             w_likp,
             w_lips,
             w_vbuk,
             w_vbup,
             w_vepo,
             w_vekp.
      refresh: t_likp,
               t_lips,
               t_vbuk,
               t_vbup,
               t_vepo,
               t_vantr,
               t_pallettr.
    select data for ALV
    due to different input parameters being used, to streamline the data
    selection process, different selection methods are required
      if not s_vanno is initial
      or not s_palno is initial.
      if selecting by van/pallet number, need to select the data from the
      handling unit upwards to delivery
        perform select_data_up.
      else.
      otherwise the data can be selected from the delivery downwards
        perform select_data_down.
      endif.
    End of selection                                                     *
    end-of-selection.
    call hierarchical ALV display function module
      call function 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'
           exporting
                i_callback_program       = 'ZWMR_PICK_STATUS_REPORT'
                i_callback_pf_status_set = 'SET_STATUS'
                i_callback_user_command =
                   'USER_COMMAND' "custom gui status form
                is_layout                = g_layout  "user command form
                it_fieldcat              = gt_fieldcat
                it_sort                  = g_sort
                it_events                = gt_events
                i_tabname_header         = 't_disp_head'
                i_tabname_item           = 't_disp_tab'
                i_structure_name_header  = 'ZPICKHEAD'
                i_structure_name_item    = 'ZPICKDISP'
                is_keyinfo               = g_keyinfo
           tables
                t_outtab_header          = t_disp_head
                t_outtab_item            = t_disp_tab.
      if sy-subrc <> 0.
        message id sy-msgid type sy-msgty number sy-msgno
                with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      endif.
                                FORMS                                    *
    Includes inserted by Screen Painter Wizard. DO NOT CHANGE THIS LINE!
      include zwmr_pick_status_reporto01 .
      include zwmr_pick_status_reporti01 .
      include zwmr_pick_status_reportf01 .
    *&      Form  select_pal_nos
          select pallet numbers for search help
    form select_pal_nos.
      data: begin of t_palno occurs 0,
              zpallet_no like zpallettr-zpallet_no,
            end of t_palno.
    select all available pallet numbers
      select distinct zpallet_no from zpallettr
                      into corresponding fields of table t_palno.
      loop at t_palno.
      get pallet id
        select single zpallet_id from zpallettr
                      into number_range-id
                      where zpallet_no = t_palno-zpallet_no.
      get pallet description
        select single zdesc from zpalletmd
                      into number_range-desc
                      where zpallet_id = number_range-id.
        number_range-num = t_palno-zpallet_no.
      append to search help table
        append number_range.
      endloop.
    call pop up dialog box
      call screen 0100 starting at 5 5.
    endform.                    " select_pal_nos
    *&      Form  select_van_nos
          select van numbers for search help
    form select_van_nos.
      data: begin of t_vanno occurs 0,
              zvan_no like zvantr-zvan_no,
            end of t_vanno.
    select available van numbers
      select distinct zvan_no from zvantr
                      into corresponding fields of table t_vanno.
      loop at t_vanno.
      select van id
        select single zvan_id from zvantr
                      into number_range-id
                      where zvan_no = t_vanno-zvan_no.
      select van description (maintained in pallet tables)
        select single zdesc from zpalletmd
                      into number_range-desc
                      where zpallet_id = number_range-id.
        number_range-num = t_vanno-zvan_no.
      append to search help table
        append number_range.
      endloop.
    call pop up dialog box
      call screen 0100 starting at 5 5.
    endform.                    " select_van_nos
    *&      Form  select_data_down
          select data if selecting from delivery down
    form select_data_down.
    select all deliveries from LIKP that fulfill selection criteria
      select * from likp into table t_likp
                         where vbeln in s_vbeln
                       and   vstel eq p_vstel                 "TR01-
                         and   vstel in p_vstel
                         and   lgtor in s_lgtor
                         and   wadat in s_wadat
                         and   lfart in s_lfart.
      if sy-subrc ne 0.
      no data found
        message i007.
        exit.
      endif.
      if not t_likp[] is initial.
      select sales document headers from VBUK
        select * from vbuk into table t_vbuk
                      for all entries in t_likp
                      where vbeln eq t_likp-vbeln.
      select all relevant delivery items from LIPS
        select * from lips into table t_lips
                      for all entries in t_likp
                      where vbeln eq t_likp-vbeln
                      and   pstyv ne 'ZPAC'
                      and   pstyv ne 'ZGDP'                     "TR02+
                      and   lfimg gt 0.                         "TR01+
      endif.
      if not t_lips[] is initial.
      select all sales document line items from VBUP
        select * from vbup into table t_vbup
                      for all entries in t_lips
                      where vbeln eq t_lips-vbeln
                      and   posnr = t_lips-posnr.
      select corresponding handling unit ID's (venum)
    TR03 Replace start
       select * from vepo appending corresponding fields of table t_vepo
                     for all entries in t_lips
                     where vbeln = t_lips-vbeln
                     and   posnr = t_lips-posnr
                     and   matnr = t_lips-matnr
                     and   charg = t_lips-charg.
        select * from vepo
                      inner join vekp on vepovenum = vekpvenum
                      appending corresponding fields of table t_vepo
                      for all entries in t_lips
                      where vepo~vbeln = t_lips-vbeln
                      and   vepo~posnr = t_lips-posnr
                      and   vepo~matnr = t_lips-matnr
                      and   vepo~charg = t_lips-charg
                      and   vekp~exidv in s_exidv.
    TR03 Replace end
      endif.
    build process table
      perform move_to_table.
    endform.   "select_data_down
    *&      Form  select_data_up
          select data if selecting from van/pallet up
    form select_data_up.
      if not s_vanno is initial.
      if van then select van numbers and hence pallet numbers
        select * from zvantr into table t_vantr
                              where zvan_no in s_vanno.
                            and   vstel   eq p_vstel."TR01-
        if not t_vantr[] is initial.
          select * from zpallettr into table t_pallettr
                                  for all entries in t_vantr
                                  where zpallet_no eq t_vantr-zpallet_no.
                                and   vstel      eq p_vstel."TR01-
        endif.
      else.
      otherwise can get pallet numbers directly
        select * from zpallettr into table t_pallettr
                                where zpallet_no in s_palno.
                              and   vstel      eq p_vstel."TR01-
      endif.
      if not t_pallettr[] is initial.
      from the pallet nos. we can select the handling units
        select * from vekp into table t_vekp
                           for all entries in t_pallettr
                           where exidv eq t_pallettr-exidv
                           and   exidv ne space
                           and   exidv in s_exidv               "TR03+
                           and ( exida = 'E'                    "TR01+
                           or    exida = 'F' ).                 "TR01+
      endif.
      if not t_vekp[] is initial.
      build vbeln range from t_vekp.
        loop at t_vekp.
          r_del-sign = 'I'.
          r_del-option = 'EQ'.
          r_del-low = t_vekp-vpobjkey.
          append r_del.
        endloop.
      select all deliveries from LIKP that correspond to HU's
        select * from likp into table t_likp
                           where vbeln in r_del
                           and   wadat in s_wadat
                           and   lfart in s_lfart.
      endif.
      if not t_likp[] is initial.
      select sales document headers from VBUK
        select * from vbuk into table t_vbuk
                      for all entries in t_likp
                      where vbeln eq t_likp-vbeln.
      select all relevant delivery items from LIPS
        select * from lips into table t_lips
                      for all entries in t_likp
                      where vbeln eq t_likp-vbeln
                      and   pstyv ne 'ZPAC'
                      and   pstyv ne 'ZGDP'                     "TR02+
                      and   lfimg gt 0.                         "TR01+
      endif.
      if not t_lips[] is initial.
      select all sales document line items from VBUP
        select * from vbup into table t_vbup
                      for all entries in t_lips
                      where vbeln eq t_lips-vbeln
                      and   posnr = t_lips-posnr.
      select corresponding handling unit ID's (venum)
        select * from vepo appending corresponding fields of table t_vepo
                      for all entries in t_lips
                      where vbeln = t_lips-vbeln
                      and   posnr = t_lips-posnr
                      and   matnr = t_lips-matnr
                      and   charg = t_lips-charg.
      endif.
    build process table
      perform move_to_table.
    endform.   "select_data_up
    *&      Form  move_to_table
          move data to processing table
    form move_to_table.
      loop at t_vepo.
        clear t_data_tab.
      delivery lines.
        clear w_lips.
        read table t_lips with key vbeln = t_vepo-vbeln
                                   posnr = t_vepo-posnr
                                   into w_lips.
        move-corresponding w_lips to t_data_tab.
      sales document line items
        clear w_vbup.
        read table t_vbup with key vbeln = t_vepo-vbeln
                                   posnr = t_vepo-posnr
                                   into w_vbup.
      if w_vbup-kosta = space.                   "TR01-
        not relevant for picking
        delete t_vepo.                           "TR01-
        continue.                                "TR01-
      else.                                      "TR01-
        move-corresponding w_vbup to t_data_tab.
      endif.                                     "TR01-
      sales doc header
        clear w_vbuk.
        read table t_vbuk with key vbeln = t_vepo-vbeln
                               into w_vbuk.
        move-corresponding w_vbuk to t_data_tab.
      delivery header
        clear w_likp.
        read table t_likp with key vbeln = t_vepo-vbeln
                               into w_likp.
        move-corresponding w_likp to t_data_tab.
      select handling unit info using vepo entry
        clear w_vekp.
        if t_vekp[] is initial.
          select single * from vekp into w_vekp
                                    where venum = t_vepo-venum.
        else.
          read table t_vekp with key venum = t_vepo-venum
                                     into w_vekp.
          if sy-subrc ne 0.
            select single * from vekp into w_vekp
                            where venum = t_vepo-venum.
          endif.
        endif.
        move-corresponding w_vekp to t_data_tab.
      select pallet / van load information
        select single zpallet_no zcount_check from zpallettr
                                 into (t_data_tab-zpallet_no,
                                       t_data_tab-zcount_check)
                                 where exidv eq w_vekp-exidv.
        if not t_data_tab-zpallet_no in s_palno.                "TR01+
          continue.                                             "TR01+
        endif.                                                  "TR01+
        if sy-subrc = 0.
          select single zvan_no zvan_print zeod_print from zvantr
                        into (t_data_tab-zvan_no,
                              t_data_tab-zvan_print,
                              t_data_tab-zeod_print)
                        where zpallet_no eq t_data_tab-zpallet_no.
          if not t_data_tab-zvan_no in s_vanno.                 "TR01+
            continue.                                           "TR01+
          endif.                                                "TR01+
        endif.
        append t_data_tab.
      endloop.
    *-----> TR01+ start
    If the delivery has yet to be packed, then need to include in report
    Thus delete t_lips here and if any entries left after looping through
    t_vepo, these will also need to be added to t_data_tab
    if the selection is by handling unit though we do not want these"TR03+
      if s_exidv is initial.                                          "TR03+
        loop at t_vepo.
          read table t_lips with key vbeln = t_vepo-vbeln
                                     posnr = t_vepo-posnr.
          if sy-subrc = 0.
            delete t_lips index sy-tabix.
          endif.
        endloop.
        if not t_lips[] is initial.
      move any unpacked items to the data table
          perform move_lips_to_table.
        endif.
      endif.                                                          "TR03+
    *<---- TR01+ End
    get relevant status icons
      perform select_icons.
    prepare ALV data
      perform prepare_alv.
    endform.                    " select_data
    *&      Form  select_icons
          select icons for display and move data to display table
    form select_icons.
      data: w_disp_tab like zpickdisp,
            w_disp_head like zpickhead,
            w_color like zpickdisp-color,
            ov_icon like zpickdisp-ov_icon,
            gi_icon like zpickdisp-gi_icon,
            to_icon like zpickdisp-to_icon,
            lp_icon like zpickdisp-lp_icon,
            pc_icon like zpickdisp-pc_icon,
            lv_icon like zpickdisp-lv_icon,
            vm_icon like zpickdisp-vm_icon,
            em_icon like zpickdisp-em_icon,
            t_ovst_tab like t_disp_tab with header line.
      constants: c_col1(3) value 'C10',
                 c_col2(3) value 'C20'.
      sort t_data_tab by lgtor vbeln.
      w_color = c_col2.
      loop at t_data_tab.
        at new lgtor.
        fill ALV header table
          clear w_disp_head.
          w_disp_head-lgtor = t_data_tab-lgtor.
          append w_disp_head to t_disp_head.
        endat.
      goods issue status & overall amber/green only
        case t_data_tab-wbstk.
          when c_c.
            move icon_green_light to gi_icon.
            move icon_green_light to ov_icon.
          when others.
            move icon_red_light to gi_icon.
            move icon_yellow_light to ov_icon.
        endcase.
      transfer order status
        case t_data_tab-lvsta.
          when c_a.
            move icon_red_light to to_icon.
          when c_b.
            move icon_yellow_light to to_icon.
          when c_c.
            move icon_green_light to to_icon.
          when space.
          write N/A
            to_icon = 'N/A'.
        endcase.
      loaded to pallet status
        if not t_data_tab-zpallet_no is initial.
          move icon_green_light to lp_icon.
        else.
          move icon_red_light to lp_icon.
        endif.
      pallet count status
        if not t_data_tab-zcount_check is initial.
          move icon_green_light to pc_icon.
        else.
          move icon_red_light to pc_icon.
        endif.
      loaded to van status
        if not t_data_tab-zvan_no is initial.
          move icon_green_light to lv_icon.
        else.
          move icon_red_light to lv_icon.
        endif.
      van manifest status
        if not t_data_tab-zvan_print is initial.
          move icon_green_light to vm_icon.
        else.
          move icon_red_light to vm_icon.
        endif.
      end of day manifest status
        if not t_data_tab-zeod_print is initial.
          move icon_green_light to em_icon.
        else.
          move icon_red_light to em_icon.
        endif.
      move working data table to display table
        move-corresponding t_data_tab to w_disp_tab.
        w_disp_tab-ov_icon = ov_icon.
        w_disp_tab-gi_icon = gi_icon.
        w_disp_tab-to_icon = to_icon.
        w_disp_tab-lp_icon = lp_icon.
        w_disp_tab-pc_icon = pc_icon.
        w_disp_tab-lv_icon = lv_icon.
        w_disp_tab-vm_icon = vm_icon.
        w_disp_tab-em_icon = em_icon.
        w_disp_tab-color = w_color.
      fill N/A values for initial fields for display
        if w_disp_tab-packvorschr is initial.
          w_disp_tab-packvorschr = 'N/A'.
        endif.
        if w_disp_tab-exidv is initial.
          w_disp_tab-exidv = 'N/A'.
        endif.
        if w_disp_tab-zpallet_no is initial.
          write 'N/A' to w_disp_tab-zpallet_no.
        endif.
        if w_disp_tab-zvan_no is initial.
          write 'N/A' to w_disp_tab-zvan_no.
        endif.
      display different color for new doc number
        at end of vbeln.
          if w_color = c_col1.
            w_color = c_col2.
          elseif w_color = c_col2.
            w_color = c_col1.
          endif.
        endat.
        append w_disp_tab to t_disp_tab.
        clear w_disp_tab.
      endloop.
    we have all the icons in display but need to check the overall status
    as this refers to the line items
    green and amber statuses already set and use the same criteria as the
    goods issue status unless detected as red here
      data: ov_stat_red(1).
      clear w_disp_tab.
      sort t_disp_tab by vbeln.
      loop at t_disp_tab into w_disp_tab.
        at new vbeln.
        check all line items for delivery
          loop at t_data_tab where vbeln = w_disp_tab-vbeln.
            if t_data_tab-lvsta = c_a.
            set overall status to red
              ov_stat_red = c_yes.
              exit.
            else.
            leave green/amber status icon as previosly determined
            endif.
          endloop.
          if ov_stat_red = c_yes.
          set overall status to red for all items in that delivery
            clear ov_stat_red.
            move icon_red_light to w_disp_tab-ov_icon.
            modify t_disp_tab from w_disp_tab transporting ov_icon
                              where vbeln = w_disp_tab-vbeln.
          endif.
        endat.
      endloop.
    endform.                    " select_icons
    *&      Form  fill_layout
          fill ALV layout parameters
    form fill_layout.
      clear g_layout.
      g_layout-colwidth_optimize = c_yes.   " column width optimisation
      g_layout-zebra = space.               " alternate line colors
      g_layout-box_fieldname = 'MARK'.      " checkbox fieldname
      g_layout-info_fieldname = 'COLOR'.    " highlight row indicator
      g_layout-no_vline = space.            " vertical line
      g_layout-key_hotspot = space.         " hotspot field
      g_layout-f2code = 'PICK'.             " F2 ok_code
      g_layout-numc_sum = c_yes.            " sum numc fields
      g_layout-box_tabname = 't_disp_head'. " checkbox table name
      g_layout-expand_fieldname = 'EXPAND'. " expand field name
    endform.                    " fill_layout
    *&      Form  fill_sort
          fill ALV sort table
    form fill_sort.
      data: w_g_sort type slis_sortinfo_alv.
      w_g_sort-spos      = 1.
      w_g_sort-fieldname = 'LGTOR'.
      w_g_sort-tabname   = 't_disp_tab'.
      w_g_sort-up        = c_yes.
      append w_g_sort to g_sort.
      w_g_sort-spos      = 2.
      w_g_sort-fieldname = 'VBELN'.
      w_g_sort-tabname   = 't_disp_tab'.
      w_g_sort-up        = c_yes.
      append w_g_sort to g_sort.
      w_g_sort-spos      = 3.
      w_g_sort-fieldname = 'POSNR'.
      w_g_sort-tabname   = 't_disp_tab'.
      w_g_sort-up        = c_yes.
      append w_g_sort to g_sort.
      w_g_sort-spos      = 4.
      w_g_sort-fieldname = 'WADAT'.
      w_g_sort-tabname   = 't_disp_tab'.
      w_g_sort-up        = c_yes.
      append w_g_sort to g_sort.
    endform.                    " fill_sort
    *&      Form  fill_fieldcat
          Fill field category structure for ALV
    form fill_fieldcat.
      clear t_fldcat.
    create field catalogue for header table
      call function 'REUSE_ALV_FIELDCATALOG_MERGE'
           exporting
                i_program_name         = 'ZWMR_PICK_STATUS_REPORT'
                i_internal_tabname     = 't_disp_head'
                i_structure_name       = 'ZPICKHEAD'
                i_client_never_display = c_yes
           changing
                ct_fieldcat            = gt_fieldcat[].
      if sy-subrc <> 0.
        message id sy-msgid type sy-msgty number sy-msgno
                with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      endif.
    ceate field catalogue for items table
      call function 'REUSE_ALV_FIELDCATALOG_MERGE'
           exporting
                i_program_name         = 'ZWMR_PICK_STATUS_REPORT'
                i_internal_tabname     = 't_disp_tab'
                i_structure_name       = 'ZPICKDISP'
                i_client_never_display = c_yes
           changing
                ct_fieldcat            = gt_fieldcat[].
      if sy-subrc <> 0.
        message id sy-msgid type sy-msgty number sy-msgno
                with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      endif.
    modify field catalogue for this report
    set no display flag if not requested on selection screen
      if p_exdata ne c_yes.
        t_fldcat-no_out    =  c_yes.
        modify gt_fieldcat from t_fldcat transporting no_out
                           where fieldname eq 'PACKVORSCHR'
                           or    fieldname eq 'EXIDV'
                           or    fieldname eq 'ZPALLET_NO'
                           or    fieldname eq 'ZVAN_NO'
                           or    fieldname eq 'ZZPACKCLASS'
                           or    fieldname eq 'ZZTI'.
      endif.
    set no display flag for item level LGTOR field
      t_fldcat-no_out    =  c_yes.
      modify gt_fieldcat from t_fldcat transporting no_out
                         where fieldname eq 'LGTOR'
                         and   tabname   eq 't_disp_tab'.
    prevent display of technical fields
      t_fldcat-tech = c_yes.
      modify gt_fieldcat from t_fldcat transporting tech
                         where fieldname eq 'EXPAND'
                         or    fieldname eq 'SELKZ'.
    set vbeln as key
      t_fldcat-key = c_yes.
      modify gt_fieldcat from t_fldcat transporting key
                         where fieldname eq 'VBELN'.
    prevent scrolling for info fields
      t_fldcat-fix_column = c_yes.
      modify gt_fieldcat from t_fldcat transporting fix_column
                         where fieldname eq 'VBELN'.
    endform.                    " fill_fieldcat
    *&      Form  prepare_ALV
          Fill ALV parameters
    form prepare_alv.
    fill ALV key info
      g_keyinfo-header01 = 'LGTOR'.
      g_keyinfo-item01   = 'LGTOR'.
    fill ALV events
      gs_event-name = 'TOP_OF_PAGE'.
      gs_event-form = 'TOP_OF_PAGE'.
      append gs_event to gt_events.
    fill ALV sort table
      perform fill_sort.
    fill ALV layout structure
      perform fill_layout.
    fill ALV field category
      perform fill_fieldcat.
    endform.                    " prepare_ALV
    *&      Form  user_command
          form called on user command from ALV list
    form user_command using r_ucomm     like sy-ucomm
                            rs_selfield type slis_selfield.
      data: index type i,
            w_disp_head like line of t_disp_head,
            w_door like likp-lgtor.
      clear r_lgtor. refresh r_lgtor.
      case r_ucomm.
        when 'PICK'. " Double click line
        when 'VANM'. " Van Manifest button
        read the header table where has been selected
          loop at t_disp_head into w_disp_head where mark = c_yes.
            r_lgtor-sign   = 'I'.
            r_lgtor-option = 'EQ'.
            r_lgtor-low    = w_disp_head-lgtor.
            append r_lgtor.
          endloop.
        print the van manifest
          perform print_van_manifest tables r_lgtor.
        when 'EODM'. " EOD Manifest button
        read the header table where has been selected
          loop at t_disp_head into w_disp_head where mark = c_yes.
            r_lgtor-sign   = 'I'.
            r_lgtor-option = 'EQ'.
            r_lgtor-low    = w_disp_head-lgtor.
            append r_lgtor.
          endloop.
        print the end of day manifest
          perform print_eod_manifest tables r_lgtor.
        when 'REFR'. "Refresh
        refresh display
          w_sy_repid = sy-repid.
          call function 'RS_REFRESH_FROM_SELECTOPTIONS'
               exporting
                    curr_report     = w_sy_repid
               tables
                    selection_table = seltab.
              exceptions
                  not_found       = 1
                  no_report       = 2
                  others          = 3.
          if sy-

  • Remove buttons in ALV grid display in ABAP Web Dynpro

    Hi,
    Sub: ALV grid-->Web Dynpro ABAP.
    Request guidance to prevent display of the buttons "Microsoft Excel" and "Print Version" (which provide options to export the ALV grid output into an Excel format document).
    Is there a way we could hide this from being displayed on the ALV grid in a Web dynpro ABAP component output?
    Thanks very much.
    Best Regards,
    Adi

    Hi Adithya,
    really simple solution is to call cl_salv_wd_model_table_util=>if_salv_wd_table_util_stdfuncs=>set_all( abap_false ). This deactivates all ALV functionality.
    For individual setting cl_salv_wd_config_table if_salv_wd_standard_functions~set_<x>_allowed.
    - Michelle

  • Want to export output of alv grid to excel automatically

    hi friends.............
      i want to export output of alv grid without displaying on screen to excel file .......................
    how i m able to do it ..............................
    in the same way as after alv grid display click on LOCAL FILE-> SPREADSHEET-> ........................
    plz rply me soon if anyone of u know abt that.................
    thanks allot.............

    actually in output through 'REUSE_ALV_GRID_DISPLAY' some title is also there through TOP_OF_PAGE how can download it also and data table in excel sheet ...................
    actually when an alv output is displayed then some title data  is also displayed in alv grid then we can download it by clicking on icon 'local file--> spreadsheet........and soon ' ..........
    my req. is download it automatically without doing this process and without displaying it on screen......... it means i want to interrupt to alv grid output to only download without displaying it in output screen............
    if u clear my question then reply me.............

  • ALV output to be send to an email in Excel format

    Hi All,
    Now I am sending alv output to email through excel format successfully but my problem is in last coloumn output some times last charectors are missing. Please help me out.
    For example out put is 'Not Approved'. Some times it is displaying correct and some times it is displaying only 'Not'.
    Thanks and Regards,
    Siva.

    hi,
    check this thread for  reference:
    Sending ALV by mail

Maybe you are looking for

  • Working with pop up menus in Dreamweaver CS4

    this is my first time working with pop up menus in CS4 (have built many in previous versions), Adobe says you cannot create the pop up menus due to the new Spry feature - but that you can alter existing menus using the Behaviours panel I have just la

  • SNOW LEOPARD MAIL - INCOMPATIBLE PULGIN

    After i updated to snow leopard its saying ing the mail app (first time ive launched it since update last night) it says: Incompatible Plug-ins Disabled Mail has disabled the following plug-ins: MailUnreadMenu Contact the makers of these plug-ins for

  • Bubble Chart mouse hover issue

    Hi, we are facing problem in removing mouse hover data point in the bubble chart. Requirement is such that we do not want to show a data point in mouse hover in a bubble chart.Since size of bubbles in the chart have been mapped with these values,thes

  • Exchange server 2010 DAG configuration

    Dear Boss, I would like to configure Exchange server 2010 with DAG . I have test lab . i would like to tell my test LAB setup . One domain controller win-2008 X 64 Ent  Two Exchange server 2010  ( Role - Client Access, Mailbox) Each Server  Two Netwo

  • Upgarded Oracle database works incorrect with Turkish Characters

    Hi All, I have upgarded my database from oracle version 7.3 to 8.0.6. My new database in oracle 8.0.6 works incorrect with Turkish Characters, displays incorrect. I tried creating new oracle database in oracle 8.0.6, not upgrading as above, this data