Problem in Reuse_alv_grid_display

Hi Expert,
                    I am using the Reuse_alv_grid_display for dispay the Grid in the Report Program without using the ABAP Objects, the Grid is displaying and when we are trying to select the Row its giving the permission to select the Multiple row, we don't need the multiple selection ... we need only the single row selection at the same time.....
Is there any parameter in the Reuse_alv_grid_display for selection criteria
Please help me
Thanks in advance

hi,
In field catalogue set the checkbox as follows.
MOVE 'checkbox' TO e_layout-box_fieldname.
MOVE 'x'  TO e_layout-colwidth_optimize.
the perform f_validation will check if one or more lines is checked or not.
  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      i_callback_program       = sy-repid
      i_callback_pf_status_set = 'f_set_pfstatus'         
      i_callback_user_command  = 'f_zuser_command'  
      is_layout                = e_layout
      it_fieldcat              = ts_fieldcat
    TABLES
      t_outtab                 = ts_final
    EXCEPTIONS
      program_error            = 1
      OTHERS                   = 2.
  IF sy-subrc NE 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
            WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  ENDIF.
FORM f_zuser_command USING us_r_ucomm LIKE sy-ucomm
                         us_rs_selfield TYPE slis_selfield. "#EC NEEDED
  DATA : ob_ref_grid TYPE REF TO cl_gui_alv_grid.
  CLEAR : ob_ref_grid.
  IF ob_ref_grid IS INITIAL.
    CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
      IMPORTING
        e_grid = ob_ref_grid.
    IF sy-subrc EQ c_0.                              
      SKIP c_0.
    ENDIF.
  ENDIF.
  IF NOT ob_ref_grid IS INITIAL.
    CALL METHOD ob_ref_grid->check_changed_data .
    CALL METHOD ob_ref_grid->refresh_table_display.
  ENDIF.
  CASE us_r_ucomm.
    WHEN case1.
      PERFORM f_validation.
    WHEN case2.
      PERFORM f_validation.
  WHEN others.
  ENDCASE. " endcase
ENDFORM.   
FORM f_validation .
  CLEAR  w_line.
  FREE ts_final1.
  LOOP AT ts_final ASSIGNING <fs_final>.
    IF <fs_final>-checkbox EQ c_x.
      CLEAR : e_final.
      MOVE <fs_final> TO e_final.
      APPEND e_final TO ts_final1.
    ENDIF.
  ENDLOOP.
  DESCRIBE TABLE ts_final1 LINES w_line.
  IF w_line LE 0
  OR w_line GT 1.
    MESSAGE e210 WITH 'Select one row at a time !!'.
  ENDIF.
ENDFORM.

Similar Messages

  • REUSE_ALV_GRID_DISPLAY   - in background - print problem

    Hi all .
         I am using the function module REUSE_ALV_GRID_DISPLAY  with a lot of fields in line .
         Result of report in case of on line running looks well , but I have problem with job in background :
               Part of the fields were transferred to additional line and report doesn't  look good .
               How can I solve this problem ?
               Regards Helena  .

    To get the right format of output in the spool we generally increase the u201Cno. of columns fieldu201D in the Format typesu201D.
    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
    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
    Hope it will solve ur problem.
    Regards,
    JOy.

  • Problems displaying itab with 'REUSE_ALV_GRID_DISPLAY'

    Hi experts!
    I have a problem displaying the internal table itab_test. Itab_uload is a TYPE TABLE of a complex and nested structure I defined in the DDIC. I am able to pass the entries, which are not conform with the specifications, to itab_test, but when I execute the program I get a short dump.
    Error message is:" It was tried to pass the internal table IT_FIELDCAT to the formal parameter IT_FIELDCAT. In doing so, a ^type conflict occured between the formal and the actual parameter."
    Can anybody please advise on the code-sample below. What did I wrong and what can I do to correct it?
    Thanks a lot for your help!
    Johann
    P.S.:Points will be rewarded for helpful answers!
    *&          DECLARATIONS
    TYPES: BEGIN OF error_test,
           oz TYPE c,
           bez TYPE c,
           END OF error_test.
    DATA: itab_test TYPE TABLE OF error_test WITH HEADER LINE,
          itab_upload TYPE TABLE OF zstr_gaeb WITH HEADER LINE.
    DATA: wa_upload TYPE zstr_gaeb,
          wa_lvbereich TYPE zstr_lvbereich,
          wa_bereichdeslv TYPE zstr_bereichdeslv,
          wa_beschreibung TYPE zstr_lvbeschreibung,
          wa_position TYPE zstr_position.
    DATA :      it_fieldcat TYPE lvc_t_fcat,
              wa_fieldcat LIKE LINE OF it_fieldcat,
              wrk_pos TYPE i.      
    *&           START OF SELECTION
    START-OF-SELECTION.
    LOOP AT itab_upload INTO wa_upload.
        LOOP AT wa_upload-vergabe-lv-lvbereich INTO wa_lvbereich.
          oz_len = STRLEN( wa_lvbereich-oz ).
          IF oz_len <> 3.
            MOVE wa_lvbereich-oz TO itab_test-oz.
            MOVE wa_lvbereich-bez TO itab_test-bez.
          ENDIF.
        ENDLOOP.
      ENDLOOP.
      CLEAR wa_fieldcat.
      wrk_pos = wrk_pos + 1.
      wa_fieldcat-col_pos = wrk_pos.
      wa_fieldcat-tabname = 'ITAB_TEST'.
      wa_fieldcat-fieldname = 'oz'.
      wa_fieldcat-seltext = 'Ordnungszahl'.
      wa_fieldcat-emphasize = ''.
      wa_fieldcat-hotspot = 'X'.
      APPEND wa_fieldcat TO it_fieldcat.
      CLEAR wa_fieldcat.
      wrk_pos = wrk_pos + 1.
      wa_fieldcat-col_pos = wrk_pos.
      wa_fieldcat-tabname = 'ITAB_TEST'.
      wa_fieldcat-fieldname = 'bez'.
      wa_fieldcat-seltext = 'Bezeichnung'.
      wa_fieldcat-emphasize = ''.
      wa_fieldcat-hotspot = ''.
      APPEND wa_fieldcat TO it_fieldcat.
      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_CALLBACK_TOP_OF_PAGE            = ' '
      I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
      I_CALLBACK_HTML_END_OF_LIST       = ' '
      I_STRUCTURE_NAME                  =
      I_BACKGROUND_ID                   = ' '
      I_GRID_TITLE                      =
      I_GRID_SETTINGS                   =
      IS_LAYOUT                         =
         it_fieldcat                       = 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
      I_HTML_HEIGHT_TOP                 = 0
      I_HTML_HEIGHT_END                 = 0
      IT_ALV_GRAPHICS                   =
      IT_HYPERLINK                      =
      IT_ADD_FIELDCAT                   =
      IT_EXCEPT_QINFO                   =
      IR_SALV_FULLSCREEN_ADAPTER        =
    IMPORTING
      E_EXIT_CAUSED_BY_CALLER           =
      ES_EXIT_CAUSED_BY_USER            =
        TABLES
          t_outtab                          = itab_test
    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.

    Hello,
    Make the change like this
      DATA: L_R_REPID LIKE SY-REPID.
      L_R_REPID = SY-REPID.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
    I_CALLBACK_PROGRAM = L_R_REPID " CHeck here
    * I_INTERFACE_CHECK = ' '
    * I_BYPASSING_BUFFER = ' '
    * I_BUFFER_ACTIVE = ' '
    * I_CALLBACK_PROGRAM = ' '
    * I_CALLBACK_PF_STATUS_SET = ' '
    * I_CALLBACK_USER_COMMAND = ' '
    * I_CALLBACK_TOP_OF_PAGE = ' '
    * I_CALLBACK_HTML_TOP_OF_PAGE = ' '
    * I_CALLBACK_HTML_END_OF_LIST = ' '
    * I_STRUCTURE_NAME =
    * I_BACKGROUND_ID = ' '
    * I_GRID_TITLE =
    * I_GRID_SETTINGS =
    * IS_LAYOUT =
    it_fieldcat = 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
    * I_HTML_HEIGHT_TOP = 0
    * I_HTML_HEIGHT_END = 0
    * IT_ALV_GRAPHICS =
    * IT_HYPERLINK =
    * IT_ADD_FIELDCAT =
    * IT_EXCEPT_QINFO =
    * IR_SALV_FULLSCREEN_ADAPTER =
    * IMPORTING
    * E_EXIT_CAUSED_BY_CALLER =
    * ES_EXIT_CAUSED_BY_USER =
    TABLES
    t_outtab = itab_test
    * 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.
    VAsanth

  • Problem displaying itab with reuse_alv_grid_display

    Hi experts!
    I passed non-conform entries from itab_upload to itab_test. I do not find any syntax error and I do not get a short dump, but the table which appears on the screen does not contain any data, but empty columns ( with the right title ). I also tried it with reuse_alv_list_display, but the in the fields of the list is written: no data.
    I checked with the debugger and itab_test contains the data when it is passed to the Function...
    Can you please advise me where I did wrong?
    Below you will find the code.
    Thanks a lot for your help!
    Johann
    P.S.:Points will be rewarded for helpful answers!
    *& DECLARATIONS
    TYPE-POOLS: slis.
    TYPES: BEGIN OF error_test,
    oz(255) TYPE c,
    bez(255) TYPE c,
    END OF error_test.
    DATA: itab_test TYPE TABLE OF error_test WITH HEADER LINE,
    itab_upload TYPE TABLE OF zstr_gaeb WITH HEADER LINE.
    DATA: wa_upload TYPE zstr_gaeb,
    wa_lvbereich TYPE zstr_lvbereich,
    wa_bereichdeslv TYPE zstr_bereichdeslv,
    wa_beschreibung TYPE zstr_lvbeschreibung,
    wa_position TYPE zstr_position.
    DATA : it_fieldcat TYPE slis_t_fieldcat_alv,
    wa_fieldcat LIKE LINE OF it_fieldcat,
    wrk_pos TYPE i.
    *& START OF SELECTION
    START-OF-SELECTION.
    LOOP AT itab_upload INTO wa_upload.
    LOOP AT wa_upload-vergabe-lv-lvbereich INTO wa_lvbereich.
    oz_len = STRLEN( wa_lvbereich-oz ).
    IF oz_len <> 3.
    MOVE wa_lvbereich-oz TO itab_test-oz.
    MOVE wa_lvbereich-bez TO itab_test-bez.
    ENDIF.
    ENDLOOP.
    ENDLOOP.
    CLEAR wa_fieldcat.
    wrk_pos = wrk_pos + 1.
    wa_fieldcat-col_pos = wrk_pos.
    wa_fieldcat-tabname = 'ITAB_TEST'.
    wa_fieldcat-fieldname = 'oz'.
    wa_fieldcat-seltext = 'Ordnungszahl'.
    wa_fieldcat-emphasize = ''.
    wa_fieldcat-hotspot = 'X'.
    APPEND wa_fieldcat TO it_fieldcat.
    CLEAR wa_fieldcat.
    wrk_pos = wrk_pos + 1.
    wa_fieldcat-col_pos = wrk_pos.
    wa_fieldcat-tabname = 'ITAB_TEST'.
    wa_fieldcat-fieldname = 'bez'.
    wa_fieldcat-seltext = 'Bezeichnung'.
    wa_fieldcat-emphasize = ''.
    wa_fieldcat-hotspot = ''.
    APPEND wa_fieldcat TO it_fieldcat.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
    I_INTERFACE_CHECK = ' '
    I_BYPASSING_BUFFER = ' '
    I_BUFFER_ACTIVE = ' '
    I_CALLBACK_PROGRAM = l_r_repid
    I_CALLBACK_PF_STATUS_SET = ' '
    I_CALLBACK_USER_COMMAND = ' '
    I_CALLBACK_TOP_OF_PAGE = ' '
    I_CALLBACK_HTML_TOP_OF_PAGE = ' '
    I_CALLBACK_HTML_END_OF_LIST = ' '
    I_STRUCTURE_NAME =
    I_BACKGROUND_ID = ' '
    I_GRID_TITLE =
    I_GRID_SETTINGS =
    IS_LAYOUT =
    it_fieldcat = 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
    I_HTML_HEIGHT_TOP = 0
    I_HTML_HEIGHT_END = 0
    IT_ALV_GRAPHICS =
    IT_HYPERLINK =
    IT_ADD_FIELDCAT =
    IT_EXCEPT_QINFO =
    IR_SALV_FULLSCREEN_ADAPTER =
    IMPORTING
    E_EXIT_CAUSED_BY_CALLER =
    ES_EXIT_CAUSED_BY_USER =
    TABLES
    t_outtab = itab_test
    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.

    Hello,
    The problem is here.
    Firsdt
    " First check her.
    LOOP AT itab_upload INTO wa_upload.
    LOOP AT wa_upload-vergabe-lv-lvbereich INTO wa_lvbereich.
    oz_len = STRLEN( wa_lvbereich-oz ).
    IF oz_len <> 3.
    MOVE wa_lvbereich-oz TO itab_test-oz.
    MOVE wa_lvbereich-bez TO itab_test-bez.
    APPEND ITAB_TEST.  " The table is not appended
    ENDIF.
    ENDLOOP.
    ENDLOOP.
    "Give the fieldname in UPPER CASE
    CLEAR wa_fieldcat.
    wrk_pos = wrk_pos + 1.
    wa_fieldcat-col_pos = wrk_pos.
    wa_fieldcat-tabname = 'ITAB_TEST'.
    wa_fieldcat-fieldname = 'OZ'.  " Check here
    wa_fieldcat-seltext = 'Ordnungszahl'.
    wa_fieldcat-emphasize = ''.
    wa_fieldcat-hotspot = 'X'.
    APPEND wa_fieldcat TO it_fieldcat.
    CLEAR wa_fieldcat.
    wrk_pos = wrk_pos + 1.
    wa_fieldcat-col_pos = wrk_pos.
    wa_fieldcat-tabname = 'ITAB_TEST'.
    wa_fieldcat-fieldname = 'BEZ'.  " Check here
    wa_fieldcat-seltext = 'Bezeichnung'.
    wa_fieldcat-emphasize = ''.
    wa_fieldcat-hotspot = ''.
    APPEND wa_fieldcat TO it_fieldcat.
    If useful reward.
    Vasanth

  • Reuse_alv_grid_display TITLE problem after refresh

    All,
    I have a alv report using fm reuse_alv_grid_display. While calling initially this fm i am passing the grid tile in I_GRID_TITLE parameter. its displaying in grid, then after user click on the app toolbar button , i am doing some filteration , then coming back to grid the TITLE is missing in display
    Any Info .  below is the code snipet
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
         i_callback_program             = sy-repid
         i_callback_pf_status_set       = 'F_PF_STATUS_SET'
         i_callback_user_command        = gc_user_com
         i_grid_title                   = gv_gtitle "<< passing initially
    then in User_command i am filering some values on the basis of button clicked (Button placed in app toolbar)
    FORM f_user_command USING p_ucomm    LIKE sy-ucomm
                              p_selfield TYPE slis_selfield .
        WHEN '&EXP'.
          perform f_expand.
          p_selfield-refresh = 'X'.  "<<<----- refresh the grid
      code for f_expand
    form f_expand.
        CALL FUNCTION 'REUSE_ALV_GRID_LAYOUT_INFO_GET'  " Getting current layout
          IMPORTING
            es_layout      = ls_layout
            et_filter      = lt_filter
            es_grid_scroll = ls_grid_scroll
            es_print       = ls_print
          EXCEPTIONS
            OTHERS         = 1.
    " Here doing some filteration. ie append some values to IT_FILTER table for enabling then filter
        perform f_set_fltr_val_exp using lt_filter[].
        ls_layout-colwidth_optimize = gc_x.
        read table gt_sfieldcat into gv_fieldcat
                          with key fieldname = 'REGIO'.
        if sy-subrc eq 0.
          gv_fieldcat-no_out = ' '.
          modify gt_sfieldcat from gv_fieldcat index sy-tabix.
        endif.
    * Set the grid title to include the parameters and the report type
      CONCATENATE text-027 p_bukrs text-028 p_perio
                  text-029 p_gjahr
             INTO gv_gtitle SEPARATED BY space.
        CALL FUNCTION 'REUSE_ALV_GRID_LAYOUT_INFO_SET'
          EXPORTING
            is_layout      = ls_layout
            it_fieldcat    = gt_sfieldcat
            it_sort        = gt_sort
            it_filter      = lt_filter
            is_grid_scroll = ls_grid_scroll
            is_print       = ls_print
          EXCEPTIONS
            OTHERS         = 0.
    endform.                    " F_expand

    Hi All,
    Thanks for your replies.  I have done all that has been said.  My problem is that when the user double clicks on the ALV without pressing the sort button in the ALV display, the index provided in the user-command subroutine is the same as the index of the record in the internal table.  But, when the user sorts dynamically when the ALV is displayed and then double clicks, the index of the record provided by ALV is different from the index of that record in the internal table.
    For example, when the ALV grid is shown a record is in the 1st row, and when the user double clicks now, the index of this record provided is 1 which is same as the index in the internal table.
    But, after the user sorts in the display, if this record moves to the 5th row, the index provided by ALV will become 5, but, actually the index in the internal table is still 1.
    Hope I have clarified my problem.
    Thanks,
    Sridhar

  • Pop problem while creating spool request in reuse_alv_grid_display

    Hi Experts,
    I am trying to create a spool request of alv
    and problem is that i do not want pop-up window for asking output devices,
    actually i am calling reuse alv in loop and following steps i have done:
    w_print-print = 'X'.
      CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
        EXPORTING
          I_BYPASSING_BUFFER = 'X'
          I_CALLBACK_PROGRAM = SY-REPID
          IT_FIELDCAT         = FIELDCAT[]
          I_DEFAULT           = 'X'
          I_SAVE                = 'X'
          is_print                 = w_print
        TABLES
          T_OUTTAB           = T_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.
    Please give the solution.
    Thanks
    Pankaj

    Hi,
    Use FM GET_PRINT_PARAMETERS ,  and  use command NEW-PAGE PRINT ON PARAMETERS <wa_params> NO DIALOG. before calling the alv FM.
    ls_print-print = 'X'.
    DATA: lwa_params TYPE pri_params,
          lv_valid TYPE c.
    CLEAR: lwa_params, lv_valid.
    CALL FUNCTION 'GET_PRINT_PARAMETERS'
      EXPORTING
        in_parameters          = lwa_params
        layout                 = 'X_65_132'
        line_count             = 65
        line_size              = 132
        no_dialog              = 'X'
      IMPORTING
        out_parameters         = lwa_params
        valid                  = lv_valid
      EXCEPTIONS
        archive_info_not_found = 1
        invalid_print_params   = 2
        invalid_archive_params = 3
        OTHERS                 = 4.
    MOVE-CORRESPONDING lwa_params TO ls_print-print_ctrl-pri_params.
    ls_print-print_ctrl-pri_params-pdest = 'LP01'. " your printr device
    NEW-PAGE PRINT ON PARAMETERS lwa_params NO DIALOG.
    then call FM CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'.
    this will work.
    refer link [ALV - print - create spool request;
    Regards,
    Ravi.

  • REUSE_ALV_GRID_DISPLAY  Print_preview problem

    Hi ,
    Function Module REUSE_ALV_GRID_DISPLAY displays data from custom internal table content perfectly ok
    But when we try to see data through Print_Preview or download to excel sheet it shows blank output ...
    The above problem only started after adding LTEXT field in Fieldcatlog.
    PERFORM fill_fields USING 'BELNR' 'BSIS' 'Doc No' .
    PERFORM fill_fields USING 'GJAHR' 'BSIS' 'Fiscal Year'.
    PERFORM fill_fields USING 'BLART' 'BSIS' 'Doc type'.
    PERFORM fill_fields USING 'DMBTR' 'BSIS' 'Amount' .
    PERFORM fill_fields USING 'SGTXT' 'BSIS' 'Text' .
    PERFORM fill_fields USING  'LTEXT' 'T003T' 'Doc type Desc' .
    How to fix it ..
    Rgds
    Lal

    Hi,
    The problem is in filling the
    wa_fieldcat-fieldname = p_fieldname.
    wa_fieldcat-tabname = p_tabname.
    Here instead of giving tabname as STD table name give internal table(ie table u r passing to outtab)
    also field name should be corresponding fieldname in intenal table.
    This will definitely work...
    Reward points if useful

  • REUSE_ALV_GRID_DISPLAY layout problem

    Hi All,
    I have a report which can output two different ALV grid depending upon the option selected on selection screen.
    For example say I have selection screen with option button for Vendor report and Customer report. When user select Vendor report option button then content of KNA1 is displayed in ALV grid, similarly when user select Vendor report option button then content of LFA1 is displayed.
    Now when I save a layout on Vendor report, that layout is also visible on Customer report and vice versa. Both of these report share same set of layouts.
    Is there any method so that both of these report have there own set of layouts?
    The problem which I am facing is I have save a layout on Vendor report to display column LFA1-LIFNR only and this layout is DEFAULT layout. Now when I run report for Customer report (customer option button selected) it shows me only on column KNA1-LIFNR. Actually it select the layout which is saved with Vendor report.
    Is there any solution? Thanks in advance...
    Vendor
    Ceus

    hii
    check this out
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME.
    SELECT-OPTIONS: S_VBELN FOR VBAK-VBELN.
    PARAMETERS: P_VBTYP LIKE VBAK-VBTYP DEFAULT 'C'.
    SELECTION-SCREEN END OF BLOCK B1.
    SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME.
    PARAMETERS: LIST RADIOBUTTON GROUP G1,
                GRID RADIOBUTTON GROUP G1.
    SELECTION-SCREEN END OF BLOCK B2.
    FORM CHECK_OPTION.
      WA_EVENTS-NAME = 'TOP_OF_PAGE'.
      WA_EVENTS-FORM = 'TOP'.
      APPEND WA_EVENTS TO IT_EVENTS.
      CLEAR WA_EVENTS.
      WA_EVENTS-NAME = 'END_OF_LIST'.
      WA_EVENTS-FORM = 'END_LIST'.
      APPEND WA_EVENTS TO IT_EVENTS.
      CLEAR WA_EVENTS.
      IF LIST = 'X'.
        PERFORM LIST_DISP.
      ENDIF.
      IF GRID = 'X'.
        PERFORM GRID_DISP.
      ENDIF.
    ENDFORM.         
    FORM CHECK_OPTION.
      WA_EVENTS-NAME = 'TOP_OF_PAGE'.
      WA_EVENTS-FORM = 'TOP'.
      APPEND WA_EVENTS TO IT_EVENTS.
      CLEAR WA_EVENTS.
      WA_EVENTS-NAME = 'END_OF_LIST'.
      WA_EVENTS-FORM = 'END_LIST'.
      APPEND WA_EVENTS TO IT_EVENTS.
      CLEAR WA_EVENTS.
      IF LIST = 'X'.
        PERFORM LIST_DISP.
      ENDIF.
      IF GRID = 'X'.
        PERFORM GRID_DISP.
      ENDIF.
    ENDFORM.   
    hope this helps
    Thanks&Regards
    Naresh

  • Problem with FM  'REUSE_ALV_GRID_DISPLAY'

    Hi,
    I have a program which uses this FM 'REUSE_ALV_GRID_DISPLAY' and has a no of columns in the output display.
    One of my fields is message which is for diplaying message related to the record row.
    In the internal table for ALV the length of this field is 256 characters, set by me.
    When I use this internal table for ALV diplay in the 'REUSE_ALV_GRID_DISPLAY', the message gets truncated at 128 characters i.e. after 128 charaters the remaining part of the message is not shown. I've tried changing the display length for the column in the fieldcat but still the message is truncated and column shows blank in place of remaining characters.
    Is there a solution for this? Or is it the limitation for the FM?

    Hello Hitesh,
               Plz check out this
    http://www.sap-img.com/abap/sample-alv-heading-in-alv.htm
    hope it will help you.
    Thanks
    Anirudh Saini

  • Problem using parameter IT_EVENT_EXIT of FM   'REUSE_ALV_GRID_DISPLAY'

    Hi,
    I am working with FM 'REUSE_ALV_GRID_DISPLAY' .
    Now when i am trying to use the parameter IT_EVENT_EXIT according to the FM documentation, its not responding accordingly.
    I want that when i press the menu button for "DESELECT ALL' , i should be able to respond to the execution of the standard function before the ALV does it.
    *&      Form  Z8_EVENT_EXIT
          text
    -->  p1        text
    <--  p2        text
    form Z8_EVENT_EXIT .
    DATA : L_EVENT_EXIT TYPE SLIS_EVENT_EXIT.
    REFRESH R_EVENT_EXIT.
    L_EVENT_EXIT-UCOMM = '&SAL'.
    L_EVENT_EXIT-BEFORE = 'X'.
    APPEND L_EVENT_EXIT TO R_EVENT_EXIT.
    CLEAR R_EVENT_EXIT.
    endform.                    " Z8_EVENT_EXIT
    FORM Z8_PERFORM_ALV_GRID .
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
       IT_EVENT_EXIT                     = R_EVENT_EXIT
    ENDFORM.

    In fact, you should use the 'USER_COMMAND' routine to put your code, not the 'EVENT'.
    eg :
    *       ITAB_user_command                                             *
    FORM itab_user_command  USING ucomm TYPE sy-ucomm
                            s_selfield TYPE slis_selfield.
        WHEN '&IC1'.
    *     Call Transaction MM03
          IF s_selfield-fieldname = 'MATNR' .
                READ TABLE itab INDEX s_selfield-tabindex.
                SET PARAMETER ID 'MAT' FIELD itab-matnr.
                SET PARAMETER ID 'WRK' FIELD itab-werks.
            CALL TRANSACTION 'MD04' AND SKIP FIRST SCREEN.
          ENDIF.
      ENDCASE.
    ENDFORM. "ITAB_user_command
    Regards,
    Erwan

  • Problem in FM - REUSE_ALV_GRID_DISPLAY ?

    Hi All,
    I am using REUSE_ALV_GRID_DISPLAY  to display a ALV grid. I need to DISABLE the following buttons on the Grid Toolbar;
    1. Sort Ascending
    2. Sort Descending
    3. Filter
    4. Total
    Please give me a complete example.
    Thanks,
    Kishan

    Hi,
    Fill in the rows for thos buttons in the parameter IT_EXCLUDING and pass that to the function.
    IT_EXCL_BUTT type SLIS_T_EXTAB.
    wa_excl_buttons type SLIS_EXTAB
    wa_excl_buttons-fcode = &OUP
    append wa_excl_buttons to it_excl_butt.
    wa_excl_buttons-fcode = &ODN
    append wa_excl_buttons to it_excl_butt.
    wa_excl_buttons-fcode = &ILT
    append wa_excl_buttons to it_excl_butt.
    wa_excl_buttons-fcode = &UMC
    append wa_excl_buttons to it_excl_butt.
    That's all.
    Regards,
    Ravi
    Message was edited by: Ravikumar Allampallam

  • REUSE_ALV_GRID_DISPLAY drill down problem

    Hi all,
    I've searched through the forums and can't find out why my code doesn't work when I try to double-click to drill-down on my report. I've tried a number of variations including the usage of "status" and "events" but none have worked. I'd like the simplest solution. Can anyone provide any suggestions please?
    In my code, the break-point is never reached.
    form display_alv_report.
      call function 'REUSE_ALV_GRID_DISPLAY'
        exporting
          i_callback_program       = wa_repid
          it_fieldcat              = it_fcat[]
          it_sort                  = it_sort[]
          i_save                   = 'A'
          i_callback_user_command  = 'USER_COMMAND'
        tables
          t_outtab                 = it_data
        exceptions
          program_error            = 1
          others                   = 2.
      if sy-subrc <> 0.
        write:
          / 'Returncode',
            sy-subrc,
            'from function REUSE_ALV_LIST_DISPLAY'.
      endif.
    endform.                                             "display_alv_report
    form user_command using r_ucomm like sy-ucomm
                            rs_selfield  type slis_selfield.
      break-point.
      case r_ucomm.
        when '&IC1'.
          read table it_data into wa_data index rs_selfield-tabindex.
          set parameter id 'BUK' field wa_data-bukrs.
          set parameter id 'AN1' field wa_data-anln0.
          call transaction 'AW01N'.
      endcase.
    endform.                                           "user_command
    Thanks in advance! Points will be awarded for helpful answers.

    John,  your code looks pretty good to me.  Once thing though,  make sure that you are filling the wa_repid variable before the function call.
    wa_repid = sy-repid.
    Regards,
    Rich Heilman

  • Problem in Filter in REUSE_ALV_GRID_DISPLAY

    Hi,
    I have a condition column (KSCHL) in the grid output. I am able to filter rows by choosing 'Filter' option in ALV output.
    But when I try to apply the same filter programatically, by using IT_FILTER table, it does not work. Filtering is not done in the output, and all rows appear on output.
    I went through various threads related to it, But did not get a solution.
    Output length is not changed in the field catalog.
    I tried passing Field name, table name, sign,option, low,high, Intlen,inttype, reference table , reference field.
    But it does not work.
    Can you please advise on, how this can be handled.
    Thanks
    Meenakshi

    Hi Meenakshi,
    You can refer to the standard way of handling the filter, may be you can tyr out by calling the methid to get the filter and pass the same .
    Refer LSLVC_FULLSCREENF04
    call method gt_grid-grid->get_filter_criteria
         importing
           et_filter = lt_filter.
    http://wiki.sdn.sap.com/wiki/display/ABAP/Alv%20with%20sort%20and%20filter?bc=true
    Refer this thread
    How to use exporting prameter IT_FILTER in FM 'REUSE_ALV_GRID_DISPLAY'
    Regards,
    Judith

  • What is diff b/w reuse_alv_grid_display and reuse_alv_grid_display_lvc

    Hi everbody,
    what is diff b/w reuse_alv_grid_display and reuse_alv_grid_display_lvc.
    can u give a dteils on it .
    Regards,
    Priya

    ALV
    1. Please give me general info on ALV.
    http://www.sapfans.com/forums/viewtopic.php?t=58286
    http://www.sapfans.com/forums/viewtopic.php?t=76490
    http://www.sapfans.com/forums/viewtopic.php?t=20591
    http://www.sapfans.com/forums/viewtopic.php?t=66305 - this one discusses which way should you use - ABAP Objects calls or simple function modules.
    2. How do I program double click in ALV?
    http://www.sapfans.com/forums/viewtopic.php?t=11601
    http://www.sapfans.com/forums/viewtopic.php?t=23010
    3. How do I add subtotals (I have problem to add them)...
    http://www.sapfans.com/forums/viewtopic.php?t=20386
    http://www.sapfans.com/forums/viewtopic.php?t=85191
    http://www.sapfans.com/forums/viewtopic.php?t=88401
    http://www.sapfans.com/forums/viewtopic.php?t=17335
    4. How to add list heading like top-of-page in ABAP lists?
    http://www.sapfans.com/forums/viewtopic.php?t=58775
    http://www.sapfans.com/forums/viewtopic.php?t=60550
    http://www.sapfans.com/forums/viewtopic.php?t=16629
    5. How to print page number / total number of pages X/XX in ALV? http://www.sapfans.com/forums/viewtopic.php?t=29597 (no direct solution)
    6. ALV printing problems. The favourite is: The first page shows the number of records selected but I don't need this.
    http://www.sapfans.com/forums/viewtopic.php?t=64320
    http://www.sapfans.com/forums/viewtopic.php?t=44477
    7. How can I set the cell color in ALV? http://www.sapfans.com/forums/viewtopic.php?t=52107
    8. How do I print a logo/graphics in ALV?
    http://www.sapfans.com/forums/viewtopic.php?t=81149
    http://www.sapfans.com/forums/viewtopic.php?t=35498
    http://www.sapfans.com/forums/viewtopic.php?t=5013
    9. How do I create and use input-enabled fields in ALV?
    http://www.sapfans.com/forums/viewtopic.php?t=84933
    http://www.sapfans.com/forums/viewtopic.php?t=69878
    10. How can I use ALV for reports that are going to be run in background?
    http://www.sapfans.com/forums/viewtopic.php?t=83243
    http://www.sapfans.com/forums/viewtopic.php?t=19224
    11. How can I display an icon in ALV? (Common requirement is traffic light icon).
    http://www.sapfans.com/forums/viewtopic.php?t=79424
    http://www.sapfans.com/forums/viewtopic.php?t=24512
    12. How can I display a checkbox in ALV? http://www.sapfans.com/forums/viewtopic.php?t=88376
    http://www.sapfans.com/forums/viewtopic.php?t=40968
    http://www.sapfans.com/forums/viewtopic.php?t=6919
    Check this for basic concepts of OOPS
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/abap/abap%20code%20samples/abap%20objects/abap%20code%20sample%20to%20learn%20basic%20concept%20of%20object-oriented%20programming.doc
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/abap/abap%20code%20samples/alv%20grid/abap%20code%20sample%20to%20display%20data%20in%20alv%20grid%20using%20object%20oriented%20programming.doc
    Tabstrip
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/abap/abap%20code%20samples/alv%20grid/abap%20code%20sample%20for%20tab%20strip%20in%20alv.pdf
    Editable ALV
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/abap/abap%20code%20samples/alv%20grid/abap%20code%20sample%20to%20edit%20alv%20grid.doc
    Tree
    http://www.sapdevelopment.co.uk/reporting/alv/alvtree/alvtree_usrint.htm
    General Tutorial for OOPS
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/abap/an%20easy%20reference%20for%20alv%20grid%20control.pdf
    http://www.sapdevelopment.co.uk/reporting/alvhome.htm
    http://www.sap-img.com/abap/what-is-alv-programming.htm
    http://www.sap-img.com/abap-function.htm
    http://www.geocities.com/mpioud/Abap_programs.html
    http://www.sapdevelopment.co.uk/reporting/alv/alvtree%5Calvtree_basic.htm
    http://esnips.com/doc/ad20dca9-6182-4903-8d8f-96a66dc8590c/ALV.pdf
    http://www.sap-img.com/abap-function.htm

  • Problem in ALV report

    Hi Friends,
    I have the following 2 problems in ALV report
    1) Logo is not getting displayed in the report.
    2) When i click on the Purchase order number in the report  the interactive report is not working,i am not able to see report of First interactive level.
    can you help it out friends.
    Thanks and regards
    Dinesh
    REPORT  YSDBALV1
    tables: ekko , ekpo .
    type-pools: slis .
    Table for Display Header
    data:i_header type slis_t_listheader with header line.
    *Fieldcat Declaration
    data:fieldcatalog type slis_T_fieldcat_alv  WITH HEADER LINE.
    *Table of Events
    data:i_event type slis_t_event with header line .
    For Layout
    data:i_layout type slis_layout_alv .
    data: text(30) .
    *Internal Table Declaration
    data: begin of it_final occurs 0 ,
          ebeln like ekko-ebeln ,           "Purchasing Document No.
          bedat like ekko-bedat ,           "Purchasing Document Date
          matnr like ekpo-matnr ,           "Material No.
          netwr like ekpo-netwr ,         "Net Order Value in PO Currancy
          meins like ekpo-meins ,           "UOM
          chk(1) ,
          light(1) ,
          change like ekpo-menge ,
          end of it_final .
    **select option Declaration
    selection-screen begin of block block.
    select-options: s_ebeln for ekko-ebeln  .
    selection-screen end of block block .
    selection-screen begin of block block1 .
    parameters:grid radiobutton group r .
    parameters:list radiobutton group r .
    selection-screen end of block block1 .
    at selection screen
    at selection-screen .
    select single * from ekko where ebeln in s_ebeln .
    if sy-subrc <> 0 .
       message e000(8I) WITH 'No Data Exists' .
    endif .
    start-of-selection .
    if grid = 'X' .
    perform get_data .
    perform event using i_event[] .
    perform field using fieldcatalog[] .
    perform layout using i_layout .
    perform grid_display .
    endif .
    *&      Form  get_data
          text
    -->  p1        text
    <--  p2        text
    form get_data .
    *DATA Retrieval from tables
    SELECT EKKO~EBELN
           EKKO~BEDAT
           EKPO~EBELP
           EKPO~MATNR
           EKPO~NETWR
           EKPO~MEINS
           EKPO~MENGE
           EKPO~BPRME
           INTO CORRESPONDING FIELDS OF  table IT_FINAL
           FROM EKKO INNER JOIN EKPO ON EKKOEBELN = EKPOEBELN
           WHERE EKKO~EBELN IN S_EBELN.
           APPEND IT_FINAL.
    endform.                    " get_data
    *Getting the Event for Top of Page display.
    *&      Form  event
          text
         -->P_I_event[]  text
    form event  using    p_i_event type slis_t_event.
      clear p_i_event .
      refresh p_i_event .
    CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
    EXPORTING
       I_LIST_TYPE           = 0
       IMPORTING
         ET_EVENTS             = p_i_event
    EXCEPTIONS
       LIST_TYPE_WRONG       = 1
       OTHERS                = 2
    read table p_i_event with key name = slis_ev_top_of_page into i_event.
          if sy-subrc = 0.
                 move 'TOP_OF_PAGE_PO' to i_event-form.
                 modify p_i_event from i_event index sy-tabix transporting form.
          endif.
          clear i_event.
    endform.                    " event
    *Display Top-of –Page Details and Logo
    form top_of_page_po .
           clear i_header .
           refresh i_header .
           write sy-datum to text.
           i_header-typ = 'H'.
           i_header-info = 'PURCHASE OREDER DETAILS'.
           append i_header.
          *Logo Display
          CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
                 EXPORTING
                     it_list_commentary       = i_header[]
                     I_LOGO                   = 'ENJOYSAPLOGO'.
    endform .
    *Field Catalog Append
    *&      Form  field
          text
         -->P_fieldCATALOG[]  text
    form field using  p_fieldcatalog type slis_t_fieldcat_alv.
         clear fieldcatalog.
          fieldcatalog-fieldname   = 'EBELN'.
          fieldcatalog-seltext_m   = 'Purchase Order No'.
          fieldcatalog-col_pos     = 1.
          append fieldcatalog .
          clear fieldcatalog.
          fieldcatalog-fieldname   = 'BEDAT'.
          fieldcatalog-seltext_m   = 'PO Date'.
          fieldcatalog-col_pos     = 2.
          append fieldcatalog .
          clear fieldcatalog.
          fieldcatalog-fieldname   = 'MATNR'.
          fieldcatalog-seltext_m   = 'Material No'.
          fieldcatalog-col_pos     = 4.
          fieldcatalog-outputlen   = 20.
          append fieldcatalog .
          clear fieldcatalog.
          fieldcatalog-fieldname   = 'NETWR'.
          fieldcatalog-seltext_m   = 'Net Value '.
          fieldcatalog-col_pos     = 5.
          fieldcatalog-outputlen   = 20.
          fieldcatalog-do_sum = 'X'.
          append fieldcatalog .
          clear fieldcatalog.
          fieldcatalog-fieldname   = 'MEINS'.
          fieldcatalog-seltext_m   = 'Units'.
          fieldcatalog-col_pos     = 6.
          fieldcatalog-outputlen   = 4.
          append fieldcatalog .
          clear fieldcatalog.
    endform.                    " field
    *&      Form  layout
          text
    form layout  using    p_i_layout TYPE SLIS_LAYOUT_ALV .
    i_layout-zebra  = 'X'.
        i_layout-lights_fieldname = 'LIGHT'.
        i_layout-lights_tabname = 'IT_FINAL'.
        i_layout-box_fieldname = 'CHK'.
        i_layout-box_tabname  = 'IT_FINAL'.
        i_layout-edit = ' '.
    endform.
    *To display Buttons in the MENU BAR if needed
    FORM SET_PO_PF_STATUS USING  P_I_EXTAB TYPE
                     SLIS_T_EXTAB.
                     SET PF-STATUS 'MENUPO'.
      ENDFORM.
    *Event for Interactive display of ALV report
    form USER_COMMAND  using r_ucomm like sy-ucomm
                             rs_selfield type slis_selfield .
      if r_ucomm = '&IC1'.
      READ TABLE IT_FINAL  index   rs_selfield-tabindex.
      write:/ IT_FINAL-ebeln.
      endif.
    endform .
    *Parameters of FM  REUSE_ALV_GRID_DISPLAY
    *&      Form  grid_display
          text
    -->  p1        text
    <--  p2        text
    form grid_display .
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
      EXPORTING
        I_CALLBACK_PROGRAM                = SY-REPID
       I_CALLBACK_PF_STATUS_SET          = 'SET_PO_PF_STATUS'
        I_CALLBACK_USER_COMMAND           = 'USER_COMMAND'
        IS_LAYOUT                         = I_LAYOUT
        IT_FIELDCAT                       = FIELDCATALOG[]
        IT_EVENTS                         = I_EVENT[]
      TABLES
        t_outtab                          = IT_FINAL.
    endform.                    " grid_display

    *& Report  YSDBALV1
    REPORT  YSDBALV1.
    tables: ekko , ekpo .
    type-pools: slis .
    Table for Display Header
    data:i_header type slis_t_listheader with header line.
    *Fieldcat Declaration
    data:fieldcatalog type slis_T_fieldcat_alv WITH HEADER LINE.
    *Table of Events
    data:i_event type slis_t_event with header line ,
         wa_event type line of slis_t_event.
    For Layout
    data:i_layout type slis_layout_alv .
    data: text(30) .
    *Internal Table Declaration
    data: begin of it_final occurs 0 ,
    ebeln like ekko-ebeln , "Purchasing Document No.
    bedat like ekko-bedat , "Purchasing Document Date
    matnr like ekpo-matnr , "Material No.
    netwr like ekpo-netwr , "Net Order Value in PO Currancy
    meins like ekpo-meins , "UOM
    chk(1) ,
    light(1) ,
    change like ekpo-menge ,
    end of it_final .
    **select option Declaration
    selection-screen begin of block block.
    select-options: s_ebeln for ekko-ebeln .
    selection-screen end of block block .
    selection-screen begin of block block1 .
    parameters:grid radiobutton group r .
    parameters:list radiobutton group r .
    selection-screen end of block block1 .
    at selection screen
    at selection-screen .
    select single * from ekko where ebeln in s_ebeln .
    if sy-subrc <> 0 .
    message e000(8I) WITH 'No Data Exists' .
    endif .
    start-of-selection .
    if grid = 'X' .
    perform get_data .
    perform event using i_event[] .
    perform field using fieldcatalog[] .
    perform layout using i_layout .
    perform grid_display .
    endif .
    *& Form get_data
    text
    --> p1 text
    <-- p2 text
    form get_data .
    *DATA Retrieval from tables
    SELECT EKKO~EBELN
    EKKO~BEDAT
    EKPO~EBELP
    EKPO~MATNR
    EKPO~NETWR
    EKPO~MEINS
    EKPO~MENGE
    EKPO~BPRME
    INTO CORRESPONDING FIELDS OF table IT_FINAL
    FROM EKKO INNER JOIN EKPO ON EKKOEBELN = EKPOEBELN
    WHERE EKKO~EBELN IN S_EBELN.
    APPEND IT_FINAL.
    endform. " get_data
    *Getting the Event for Top of Page display.
    *& Form event
    text
    -->P_I_event[] text
    form event using p_i_event type slis_t_event.
    clear p_i_event .
    refresh p_i_event .
    CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
    EXPORTING
    I_LIST_TYPE = 0
    IMPORTING
    ET_EVENTS = p_i_event.
    EXCEPTIONS
    LIST_TYPE_WRONG = 1
    OTHERS = 2.
    read table p_i_event with key name = slis_ev_top_of_page into wa_event.
    if sy-subrc = 0.
    move 'TOP_OF_PAGE_PO' to i_event-form.
    modify p_i_event from i_event index sy-tabix transporting form.
    endif.
    clear i_event.
    endform. " event
    *Display Top-of –Page Details and Logo
    form top_of_page_po .
    clear i_header .
    refresh i_header .
    write sy-datum to text.
    i_header-typ = 'H'.
    i_header-info = 'PURCHASE OREDER DETAILS'.
    append i_header.
    *Logo Display
    CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
    EXPORTING
    it_list_commentary = i_header[]
    I_LOGO = 'ENJOYSAP_LOGO'.
    endform .
    *Field Catalog Append
    *& Form field
    text
    -->P_fieldCATALOG[] text
    form field using p_fieldcatalog type slis_t_fieldcat_alv.
    clear fieldcatalog.
    fieldcatalog-fieldname = 'EBELN'.
    fieldcatalog-seltext_m = 'Purchase Order No'.
    fieldcatalog-col_pos = 1.
    append fieldcatalog .
    clear fieldcatalog.
    fieldcatalog-fieldname = 'BEDAT'.
    fieldcatalog-seltext_m = 'PO Date'.
    fieldcatalog-col_pos = 2.
    append fieldcatalog .
    clear fieldcatalog.
    fieldcatalog-fieldname = 'MATNR'.
    fieldcatalog-seltext_m = 'Material No'.
    fieldcatalog-col_pos = 4.
    fieldcatalog-outputlen = 20.
    append fieldcatalog .
    clear fieldcatalog.
    fieldcatalog-fieldname = 'NETWR'.
    fieldcatalog-seltext_m = 'Net Value '.
    fieldcatalog-col_pos = 5.
    fieldcatalog-outputlen = 20.
    fieldcatalog-do_sum = 'X'.
    append fieldcatalog .
    clear fieldcatalog.
    fieldcatalog-fieldname = 'MEINS'.
    fieldcatalog-seltext_m = 'Units'.
    fieldcatalog-col_pos = 6.
    fieldcatalog-outputlen = 4.
    append fieldcatalog .
    clear fieldcatalog.
    endform. " field
    *& Form layout
    text
    form layout using p_i_layout TYPE SLIS_LAYOUT_ALV .
    i_layout-zebra = 'X'.
    i_layout-lights_fieldname = 'LIGHT'.
    i_layout-lights_tabname = 'IT_FINAL'.
    i_layout-box_fieldname = 'CHK'.
    i_layout-box_tabname = 'IT_FINAL'.
    i_layout-edit = ' '.
    endform.
    *To display Buttons in the MENU BAR if needed
    FORM SET_PO_PF_STATUS USING P_I_EXTAB TYPE
    SLIS_T_EXTAB.
    SET PF-STATUS 'MENUPO'.
    ENDFORM.
    *Event for Interactive display of ALV report
    form USER_COMMAND using r_ucomm like sy-ucomm
    rs_selfield type slis_selfield .
    if r_ucomm = '&IC1'.
    READ TABLE IT_FINAL index rs_selfield-tabindex.
    set parameter id 'VL1' field it_final-ebeln.
    call transaction 'ME23N'.
    endif.
    endform .
    *Parameters of FM REUSE_ALV_GRID_DISPLAY
    *& Form grid_display
    text
    --> p1 text
    <-- p2 text
    form grid_display .
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
    I_CALLBACK_PROGRAM = SY-REPID
    I_CALLBACK_PF_STATUS_SET = 'SET_PO_PF_STATUS'
    I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
    IS_LAYOUT = I_LAYOUT
    IT_FIELDCAT = FIELDCATALOG[]
    IT_EVENTS = I_EVENT[]
    TABLES
    t_outtab = IT_FINAL.
    endform. " grid_display
    Regards,
    Rusidar S.

Maybe you are looking for

  • How to create secure EJB web service in Oc4J using JDeveloper?

    We are going to develop a EJB web service running in OC4J using JDeveloper 10.1.3.3. By using the JDeveloper feature, we can simply create the web service by using the "Web Service Endpoint Interface" in the session bean. However, unlike the web serv

  • How can I create an animated countdown timer?

    Is there a way to create an animated countdown timer in Adobe Fireworks (animated gif)? Thank you

  • Charting with stacked hybrid plot - how do I?

    Is there a way to stack column and line charts? I want the same CartesianChart to have bars with multiple series, and centered above them, I would like lines. I can get the lines and columns on the same chart, but I dont' want the line chart overlaid

  • How can i learn something in DReamweaver??

    I have various versions of Dreamweaver can adobe help me to update or upgrade to something that works??

  • Function module to create users

    Hi All, Is there any function modules, with which I can create dialog users? (May be by inputing some parameters) Coudl any one help me out with it? Thanks a lot in advance. Regards, Pradeep