Problems submitting ALV list to spool

Hi!
When sending the ALV list (function module REUSE_ALV_GRID_DISPLAY) to sap-spool, there seems to be a problem with the <b>"Total"</b> lines. When the <b>"Total"</b> line appears on a page break, it's not displayed at all - not at the end of the current page nor at the top of the next page. All the other <b>"Total"</b> lines are displayed correctly, as long as they don't appear on a page break.
Does anyone know how to solve this problem?
- Mari Virik

I have not heard of this.  I would suggest that you search OSS notes for this issue.  Or report the problem directly to SAP through OSS.

Similar Messages

  • Problem with ALV list

    Hi friends,
                  I have created one program with alv list, but i am unable to add one header and footer, also i have to add one logo to the program. Plese some one tell me a easy procedure to add a header, footer and also a logo. If you can show me one with example that would be very helpful.
    This is my program, plz add the necessary parts.
    *& Report Y_BOM2_ALV
    REPORT y_bom2_alv LINE-SIZE 350 LINE-COUNT 350.
    *& Include YINCLUDE1
    TABLES : mast, stko, stpo.
    TYPE-POOLS : slis.
    DATA : BEGIN OF iall OCCURS 10,
    matnr LIKE mast-matnr,
    werks LIKE mast-werks,
    stlan LIKE mast-stlan,
    stlal LIKE mast-stlal,
    stlst LIKE stko-stlst,
    posnr LIKE stpo-posnr,
    idnrk LIKE stpo-idnrk,
    menge LIKE stpo-menge,
    meins LIKE stpo-meins,
    ausch LIKE stpo-ausch,
    lgort LIKE stpo-lgort,
    END OF iall.
    DATA : i_repid LIKE sy-repid,
    i_lines LIKE sy-tabix.
    DATA : int_fcat TYPE slis_t_fieldcat_alv.
    SELECTION-SCREEN BEGIN OF BLOCK a1 WITH FRAME TITLE title1.
    PARAMETER : p_werks LIKE mast-werks.
    SELECT-OPTIONS : s_matnr FOR mast-matnr.
    SELECTION-SCREEN END OF BLOCK a1.
    INITIALIZATION.
    title1(50) = ' Bill Of Material Input Screen '.
    *& Include YINCLUDE2
    START-OF-SELECTION.
    SELECT mastmatnr mastwerks maststlan maststlal stko~stlst
    stpoposnr stpoidnrk stpomenge stpomeins stpo~ausch
    stpo~lgort INTO TABLE iall FROM stpo INNER JOIN stko ON
    stpostlnr = stkostlnr INNER JOIN mast ON
    stpostlnr = maststlnr WHERE mast~werks EQ
    p_werks AND mast~matnr IN s_matnr.
    IF sy-subrc <> 0 OR p_werks EQ ' ' OR s_matnr EQ ' '.
    CALL FUNCTION 'POPUP_TO_DISPLAY_TEXT'
    EXPORTING
    titel = 'ERROR MESSAGE ( INPUT ERROR / WRONG INPUT ) '
    textline1 = ' PLANT / MATERIAL Invalid or Empty '
    textline2 = ' Plese enter plant no / material no again '
    start_column = 20
    start_row = 5.
    EXIT.
    ENDIF.
    CLEAR i_lines.
    DESCRIBE TABLE iall LINES i_lines.
    IF i_lines LT 1.
    WRITE: /
    'No materials found.'.
    EXIT.
    ENDIF.
    END-OF-SELECTION.
    i_repid = sy-repid.
    *& Include YINCLUDE3
    CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
    EXPORTING
    i_program_name = i_repid
    i_internal_tabname = 'IALL'
    i_inclname = i_repid
    CHANGING
    ct_fieldcat = int_fcat
    EXCEPTIONS
    inconsistent_interface = 1
    program_error = 2
    OTHERS = 3.
    IF sy-subrc <> 0.
    WRITE: /
    'Returncode',
    sy-subrc,
    'from FUNCTION REUSE_ALV_FIELDCATALOG_MERGE'.
    ENDIF.
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
    EXPORTING
    i_callback_program = i_repid
    it_fieldcat = int_fcat
    i_save = 'A'
    TABLES
    t_outtab = iall
    EXCEPTIONS
    program_error = 1
    OTHERS = 2.
    IF sy-subrc <> 0.
    WRITE: /
    'Returncode',
    sy-subrc,
    'from FUNCTION REUSE_ALV_LIST_DISPLAY'.
    ENDIF.

    Hi Tapodipta,
    See below example and modify ur code according to ur requirement..
    REPORT  ZTEST_ALV_CHECK        .
    TYPE-POOLS: SLIS.
    DATA: X_FIELDCAT TYPE SLIS_FIELDCAT_ALV,
          IT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
          L_LAYOUT type slis_layout_alv,
          x_events type slis_alv_event,
          it_events type SLIS_T_EVENT.
    DATA: BEGIN OF ITAB OCCURS 0,
          VBELN LIKE VBAK-VBELN,
          POSNR LIKE VBAP-POSNR,
         END OF ITAB.
    SELECT VBELN
           POSNR
           FROM VBAP
           UP TO 20 ROWS
           INTO TABLE ITAB.
    X_FIELDCAT-FIELDNAME = 'VBELN'.
    X_FIELDCAT-SELTEXT_L = 'VBELN'.
    X_FIELDCAT-TABNAME = 'ITAB'.
    X_FIELDCAT-COL_POS = 1.
    APPEND X_FIELDCAT TO IT_FIELDCAT.
    CLEAR X_FIELDCAT.
    X_FIELDCAT-FIELDNAME = 'POSNR'.
    X_FIELDCAT-SELTEXT_L = 'POSNR'.
    X_FIELDCAT-TABNAME = 'ITAB'.
    X_FIELDCAT-COL_POS = 2.
    APPEND X_FIELDCAT TO IT_FIELDCAT.
    CLEAR X_FIELDCAT.
      x_events-NAME = SLIS_EV_END_OF_PAGE.
      x_events-FORM = 'END_OF_PAGE'.
      APPEND x_events  TO iT_EVENTS.
      CLEAR x_events .
      x_events-NAME = SLIS_EV_TOP_OF_PAGE.
      x_events-FORM = 'TOP_OF_PAGE'.
      APPEND x_events  TO iT_EVENTS.
      CLEAR x_events .
      x_events-NAME = slis_ev_end_of_list.
      x_events-FORM = 'END_OF_LIST'.
      APPEND x_events  TO iT_EVENTS.
      CLEAR x_events .
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
      EXPORTING
        I_CALLBACK_PROGRAM       = SY-REPID
        IS_LAYOUT                = L_LAYOUT
        IT_FIELDCAT              = IT_FIELDCAT
        it_events                = it_events
      TABLES
        T_OUTTAB                 = ITAB
      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.
    FORM TOP_OF_PAGE.
    * BREAK-POINT.
      WRITE: / 'TOP_OF_PAGE'.
    ENDFORM.
    FORM END_OF_LIST.
    * BREAK-POINT.
    "here you can use this for footer
      WRITE: / 'FOR FOOTER'.
    ENDFORM.
    FORM END_OF_PAGE.
    * BREAK-POINT.
      WRITE: / 'END_OF_PAGE'.
    ENDFORM.
    Go through the link as well..
    Re: ALV  Footer
    Hope it will solve ur problem..
    <b>Reward points if useful..</b>
    Thanks & Regards
    ilesh 24x7

  • ALV List to spool..

    Hello,
    I need to send the alv list to the spool . The device name is part of my selection screen. I know that i have to pass the value in the structure in the function module REUSE_LIST_DIPSLAY  but where would i pass on the device name and other print parameters?
    Thanks & Regards

    Hi subramaniam,
    My requirement is that the selection screen has the following options as radio buttons
    1) Send to Device
    2) Send to device
    Depending on the choice the report has to be printed.I don't think the user is going to agree to the method that you suggested .
    The selection screen has also an input field for the device name.
    Thanks and regards
    Avirop

  • Problems converting ALV LIST to ALV GRID

    Hey guys
    when i changed the name of the function REUSE_ALV_LIST_DISPLAY to REUSE_ALV_GRID_DISPLAY..in a report..I get the GRID in next page..
    whys is it so??
    like the rpeort has the the ALV to be displayed in END_OF_LIST event...(the report has oen HIERARCHIAL ALV as the main ALV LIST and in the END OF LIST it has another ALV)
    when i change LIST to GRID ...
    the GRID gets itno 2nd page while the rest of the report gets into page 1...
    i want both these in 1st page only

    you can do it with blocks, but the whole thing will be in list mode
    REUSE_ALV_BLOCK_LIST_INIT
    REUSE_ALV_BLOCK_LIST_HS_APPEND (for hierarchical list)
    REUSE_ALV_BLOCK_LIST_APPEND (for simple grid list)
    REUSE_ALV_BLOCK_LIST_DISPLAY

  • Problem with ALV list display

    Hello experts,
    When i call the funcation module for REUSE_ALV_LIST_DISPLAY to display for than 5 field columns , then it gives dump saying field symbol not assigned, but the same thing using REUSE_ALV_GRID_DISPLAY works fine for any number of columns.
    Kindly help how should this be done??

    Hi,
    Here is the code using 'REUSE_ALV_LIST_DISPLAY'
    just check this out...
    tables: mara.
    type-pools:slis.
    data: itab type standard table of mara.
    data: fcat type slis_t_fieldcat_alv.
    data i_repid like sy-repid.
    select * from mara into table itab.
    i_repid = sy-repid.
    CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
    EXPORTING
       I_PROGRAM_NAME               = i_repid
      I_INTERNAL_TABNAME           = 'ITAB'
       I_STRUCTURE_NAME             = 'MARA'
      I_CLIENT_NEVER_DISPLAY       = 'X'
      I_BYPASSING_BUFFER           =
      I_BUFFER_ACTIVE              =
      CHANGING
        ct_fieldcat                  = fcat
    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.
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
    EXPORTING
      I_INTERFACE_CHECK              = ' '
      I_BYPASSING_BUFFER             =
      I_BUFFER_ACTIVE                = ' '
      I_CALLBACK_PROGRAM             = ' '
      I_CALLBACK_PF_STATUS_SET       = ' '
      I_CALLBACK_USER_COMMAND        = ' '
      I_STRUCTURE_NAME               =
      IS_LAYOUT                      =
    IT_FIELDCAT                    = fcat
      IT_EXCLUDING                   =
      IT_SPECIAL_GROUPS              =
      IT_SORT                        =
      IT_FILTER                      =
      IS_SEL_HIDE                    =
      I_DEFAULT                      = 'X'
      I_SAVE                         = ' '
      IS_VARIANT                     =
      IT_EVENTS                      =
      IT_EVENT_EXIT                  =
      IS_PRINT                       =
      IS_REPREP_ID                   =
      I_SCREEN_START_COLUMN          = 0
      I_SCREEN_START_LINE            = 0
      I_SCREEN_END_COLUMN            = 0
      I_SCREEN_END_LINE              = 0
      IR_SALV_LIST_ADAPTER           =
      IT_EXCEPT_QINFO                =
      I_SUPPRESS_EMPTY_DATA          = ABAP_FALSE
    IMPORTING
      E_EXIT_CAUSED_BY_CALLER        =
      ES_EXIT_CAUSED_BY_USER         =
      TABLES
        t_outtab                       = itab.
    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.
    Thanks & Regards
    Ashu Singh

  • ALV List not populating data statistics output in ECC6.0

    Hi,
    I am working in an upgrade upgrade project from 4.6c to ECC6.0.
    4.6c is non-unicode system. ECC6 is Unicode system.
    I am facing one problem in ALV list output in the background job. In 4.6c the data statistics output is displayed as per the screen
    Data statistics
    Number of
    Records passed
    584
    but this output is not displayed in ECC 6.0.
    I given below the code which we are using in programe 4.6c and ECC6.0
        CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
             EXPORTING
                  i_callback_program = 'ZNHNZLLVL0'
                 i_grid_title       = l_title
                  is_layout          = alv_layout
                  it_fieldcat        = alv_fieldcat
                  i_save             = 'A'
                 is_variant         = stru_disvar
             TABLES
                  t_outtab           = list_table
             EXCEPTIONS
                  program_error      = 1
                  OTHERS             = 2.
    Give your input to solve this issue .
    - Anandakumar.K

    Hi Ganesh,
           this problem is mainly printer problem issue, to resovle this isues you have to do small changes in the print setting.
    Step1) Execute the report in background -> you will get a popup .....where you will give the output device for ex : LOCL
    fruther in the same popup you can see Properties .......click that you can see COVERSHEETs > select coversheets and
    then click SPECIFICATIONS buttons > select int he Fied name A) ALVSELECTIONS B) ALVSTATISTICS one bye bone
    and then change the  Field Default value to YES.... for both the options . Now finally click COPY Settings ...........
    now you again shedule the report again in background ........you can see the result you are expecting.......
    Cheers
    Divya.

  • ALV list display in a Background job - Spool output

    Hi,
    We are currently working on a report scheduled to be run in the background job, and the ALV list is displayed in the spool output.
    ALV list in the spool does not look the same as front run job, the column headers are all crowded together, and there is no grid in-between different columns or rows. It's hard to read.
    Is there a way to add grid for this kind of output?
    Thanks!

    Hi Deepak:
    I expanded your report into two rows display, and the grid in the spool display simply gone!
    report zzscratch line-size 120 no standard page heading.
    type-pools slis.
    tables pa0001.
    data : li_field type standard table of slis_fieldcat_alv,
    gi_events type standard table of slis_alv_event,
    gr_layout_bck type slis_layout_alv,
    gr_save like disvariant,
    gr_events type slis_alv_event.
    types : begin of gtt_emp,
    pernr type persno,
    ename  like pa0001-ename,
    uname  like pa0001-UNAME,
    end of gtt_emp.
    data : lr_field type slis_fieldcat_alv.
    data : lc_rep like syst-repid.
    data : li_emp type standard table of gtt_emp,
    lr_emp type gtt_emp.
    data : gv_ref_table type lvc_rtname.
    gv_ref_table = 'CATSDB'.
    lr_field-fieldname = 'PERNR'.
    lr_field-ref_tabname = gv_ref_table.
    lr_field-inttype = 'N'.
    lr_field-outputlen = 8.
    lr_field-seltext_l = 'EMPLOYEE Number'.
    append lr_field to li_field.
    lr_field-fieldname = 'ENAME'.
    lr_field-ref_tabname = 'PA0001'.
    lr_field-inttype = 'C'.
    lr_field-outputlen = 40.
    lr_field-seltext_l = 'EMPLOYEE Name'.
    append lr_field to li_field.
    lr_field-fieldname = 'UNAME'.
    lr_field-ref_tabname = 'PA0001'.
    lr_field-inttype = 'C'.
    lr_field-outputlen = 12.
    lr_field-seltext_l = 'User Name'.
    lr_field-row_pos = 2.
    lr_field-col_pos = 1.
    append lr_field to li_field.
    lc_rep = sy-repid.
    gr_layout_bck-edit_mode = 'D'.
    gr_save-report = sy-repid.
    lr_emp-pernr = '00000001'.
    lr_emp-ename = 'abc'.
    lr_emp-uname = 'testus'.
    append lr_emp to li_emp.
    lr_emp-pernr = '00000002'.
    lr_emp-ename = 'def'.
    append lr_emp to li_emp.
    lr_emp-pernr = '00000003'.
    append lr_emp to li_emp.
    lr_emp-pernr = '00000004'.
    append lr_emp to li_emp.
    lr_emp-pernr = '00000005'.
    append lr_emp to li_emp.
    lr_emp-pernr = '00000006'.
    append lr_emp to li_emp.
    lr_emp-pernr = '00000007'.
    append lr_emp to li_emp.
    lr_emp-pernr = '00000008'.
    append lr_emp to li_emp.
    end-of-selection.
    Function module for ALV grid display
      call function 'REUSE_ALV_GRID_DISPLAY'
           EXPORTING
                i_buffer_active    = 'X'
                i_callback_program = lc_rep
                is_layout          = gr_layout_bck
                it_fieldcat        = li_field
                i_save             = 'A'
                is_variant         = gr_save
                it_events          = gi_events
           TABLES
                t_outtab           = li_emp[]
           EXCEPTIONS
                program_error      = 1
                others             = 2.
      if sy-subrc <> 0.
    clear gr_messages.
    message e023 into gr_messages.
    append gr_messages to gi_messages.
      endif.

  • Scrolling-problem in an editable ALV-list

    Hi,
    I have built an <b>ALV-list</b> with one of the fields <b>open for input</b>. The user wants to use the arrow to scroll <u>down</u> through the table and update that particular field in every row. I have <b>2</b> questions about this:
    - First of all, the cursor moves in a strange way. The first number of rows it stays in the right column, but then, out of the blue, it jumps back and forth to other columns after scrolling.
    - Secondly, the field I want to edit is always in Insert-mode. Is there any way I can get it into Overwrite-mode? I cannot use the Tab-key, because of the lead-selection.
    Thanks in advance for your help.
    Kind regards,
    Andre Moniharapon

    Hi Vijay,
    please don't get me wrong, I really appreciate your attempts to help me, but my problem is that when I press the Down-arrow it <u>doesn't</u> always go to the next cell in the <i>same</i> column. It sometimes goes to the next cell in <i>another</i> column. And if I can't force it to stay in the same column in some way, than my problem cannot be solved and I must think of another solution. So, I don't want the cursor to stay in the same field, I want it to go to the next cell in the same column. You got that right. Again, I really appreciate your help, but it looks more and more that there's no solution to my problem.
    Kind regards,
    Andre

  • How to send the alv list display to spool

    Hi all,
    I am executing a program in foreground. My requirement is sending alv list output to spool. When i execute the smae program in background mode the SAP is handling the spool output in hierarchial list display. How to get the same output in foreground also.
    Thanks and Regards,
    Vijay.

    Hi max,
    I think my question is not clear.
    when I execute my report in background mode, I can able to see the output in the spool.
    But when I execute the same report in foreground no spool output is getting generated.
    To handle this I am calling some function modules like RSPO_OPEN_SPOOLREQUEST , RSPO_WRITE_SPOOLREQUEST,  RSPO_WRITE_SPOOLREQUEST. But by using this i cannot able to get the desired output in alv list display format. what to do to get my desired output.
    Thanks and Regards,
    Vijay.

  • Multiple ALV lists in a single spool of a job

    Hi All,
    Executing a custom program in background generates 2 lists in two different spools.
    First list  - ALV Grid displayed as ALV list
    Second List - ALV Blocked List.
    Though both the Spool request numbers generated during the execution of the program are displayed in the JOB LOG of the background job,only the latest spool(ALV Blocked List) is saved under this job.
    We should go to Tx:SP01/02 to view the First list(ALV Grid) generated in the first Spool request.
    Can someone tell me how to get both the lists in a single spool request..(Programmatically)
    Or let me know if there is a way to display both the spool numbers in the Spool list of the job in SM37.
    Thanks in advance.
    Hemanth

    Hi Hemanth,
    maybe you can have a look at the function RSPO_INSERT_SPOOL_CONCATENATE. There is a documentation in the function module transaction.
    Regards
    Frédéric

  • Problem with printing ALV lists

    Hey Guys,
    I have a problem with printing ALV lists ,
    I created a report with several ALV lists (not grids) on the same screen but when i attempt to print the report
    it prints each alv list on a different page..so if i have 3 alv lists in the same report it will print the report on 3 pages
    How can i print  them all in one page?
    Thanks in advance
    Noha Salah.

    Hey Max,
    I tried setting the Layout-list_append  before my block_list_append function call
    And setting the is_print-NO_NEW_PAGE , it printed the 3 lists on one page the only problem i have
    is that the lists are truncated and the list formats has totally been messed up..how can i restore them back
    to their original format?

  • Problem  in Printing the ALV list

    Hi,
       I have one problem with printing the ALV list. While printing the ALV list(thro Print Icon on application Tool bar) ,Fist page of my print out contains some other inforamtion.
      inforamtions included two tables
      first table  contains Sort Criteria, Ascdg, Descnd, Subtotal  columns.
      And second table contains Data statistics , number of
    columns.
    But from Second page onwards , my alv list printed correctly .
      How can i avoid the First page inforamtion and
          what is the Reason of coming like this?
    Thanks,
    Neptune.M

    I assume you are using function module Reuse_alv_grid_display or reuse_alv_list_display for ALV.
    If this is the case, there is a parameter called IS_PRINT that you need to supply while calling the function module.
    you can for exapmle declare
    data:
    printstruc type SLIS_PRINT_ALV.
    printstruc-NO_PRINT_LISTINFOS = 'X'.
    call function 'REUSE_ALV_GRID_DISPLAY'
      EXPORTING
    IS_PRINT = printstruc
    There are many other flags in is_print structures that you can use to manipulate the printing.
    Cheers!

  • Problem in Expand when using Blocked ALV list

    Hi All,
    I am using the Blocked list ALV to display two lists in a program. One among them is a hierarchial ALV. When i click on the Expand button of this ALV it terminates with the runtime error "GETWA_NOT_ASSIGNED".
    I was able to use this functionality using similar code in a stand alone hierarchial ALV list in another program without any problem.
    I have assigned the Expand Field name as follows in both programs:
    wa_layout-expand_fieldname  = 'EXPAND'
    Any suggestions or help in this would be highly appreciated.
    Thanks & Reagrds,
    Praveen

    Hai Praveen
    Check the following Code
    *& Report  ZALV_BLOCKLIST                                                *
    REPORT  ZALV_BLOCKLIST NO STANDARD PAGE HEADING
                                  LINE-SIZE 150
                                  LINE-COUNT 60(4)
                                  MESSAGE-ID Z00.
    *..Type Definitions for ALV Report
    TYPE-POOLS SLIS.
    *..Includes
    *for ICONs
    *INCLUDE <ICON>.
    Table/Structure declarations.                                        *
    TABLES:  MARA,
             MARC,
             T134.
    Internal Tables declaration                                          *
    *..To store Basic Report fields
    DATA:BEGIN OF IT_MARA OCCURS 0,
           MATNR LIKE MARA-MATNR,
           MTART LIKE MARA-MTART,
           MATKL LIKE MARA-MATKL,
           MEINS LIKE MARA-MEINS,
           NTGEW LIKE MARA-NTGEW,
         END OF IT_MARA.
    *DATA:BEGIN OF IT_MATKL OCCURS 0,
          MATKL LIKE T023-MATKL,
          WGBEZ LIKE T023-WGBEZ,
        END OF IT_MATKL.
    DATA:BEGIN OF IT_MARC OCCURS 0,
           WERKS LIKE MARC-WERKS,
           LADGR LIKE MARC-LADGR,
           MTVFP LIKE MARC-MTVFP,
           DISPR LIKE MARC-DISPR,
           DISMM LIKE MARC-DISMM,
           DISPO LIKE MARC-DISPO,
         END OF IT_MARC.
    ALV Type declaration                                                 *
    DATA:V_NO_DATA            TYPE C.
    ALV Type declaration                                                 *
    DATA:V_REPID              TYPE SYREPID.
    DATA: IT_FIELDCATALOG_MARA   TYPE SLIS_T_FIELDCAT_ALV,
          WA_FIELDCATALOG_MARA   TYPE SLIS_FIELDCAT_ALV,
          IT_FIELDCATALOG_MARC   TYPE SLIS_T_FIELDCAT_ALV,
          WA_FIELDCATALOG_MARC   TYPE SLIS_FIELDCAT_ALV,
          IT_FIELDCATALOG_MATKL  TYPE SLIS_T_FIELDCAT_ALV,
          WA_FIELDCATALOG_MATKL  TYPE SLIS_FIELDCAT_ALV,
          WA_LAYOUT              TYPE SLIS_LAYOUT_ALV,
          IT_EVENTS              TYPE SLIS_T_EVENT,
          WA_EVENTS              TYPE SLIS_ALV_EVENT,
          WA_KEYINFO             TYPE SLIS_KEYINFO_ALV.
    Selection Screen.                                                    *
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-H01.
    SELECT-OPTIONS: S_MATNR FOR MARA-MATNR ,
                    S_MTART FOR MARA-MTART .
    SELECTION-SCREEN END OF BLOCK B1.
    Event:Initialization                                                 *
    INITIALIZATION.
    *Report Name
      V_REPID = SY-REPID.
    AT Selection Screen.                                                 *
    AT SELECTION-SCREEN.
    Event: Start-of-Selection                                            *
    START-OF-SELECTION.
      PERFORM FETCH_DATA.
    Event: End-of-Selection                                            *
    END-OF-SELECTION.
      IF V_NO_DATA = ''.
        MESSAGE I010 WITH 'NO DATA TO DISPLAY ! '.
        EXIT.
      ELSE.
        PERFORM FILL_FIELDCAT_MARA.
      PERFORM FILL_FIELDCAT_MAKT.
        PERFORM FILL_FIELDCAT_MARC.
        PERFORM FILL_LAYOUT.
        PERFORM CALL_ALV_INIT.
        PERFORM ADD_LISTS.
        PERFORM DISPLAY_BLOCK_LIST.
      ENDIF.
                             FORM DEFINITIONS                            *
    *&      Form  FETCH_DATA
          text
    -->  p1        text
    <--  p2        text
    FORM FETCH_DATA.
      SELECT MATNR
             MTART
             MATKL
             MEINS
             NTGEW
             INTO CORRESPONDING FIELDS OF TABLE IT_MARA
             FROM MARA
             WHERE MATNR IN S_MATNR
               AND MTART IN S_MTART.
      IF SY-SUBRC <> 0.
        V_NO_DATA = ''.
      ELSE.
        V_NO_DATA = 'X'.
        SELECT WERKS
               LADGR
               MTVFP
               DISPR
               DISMM
               DISPO
               INTO CORRESPONDING FIELDS OF TABLE IT_MARC
               FROM MARC
               WHERE MATNR IN S_MATNR.
      ENDIF.
    ENDFORM.                    " FETCH_DATA
    *&      Form  FILL_FIELDCAT_MARA
          text
    -->  p1        text
    <--  p2        text
    FORM FILL_FIELDCAT_MARA.
      CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
        EXPORTING
          I_PROGRAM_NAME               = V_REPID
        I_INTERNAL_TABNAME           =
          I_STRUCTURE_NAME             = 'IT_MARA'
        I_CLIENT_NEVER_DISPLAY       = 'X'
          I_INCLNAME                   =  V_REPID
        I_BYPASSING_BUFFER           =
        I_BUFFER_ACTIVE              =
        CHANGING
          CT_FIELDCAT                  = IT_FIELDCATALOG_MARA
        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.
      LOOP AT IT_FIELDCATALOG_MARA INTO WA_FIELDCATALOG_MARA.
        CASE WA_FIELDCATALOG_MARA-FIELDNAME.
          WHEN 'MATNR'.
            WA_FIELDCATALOG_MARA-COL_POS     = '1'.
            WA_FIELDCATALOG_MARA-OUTPUTLEN   = '15'.
            WA_FIELDCATALOG_MARA-SELTEXT_L   = 'Material NO'.
          WHEN 'MTART'.
            WA_FIELDCATALOG_MARA-COL_POS     = '2'.
            WA_FIELDCATALOG_MARA-OUTPUTLEN   = '15'.
            WA_FIELDCATALOG_MARA-SELTEXT_L   = 'Mat Type'.
          WHEN 'MATKL'.
            WA_FIELDCATALOG_MARA-COL_POS     = '3'.
            WA_FIELDCATALOG_MARA-OUTPUTLEN   = '15'.
            WA_FIELDCATALOG_MARA-SELTEXT_L   = 'Mat Group'.
          WHEN 'MEINS'.
            WA_FIELDCATALOG_MARA-COL_POS     = '4'.
            WA_FIELDCATALOG_MARA-OUTPUTLEN   = '15'.
            WA_FIELDCATALOG_MARA-SELTEXT_L   = 'Measure Unit'.
          WHEN 'NTGEW'.
            WA_FIELDCATALOG_MARA-COL_POS     = '5'.
            WA_FIELDCATALOG_MARA-OUTPUTLEN   = '15'.
            WA_FIELDCATALOG_MARA-SELTEXT_L   = 'Net Wt'.
            WA_FIELDCATALOG_MARA-DO_SUM      = 'X'.
        ENDCASE.
       MODIFY IT_FIELDCATALOG_MARA FROM WA_FIELDCATALOG_MARA INDEX SY-TABIX.
      ENDLOOP.
    ENDFORM.                    " FILL_FIELDCAT_MARA
    *&      Form  FILL_FIELDCAT_MARC
          text
    -->  p1        text
    <--  p2        text
    FORM FILL_FIELDCAT_MARC.
      CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
       EXPORTING
         I_PROGRAM_NAME               = V_REPID
         I_INTERNAL_TABNAME           = 'IT_MARC'
      I_STRUCTURE_NAME             =
      I_CLIENT_NEVER_DISPLAY       = 'X'
         I_INCLNAME                   = V_REPID
      I_BYPASSING_BUFFER           =
      I_BUFFER_ACTIVE              =
        CHANGING
          CT_FIELDCAT                  = IT_FIELDCATALOG_MARC
       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.
      LOOP AT IT_FIELDCATALOG_MARC INTO WA_FIELDCATALOG_MARC.
        CASE WA_FIELDCATALOG_MARC-FIELDNAME.
          WHEN 'WERKS'.
            WA_FIELDCATALOG_MARC-COL_POS     = '1'.
            WA_FIELDCATALOG_MARC-OUTPUTLEN   = '15'.
            WA_FIELDCATALOG_MARC-SELTEXT_L   = 'PLANT NAME'.
          WHEN 'LADGR'.
            WA_FIELDCATALOG_MARC-COL_POS     = '2'.
            WA_FIELDCATALOG_MARC-OUTPUTLEN   = '15'.
            WA_FIELDCATALOG_MARC-SELTEXT_L   = 'Loading Group'.
          WHEN 'MTVFP'.
            WA_FIELDCATALOG_MARC-COL_POS     = '3'.
            WA_FIELDCATALOG_MARC-OUTPUTLEN   = '20'.
            WA_FIELDCATALOG_MARC-SELTEXT_L   = 'Checking group'.
          WHEN 'DISPR'.
            WA_FIELDCATALOG_MARC-COL_POS     = '4'.
            WA_FIELDCATALOG_MARC-OUTPUTLEN   = '15'.
            WA_FIELDCATALOG_MARC-SELTEXT_L   = 'MRP PROFILE'.
          WHEN 'DISMM'.
            WA_FIELDCATALOG_MARC-COL_POS     = '5'.
            WA_FIELDCATALOG_MARC-OUTPUTLEN   = '15'.
            WA_FIELDCATALOG_MARC-SELTEXT_L   = 'MRP TYPE'.
          WHEN 'DISPO'.
            WA_FIELDCATALOG_MARC-COL_POS     = '6'.
            WA_FIELDCATALOG_MARC-OUTPUTLEN   = '15'.
            WA_FIELDCATALOG_MARC-SELTEXT_L   = 'MRP CONTROLLER'.
        ENDCASE.
       MODIFY IT_FIELDCATALOG_MARC FROM WA_FIELDCATALOG_MARC INDEX SY-TABIX.
      ENDLOOP.
    ENDFORM.                    " FILL_FIELDCAT_MARC
    *&      Form  FILL_FIELDCAT_MAKT
          text
    -->  p1        text
    <--  p2        text
    FORM FILL_FIELDCAT_MAKT.
    ENDFORM.                    " FILL_FIELDCAT_MAKT
    *&      Form  CALL_ALV_INIT
          text
    -->  p1        text
    <--  p2        text
    FORM CALL_ALV_INIT.
      CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_INIT'
        EXPORTING
          I_CALLBACK_PROGRAM             = V_REPID
      I_CALLBACK_PF_STATUS_SET       = ' '
      I_CALLBACK_USER_COMMAND        = ' '
      IT_EXCLUDING                   =
    ENDFORM.                    " CALL_ALV_INIT
    *&      Form  ADD_LISTS
          text
    -->  p1        text
    <--  p2        text
    FORM ADD_LISTS.
    *ADD IT_MARA TABLE TO THE OUTPUT
      CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
        EXPORTING
          IS_LAYOUT                        = WA_LAYOUT
          IT_FIELDCAT                      = IT_FIELDCATALOG_MARA
          I_TABNAME                        = 'IT_MARA'
          IT_EVENTS                        = IT_EVENTS
      IT_SORT                          =
      I_TEXT                           = ' '
        TABLES
          T_OUTTAB                         = IT_MARA
       EXCEPTIONS
         PROGRAM_ERROR                    = 1
         MAXIMUM_OF_APPENDS_REACHED       = 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.
    **ADD IT_MARC TABLE TO THE OUTPUT
    CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
      EXPORTING
        IS_LAYOUT                        = WA_LAYOUT
        IT_FIELDCAT                      = IT_FIELDCATALOG_MARC
        I_TABNAME                        = 'IT_MARC'
        IT_EVENTS                        = IT_EVENTS
      IT_SORT                          =
      I_TEXT                           = ' '
      TABLES
        T_OUTTAB                         = IT_MARC
    EXCEPTIONS
      PROGRAM_ERROR                    = 1
      MAXIMUM_OF_APPENDS_REACHED       = 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.                    " ADD_LISTS
    *&      Form  FILL_LAYOUT
          text
    -->  p1        text
    <--  p2        text
    FORM FILL_LAYOUT.
      WA_LAYOUT-ZEBRA = 'X'.
      WA_LAYOUT-TOTALS_TEXT = 'TOTAL'.
    ENDFORM.                    " FILL_LAYOUT
    *&      Form  DISPLAY_BLOCK_LIST
          text
    -->  p1        text
    <--  p2        text
    FORM DISPLAY_BLOCK_LIST.
    WA_KEYINFO-HEADER01 = 'MATNR'.
    WA_KEYINFO-ITEM01 = 'MATNR'.
      CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_DISPLAY'
    EXPORTING
      I_INTERFACE_CHECK             = ' '
      IS_PRINT                      =
      I_SCREEN_START_COLUMN         = 0
      I_SCREEN_START_LINE           = 0
      I_SCREEN_END_COLUMN           = 0
      I_SCREEN_END_LINE             = 0
    IMPORTING
      E_EXIT_CAUSED_BY_CALLER       =
      ES_EXIT_CAUSED_BY_USER        =
       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.                    " DISPLAY_BLOCK_LIST                   .
    Thanks & regards
    Sreenivasulu P

  • ALV list problem

    Hi all,
    I am facing a strange problem in ALV. i have two internal tables one is for alv header and another is alv line items. i have a proper data in in both internal tables.
    when i pass the data of these two internal tables to the function REUSE_ALV_HIERSEQ_LIST_DISPLAY i found in the output that line items date changes.
    actually date is in format 04112005 but when i see the output its showing like this 05.20.0411 .
    please help me to solve the problem.
    Regards,
    Lisa

    Hii
    use this func module
    <b>CONVERT_DATE_TO_INTERN_FORMAT</b>
    <b>CONVERSION_EXIT_PDATE_INPUT</b>
    Thsi will give the dtae in YYYY.MM.DD format
    check this program for reference
    REPORT  Z_50657_ALV_EX1
            MESSAGE-ID ZZ .
                                Type Pools                               *
    TYPE-POOLS: SLIS.
                                 Tables                                  *
    TABLES: LFA1, "Vendor Master
            LFB1, "Vendor Master (Company Code)
            LFM1. "purchasing organization data
                            Internal Tables                              *
    TABLE TO HOLD DATA FROM VENDOR MASTER
    DATA: BEGIN OF IT_LFA1 OCCURS 0,
            LIFNR LIKE LFA1-LIFNR,  "Account Number of Vendor
            KTOKK LIKE LFA1-KTOKK,  "Vendor account group
            NAME1 LIKE LFA1-NAME1,  "Name
            STRAS LIKE LFA1-STRAS,  "House Number and Street
            ORT01 LIKE LFA1-ORT01,  "City
            REGIO LIKE LFA1-REGIO,  "Region
            PFORT LIKE LFA1-PFORT,  "PO Box City
            PSTLZ LIKE LFA1-PSTLZ,  "Postal Code
            PSTL2 LIKE LFA1-PSTL2,  "P.O. Box
            TELF1 LIKE LFA1-TELF1,  "First telephone number
          END OF IT_LFA1.
    TABLE TO HOLD DATA ABOUT COMPANY
    DATA: BEGIN OF IT_LFB1 OCCURS 0,
            LIFNR LIKE LFB1-LIFNR, "Account Number of Vendor
            BUKRS LIKE LFB1-BUKRS, "COMP CODE
          END OF IT_LFB1.
    TABLE TO HOLD DATA ABOUT PURCHASING ORG
    DATA: BEGIN OF IT_LFM1 OCCURS 0,
            LIFNR LIKE LFM1-LIFNR, "Account Number of Vendor
            EKORG LIKE LFM1-EKORG, "Purchasing Organization
          END OF IT_LFM1.
    TABLE TO HOLD DATA FOR FINAL DISPLAY
    DATA: BEGIN OF IT_FINAL OCCURS 0,
            LIFNR LIKE LFB1-LIFNR,  "Account Number of Vendor
            BUKRS LIKE LFB1-BUKRS,  "COMP CODE
            EKORG LIKE LFM1-EKORG,  "Purchasing Organization
            KTOKK LIKE LFA1-KTOKK,  "Vendor account group
            NAME1 LIKE LFA1-NAME1,  "Name
            STRAS LIKE LFA1-STRAS,  "House Number and Street
            ORT01 LIKE LFA1-ORT01,  "City
            REGIO LIKE LFA1-REGIO,  "Region
            PFORT LIKE LFA1-PFORT,  "PO Box City
            PSTLZ LIKE LFA1-PSTLZ,  "Postal Code
            PSTL2 LIKE LFA1-PSTL2,  "P.O. Box
            TELF1 LIKE LFA1-TELF1,  "First telephone number
          END OF IT_FINAL.
    DATA: V_INDEX TYPE SY-TABIX.
                                Work Areas                               *
    *WORK AREAS DEFINED FOR ALV'S
    DATA: X_FIELDCAT TYPE SLIS_FIELDCAT_ALV,
          IT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
          L_LAYOUT TYPE SLIS_LAYOUT_ALV.
                          Selection-Screen                               *
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
    SELECT-OPTIONS: S_LIFNR FOR LFA1-LIFNR, "ACCOUNT NUMBER
                    S_BUKRS FOR LFB1-BUKRS, "COMPANY CODE
                    S_EKORG FOR LFM1-EKORG, "PURCHASING ORG
                    S_KTOKK FOR LFA1-KTOKK. "ACCOUNT GROUP
    SELECTION-SCREEN END OF BLOCK B1.
    SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-002.
    PARAMETERS: LIST RADIOBUTTON GROUP G1, "ALV LIST DISPLAY
                GRID RADIOBUTTON GROUP G1. "ALV GRID DISPLAY
    SELECTION-SCREEN END OF BLOCK B2.
                        At  Selection-Screen                             *
    AT SELECTION-SCREEN.
      PERFORM VALIDATION.
                          Start of Selection                             *
    START-OF-SELECTION.
    *POPULATE DATA INTO ITAB_FINAL USING INNER JOINS OF IT_LFA1 IT_LFB1
    *IT_LFM1
      PERFORM GET_DATA.
    *CHECK FOR RADIO BUTTON SELECTION AND ACCORDINGLY DISPLAY ALV GRID/LIST
      PERFORM CHECK_SEL.
    *&      Form  VALIDATION
          text
    FORM VALIDATION.
      IF S_LIFNR IS NOT INITIAL.
        SELECT SINGLE LIFNR FROM LFA1 INTO IT_LFA1 WHERE LIFNR IN S_LIFNR.
        IF SY-SUBRC <> 0.
          MESSAGE I000 WITH 'THIS IS NOT A VALID VENDOR NUMBER'.
          STOP.
        ELSE.
          IF S_BUKRS IS NOT INITIAL.
            SELECT SINGLE BUKRS FROM LFB1 INTO IT_LFB1-BUKRS WHERE BUKRS IN
            S_BUKRS.
            IF SY-SUBRC <> 0.
              MESSAGE I000 WITH 'THIS IS NOT A VALID COMPANY CODE'.
              STOP.
            ENDIF.
          ENDIF.
        ENDIF.
      ENDIF.
      CLEAR IT_LFA1.
      CLEAR IT_LFB1.
    ENDFORM.                    "VALIDATION
    *&      Form  GET_DATA
          text
    FORM GET_DATA.
      SELECT LIFNR
             KTOKK
             NAME1
             STRAS
             ORT01
             REGIO
             PFORT
             PSTLZ
             PSTL2
             TELF1
             FROM LFA1
             INTO TABLE IT_LFA1
             WHERE LIFNR IN S_LIFNR AND KTOKK IN S_KTOKK.
      SORT IT_LFA1 BY LIFNR.
      IF NOT IT_LFA1[] IS INITIAL.
        SELECT LIFNR
               BUKRS
               FROM LFB1
               INTO TABLE IT_LFB1
               FOR ALL ENTRIES IN IT_LFA1 WHERE LIFNR = IT_LFA1-LIFNR AND
                                                BUKRS IN S_BUKRS.
        SORT IT_LFB1 BY LIFNR BUKRS.
        SELECT LIFNR
               EKORG
               FROM LFM1
               INTO TABLE IT_LFM1
               FOR ALL ENTRIES IN IT_LFA1 WHERE LIFNR = IT_LFA1-LIFNR.
        SORT IT_LFM1 BY LIFNR.
      ENDIF.
      IT_FINAL[] = IT_LFB1[].
      LOOP AT IT_FINAL.
        V_INDEX = SY-TABIX.
        READ TABLE IT_LFA1 WITH KEY LIFNR = IT_FINAL-LIFNR BINARY SEARCH.
        IF SY-SUBRC = 0.
          MOVE: IT_LFA1-KTOKK TO IT_FINAL-KTOKK,
                IT_LFA1-NAME1 TO IT_FINAL-NAME1,
                IT_LFA1-STRAS TO IT_FINAL-STRAS,
                IT_LFA1-ORT01 TO IT_FINAL-ORT01,
                IT_LFA1-REGIO TO IT_FINAL-REGIO,
                IT_LFA1-PFORT TO IT_FINAL-PFORT,
                IT_LFA1-PSTLZ TO IT_FINAL-PSTLZ,
                IT_LFA1-PSTL2 TO IT_FINAL-PSTL2,
                IT_LFA1-TELF1 TO IT_FINAL-TELF1.
        ENDIF.
        READ TABLE IT_LFM1 WITH KEY LIFNR = IT_FINAL-LIFNR BINARY SEARCH.
        IF SY-SUBRC = 0.
          MOVE IT_LFM1-EKORG TO IT_FINAL-EKORG.
        ENDIF.
        MODIFY IT_FINAL INDEX V_INDEX.
      ENDLOOP.
    LOOP AT IT_LFA1.
       LOOP AT IT_FINAL WHERE LIFNR = IT_LFA1-LIFNR.
         MOVE IT_LFA1-KTOKK TO IT_FINAL-KTOKK.
         MODIFY IT_FINAL INDEX SY-TABIX.
         MOVE IT_LFA1-NAME1 TO IT_FINAL-NAME1.
         MODIFY IT_FINAL INDEX SY-TABIX.
         MOVE IT_LFA1-STRAS TO IT_FINAL-STRAS.
         MODIFY IT_FINAL INDEX SY-TABIX.
         MOVE IT_LFA1-ORT01 TO IT_FINAL-ORT01.
         MODIFY IT_FINAL INDEX SY-TABIX.
         MOVE IT_LFA1-REGIO TO IT_FINAL-REGIO.
         MODIFY IT_FINAL INDEX SY-TABIX.
         MOVE IT_LFA1-PFORT TO IT_FINAL-PFORT.
         MODIFY IT_FINAL INDEX SY-TABIX.
         MOVE IT_LFA1-PSTLZ TO IT_FINAL-PSTLZ.
         MODIFY IT_FINAL INDEX SY-TABIX.
         MOVE IT_LFA1-PSTL2 TO IT_FINAL-PSTL2.
         MODIFY IT_FINAL INDEX SY-TABIX.
         MOVE IT_LFA1-TELF1 TO IT_FINAL-TELF1.
         MODIFY IT_FINAL INDEX SY-TABIX.
       ENDLOOP.
    ENDLOOP.
    LOOP AT IT_LFM1.
       LOOP AT IT_FINAL WHERE LIFNR = IT_LFM1-LIFNR.
         MOVE IT_LFM1-EKORG TO IT_FINAL-EKORG.
         MODIFY IT_FINAL INDEX SY-TABIX.
       ENDLOOP.
    ENDLOOP.
    SORT IT_FINAL BY LIFNR BUKRS EKORG.
    ENDFORM.                    "GET_DATA
    *&      Form  CHECK_SEL
          text
    FORM CHECK_SEL.
    X_FIELDCAT-FIELDNAME = 'LIFNR'.
    X_FIELDCAT-TABNAME = 'IT_FINAL'.
    X_FIELDCAT-SELTEXT_L  = 'VENDOR'.
    X_FIELDCAT-NO_ZERO    = 'X'.
    X_FIELDCAT-OUTPUTLEN  = 10.
    X_FIELDCAT-COL_POS    = 1.
    APPEND X_FIELDCAT TO IT_FIELDCAT.
    CLEAR X_FIELDCAT.
    X_FIELDCAT-FIELDNAME = 'BUKRS'.
    X_FIELDCAT-TABNAME = 'IT_FINAL'.
    X_FIELDCAT-SELTEXT_L  = 'COMPANY'.
    X_FIELDCAT-NO_ZERO    = 'X'.
    X_FIELDCAT-OUTPUTLEN  = 4.
    X_FIELDCAT-COL_POS    = 2.
    APPEND X_FIELDCAT TO IT_FIELDCAT.
    CLEAR X_FIELDCAT.
    X_FIELDCAT-FIELDNAME = 'EKORG'.
    X_FIELDCAT-TABNAME = 'IT_FINAL'.
    X_FIELDCAT-SELTEXT_L  = 'PURCHASING ORGANISATION'.
    X_FIELDCAT-NO_ZERO    = 'X'.
    X_FIELDCAT-OUTPUTLEN  = 4.
    X_FIELDCAT-COL_POS    = 3.
    APPEND X_FIELDCAT TO IT_FIELDCAT.
    CLEAR X_FIELDCAT.
    X_FIELDCAT-FIELDNAME = 'KTOKK'.
    X_FIELDCAT-TABNAME = 'IT_FINAL'.
    X_FIELDCAT-SELTEXT_L  = 'ACCOUNT GROUP'.
    X_FIELDCAT-NO_ZERO    = 'X'.
    X_FIELDCAT-OUTPUTLEN  = 4.
    X_FIELDCAT-COL_POS    = 4.
    APPEND X_FIELDCAT TO IT_FIELDCAT.
    CLEAR X_FIELDCAT.
    X_FIELDCAT-FIELDNAME = 'NAME1'.
    X_FIELDCAT-TABNAME = 'IT_FINAL'.
    X_FIELDCAT-SELTEXT_L  = 'VENDOR NAME'.
    X_FIELDCAT-NO_ZERO    = 'X'.
    X_FIELDCAT-OUTPUTLEN  = 35.
    X_FIELDCAT-COL_POS    = 5.
    APPEND X_FIELDCAT TO IT_FIELDCAT.
    CLEAR X_FIELDCAT.
    X_FIELDCAT-FIELDNAME = 'STRAS'.
    X_FIELDCAT-TABNAME = 'IT_FINAL'.
    X_FIELDCAT-SELTEXT_L  = 'STREET'.
    X_FIELDCAT-NO_ZERO    = 'X'.
    X_FIELDCAT-OUTPUTLEN  = 10.
    X_FIELDCAT-COL_POS    = 6.
    APPEND X_FIELDCAT TO IT_FIELDCAT.
    CLEAR X_FIELDCAT.
    X_FIELDCAT-FIELDNAME = 'ORT01'.
    X_FIELDCAT-TABNAME = 'IT_FINAL'.
    X_FIELDCAT-SELTEXT_L  = 'CITY NAME'.
    X_FIELDCAT-NO_ZERO    = 'X'.
    X_FIELDCAT-OUTPUTLEN  = 20.
    X_FIELDCAT-COL_POS    = 7.
    APPEND X_FIELDCAT TO IT_FIELDCAT.
    CLEAR X_FIELDCAT.
    X_FIELDCAT-FIELDNAME = 'REGIO'.
    X_FIELDCAT-TABNAME = 'IT_FINAL'.
    X_FIELDCAT-SELTEXT_L  = 'REGION NAME'.
    X_FIELDCAT-NO_ZERO    = 'X'.
    X_FIELDCAT-OUTPUTLEN  = 2.
    X_FIELDCAT-COL_POS    = 8.
    APPEND X_FIELDCAT TO IT_FIELDCAT.
    CLEAR X_FIELDCAT.
      IF LIST = 'X'.
        CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
          EXPORTING
            I_PROGRAM_NAME         = SY-REPID
            I_INTERNAL_TABNAME     = 'IT_FINAL'
            I_INCLNAME             = SY-REPID
          CHANGING
            CT_FIELDCAT            = IT_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.
        L_LAYOUT-ZEBRA = 'X'.
        CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
          EXPORTING
            I_CALLBACK_PROGRAM = SY-REPID
            IS_LAYOUT          = L_LAYOUT
            IT_FIELDCAT        = IT_FIELDCAT
          TABLES
            T_OUTTAB           = IT_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.
      ELSE.
        CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
          EXPORTING
            I_PROGRAM_NAME         = SY-REPID
            I_INTERNAL_TABNAME     = 'IT_FINAL'
            I_INCLNAME             = SY-REPID
          CHANGING
            CT_FIELDCAT            = IT_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.
        L_LAYOUT-ZEBRA = 'X'.
        CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
          EXPORTING
            I_CALLBACK_PROGRAM = SY-REPID
            IS_LAYOUT          = L_LAYOUT
            IT_FIELDCAT        = IT_FIELDCAT
          TABLES
            T_OUTTAB           = IT_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.
      ENDIF.
    Regards
    Naresh

  • Reg:ALV list Background Problem

    Dear All,
    I created a ALV LIST report. While i am running in that program in foreground i am getting timeout error. While running in background i am getting the output in improper way. While i am seeing that report in spool request and pressing the spool  output display in maximum width i am getting the output list fields  in improper position. What should i have to do for this issue?
    Thanks,
    Sankar M

    When you execute the report in background, u require to provide the width of the output it will be some thing like X_65_255.Try increasing the width.
    One more alternative is go to SPAD -> In settings Menu option -> Select Spool System -> go to others tab -> select the check box number of columns for list display format.
    Hope this inputs will help you.
    Regards,
    Shafivullah Mohammad

Maybe you are looking for

  • FRM-92160: Web Client version too old

    Hi folks, i have been developing and running my forms using Oracle 9iDS and the Oracle 9i database. The forms are run in the browser using the version of OC4J that comes with the developer suite. i installed Oracle 10g Application server forms and re

  • Where are my notes?

    I switched off my Ipad because I had a problem with my mail. Back online I seem to have lost all my notes. Is there a way to recover them?

  • Photos copies photos when importing even when told not to copy photos when importing?

    The new Photos app is pretty cool. The one thing I didn't like about iPhotos is still present here:  Rather than handling my photos in the Finder it creates a weird database full of all the photos -- and the only way to get to them is via this one ap

  • J2EE Tutorial

    I need do make work the examples of J2EE Tutorial. But, when i execute c:\j2eetutotial\examples\ant all happen following error : Exception in thread main java.lang.NoClassDefFoundError: org/apache/tools/ant/Main. What I do will make to try ?? Tanks a

  • Iphoto recovered photos.

    When I open iphoto I get a window showing: 3 photos have been found in the iPhoto library that were not imported.Import now, yes or no.  When I import, nothing show up, and when i decline I get a message saying pics saved in recovered photo abum, but