Hi experts 1 query regarding alv report running in background

when i run my alv report with 40 columns in background in spool when i get output disturbed 20 lines of first row is moving to second row so when i download to excel the o/p is completely disturbed and no use for me is there any way to solve this problem.please reply

hi ,
this will solve your problem
http://www.****************/Tutorials/ALV/Spool/width.htm
Increasing the width of the spool when using ALV List
By Aafaque Husain, YASH Technologies
Whenever an ALV report (with more number of columns) is scheduled in background, the output will be displayed in a zigzag fashion as shown below:  
If we try to download the output from the spool or try to view the output, then we observe that the output is not in an appropriate fashion.  
To get the right format of output in the spool we generally increase the u201Cno. of columns fieldu201D in the Format typesu201D. Have a look at the following screenshot:   
Sometimes even when we change this field, we get the output truncated at the end, like last few columns are not displayed. There is certain limitation for this field, so that even if increase this value again, we find no change in the output display in spool. 
This value is effective only when we check the check box u201CNumber of columns from list display formatu201D in the SPAD transaction.
Ø       GO to SPAD Transaction code
Ø       In the menu Settings -> Spool System as shown belowu2026
Ø       In the others tab check the first check box in the Output Controller block, SAVE and exit.
Now Schedule the ALV report again by providing the output device and format, and then we get the full output in the spool as shown below: 
Regards,
Madhavi

Similar Messages

  • Error when OO ALV report run in background

    Hello all,
    We recently applied stack 12 for a 7.0 system.  My custom ALV report using CL_GUI_CUSTOM_CONTAINER coding now returns an error when run in Background.  It works fine in dialog.
    The error occurred in program CL_GUI_CUSTOM_CONTAINER=======CP.  The log message was "Control Framework: Fatal error - GUI cannot be reached".
    Is there a solution for OO ALV reports run in the background?  I would not like to re-write my ALV reports using the function call.  Any advice is appreciated.  Thanks!!

    Yes, you need to code it a little differently, but you can still use CL_GUI_ALV_GRID.  Here is an example. 
    REPORT ZRICH_0006 .
    DATA: ITAB TYPE TABLE OF MARA.
    DATA: R_GRID TYPE REF TO CL_GUI_ALV_GRID.
    DATA: R_CONTROL TYPE REF TO CL_GUI_CUSTOM_CONTAINER.
    DATA: G_DOCK TYPE REF TO CL_GUI_DOCKING_CONTAINER.
    DATA: OKCODE type sy-ucomm.
    START-OF-SELECTION.
      SELECT * FROM MARA INTO TABLE ITAB  up to 100 rows.
      CALL SCREEN 100.
    *& Module STATUS_0100 OUTPUT
    * text
    MODULE STATUS_0100 OUTPUT.
      SET PF-STATUS '0100'.
      SET TITLEBAR '0100'.
      IF R_CONTROL IS INITIAL.
    * Check whether the program is run in batch or foreground
        IF CL_GUI_ALV_GRID=>OFFLINE( ) IS INITIAL.
    * Run in foreground
          CREATE OBJECT R_CONTROL EXPORTING CONTAINER_NAME = 'CONTAINER_1'.
          CREATE OBJECT R_GRID EXPORTING I_PARENT = R_CONTROL.
        ELSE.
    * Run in background
          CREATE OBJECT R_GRID EXPORTING I_PARENT = G_DOCK.
        ENDIF.
        CALL METHOD R_GRID->SET_TABLE_FOR_FIRST_DISPLAY
        EXPORTING
        I_STRUCTURE_NAME = 'MARA'
        CHANGING
        IT_OUTTAB = ITAB.
      ENDIF.
    ENDMODULE. " STATUS_0100 OUTPUT
    *& Module USER_COMMAND_0100 INPUT
    * text
    MODULE USER_COMMAND_0100 INPUT.
      CASE OKCODE.
        WHEN 'BACK'.
          leave program.
      ENDCASE.
    ENDMODULE. " USER_COMMAND_0100 INPUT
    Regards,
    Rich Heilman

  • ALV report run in background creates problem

    hi All,
    i have a ALV report which works fine in foreground but when i run the report in background
    (Execute in beackground option) the job always gets cancelled.
    As i was thinking that its due to quantity and currency field i passed the below parameters inMY FIELD CAT
    w_fieldcat-CFIELDNAME  =  p_001.
       w_fieldcat-CURRENCY    = 'WAERS'.
    w_fieldcat-CFIELDNAME  =  p_001.
        w_fieldcat-QUANTITY    = 'MEINS'.
    Still the job gets cancelled always , can anybody help me with this issue?
    Please give some useful suggestions?

    Hi Bhanu
    After populating the Grid/List elements, may be you were using 'REUSE_ALV_LIST/GRID_DISPLAY' function module.
    As some Function Modules will give problems in background execution,please call the same function module using CL_GUI_ALV_GRID => REUSE_ALV_LIST_DISPLAY for some cases it is the good solution.
    Regards,
    Sreeram Kumar.Madisetty

  • ALV report - run in background and output to screen

    I wish to run a report in background and then output the report to screen as a standard ALV report with all the associated functionality. Can anyone tell me how to do this?
    Thanks.

    Hi,
       In background i dont think so its possible.
    Regards,
    Prashant

  • ALV report run In background gives 2 spool numbers

    Hi ,
    The ALV report which I am running in Background gives me 2 spool numbers after the Job is created in sm37.
    I am just executing my ALV report by running it in backgroung procressing, but I get 2 spool one has all the correct data of the ALV and 1 blank spool is created.
    I have Passed the followin parameter to my ALV FM.
      lwa_print-no_change_print_params = 'X'.
      lwa_print-no_print_listinfos = 'X'.
        CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
       EXPORTING
         i_callback_program       = sy-repid
         i_callback_pf_status_set = 'SET_PF_STATUS'
         i_callback_user_command  = 'USER_COMMAND'
         i_default                = space
         is_layout                = t_layout
         is_print                 = lwa_print
         it_fieldcat              = t_fieldcat
       TABLES
         t_outtab                 = t_final
       EXCEPTIONS
         program_error            = 1
         OTHERS                   = 2.
    Unable to find the reason why I get 2 spool created for it?
    Thanks
    Ritesh

    Hi venkatesh,
    Thanks for the reply.
    I tried that also but issue was due to a SKIP statement called in the program and due to which a new spool which was blank was called.
    The issue is resolved.
    Thanks
    Solanki Ritesh

  • Help needed regarding ALV report

    Hi,
    I have a query regarding ALV report.
    The requirement is as follows:-
    When the user executes the ALV report and if he sums one numeric field column values and filters out some of the field columns ( for example there r 5 columns in the report and the user has filtered out 2 of them and viewing only 3 columns)
    and now the requirements is that when the user runs the report later he should see the modified report ( i mean only 3 cloumns and the total value of the column which he has made) but not the original output which was there when the report was developed.
    First of all i wanna know is it possible to do r not. If yes then how
    Hope u have got what i want.
    eagerly waiting for ur reply.
    regards,
    maqsood

    Hi
    Yes you can! You have to manage the layout variant.
    So when you call your ALV you have to set the parameter I_SAVE = 'A'.
    In this way you'll allow the user to save the variants for layout.
    After you has to have a chance to choose the variant in selection-screen.
    See the demo program BCALV_GRID_11 to manage the variant in selection-screen.
    Max

  • Query regarding Crystal Reports Server

    Hi,
    I am new to Crystal Reports.
    I have created a couple of .rpt files using CR2008 and I am loading these report files in my aspx pages using CrystalReportViewer control.
    I am planning to host my webApp on IIS in production environment. Maximum simultaneous/concurrent connections to my reports would be 1 or 2.
    My question is:
    1. Do I need Crystal Reports Server in this scenario?
    2. In future if the number of concurrent users to report increases then do I need to go for Crystal Reports Server? Will just buying and installing the Crystal reports server on production server work? or will I have to do some configuration or some other changes in the existing deployed reports? OR Will I have to deploy my existing reports on Crystal Report Server again?
    Any help will be highly appreciated.
    Thanks in advance,
    Manish

    Manish, please do not cross post:
    Query regarding Crystal Reports Server
    See the [Rules of Engagement|http://www.sdn.sap.com/irj/sdn/wiki?path=/display/home/rulesofEngagement] for more details.
    Marking this thread as answered and locking...
    - Ludek

  • Urgent: regarding ALV  report display problem

    hi,
    There are 3 problems:-
    1.) I had made a ALV report in which i have to display 'POSTING DATE' (iseg-budat) when we execute the report i.e. it should be displayed as  PERIOD :- _______  to _______ on alv report ..
    2.)the 2nd problem is dat when i use the '  wa_fieldcat-no_zero = 'X'.  It eliminates all the leading zeros which are present which is okay when i it displays material no.. but the problem is dat it also deletes the other fields where the values are to be zeros.
    i had used this FM:-
    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
      EXPORTING
       INPUT = ITS1-MATNR
       IMPORTING
       OUTPUT = ITS1-MATNR.
    so that only matnr field are to be 0's.
    3.) I want to delete the rows which use to contain the values 0's as there are no calculations are performing as these are displayed .
    ANYbody having solution of this problem ,plzzzz provide the soluion of it as it is most urgent to me and dat person will definately rewarded.
    regards,
    ric.s

    hi kiran,
    thanks for ur response. here is d code which i am using it and plzz help me to figure out where i have to make changes:-
    REPORT  ZTEST03.
    TABLES: ISEG,MARA.
    TYPE-POOLS : SLIS.
    INTERNAL TABLE FOR INVENTORY STOCK *****************
    DATA: BEGIN OF ITS1 OCCURS 0,
          MATNR LIKE ISEG-MATNR,
          MEINS LIKE ISEG-MEINS,
          MENGE LIKE ISEG-MENGE,
          WRTZL LIKE ISEG-WRTZL,
          BUCHM LIKE ISEG-BUCHM,
          WRTBM LIKE ISEG-WRTBM,
          WERKS LIKE ISEG-WERKS,
          BUDAT LIKE ISEG-BUDAT,
          MTART LIKE MARA-MTART,
          ITEMDESC LIKE MAKT-MAKTX,
          DIFFQTY LIKE ISEG-BUCHM,
          DIFFVALUE LIKE ISEG-WRTBM,
          END OF ITS1.
    data: t_heading type slis_t_listheader.
    SELECTION-SCREEN BEGIN OF BLOCK PAR1 WITH FRAME TITLE TEXT-001.
    *********PARAMETERS*********
    PARAMETERS : PLANT LIKE ISEG-WERKS OBLIGATORY.
    *********SELECTION SCREEN OPTIONS*********
    SELECT-OPTIONS : R_DATE FOR ISEG-BUDAT,
                     M_TYPE  FOR MARA-MTART,
                     IT_M FOR MARA-MATNR.
    *********DEFINING VARIABLES*********
      SELECTION-SCREEN END OF BLOCK par1.
    TOP-OF-PAGE.
         PERFORM PG_HEADER.
    START-OF-SELECTION.
    SELECT DISTINCT A~MATNR A~MEINS A~MENGE A~WRTZL A~BUCHM A~WRTBM A~WERKS A~BUDAT B~MTART
       FROM ISEG AS A INNER JOIN MARA AS B ON B~MATNR = A~MATNR
         INTO CORRESPONDING FIELDS OF TABLE ITS1 WHERE B~MATNR = A~MATNR  AND B~MEINS = A~MEINS AND A~WERKS = PLANT AND A~BUDAT IN R_DATE AND B~MTART IN M_TYPE AND B~MATNR IN IT_M.
    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
      EXPORTING
       INPUT = ITS1-MATNR
       IMPORTING
       OUTPUT = ITS1-MATNR.
      SORT ITS1 BY MATNR.
      DELETE ADJACENT DUPLICATES  FROM  ITS1 WHERE MENGE = 0 AND BUCHM = 0.
    LOOP AT ITS1.
         ITS1-DIFFQTY = ITS1-MENGE - ITS1-BUCHM.
         ITS1-DIFFVALUE = ITS1-WRTZL - ITS1-WRTBM.
         SELECT SINGLE MAKTX FROM MAKT INTO ITS1-ITEMDESC WHERE MATNR = ITS1-MATNR.
         MODIFY ITS1.
    ENDLOOP.
    PERFORM PRN_SMSTOCK_ALV.
    WRITING DATA FROM D TABLES**********
    FORM PG_HEADER.
    WRITE : 'PHYSICAL INVENTORY AUDIT REPORT             PLANT : ', PLANT.
    ENDFORM.
    *&      Form  PRN_SMSTOCK_ALV
          text
    -->  p1        text
    <--  p2        text
    form PRN_SMSTOCK_ALV .
    data: w_title   type lvc_title,
          w_repid   type syrepid,
          w_comm    type slis_formname,
          w_status  type slis_formname,
          x_layout  type slis_layout_alv,
          t_event    type slis_t_event,
          t_fieldcat type slis_t_fieldcat_alv,
          t_sort     type slis_t_sortinfo_alv.
    refresh t_fieldcat.
    refresh t_event.
    refresh t_sort.
    clear x_layout.
    clear w_title.
      perform set_fieldcat2 using:
    1  'MTART'     'MTART'     'MARA'  '15'  space 'MATERIAL TYPE'        space  space  space space space space space space SPACE t_fieldcat 'L' 'C',
    2  'MATNR'     'MATNR'     'MARA'  '13'  space 'MATERIAL NO. '        space  space  space space space space space space SPACE t_fieldcat 'R' 'C',
    3  'ITEMDESC'  'MAKTX'     'MAKT'  '25'  space 'MATERIAL DESCRIPTION' space  space  space space space space space space SPACE t_fieldcat 'L' 'C',
    4  'MEINS'     'MEINS'     'MARA'  '5'   space 'UOM'                  space  space  space space space space space space SPACE t_fieldcat 'C' 'C',
    5  'MENGE'     'MENGE'     'ISEG'  '13'  space 'ORG.INV.QTY'          space  space  space space space space space space SPACE t_fieldcat 'R' 'C',
    6  'WRTZL'     'WRTZL'     'ISEG'  '13'  space 'ORG.INV.VALUE'        space  space  space space space space space space SPACE t_fieldcat 'R' 'C',
    7  'BUCHM'     'BUCHM'     'ISEG'  '13'  space 'PHY.INV.QTY'          space  space  space space space space space space SPACE t_fieldcat 'R' 'C',
    8  'WRTBM'     'WRTBM'     'ISEG'  '13'  space 'PHY.INV.VALUE'        space  space  space space space space space space SPACE t_fieldcat 'R' 'C',
    9  'DIFFQTY'   'MENGE'     'ISEG'  '13'  space 'DIFF.INV.QTY'         space  space  space space space space space space SPACE t_fieldcat 'R' 'C',
    10 'DIFFVALUE' 'WRTZL'     'ISEG'  '13'  space 'DIFF.INV.VALUE'       space  space  space space space space space space SPACE t_fieldcat SPACE 'P'.
    x_layout-zebra = 'X'.
    perform set_top_page_heading using t_heading t_event.
    perform set_events using t_event.
      w_status = ''.
      w_repid = sy-repid.
      w_comm   = 'USER_COMMAND'.
      call function 'REUSE_ALV_GRID_DISPLAY'
        exporting
          i_callback_program       = w_repid
          it_fieldcat              = t_fieldcat
          i_Callback_top_of_page   = 'Top-of-page'
          is_layout                = x_layout
          it_sort                  = t_sort
          i_callback_pf_status_set = w_status
          i_callback_user_command  = w_comm
          i_save                   = 'X'
          it_events                = t_event
          i_grid_title             = w_title
          tables
          t_outtab                 = ITS1
        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.
    FORM set_fieldcat2 USING
          p_colpos p_fieldname p_ref_fieldname p_ref_tabname
          p_outputlen p_noout
          p_seltext_m p_seltext_l p_seltext_s p_reptext_ddic p_ddictxt
          p_hotspot p_showasicon p_checkbox p_edit
          p_dosum
          t_fieldcat TYPE slis_t_fieldcat_alv
          P_JUST
          P_FTYPE.
      DATA: wa_fieldcat TYPE slis_fieldcat_alv.
      CLEAR wa_fieldcat.
    General settings
      wa_fieldcat-fieldname = p_fieldname.
    wa_fieldcat-no_zero = 'X'.
      wa_fieldcat-col_pos = p_colpos.
      wa_fieldcat-no_out = p_noout.
      wa_fieldcat-hotspot = p_hotspot.
      wa_fieldcat-checkbox = p_checkbox.
      wa_fieldcat-icon = p_showasicon.
      wa_fieldcat-do_sum = p_dosum.
    Set output length.
      IF NOT p_outputlen IS INITIAL.
        wa_fieldcat-outputlen = p_outputlen.
      ENDIF.
    Set text headers.
    IF NOT p_seltext_m IS INITIAL.
        wa_fieldcat-seltext_m = p_seltext_m.
    ENDIF.
    IF NOT p_seltext_l IS INITIAL.
        wa_fieldcat-seltext_l = p_seltext_l.
    ENDIF.
    IF NOT p_seltext_s IS INITIAL.
        wa_fieldcat-seltext_s = p_seltext_s.
    ENDIF.
      IF NOT p_reptext_ddic IS INITIAL.
        wa_fieldcat-reptext_ddic = p_reptext_ddic.
      ENDIF.
    IF NOT p_ddictxt IS INITIAL.
        wa_fieldcat-ddictxt = p_ddictxt.
    ENDIF.
      IF NOT P_JUST IS INITIAL.
        WA_FIELDCAT-JUST = P_JUST.
      ENDIF.
    Set as editable or not.
      IF NOT p_edit IS INITIAL.
        wa_fieldcat-input     = 'X'.
        wa_fieldcat-edit     = 'X'.
      ENDIF.
      APPEND wa_fieldcat TO t_fieldcat.
    ENDFORM.                   "set_fieldcat2
    ======================== Subroutines called by ALV ================
    *&      Form  top_of_page
          Called on top_of_page ALV event.
          Prints the heading.
    form top_of_page.
      call function 'REUSE_ALV_COMMENTARY_WRITE'
         exporting
              it_list_commentary = t_heading.
    ENDFORM.
    form set_top_page_heading using t_heading type slis_t_listheader
                                    t_events  type slis_t_event.
    data: x_heading type slis_listheader,
          x_event   type line of slis_t_event.
    Report title
      clear t_heading[].
      clear x_heading.
      x_heading-typ = 'H'.
      x_heading-info = 'PHYSICAL INVENTORY AUDIT REPORT'.
      append x_heading to t_heading.
    Plant Name
    clear x_heading.
      x_heading-typ = 'S'.
      x_heading-key = 'PLANT: '.
      x_heading-info = its1-werks.
      append x_heading to t_heading.
    Posting Date
    *clear x_heading.
    x_heading-typ = 'S'.
    x_heading-key = 'POSTING DATE: '.
    x_heading-info = ITS1-BUDAT.
    append x_heading to t_heading.
    Control Date
    clear x_heading.
    x_heading-typ = 'S'.
    x_heading-key = 'CONTROL No: '.
    x_heading-info = its1-werks.
    append x_heading to t_heading.
    Control date
    clear x_heading.
    x_heading-typ = 'S'.
    x_heading-key = 'CONTROL DATE: '.
    x_heading-info = its1-werks.
    append x_heading to t_heading.
    User who is running the report
    clear x_heading.
    x_heading-typ = 'S'.
    x_heading-key = 'User: '.
    x_heading-info = sy-uname.
    append x_heading to t_heading.
    Date of execution
      clear x_heading.
      x_heading-typ = 'S'.
      x_heading-key = 'Date: '.
      write sy-datum to x_heading-info.
      append x_heading to t_heading.
    Time of execution
      clear x_heading.
      x_heading-typ = 'S'.
      x_heading-key = 'Time: '.
      write sy-uzeit to x_heading-info.
      append x_heading to t_heading.
    Top of page event
      x_event-name = slis_ev_top_of_page.
      x_event-form = 'TOP_OF_PAGE'.
      append x_event to t_events.
    endform.
    form set_events using t_events type slis_t_event.
    data: x_event   type line of slis_t_event.
    endform.
    plzzz help me out as it is most urgent to me.
    regards,
    ric.s

  • Issue regarding ALV report

    Hi all,
             I've created an ALV report which is having a editable checkbox box field and some more fields that are not editable.
    My requirement is that when i check any checkbox, some of the fields in that particular row should become editable.
    In table control it can be done easily but can it be done in ALV.
    Note: I have created the ALV through container as it was required.
    Thanks in Advance.
    Regards
    Dheeraj

    Hi,
    Basically you will have to first register the data change event after you display the grid as follows:-
        CALL METHOD y_lobj_grid->register_edit_event
          EXPORTING
            i_event_id = cl_gui_alv_grid=>MC_EVT_MODIFIED
          EXCEPTIONS
            error      = 1
            OTHERS     = 2.
    Here Y_LOBJ_GRID is my grid object of type CL_GUI_ALV_GRID.
    Then you will have to set a handler method for this.
       SET HANDLER y_obj_evt_handler->y_m_handle_cell_modified
        FOR Y_LOBJ_GRID.
    Here y_obj_evt_handler is a local class in your program and y_m_handle_cell_modified is the method of that class.
    In this method you can change the fields to make then editable or non editable.
    Regards,
    Ankur Parab

  • Help regarding alv report

    i need to develop alv report which displays po and corresponding invoice receipt information.
    what all  fields can i include in invoice receipt information.please help on this.thanks in advance.credit will be given.

    Hi,
    Check the following link:
    http://www.sapbrain.com/TUTORIALS/TECHNICAL/ALV_tutorial.html
    http://www.sapbrain.com/ARTICLES/TECHNICAL/ABAP/company%20logo%20in%20the%20top%20of%20alv%20report.html
    Regards,
    Bhaskar

  • Re: Regarding ALV report

    Hi experts,
    Please help me out as i am new to abap.My problem is how to create a an ALV Report that will show the details of order like order no, order date, customer, product code & description, order quantity and value along with the details of dispatch of those orders like invoice no, invoice date, invoice quantity and pending order quantity.
    Replies will be highly appreciated.
    Thanks,
    Pankaj

    Hi,
    Have a look on the following ALV Grid report.Later find the fields and tables for your requirement.
    Use that fields and tables in this report.
    Follow the below step for uploading the image file:
    Steps for uploading Logo :-:
    1. Goto the transaction OAER
    2. Enter the class name as 'PICTURES'
    3. Enter the class type as 'OT'
    4. Enter the object key as the name of the logo(e.g. tripodsm.gif) you wish to give
    5. Execute
    6. Then in the new screen select Standard doc. types in bottom window
    Click on the Screen icon
    Now, it will ask for the file path where you have to upload the logo
    7. Now you can use this logo in REUSE_ALV_COMMENTARY_WRITE
    call function 'REUSE_ALV_COMMENTARY_WRITE'
    exporting
    it_list_commentary = i_header
    i_logo = 'tripodsm.gif'.
    TABLES VBAK.
    TYPE-POOLS SLIS.
    Data Declaration
    TYPES: BEGIN OF T_VBAK,
          VBELN TYPE VBAK-VBELN,
          ERDAT TYPE VBAK-ERDAT,
          ERNAM TYPE VBAK-ERNAM,
          AUDAT TYPE VBAK-AUDAT,
          VBTYP TYPE VBAK-VBTYP,
          NETWR TYPE VBAK-NETWR,
          VKORG TYPE VBAK-VKORG,
          VKGRP TYPE VBAK-VKGRP,
          LINE_COLOR(4) TYPE C,
          END OF T_VBAK.
    DATA: IT_VBAK TYPE STANDARD TABLE OF T_VBAK INITIAL SIZE 0,
          WA_VBAK TYPE T_VBAK.
    ALV Data Declaration
    DATA: FLDCAT TYPE SLIS_T_FIELDCAT_ALV WITH HEADER LINE,
          GD_LAYOUT TYPE SLIS_LAYOUT_ALV,
          GD_REPID TYPE SY-REPID.
    START-OF-SELECTION.
    PERFORM DATA_RETRIEVAL.
    PERFORM BLD_FLDCAT.
    PERFORM BLD_LAYOUT.
    PERFORM DISPLAY_ALV_REPORT.
    Build Field Catalog for ALV Report
    FORM BLD_FLDCAT.
    FLDCAT-FIELDNAME = 'VBELN'.
    FLDCAT-SELTEXT_M = 'Sales Document'.
    FLDCAT-COL_POS = 0.
    *FLDCAT-EMPHASIZE = 'C411'.
    FLDCAT-OUTPUTLEN = 20.
    FLDCAT-KEY = 'X'.
    APPEND FLDCAT TO FLDCAT.
    CLEAR FLDCAT.
    FLDCAT-FIELDNAME = 'ERDAT'.
    FLDCAT-SELTEXT_L = 'Record Date created'.
    FLDCAT-COL_POS = 1.
    FLDCAT-KEY = 'X'.
    APPEND FLDCAT TO FLDCAT.
    CLEAR FLDCAT.
    FLDCAT-FIELDNAME = 'ERNAM'.
    FLDCAT-SELTEXT_L = 'Cteated Object Person Name'.
    APPEND FLDCAT TO FLDCAT.
    CLEAR FLDCAT.
    FLDCAT-FIELDNAME = 'AUDAT'.
    FLDCAT-SELTEXT_M = 'Document Date'.
    FLDCAT-COL_POS = 3.
    FLDCAT-EMPHASIZE = 'C110'.
    APPEND FLDCAT TO FLDCAT.
    CLEAR FLDCAT.
    FLDCAT-FIELDNAME = 'VBTYP'.
    FLDCAT-SELTEXT_L = 'SD Document category'.
    FLDCAT-COL_POS = 4.
    APPEND FLDCAT TO FLDCAT.
    CLEAR FLDCAT.
    FLDCAT-FIELDNAME = 'NETWR'.
    FLDCAT-SELTEXT_L = 'Net Value of the SO in Document Currency'.
    FLDCAT-COL_POS = 5.
    FLDCAT-OUTPUTLEN = 60.
    FLDCAT-DO_SUM = 'X'.
    FLDCAT-DATATYPE = 'CURR'.
    APPEND FLDCAT TO FLDCAT.
    CLEAR FLDCAT.
    FLDCAT-FIELDNAME = 'VKORG'.
    FLDCAT-SELTEXT_L = 'Sales Organization'.
    FLDCAT-COL_POS = 6.
    APPEND FLDCAT TO FLDCAT.
    CLEAR FLDCAT.
    FLDCAT-FIELDNAME = 'VKGRP'.
    FLDCAT-SELTEXT_M = 'Sales Group'.
    FLDCAT-COL_POS = 7.
    FLDCAT-EMPHASIZE = 'C801'.
    APPEND FLDCAT TO FLDCAT.
    CLEAR FLDCAT.
    ENDFORM.
    Build Layout for ALV Grid Report
    FORM BLD_LAYOUT.
    GD_LAYOUT-NO_INPUT = 'X'.
    GD_LAYOUT-COLWIDTH_OPTIMIZE = 'X'.
    GD_LAYOUT-INFO_FIELDNAME = 'LINE_COLOR'.
    GD_LAYOUT-WINDOW_TITLEBAR = 'GRID DISPLAY'.
    GD_LAYOUT-CONFIRMATION_PROMPT = 'X'.  “ This asks the confirmation    
                                       before leaving the screen.
    ENDFORM.
    Display report using ALV grid
    FORM DISPLAY_ALV_REPORT.
    GD_REPID = SY-REPID.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
       I_CALLBACK_PROGRAM                = GD_REPID
       IS_LAYOUT                         = GD_LAYOUT
       I_CALLBACK_TOP_OF_PAGE            = 'TOP_OF_PAGE'
       I_GRID_TITLE                      = 'SALES DOCUMENT HEADER'
       IT_FIELDCAT                       = FLDCAT[]
       I_SAVE                            = 'X'
      TABLES
        T_OUTTAB                          = IT_VBAK
    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.
    Retrieve data from VBAK table and populate itab IT_VBAK
    FORM DATA_RETRIEVAL.
    DATA LD_COLOR(1) TYPE C.
    SELECT VBELN ERDAT ERNAM AUDAT VBTYP NETWR VKORG
    UP TO 20 ROWS
    FROM VBAK
    INTO TABLE IT_VBAK.
    LOOP AT IT_VBAK INTO WA_VBAK.
    LD_COLOR = LD_COLOR + 1.
    IF LD_COLOR = 8.
      LD_COLOR = 1.
    ENDIF.
    CONCATENATE 'C' LD_COLOR '10' INTO WA_VBAK-LINE_COLOR.
    MODIFY IT_VBAK FROM WA_VBAK.
    ENDLOOP.
    ENDFORM.
    FORM TOP_OF_PAGE.
    DATA: T_HEADER TYPE SLIS_T_LISTHEADER,
          W_HEADER TYPE SLIS_LISTHEADER.
    W_HEADER-TYP = 'H'.
    W_HEADER-INFO = 'WELCOME HEADER LIST'.
    APPEND W_HEADER TO T_HEADER.
    W_HEADER-TYP = 'S'.
    W_HEADER-KEY = 'REPORT:'.
    W_HEADER-INFO = SY-REPID.
    APPEND W_HEADER TO T_HEADER.
    W_HEADER-TYP = 'S'.
    W_HEADER-KEY = 'DATE:'.
    CONCATENATE SY-DATUM6(2) ' / ' SY-DATUM4(2) ' / ' SY-DATUM(4) INTO W_HEADER-INFO.
    APPEND W_HEADER TO T_HEADER.
    CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
      EXPORTING
        IT_LIST_COMMENTARY       = T_HEADER
        I_LOGO          = ‘TRIPODSM.GIF’.     
    ENDFORM.
    Reward,if useful.
    Thanks,
    Chandu

  • Regarding ALV report heading

    Hi to all
    I am preparing a ALV report.
    In which I want to display the values which are entered on selection screen.
    On the selection screen these are the fields :
    s_werks for pa0001-werks
    s_orgeh for pa0001-orgeh
    I am successful to capture one value (s_orgeh-low) but if multiple values are selected then how to display.
    Plz guide me...

    Hi,
    try like this..in the belwo code first FM captures the selection screen fields and the second function mdoule dispalys them in the output.
    DATA :
    Internal table for Selection screen parameters
           i_seltable   TYPE STANDARD TABLE OF rsparams.
    *&      Form  get_selection_screen
      Subroutine to get the user selection on selection screen
    FORM get_selection_screen .
      CALL FUNCTION 'RS_REFRESH_FROM_SELECTOPTIONS'
        EXPORTING
          curr_report     = sy-repid
        TABLES
          selection_table = i_seltable
        EXCEPTIONS
          not_found       = 01
          no_report       = 02.
      IF sy-subrc NE 0.
        REFRESH i_seltable.
      ENDIF.
    ENDFORM.                    " get_selection_screen
    *&      Form  display_selection_criteria
    Subroutine to display the selction criteria in the output
    FORM display_selection_criteria .
      CALL FUNCTION 'RS_LIST_SELECTION_TABLE'
        EXPORTING
          report        = sy-repid
          seltext       = c_x
          newpage       = space
        TABLES
          sel_tab       = i_seltable
        EXCEPTIONS
          sel_tab_empty = 1
          OTHERS        = 2.
      IF sy-subrc <> 0.
        REFRESH i_seltable.
      ENDIF.
    ENDFORM.                    " display_selection_criteria
    Regards,
    Nagaraj

  • Regarding ALV Reporting in ABAP

    Hi All,
    I have some clarifications related to <b>ALV Reporting</b> in ABAP.
    <b>Actually i have to create ALV report with Structure Length/Each record length is around 300 characters.</b>
    Is it possible to create a ALV Report with <b>300</b> length for each record!
    If possible which is the best<b>[ALV]</b> method for the same!
    Can anybody give me the solution!
    Thanks in advance.
    Thanks & Regards,
    Prasad.

    Hai Prasad
    Check with the code
    *& Report  ZALV_PRAKASH_SAMP                                           *
    REPORT  ZALV_PRAKASH_SAMP .
    TABLES: MARA.
    TYPE-POOLS : SLIS.
    Data declaration
    DATA: BEGIN OF I_MARA OCCURS 0.
            INCLUDE STRUCTURE MARA.
    DATA: END OF I_MARA.
    DATA: V_REPID LIKE SY-REPID.
    selection-screen
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME.
      SELECT-OPTIONS : S_MATNR FOR MARA-MATNR.
      PARAMETERS: P_MTART LIKE MARA-MTART DEFAULT 'ROH'.
    SELECTION-SCREEN END OF BLOCK B1.
    initialisation
    INITIALIZATION.
    S_MATNR-LOW = '1400'.
    S_MATNR-HIGH = '1500'.
    APPEND S_MATNR.
    V_REPID = SY-REPID.
    start-of-selection
    START-OF-SELECTION.
    SELECT * FROM MARA
        INTO TABLE I_MARA
        WHERE MATNR IN S_MATNR AND
              MTART = P_MTART.
      CHECK SY-SUBRC = 0.
    end of selection
    END-OF-SELECTION.
    CALL FUNCTION 'REUSE_ALV_GRID_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               = 'MARA'
      IS_LAYOUT                      =
      IT_FIELDCAT                    =
      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
    IMPORTING
      E_EXIT_CAUSED_BY_CALLER        =
      ES_EXIT_CAUSED_BY_USER         =
      TABLES
        T_OUTTAB                       = I_MARA
    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.
    loop at i_mara.
    write:/ i_mara.
    endloop.
    Thanks & Regards
    Sreenivasulu P

  • Regarding ALV report to output in excel

    How to do  ALV report to output in excel format?

    *& DATA DECLARATION *
    TABLES: MARA, "GENERAL MASTER DATA
    MARC, "PLANT DATA FOR MATERIAL
    MARD, "STORAGE LOCATION DATA FOR MATERIAL
    MBEW, "MATERIAL VALUATION
    MVKE, "SALES DATA FOR MATERIAL
    MAKT, "MATERIAL DESCRIPTION
    EKKO, "PURCHASING DOCUMENT HEADER
    EKPO, "PURCHASING DOCUMENT ITEM
    VBAK, "SALES DOCUMENT HEADER DATA
    VBAP. "SALES DOCUMENT ITEM DATA
    TYPE-POOLS : SLIS.
    DATA: VT_FIELDCAT1 TYPE SLIS_T_FIELDCAT_ALV,
    V_FIELDCAT TYPE SLIS_FIELDCAT_ALV,
    V_LAYOUT TYPE SLIS_LAYOUT_ALV,
    BDCDATA LIKE BDCDATA OCCURS 0 WITH HEADER LINE,
    BEGIN OF I_MARA OCCURS 0,
    MATNR LIKE MARA-MATNR, "MATERIAL NUMBER
    MBRSH LIKE MARA-MBRSH, "INDUSTRY SECTOR
    MEINS LIKE MARA-MEINS, "BASE UNIT OF MEASURE
    MATKL LIKE MARA-MATKL, "MATERIAL GROUP
    END OF I_MARA,
    BEGIN OF I_MARC OCCURS 0,
    MATNR LIKE MARC-MATNR, "MATERIAL NUMBER
    WERKS LIKE MARC-WERKS, "PLANT
    LVORM LIKE MARC-LVORM, "FLAG MATERIAL FOR DELETION AT PLANT
    "LEVEL
    DISPO LIKE MARC-DISPO, "MRP CONTROLLER
    END OF I_MARC,
    BEGIN OF I_MAKT OCCURS 0,
    MATNR LIKE MAKT-MATNR, "MATERIAL NUMBER
    MAKTX LIKE MAKT-MAKTX, "MATERIAL DESCRIPTION
    SPRAS LIKE MAKT-SPRAS, "LANGUAGE KEY
    END OF I_MAKT,
    BEGIN OF I_MVKE OCCURS 0,
    MATNR LIKE MVKE-MATNR, "MATERIAL NUMBER
    VKORG LIKE MVKE-VKORG, "SALES ORGANIZATION
    VTWEG LIKE MVKE-VTWEG, "DISTRIBUTION CHANNEL
    END OF I_MVKE,
    BEGIN OF I_MARD OCCURS 0,
    MATNR LIKE MARD-MATNR, "MATERIAL NUMBER
    LGORT LIKE MARD-LGORT, "STORAGE LOCATION
    LABST LIKE MARD-LABST, "VALUATED STOCK WITH UNRESTRICTED USE
    END OF I_MARD,
    BEGIN OF I_EKPO OCCURS 0,
    EBELN LIKE EKPO-EBELN, "PURCHASING DOCUMENT NUMBER
    EBELP LIKE EKPO-EBELP, "ITEM NUMBER OF PURCHASING DOCUMENT
    MATNR LIKE EKPO-MATNR, "MATERIAL NUMBER
    END OF I_EKPO,
    BEGIN OF I_VBAP OCCURS 0,
    VBELN LIKE VBAP-VBELN, "SALES DOCUMENT
    POSNR LIKE VBAP-POSNR, "SALES DOCUMENT ITEM
    MATNR LIKE VBAP-MATNR, "MATERIAL NUMBER
    END OF I_VBAP,
    BEGIN OF I_OUT OCCURS 0,
    MATNR LIKE MARC-MATNR,
    WERKS LIKE MARC-WERKS,
    LVORM LIKE MARC-LVORM,
    DISPO LIKE MARC-DISPO,
    MBRSH LIKE MARA-MBRSH,
    MEINS LIKE MARA-MEINS,
    MATKL LIKE MARA-MATKL,
    VKORG LIKE MVKE-VKORG,
    VTWEG LIKE MVKE-VTWEG,
    SPRAS LIKE MAKT-SPRAS,
    MAKTX LIKE MAKT-MAKTX,
    LGORT LIKE MARD-LGORT,
    LABST LIKE MARD-LABST,
    EBELN LIKE EKPO-EBELN,
    EBELP LIKE EKPO-EBELP,
    VBELN LIKE VBAP-VBELN,
    POSNR LIKE VBAP-POSNR,
    END OF I_OUT,
    BEGIN OF I_HEADING OCCURS 0,
    TEXT1(20),
    TEXT2(20),
    TEXT3(20),
    TEXT4(20),
    TEXT5(20),
    TEXT6(20),
    TEXT7(20),
    TEXT8(20),
    TEXT9(20),
    TEXT10(20),
    TEXT11(40),
    TEXT12(20),
    TEXT13(20),
    TEXT14(20),
    TEXT15(20),
    TEXT16(20),
    TEXT17(20),
    END OF I_HEADING.
    *& S E L E C T I O N - S C R E E N *
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-100.
    SELECT-OPTIONS: S_MATNR FOR MARA-MATNR. "OBLIGATORY.
    PARAMETERS: P_WERKS LIKE MARC-WERKS. "OBLIGATORY.
    SELECT-OPTIONS: S_LGORT FOR MARD-LGORT,
    S_DISPO FOR MARC-DISPO,
    S_EBELN FOR EKPO-EBELN .
    SELECTION-SCREEN END OF BLOCK B1.
    SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-101.
    PARAMETERS : RB1 RADIOBUTTON GROUP G1,
    RB2 RADIOBUTTON GROUP G1,
    RB3 RADIOBUTTON GROUP G1.
    SELECTION-SCREEN END OF BLOCK B2.
    *& S T A R T - O F - S E L E C T I O N *
    START-OF-SELECTION.
    SELECT MATNR WERKS LVORM DISPO FROM MARC
    INTO CORRESPONDING FIELDS OF TABLE I_MARC
    WHERE MATNR IN S_MATNR
    AND DISPO IN S_DISPO
    AND WERKS = P_WERKS.
    IF I_MARC[] IS INITIAL.
    WRITE:/ 'NO MATCHING DATA AVAILABLE FROM MARC'.
    EXIT.
    ENDIF.
    PERFORM PURCHASEDATA_VALIDATION.
    PERFORM SALESDATA_VALIDATION.
    SELECT MATNR LGORT LABST FROM MARD INTO TABLE I_MARD
    FOR ALL ENTRIES IN I_MARC
    WHERE MATNR = I_MARC-MATNR
    AND WERKS EQ P_WERKS
    AND LGORT IN S_LGORT.
    IF I_MARD[] IS INITIAL.
    WRITE:/ 'NO MATCHING DATA AVAILABLE FROM MARD'.
    EXIT.
    ENDIF.
    SELECT MATNR VKORG VTWEG FROM MVKE INTO TABLE I_MVKE
    FOR ALL ENTRIES IN I_MARC
    WHERE MATNR = I_MARC-MATNR.
    IF I_MVKE[] IS INITIAL.
    WRITE:/ 'NO MATCHING DATA AVAILABLE FROM MVKE'.
    EXIT.
    ENDIF.
    LOOP AT I_MARC.
    MOVE-CORRESPONDING I_MARC TO I_OUT.
    CLEAR MARC.
    SELECT SINGLE MATNR MBRSH MEINS MATKL FROM MARA
    INTO CORRESPONDING FIELDS OF MARA
    WHERE MATNR = I_OUT-MATNR.
    IF SY-SUBRC = 0.
    MOVE: MARA-MBRSH TO I_OUT-MBRSH,
    MARA-MEINS TO I_OUT-MEINS,
    MARA-MATKL TO I_OUT-MATKL.
    ELSE.
    CONTINUE.
    ENDIF.
    SELECT SINGLE MATNR MAKTX SPRAS FROM MAKT
    INTO CORRESPONDING FIELDS OF MAKT
    WHERE MATNR = I_OUT-MATNR.
    IF SY-SUBRC = 0.
    MOVE: MAKT-MAKTX TO I_OUT-MAKTX,
    MAKT-SPRAS TO I_OUT-SPRAS.
    ELSE.
    CONTINUE.
    ENDIF.
    LOOP AT I_EKPO WHERE MATNR = I_MARC-MATNR.
    MOVE: I_EKPO-EBELN TO I_OUT-EBELN,
    I_EKPO-EBELP TO I_OUT-EBELP.
    ENDLOOP.
    LOOP AT I_VBAP WHERE MATNR = I_MARC-MATNR.
    MOVE: I_VBAP-VBELN TO I_OUT-VBELN,
    I_VBAP-POSNR TO I_OUT-POSNR.
    ENDLOOP.
    LOOP AT I_MARD WHERE MATNR = I_MARC-MATNR.
    MOVE: I_MARD-LABST TO I_OUT-LABST,
    I_MARD-LGORT TO I_OUT-LGORT.
    ENDLOOP.
    LOOP AT I_MVKE WHERE MATNR = I_MARC-MATNR.
    MOVE: I_MVKE-VKORG TO I_OUT-VKORG,
    I_MVKE-VTWEG TO I_OUT-VTWEG.
    APPEND I_OUT.
    ENDLOOP.
    CLEAR I_OUT.
    ENDLOOP.
    PERFORM OPTIONS.
    FORM OPTIONS *
    FORM OPTIONS.
    IF RB2 = 'X'.
    PERFORM FIELDCAT.
    PERFORM OUTPUT.
    ELSE.
    IF RB1 = 'X'.
    PERFORM HEADINGS.
    PERFORM DLOAD.
    ELSE.
    IF RB3 = 'X'.
    PERFORM HEADINGS.
    PERFORM DLOAD.
    PERFORM FIELDCAT.
    PERFORM OUTPUT.
    ENDIF.
    ENDIF.
    ENDIF.
    ENDFORM. "OPTIONS
    FORM HEADINGS *
    FORM HEADINGS.
    I_HEADING-TEXT1 = 'MATNR'.
    I_HEADING-TEXT2 = 'WERKS'.
    I_HEADING-TEXT3 = 'LVORM'.
    I_HEADING-TEXT4 = 'DISPO'.
    I_HEADING-TEXT5 = 'MBRSH'.
    I_HEADING-TEXT6 = 'MEINS'.
    I_HEADING-TEXT7 = 'MATKL'.
    I_HEADING-TEXT8 = 'VKORG'.
    I_HEADING-TEXT9 = 'VTWEG'.
    I_HEADING-TEXT10 = 'SPRAS'.
    I_HEADING-TEXT11 = 'MAKTX'.
    I_HEADING-TEXT12 = 'LGORT'.
    I_HEADING-TEXT13 = 'LABST'.
    I_HEADING-TEXT14 = 'EBELN'.
    I_HEADING-TEXT15 = 'EBELP'.
    I_HEADING-TEXT16 = 'VBELN'.
    I_HEADING-TEXT17 = 'POSNR'.
    APPEND I_HEADING.
    ENDFORM. "HEADINGS
    FORM DLOAD *
    FORM DLOAD.
    CALL FUNCTION 'GUI_DOWNLOAD'
    EXPORTING
    FILENAME = 'C:\MATSTK.XLS'
    FILETYPE = 'DAT'
    WRITE_FIELD_SEPARATOR = 'X'
    TABLES
    DATA_TAB = I_HEADING
    EXCEPTIONS
    FILE_WRITE_ERROR = 1.
    CALL FUNCTION 'GUI_DOWNLOAD'
    EXPORTING
    FILENAME = 'C:\MATSTK.XLS'
    FILETYPE = 'DAT'
    APPEND = 'X'
    WRITE_FIELD_SEPARATOR = 'X'
    TABLES
    DATA_TAB = I_OUT.
    ENDFORM. "DLOAD
    FORM FIELDCAT *
    FORM FIELDCAT.
    V_FIELDCAT-COL_POS = '1'.
    V_FIELDCAT-FIELDNAME = 'MATNR'.
    V_FIELDCAT-TABNAME = 'I_OUT'.
    V_FIELDCAT-HOTSPOT = 'X'.
    V_FIELDCAT-REF_FIELDNAME = 'MATNR'.
    V_FIELDCAT-REF_TABNAME = 'MARC'.
    APPEND V_FIELDCAT TO VT_FIELDCAT1.
    CLEAR V_FIELDCAT.
    V_FIELDCAT-COL_POS = '2'.
    V_FIELDCAT-FIELDNAME = 'WERKS'.
    V_FIELDCAT-TABNAME = 'I_OUT'.
    V_FIELDCAT-REF_FIELDNAME = 'WERKS'.
    V_FIELDCAT-REF_TABNAME = 'MARC'.
    APPEND V_FIELDCAT TO VT_FIELDCAT1.
    CLEAR V_FIELDCAT.
    V_FIELDCAT-COL_POS = '3'.
    V_FIELDCAT-FIELDNAME = 'LVORM'.
    V_FIELDCAT-TABNAME = 'I_OUT'.
    V_FIELDCAT-REF_FIELDNAME = 'LVORM'.
    V_FIELDCAT-REF_TABNAME = 'MARC'.
    APPEND V_FIELDCAT TO VT_FIELDCAT1.
    CLEAR V_FIELDCAT.
    V_FIELDCAT-COL_POS = '4'.
    V_FIELDCAT-FIELDNAME = 'DISPO'.
    V_FIELDCAT-TABNAME = 'I_OUT'.
    V_FIELDCAT-REF_FIELDNAME = 'DISPO'.
    V_FIELDCAT-REF_TABNAME = 'MARC'.
    APPEND V_FIELDCAT TO VT_FIELDCAT1.
    CLEAR V_FIELDCAT.
    V_FIELDCAT-COL_POS = '5'.
    V_FIELDCAT-FIELDNAME = 'MBRSH'.
    V_FIELDCAT-TABNAME = 'I_OUT'.
    V_FIELDCAT-REF_FIELDNAME = 'MBRSH'.
    V_FIELDCAT-REF_TABNAME = 'MARA'.
    APPEND V_FIELDCAT TO VT_FIELDCAT1.
    CLEAR V_FIELDCAT.
    V_FIELDCAT-COL_POS = '6'.
    V_FIELDCAT-FIELDNAME = 'MEINS'.
    V_FIELDCAT-TABNAME = 'I_OUT'.
    V_FIELDCAT-REF_FIELDNAME = 'MEINS'.
    V_FIELDCAT-REF_TABNAME = 'MARA'.
    APPEND V_FIELDCAT TO VT_FIELDCAT1.
    CLEAR V_FIELDCAT.
    V_FIELDCAT-COL_POS = '7'.
    V_FIELDCAT-FIELDNAME = 'MATKL'.
    V_FIELDCAT-TABNAME = 'I_OUT'.
    V_FIELDCAT-REF_FIELDNAME = 'MATKL'.
    V_FIELDCAT-REF_TABNAME = 'MARA'.
    APPEND V_FIELDCAT TO VT_FIELDCAT1.
    CLEAR V_FIELDCAT.
    V_FIELDCAT-COL_POS = '8'.
    V_FIELDCAT-FIELDNAME = 'VKORG'.
    V_FIELDCAT-TABNAME = 'I_OUT'.
    V_FIELDCAT-REF_FIELDNAME = 'VKORG'.
    V_FIELDCAT-REF_TABNAME = 'MVKE'.
    APPEND V_FIELDCAT TO VT_FIELDCAT1.
    CLEAR V_FIELDCAT.
    V_FIELDCAT-COL_POS = '9'.
    V_FIELDCAT-FIELDNAME = 'VTWEG'.
    V_FIELDCAT-TABNAME = 'I_OUT'.
    V_FIELDCAT-REF_FIELDNAME = 'VTWEG'.
    V_FIELDCAT-REF_TABNAME = 'MVKE'.
    APPEND V_FIELDCAT TO VT_FIELDCAT1.
    CLEAR V_FIELDCAT.
    V_FIELDCAT-COL_POS = '10'.
    V_FIELDCAT-FIELDNAME = 'SPRAS'.
    V_FIELDCAT-TABNAME = 'I_OUT'.
    V_FIELDCAT-REF_FIELDNAME = 'SPRAS'.
    V_FIELDCAT-REF_TABNAME = 'MAKT'.
    APPEND V_FIELDCAT TO VT_FIELDCAT1.
    CLEAR V_FIELDCAT.
    V_FIELDCAT-COL_POS = '11'.
    V_FIELDCAT-FIELDNAME = 'MAKTX'.
    V_FIELDCAT-TABNAME = 'I_OUT'.
    V_FIELDCAT-REF_FIELDNAME = 'MAKTX'.
    V_FIELDCAT-REF_TABNAME = 'MAKT'.
    APPEND V_FIELDCAT TO VT_FIELDCAT1.
    CLEAR V_FIELDCAT.
    V_FIELDCAT-COL_POS = '12'.
    V_FIELDCAT-FIELDNAME = 'LGORT'.
    V_FIELDCAT-TABNAME = 'I_OUT'.
    V_FIELDCAT-REF_FIELDNAME = 'LGORT'.
    V_FIELDCAT-REF_TABNAME = 'MARD'.
    V_FIELDCAT-SELTEXT_L = 'STRG LOCT'.
    V_FIELDCAT-OUTPUTLEN = 10.
    APPEND V_FIELDCAT TO VT_FIELDCAT1.
    CLEAR V_FIELDCAT.
    V_FIELDCAT-COL_POS = '13'.
    V_FIELDCAT-FIELDNAME = 'LABST'.
    V_FIELDCAT-TABNAME = 'I_OUT'.
    V_FIELDCAT-SELTEXT_M = 'STOCK'.
    V_FIELDCAT-OUTPUTLEN = 15.
    V_FIELDCAT-REF_FIELDNAME = 'LABST'.
    V_FIELDCAT-REF_TABNAME = 'MARD'.
    V_FIELDCAT-DO_SUM = 'X'.
    V_LAYOUT-TOTALS_TEXT = 'TOTAL STOCK:'.
    V_FIELDCAT-HOTSPOT = 'X'.
    APPEND V_FIELDCAT TO VT_FIELDCAT1.
    CLEAR V_FIELDCAT.
    V_FIELDCAT-COL_POS = '14'.
    V_FIELDCAT-FIELDNAME = 'EBELN'.
    V_FIELDCAT-TABNAME = 'I_OUT'.
    V_FIELDCAT-HOTSPOT = 'X'.
    V_FIELDCAT-REF_FIELDNAME = 'EBELN'.
    V_FIELDCAT-REF_TABNAME = 'EKPO'.
    APPEND V_FIELDCAT TO VT_FIELDCAT1.
    CLEAR V_FIELDCAT.
    V_FIELDCAT-COL_POS = '15'.
    V_FIELDCAT-FIELDNAME = 'EBELP'.
    V_FIELDCAT-TABNAME = 'I_OUT'.
    V_FIELDCAT-REF_FIELDNAME = 'EBELP'.
    V_FIELDCAT-REF_TABNAME = 'EKPO'.
    APPEND V_FIELDCAT TO VT_FIELDCAT1.
    CLEAR V_FIELDCAT.
    V_FIELDCAT-COL_POS = '16'.
    V_FIELDCAT-FIELDNAME = 'VBELN'.
    V_FIELDCAT-TABNAME = 'I_OUT'.
    V_FIELDCAT-HOTSPOT = 'X'.
    V_FIELDCAT-REF_FIELDNAME = 'VBELN'.
    V_FIELDCAT-REF_TABNAME = 'VBAP'.
    APPEND V_FIELDCAT TO VT_FIELDCAT1.
    CLEAR V_FIELDCAT.
    V_FIELDCAT-COL_POS = '17'.
    V_FIELDCAT-FIELDNAME = 'POSNR'.
    V_FIELDCAT-TABNAME = 'I_OUT'.
    V_FIELDCAT-REF_FIELDNAME = 'POSNR'.
    V_FIELDCAT-REF_TABNAME = 'VBAP'.
    APPEND V_FIELDCAT TO VT_FIELDCAT1.
    CLEAR V_FIELDCAT.
    ENDFORM. "FIELDCAT
    FORM OUTPUT *
    FORM OUTPUT.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
    I_CALLBACK_PROGRAM = SY-REPID
    I_CALLBACK_TOP_OF_PAGE = 'TOP-OF-PAGE'
    I_GRID_TITLE = 'CLICK ON MATERIAL/PURDOC/SALESDOC FOR DETAILS'
    I_CALLBACK_USER_COMMAND = 'DISPLAYDETAILS'
    IS_LAYOUT = V_LAYOUT
    IT_FIELDCAT = VT_FIELDCAT1
    TABLES
    T_OUTTAB = I_OUT.
    IF SY-SUBRC 0.
    ENDIF.
    ENDFORM. "OUTPUT
    FORM TOP-OF-PAGE *
    FORM TOP-OF-PAGE.
    DATA: T_HEADER TYPE SLIS_T_LISTHEADER,
    WA_HEADER TYPE SLIS_LISTHEADER.
    WA_HEADER-TYP = 'H'.
    WA_HEADER-INFO = 'REPORT FOR : '.
    APPEND WA_HEADER TO T_HEADER.
    CLEAR WA_HEADER.
    WA_HEADER-TYP = 'S'.
    WA_HEADER-INFO = 'MATERIAL DETAILS'.
    APPEND WA_HEADER TO T_HEADER.
    CLEAR WA_HEADER.
    WA_HEADER-TYP = 'S'.
    WA_HEADER-INFO = 'PURCHASE ORDER DETAILS'.
    APPEND WA_HEADER TO T_HEADER.
    CLEAR WA_HEADER.
    WA_HEADER-TYP = 'S'.
    WA_HEADER-INFO = 'SALES ORDER DETAILS'.
    APPEND WA_HEADER TO T_HEADER.
    CLEAR WA_HEADER.
    CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
    EXPORTING
    I_LOGO = 'GEAR'
    IT_LIST_COMMENTARY = T_HEADER.
    ENDFORM. "TOP-OF-PAGE
    *& FORM PURCHASEDATA_VALIDATION *
    FORM PURCHASEDATA_VALIDATION.
    SELECT EBELN EBELP MATNR
    FROM EKPO
    INTO TABLE I_EKPO
    FOR ALL ENTRIES IN I_MARC
    WHERE MATNR = I_MARC-MATNR
    AND EBELN IN S_EBELN
    AND WERKS EQ P_WERKS.
    IF I_EKPO[] IS INITIAL.
    WRITE:/ 'NO MATCHING DATA IS SELECTED FROM TABLE EKPO'.
    EXIT.
    ENDIF.
    DATA: T_EKPO LIKE I_EKPO OCCURS 0 WITH HEADER LINE.
    T_EKPO] = I_EKPO[.
    REFRESH I_EKPO.
    FREE I_EKPO.
    LOOP AT T_EKPO.
    SELECT SINGLE EBELN FROM EKKO INTO EKPO-EBELN
    WHERE EBELN = T_EKPO-EBELN.
    IF SY-SUBRC = 0.
    MOVE-CORRESPONDING T_EKPO TO I_EKPO.
    APPEND I_EKPO.
    CLEAR I_EKPO.
    ELSE.
    CONTINUE.
    ENDIF.
    ENDLOOP.
    SORT I_EKPO.
    ENDFORM. "PURCHASEDATA_VALIDATION
    *& FORM SALESDATA_VALIDATION *
    FORM SALESDATA_VALIDATION.
    SELECT VBELN POSNR MATNR
    FROM VBAP
    INTO CORRESPONDING FIELDS OF TABLE
    I_VBAP FOR ALL ENTRIES IN I_MARC
    WHERE MATNR = I_MARC-MATNR.
    DATA: T_VBAP LIKE I_VBAP OCCURS 0 WITH HEADER LINE.
    T_VBAP] = I_VBAP[.
    REFRESH I_VBAP.
    FREE I_VBAP.
    LOOP AT T_VBAP.
    SELECT SINGLE VBELN FROM VBAK INTO VBAK-VBELN
    WHERE VBELN = T_VBAP-VBELN.
    IF SY-SUBRC = 0.
    MOVE-CORRESPONDING T_VBAP TO I_VBAP.
    APPEND I_VBAP.
    CLEAR I_VBAP.
    ELSE.
    CONTINUE.
    ENDIF.
    ENDLOOP.
    SORT I_VBAP.
    ENDFORM. "SALESDATA_VALIDATION

  • VERY URGENT:REGARDING ALV REPORT

    HI,
    I am making Interactive alv report in which i have to display 3 views in a single report i.e.
    1.) I  have to display :-
    RAW MATERIAL      DAYS
    BOP                        DAYS
    Here days are the difference b/w the Material Doc. Date and Requsition Approval date.
    (which  i have already calculated.)
    2.) When i double click the raw material or bop option then material no and days are to be dislplayed.
    3.)  After double clicking the material then the its migo status and requsition status to be dislplayed .(this thing i had performed )
    My main problem is dat i have to write it all in a single ALV but its little confusing to me as i am doing this kind of report for first time.
    If anybody provide me useful or solved awnser ,he or she will be definately rewarded.
    Message was edited by:
            ric .s

    hi ric.s
    check this prog
    *& Report  ZSAMP_INTERCTIVE                                            *
    REPORT  zsamp_interctive                        .
    TABLES: mara,vbap.
    DATA : BEGIN OF itab OCCURS 0,
           matnr LIKE mara-matnr,
           ernam LIKE mara-ernam,
           END OF itab.
    DATA :  BEGIN OF itab1 OCCURS 0,
            matnr LIKE vbap-matnr,
            vbeln LIKE vbap-vbeln,
            END OF itab1.
    DATA: fld(20) TYPE c,val LIKE mara-matnr .
    SELECTION-SCREEN BEGIN OF BLOCK blk1 WITH FRAME TITLE text-001.
    SELECT-OPTIONS: m FOR mara-matnr OBLIGATORY.
    SELECTION-SCREEN END OF BLOCK blk1.
    *AT SELECTION-SCREEN ON m.
    SELECT SINGLE matnr FROM mara INTO mara-matnr WHERE matnr = m.
    IF sy-subrc NE 0.
       MESSAGE e000(zz) WITH 'invalid ' mara-matnr 'in your ' 'selection'.
    ENDIF.
    START-OF-SELECTION.
      SELECT matnr ernam INTO TABLE itab FROM mara WHERE matnr IN m.
      SELECT matnr vbeln INTO TABLE itab1 FROM vbap FOR ALL ENTRIES IN itab
      WHERE matnr = itab-matnr.
    END-OF-SELECTION.
      LOOP AT itab.
        WRITE:/20 itab-matnr,40 itab-ernam.
       hide itab-matnr.
        CLEAR itab-matnr.
      ENDLOOP.
    AT LINE-SELECTION.
      GET CURSOR FIELD fld  VALUE val.
      CASE fld.
        WHEN 'ITAB-MATNR'.
          WRITE:/ val.
      ENDCASE.
      CASE sy-lsind.
        WHEN '1'.
          SET PF-STATUS 'XX2'.
          SET TITLEBAR 'XX2'.
          IF itab1[] IS INITIAL.
            WRITE:/ 'no data found for itab1 in first secondary list'.
          ENDIF.
          LOOP AT itab1.
            WRITE:/30 itab1-matnr,60 itab1-vbeln.
           hide itab1-matnr.
          ENDLOOP.
        WHEN '2'.
          SET PF-STATUS 'XX2'.
          SET TITLEBAR 'XX2'.
          LOOP AT itab.
            WRITE:/30 itab-matnr,60 itab-ernam.
          ENDLOOP.
      ENDCASE.
    AT USER-COMMAND.
      CASE sy-ucomm.
        WHEN 'SET'.
          IF sy-lsind = 1.
            WINDOW STARTING AT 5 3 ENDING AT 40 10.
            WRITE 'Select line for a second window'.
          ELSEIF sy-lsind = 2.
            WINDOW STARTING AT 45 10 ENDING AT 60 12.
            WRITE 'Last window'.
          ENDIF.
        WHEN 'BACK'.
        sy-lsind = sy-lsind - 1.
        WHEN 'ABC'.
          WRITE:/ 'iam great'.
       WHEN 'DOWNLOAD'.
          CALL FUNCTION 'GUI_DOWNLOAD'
            EXPORTING
            BIN_FILESIZE                    =
              filename                        = 'c:\temp.txt'
              filetype                        = 'DAT'
            TABLES
              data_tab                        = itab
           FIELDNAMES                      =
           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.
      ENDCASE.
    TOP-OF-PAGE DURING  LINE-SELECTION.
      CASE sy-lsind.
        WHEN '1'.
          WRITE:/ 'this is secondary list'.
      ENDCASE.

Maybe you are looking for

  • Photoshop Elements 4.0 for Mac

    I have a Mac OS X Version 10.4.11 - 2.16GHz Intel Core Duo. I have recently purchased Photoshop Elements 4.0.1. When I click on 'standard edit' it comes up with a box which says ' learn more by clicking through these how to topics', but below that it

  • Problems with download

    I create a download link. It's works in the same way as in Denes Kubicek application. It works correctly. Then I create another one report with download link. In the second report I have a problem. When I clicked on it, I see Error page "Not found...

  • Technical data records? What's this???

    Hello, we are on BI7.0. I have master data for customer. One customer has as a key 0101010101. When I want to maintain this record it is only possible when the check-box "Display technical data records" is activated. Questions Why? What is this for a

  • Mix of Nexus 5500 & Catalyst 6500

    Hi there, Does Nexus 5500 series require a Nexus 7000 parent device? or it will be supported with Catalyst 6509? If this is the scenario : CAT6509 - Core Layer 3 CAT6509 - Distribution Layer 2/3 NX-5548 - Access Layer 2 And FYI, no VSS on Catalyst 65

  • Issue in replication

    Hello, We have a a SLT system [SAP NetWeaver 7.3 with DMIS 2011_1_730 0005 ]. When we try to replicate tables from  LTRC transaction, we see that the tables go into Replication[Initial mode] and stay like that. But when i go to proceesing steps tab a