New ALV report development

Hi gurus,
iam new to abap.
i have a requirement to develop a report program. the layout is:
palnt :_________
date:__________
1.initial report(button)
2.category wise(button)
3.per plant(button).
the above are the fields in my report.
when i enter the plant and date, and press any of the buttons, the report should be displayed within the same screen below the selection data itself..
the report is alv type, So overall my report goes with only one screen. So please guide me how to start with the navigation between the buttons and the screen.
please give a detailed explanation and not the ex codes.
points will be rewarded.
chaitu

this is a simple pgm i developed a loooong time ago for subscreen areas.
check it out.
*& Module pool       ZPK_SUB_SCREEN                                    *
PROGRAM  ZPK_SUB_SCREEN.
CONTROLS: TABC TYPE TABLEVIEW USING SCREEN 1002.
DATA: TCODE(4) TYPE C,
      BEGIN OF WA_T001,
        BUKRS TYPE BUKRS,
        BUTXT TYPE BUTXT,
      END OF WA_T001,
      IT_T001 LIKE TABLE OF WA_T001,
      WA_MARA TYPE MARA,
      IT_MARA LIKE TABLE OF WA_MARA.
*&      Module  STATUS_1000  OUTPUT
      text
module STATUS_1000 output.
  SET PF-STATUS 'MY_STATUS'.
SET TITLEBAR 'xxx'.
CASE SY-UCOMM.
WHEN 'BACK'.
LEAVE PROGRAM.
ENDCASE.
endmodule.                 " STATUS_1000  OUTPUT
*&      Module  USER_COMMAND_1001  INPUT
      text
module USER_COMMAND_1001 input.
CASE SY-UCOMM.
  WHEN 'EXE'.
  CALL TRANSACTION TCODE.
ENDCASE.
endmodule.                 " USER_COMMAND_1001  INPUT
*&      Module  USER_COMMAND_1002  INPUT
      text
module USER_COMMAND_1002 input.
CASE SY-UCOMM.
  WHEN 'DISP'.
  SELECT BUKRS BUTXT INTO TABLE IT_T001 FROM T001 UP TO 10 ROWS.
ENDCASE.
endmodule.                 " USER_COMMAND_1002  INPUT
*&      Module  USER_COMMAND_1003  INPUT
      text
module USER_COMMAND_1003 input.
CASE SY-UCOMM.
  WHEN 'ALV'.
    SELECT * INTO TABLE IT_MARA FROM MARA UP TO 5 ROWS.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
     EXPORTING
       I_CALLBACK_PROGRAM                = 'SY-CPROG'
       I_STRUCTURE_NAME                  = 'MARA'
      TABLES
        t_outtab                          = IT_MARA.
ENDCASE.
endmodule.                 " USER_COMMAND_1003  INPUT
MAIN SCREEN FLOW LOGIC
PROCESS BEFORE OUTPUT.
  MODULE STATUS_1000.
CALL SUBSCREEN: SS1 INCLUDING SY-REPID '1001',
                SS2 INCLUDING SY-REPID '1002',
                SS3 INCLUDING SY-REPID '1003'.
PROCESS AFTER INPUT.
  CALL SUBSCREEN: SS1, SS2, SS3.
MODULE USER_COMMAND_1000.
SUBSCREEN1 FLOW LOGIC
PROCESS BEFORE OUTPUT.
MODULE STATUS_1001.
PROCESS AFTER INPUT.
  MODULE USER_COMMAND_1001.
SUBSCREEN2 FLOW LOGIC
PROCESS BEFORE OUTPUT.
MODULE STATUS_1002.
LOOP AT IT_T001 INTO WA_T001 WITH CONTROL TABC
  CURSOR TABC-TOP_LINE.
ENDLOOP.
PROCESS AFTER INPUT.
LOOP.
ENDLOOP.
MODULE USER_COMMAND_1002.
SUBSCREEN2 FLOW LOGIC
PROCESS BEFORE OUTPUT.
MODULE STATUS_1003.
PROCESS AFTER INPUT.
MODULE USER_COMMAND_1003.
pk

Similar Messages

  • ALV Report Development using OOPs concept

    complete details of " ALV Report Development using OOPs concept".
    Thanks in advance ...

    hi Sudharshan,
    please use these sample codes to understand about OOALV
    BC_ALV_GRID_CONTROL
    BC_ALVHIERGRID1_D100
    BC_ALVHIERGRID1_D210
    BC_ALVHIERGRID1_HIER
    BC_ALV_DEMO_HTML_D0100
    BC_ALV_GRID_CONTROL
    BC_ALVEXCEL
    BC_ALVEXCEL_D100
    BC_ALVEXCEL_D210
    BC_ALVEXCEL_HIER
    BC_ALVEXCEL_SAP_TEMPL
    BC_ALVEXCEL_SAP_TEMPL_F01
    BC_ALVEXCEL_SAP_TEMPL_TOP
    BC_ALVEXCELTOP
    BC_ALVHIERGRID1_D100
    BC_ALVHIERGRID1_D210
    BC_ALVHIERGRID1_HIER
    BC_ALVHIERTOP
    For learning OOPS-ALV in every SAP their is transaction named ZALV
    or try the following links:
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCSRVALV/BCSRVALV.pdf
    The ALV object Grid methods allow the same functionality as ALV grid report function modules but are displayed within
    a screen (dialog program). SAP has provided a suit of programs which demonstrate how to For examples see standard SAP
    programs as detailed below:
    BCALV_EDIT_01 This report illustrates the simplest case of using an editable/noneditable ALV Grid Control.
    BCALV_EDIT_02 This report illustrates how to set chosen cells of an ALV Grid Control editable.
    BCALV_EDIT_03 In this example the user may change values of fields SEATSOCC (occupied seats) and/or PLANETYPE.
    The report checks the input value(s) semantically and provides protocol messages in case of error
    BCALV_EDIT_04 This report illustrates how to add and remove lines to a table using the ALV Grid Control and how to
    implement the saving of the new data.
    BCALV_EDIT_05 This example shows how to use checkboxes within an ALV Grid Control. You learn:
    (1) how to define a column for editable checkboxes for an attribute of your list
    (2) how to evaluate the checked checkboxes
    (3) how to switch between editable and non-editable checkboxes
    BCALV_EDIT_06 This example shows how to define a dropdown listbox for all cells of one column in an editable ALV
    Grid Control.
    BCALV_EDIT_07 This example shows how to define dropdown listboxes for particular cells of your output table.
    BCALV_EDIT_08 This report implements an ALV Grid Control with an application specific F4 help. The following aspects
    are dealt with:
    (1) how to replace the standard f4 help
    (2) how to pass the selected value to the ALV Grid Control
    (3) how to build an f4 help, whose value range depend on a value of another cell.

  • Is there any help for ALV report development with  funcation modules?

    Hi,
    please tell me any help or example to understand the ALV function module.

    Hi neha,
    1. very simple alv
       (with minimum code)
    2. just copy paste
    3.
    report abc.
    TYPE-POOLS : slis.
    DATA : alvfc TYPE slis_t_fieldcat_alv.
    DATA : alvfcwa TYPE slis_fieldcat_alv.
    data : begin of itab occurs 0.
            include structure usr02.
    data : end of itab.
    START-OF-SELECTION.
      select * from usr02
      into table itab.
      CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
        EXPORTING
          i_program_name         = sy-repid
          i_internal_tabname     = 'ITAB'
          i_inclname             = sy-repid
        CHANGING
          ct_fieldcat            = alvfc
        EXCEPTIONS
          inconsistent_interface = 1
          program_error          = 2
          OTHERS                 = 3.
    Display
      CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
        EXPORTING
          it_fieldcat   = alvfc
        TABLES
          t_outtab      = itab
        EXCEPTIONS
          program_error = 1
          OTHERS        = 2.
    regards,
    amit m.

  • Alv report development.

    Hi,
        In fi module i am getting open items details with existing Zreport . now in that i need to get
    cleared items details also when user select that cleared item radio button.

    hi
    good
    go through this link
    http://www.sap-img.com/bc045.htm
    i think a basis consultant can help you to get a MINISAP cd.
    thanks
    mrutyun6

  • ALV report layout

    Hi Expert,
    Please help me.
    I have develop a new alv report for my client. I have faceing problem in report layout.
    The below is the layout, please advice me how can i design the layout using alv.
               total no of hotel | Room available | Occupied room|
    Hotel 1 |
    Day |
    Month |
    Year |
    Hotel 2 |
    Day |
    Month |
    Year |
    Hotel 3 |
    Thanks in Advance.
    Thanks & Regards,

    Hi
    Check out the following links:
    ALV display coloumns as rows
    ALV display coloumns as rows
    Hope this helps
    Regards,
    Jayanthi.K

  • Authorization of alv report based on plants

    I have created a new alv report for sale order statement.The problem is which can be seen in all plants
    irespective of the user.Suppose our company has 5 palnt
    Plant 1100 to 1500
    The problem is suppose a user he has only rights in a prticular plant but he can see all the palnt sale order details
    How can we authorize this particular alv report based on the plants

    Hello,
    My assumption: You have Company Code(T001-BUKRS) in the selection-screen.
    Plz check the code snippet below:
    DATA:
    IT_PLANT TYPE STANDARD TABLE OF WERKS,
    WA_PLANT LIKE LINE OF IT_PLANT.
    DATA:
    IT_R_WERKS TYPE RANGE_T_WERKS_D,
    R_WERKS TYPE RANGE_S_WERKS_D.
    SELECT BWKEY INTO TABLE IT_PLANT
    FROM T001K
    WHERE BUKRS = '1000'. "--> Here you have to use your sel. scr. parameter
    IF SY-SUBRC = 0.
      SORT IT_PLANT BY WERKS.
    ENDIF.
    LOOP AT IT_PLANT INTO WA_PLANT.
    * Check the authority for the plant
      AUTHORITY-CHECK OBJECT 'M_MSEG_WMB'
               ID 'ACTVT' FIELD '03'
               ID 'WERKS' FIELD WA_PLANT-WERKS.
      IF SY-SUBRC = 0.
        R_WERKS-SIGN = 'I'.
        R_WERKS-OPTION = 'EQ'.
        R_WERKS-LOW = WA_PLANT-WERKS.
        APPEND R_WERKS TO IT_R_WERKS.
        CLEAR R_WERKS.
      ENDIF.
    ENDLOOP.
    IF IT_R_WERKS IS NOT INITIAL.
      "Select data using the Plants for which user is authorised
    ELSE.
      "User has no authority to display any Plant data
    ENDIF.
    Hope this is of some help to you.
    BR,
    Suhas
    Edited by: Suhas Saha on Mar 18, 2009 10:18 AM

  • Problem in exporting ALV Report to excel sheet

    Hi All,
    I have developed a Report and now facing problem in exporting the same to excel sheet.
    When we click the "Locate File" icon in the report layout, the system will pop up a window with radio buttons. I have opted for 'Spreadsheet'.
    When i save the excel sheet into my desktop, the excel file has all the report headers (Title of each column). But no value is exported.
    There are around 15 columns in the report and the excel sheet shows value of last 2 columns which has some text.
    I have been into ALV report development and developed around 30+ reports in the same fashion.
    What might be the reason behind this issue?
    When i export other reports into excel sheet, everything is perfect without any flaws......
    Kindly help me out......
    Regards
    Pavan

    Hi,
    Here's my suggestion: Install OpenOffice.org and ask SAP to deliver good integration with OpenOffice.org.
    Alternative suggestion: re-install SAP Gui on the PC where the integration is not working. If that does not help, re-install Microsoft Office as well.
    Here's my comment: I think you should ask this question in a different forum, e.g. in the Duet forum. That may not be the correct forum either, but as it is a Microsoft/SAP integration technology forum, someone there may know the solution.
    Regards,
    Raj.

  • Automatic Display of NEW Data in ALV Report using Classes and Methods

    Hi,
    I have developed a ALV Report for displaying data from a set of DB tables using ABAP OO, Classes and Methods. The requirement is to have the report output to be automatically updated with the new entries from the DB table at a regular frequency of tiem may be every two minutes.
    Could anyone please tell me how can this be acheived.
    Thanks and regards,
    Raghavendra Goutham P.

    Yes its possible.
    Take a look at this thread
    Auto refresh of ALV Grid, without user interaction
    Or Rich's blog
    /people/rich.heilman2/blog/2005/10/18/a-look-at-clguitimer-in-46c
    Regards,
    Ravi
    Note : Please mark all the helpful answers

  • While developing a ALV report

    hi.
    i am developing  a ALV report.i need to add one extra button. can any one suggest me how

    Try this way:
    I am showing in OO ABAP area:
    Declare in TOP
          CLASS lcl_event_handler DEFINITION
          Class event handler
    CLASS lcl_event_handler DEFINITION .
      PUBLIC SECTION .
        METHODS:
    *To add new functional buttons to the ALV toolbar
        handle_toolbar FOR EVENT toolbar OF cl_gui_alv_grid
        IMPORTING e_object,
    *To implement user commands
        handle_user_command
        FOR EVENT user_command OF cl_gui_alv_grid
        IMPORTING e_ucomm.
      PRIVATE SECTION.
    ENDCLASS.                    "lcl_event_handler DEFINITION
    DATA: gr_event_handler1 TYPE REF TO lcl_event_handler,
          gr_event_handler2 TYPE REF TO lcl_event_handler,
          flag_alv          TYPE c.
    Implement the above defined methods in the forms(F01) or main pgm
          CLASS lcl_event_handler IMPLEMENTATION
          Implementing the method definitions
    CLASS lcl_event_handler IMPLEMENTATION .
    *Handle Toolbar
      METHOD handle_toolbar.
        PERFORM handle_toolbar USING e_object.
      ENDMETHOD .                    "handle_toolbar
    *Handle User Command
      METHOD handle_user_command .
        PERFORM handle_user_command USING e_ucomm.
      ENDMETHOD .                    "handle_user_command
    ENDCLASS.                    "lcl_event_handler IMPLEMENTATION
    *Create an object(instance) for the event handler in F01
    Creating an instance for the event handler
        CREATE OBJECT gr_event_handler1.
    Registering handler methods to handle ALV Grid events
        SET HANDLER gr_event_handler1->handle_user_command FOR g_alv_grid1.
        SET HANDLER gr_event_handler1->handle_toolbar FOR g_alv_grid1.
    *&      Form  handle_toolbar
          Create buttons on ALV Toolbar
          No parameters need to be passed to this form
    *FORM handle_toolbar USING
                       i_object TYPE REF TO cl_alv_event_toolbar_set .
    DATA: ls_toolbar TYPE stb_button.
    CLEAR ls_toolbar.
    MOVE 3 TO ls_toolbar-butn_type.
    APPEND ls_toolbar TO i_object->mt_toolbar.
    CLEAR ls_toolbar.
    IF flag_alv = '1'.
    Header Details
       MOVE   'FIND1'               TO ls_toolbar-function.
       MOVE   icon_select_detail    TO ls_toolbar-icon.
       MOVE   'Header Details'(t03) TO ls_toolbar-text.
       CLEAR  ls_toolbar-disabled.
       APPEND ls_toolbar            TO i_object->mt_toolbar.
       CLEAR  ls_toolbar.
    Item Details
       MOVE   'DETAIL1'             TO ls_toolbar-function.
       MOVE   icon_select_detail    TO ls_toolbar-icon.
       MOVE   'Item Details'(t04)   TO ls_toolbar-text.
       CLEAR  ls_toolbar-disabled.
       APPEND ls_toolbar            TO i_object->mt_toolbar.
    ENDIF.
    IF flag_alv = '2'.
    Header Details
       MOVE   'FIND2'               TO ls_toolbar-function.
       MOVE   icon_select_detail    TO ls_toolbar-icon.
       MOVE   'Header Details'(t03) TO ls_toolbar-text.
       CLEAR  ls_toolbar-disabled.
       APPEND ls_toolbar            TO i_object->mt_toolbar.
       CLEAR  ls_toolbar.
    Item Details
       MOVE   'DETAIL2'             TO ls_toolbar-function.
       MOVE   icon_select_detail    TO ls_toolbar-icon.
       MOVE   'Item Details'(t04)   TO ls_toolbar-text.
       CLEAR  ls_toolbar-disabled.
       APPEND ls_toolbar            TO i_object->mt_toolbar.
    *&      Form  handle_user_command
          User Command for ALV Toolbar Buttons
         -->P_E_UCOMM  UCOMM
    FORM handle_user_command  USING    p_e_ucomm TYPE any.
      CASE p_e_ucomm .
        WHEN 'FIND1'.
    For Header detail display
          PERFORM get_selected_rows USING g_alv_grid1.
          IF i_rowid IS INITIAL.
            MESSAGE i000(zv_gts) WITH 'Select atleast one row'(e11).
            EXIT.
          ENDIF.
          PERFORM read_detail TABLES i_zvfx_gts008_head_l .
          CALL SCREEN 9020.
        WHEN 'DETAIL1'.
    For Item Summary display
          PERFORM get_selected_rows USING g_alv_grid1.
          IF i_rowid IS INITIAL.
            MESSAGE i000(zv_gts) WITH 'Select atleast one row'(e11).
            EXIT.
          ENDIF.
          PERFORM read_detail TABLES i_zvfx_gts008_head_l.
          CALL SCREEN 9030.
        WHEN 'FIND2' .
    For Header detail display
          PERFORM get_selected_rows USING g_alv_grid2.
          IF i_rowid IS INITIAL.
            MESSAGE i000(zv_gts) WITH 'Select atleast one row'(e11).
            EXIT.
          ENDIF.
          PERFORM read_detail TABLES i_zvfx_gts008_head.
          CALL SCREEN 9020.
        WHEN 'DETAIL2'.
    For Item Summary display
          PERFORM get_selected_rows USING g_alv_grid2.
          IF i_rowid IS INITIAL.
            MESSAGE i000(zv_gts) WITH 'Select atleast one row'(e11).
            EXIT.
          ENDIF.
          PERFORM read_detail TABLES i_zvfx_gts008_head.
          CALL SCREEN 9030.
        WHEN OTHERS.
      ENDCASE .
    ENDFORM.                    " handle_user_command
    ENDIF.
    *ENDFORM.                    "handle_toolbar

  • How to use at new in alv report

    Hi Experts,
    I am creating a ALV report in which i have to sorted the data with 1 field like " if there the one division that have multiple department , so i have to show the output like division name then next row contain the releted dept of that"
    can you plz suggest me how to i do this.
    Thanks....

    Hi Asamadhi,
    Using control break statement(At new or at end of)you can do this.
    At first sort the internal table by key field(for your case i think division).
    at first field(division)
    write:/  data.
    endat.
    Regards,
    Tutun

  • New field category not display in ALV report

    Hi,
    Hi, I modifying an existing ALV report.
    I have a problem to insert the new field into the ALV report.
    The field and column title have been populated in alv field category correctly, but when FM 'REUSE_ALV_GRID_DISPLAY'  executed, the new field and column didn't appear.
    Anybody can help me.
    Regards
    Nislina

    hi
    Add that new field in the fieldcatalog and populate the value in the value in the internal table.
    loop at it_fieldcatalog into wa_fieldcatalog.
    wa_fieldcatalog-fieldname = 'NEW_FIELD'.
    wa_fieldcatalog-outputlen = '15'.
    append wa_fieldcatalog to it_fieldcatalog.
    clear wa_fieldcatalog,
    endloop.
    regards
    ravish
    <b>plz reward points if helpful</b>

  • Old icons on ALV  report dissappears when new ones are added

    Hi friends
    I have created an ALV report. However, when I tried adding new icons using Set PF-STATUS,
    the original icons are not being shown. THey are totally dissappearing from the screen.
    Is there a way to avoid this.
    Any feed back will be greatly appreciated.
    Thanks
    Ram

    Hi,
    How did you create the GUI status..
    you have to copy the standard gui status..STANDARD from the program SAPLKKBL and then add the button..
    GO to SE41..
    Press Copy status button..
    Frm
       program - SAPLKKBL
       Status   - Standard
    To
      Program - Your program name
      Status    - Your Status
    Once it is copied..
    In the new status add your buttons and activate..
    Now it will show the custom buttons along with the standard..
    Thanks,
    Naren

  • To develope an alv report or module pool and field link.. and effor require

    HI,
    I want to display the fields with sort functionality with fields
    kunnr  kna1 table
    name1 kna1
    and email id from table ADR6 field SMTP_ADDR
    my question ison mapping
    from kna1 we can get field kunnr and name1
    and adrnr
    to put in adr6 to fetch email id
    can anyoe suggest on select statements link as table kna1 has one unique kunnr
    but it can have multiple name1 and adrnr
    so how to pick the kunnr ,name 1 and adrnr from table kna1 and map to
    adr6 table
    as witinn the table kna1 there can be multiple name1 related to one single kunnr
    so wil it be like
    select kunnr from kna1..into it_kunnr
    then select nam1 from table kna2 for all entrirs in It_kunnr
    or firse selet kunnr name1 from kna1 into table it_kunnr
    pls suggest an appropiat select statament
    and i suppose this can be achevied by alv report no need for moudle pool
    regards
    Arora

    opened  a new thread with changes subject

  • Add new line in ALV report on click of button...

    Dear All,
    How to add a new line for input in ALV report at runtime, on click of a button.
    Waiting for early and favorable reply.
    Regards,
    Dharmesh Vyas

    Hi,
    First of all u have to Create ur own PF-status and Assign Fcode e.g 'INSERTROW'.
    So, whenevr you will click Insertrow button it will be triggered in your User Command and then just Append the blank line in your Final Internal Table.
    And Refresh Icon will be there by default...
    To Trigger it You have to write rs_selfield-refresh = 'X'
    You can also follow the below link...
    Try it.
    Link:[http://wiki.sdn.sap.com/wiki/display/ABAP/ALVeasytutorial].
    Regards
    Arbind

  • Add new line in ALV report and Refresh button

    How to add a new line in a ALV report?
    How to add a refresh button in a report?

    Hi,
    First of all u have to Create ur own PF-status and Assign Fcode e.g 'INSERTROW'.
    So, whenevr you will click Insertrow button it will be triggered in your User Command and then just Append the blank line in your Final Internal Table.
    And Refresh Icon will be there by default...
    To Trigger it You have to write rs_selfield-refresh = 'X'
    You can also follow the below link...
    Try it.
    Link:[http://wiki.sdn.sap.com/wiki/display/ABAP/ALVeasytutorial].
    Regards
    Arbind

Maybe you are looking for