Clasic ALV - POP UP TO SELECT

Hi,
I am writing a program using classic ALV to display customer information.
In my main ALV I am displaying the customer info. Upon double clicking the customer number, the ship to details of this customer needs to be displayed in a pop up window. I am using REUSE_ALV_POPUP_TO_SELECT fn.module for this. In my pop up display, the columns are not aligned.
Hope I have made my question clear.
Since I am an absolute novice in this area, I would greatly appreciate your valuable inputs.
Regards,
Gayathri.

Hi,
   Here is my sample code.Please check this.
type-pools: slis.
data: begin of i_outtab occurs 0.
        include structure scarr.
data:   w_chk type c.                  "For multiple selection
data: end of i_outtab.
data: begin of i_outtab1 occurs 0.
        include structure sflight.
data: end of i_outtab1.
data: begin of i_outtab2 occurs 0.
        include structure spfli.
data: end of i_outtab2.
data: begin of final_itab occurs 0,
      carrid like sflight-carrid,
      connid like sflight-connid,
      fldate like sflight-fldate,
      price like sflight-price,
      seatsmax like sflight-seatsmax,
      seatsocc like sflight-seatsocc,
      paymentsum like sflight-paymentsum,
      cityfrom like spfli-cityfrom,
      cityto like spfli-cityto,
      deptime like spfli-deptime,
      arrtime like spfli-arrtime,
    end of final_itab.
data: i_private type slis_data_caller_exit,
      i_selfield type slis_selfield,
      w_exit(1) type c.
data: i_fieldcat type slis_t_fieldcat_alv,
      wa_fieldcat type slis_fieldcat_alv.
data: ws_program like sy-repid.
data: flag type c.
initialization.
ws_program = sy-repid.
start-of-selection.
  select * from scarr into table i_outtab.
  call function 'REUSE_ALV_POPUP_TO_SELECT'
       exporting
            i_title                 = 'Programp_title'
           i_selection             = 'X'
            i_zebra                 = 'X'
          I_SCREEN_START_COLUMN   = 0
          I_SCREEN_START_LINE     = 0
          I_SCREEN_END_COLUMN     = 0
          I_SCREEN_END_LINE       = 0
            i_checkbox_fieldname    = 'W_CHK'
          I_LINEMARK_FIELDNAME    =
          I_SCROLL_TO_SEL_LINE    = 'X'
            i_tabname               = 'I_OUTTAB'
            i_structure_name        = 'SCARR'
          IT_FIELDCAT             =
          IT_EXCLUDING            =
           i_callback_program      = ws_program
          I_CALLBACK_USER_COMMAND =
           IS_PRIVATE             = I_PRIVATE
    IMPORTING
            es_selfield             = i_selfield
           e_exit                  = w_exit
       tables
            t_outtab                = i_outtab
       exceptions
            program_error           = 1
            others                  = 2.
  if sy-subrc <> 0.
    message i000(0k) with sy-subrc.
  endif.
write:/ i_selfield.
*****the internal table is modified with a cross sign for marking the
***rows selected
  loop at i_outtab where w_chk = 'X'.
   flag = ' '.
   select * from sflight  into table i_outtab1
    where carrid = i_outtab-carrid.
  if sy-subrc ne 0.
   flag = 'X'.
  else.
     select * from spfli into table i_outtab2
      for all entries in i_outtab1
       where carrid = i_outtab1-carrid
         and connid = i_outtab1-connid.
   loop at i_outtab1.
     read table i_outtab2 with key carrid = i_outtab1-carrid
                                   connid = i_outtab1-connid.
       move i_outtab1-carrid to final_itab-carrid.
       move i_outtab1-connid to final_itab-connid.
       move i_outtab1-fldate to final_itab-fldate.
       move i_outtab1-price to final_itab-price.
       move i_outtab1-seatsmax to final_itab-seatsmax.
       move i_outtab1-seatsocc to final_itab-seatsocc.
       move i_outtab1-paymentsum to final_itab-paymentsum.
       move i_outtab2-cityfrom to final_itab-cityfrom.
       move i_outtab2-cityto to final_itab-cityto.
       move i_outtab2-deptime to final_itab-deptime.
       move i_outtab2-arrtime to final_itab-arrtime.
        append final_itab.
   endloop.
  endif.
  endloop.
call function 'REUSE_ALV_FIELDCATALOG_MERGE'
exporting
   i_program_name               = ws_program
   i_internal_tabname           = 'FINAL_ITAB'
  I_STRUCTURE_NAME             =
  I_CLIENT_NEVER_DISPLAY       = 'X'
   i_inclname                   = ws_program
  I_BYPASSING_BUFFER           =
  I_BUFFER_ACTIVE              =
  changing
    ct_fieldcat                  = i_fieldcat
EXCEPTIONS
  INCONSISTENT_INTERFACE       = 1
  PROGRAM_ERROR                = 2
  OTHERS                       = 3
if sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
perform final_display.
form final_display.
if flag is initial.
  call function 'REUSE_ALV_GRID_DISPLAY'
   exporting
    I_INTERFACE_CHECK                 = ' '
    I_BYPASSING_BUFFER                =
    I_BUFFER_ACTIVE                   = ' '
     i_callback_program                = ws_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                       = i_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
    IT_ALV_GRAPHICS                   =
    IT_ADD_FIELDCAT                   =
    IT_HYPERLINK                      =
    I_HTML_HEIGHT_TOP                 =
    I_HTML_HEIGHT_END                 =
    IT_EXCEPT_QINFO                   =
  IMPORTING
    E_EXIT_CAUSED_BY_CALLER           =
    ES_EXIT_CAUSED_BY_USER            =
    tables
      t_outtab                          = final_itab
  EXCEPTIONS
    PROGRAM_ERROR                     = 1
    OTHERS                            = 2
  if sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  endif.
else.
message i003.
endif.
endform.
  Hope this can help you.
Thanks&Regards
Ruthra.R

Similar Messages

  • How to select multiple records in the ALV POP UP by using oops

    Hi All,
    We have a requirement of ALV POP UP by using the OOPS. How to select the multiple records in the POP UP and After selecting that i want do Inteactive ALV means again one more POP UP in ALV.
    Thanks for help....
    Regards,
    Bharani

    Hello Bharani
    Displaying an ALV list in a popup is by no means different from a list displayed on a main screen. The only thing you need to consider is that you set the right screen level when creating the parent container for the ALV.
    For more details refer to thread in CL_GUI_SPLITTER_CONTAINER  ALV list  is not show in called screen
    " step 1:
      CREATE OBJECT gr_spliter
        EXPORTING
          parent = cl_gui_container=>screen0 " For first popup use: =>screen1
          rows = 1
          columns = 2.
    Regards
      Uwe

  • Error in updating ALV field catalog in selection tool for Planning Book

    Hi ,
    I am Implementing BADI  '/SAPAPO/SDP_SELECTOR' to upload Custom Fields Data in Planning Book Selection Window under APO Location Product. These Custom Fields are maintained in Custom Table.So from Table whatever Custom Fields are availabe all the fields needs to be available in for selection. Once selection is done the same data to be uploaded into Planning Book.
    This BADI is working Fine upto 4 fields but if any extra fields are added in the table 'Error in updating ALV field catalog in selection tool' error Pop Up is coming. Here i am using Folloowing Methods
    1). INIT_OBJECT_LIST
    2). F4
    3). LOC_PROD_VALUE_LIST
    Please help on the same if u have any idea or clue.
    Thanks.

    Hi Srinivas!
    Where did you get your implementation from?
    It would be nice if you could debug your code!
    For the F4 method, have you seen this note?
    Note 544904 - Sample source code f.BAdI /SAPAPO/SDP_SELECTOR ('F4'method)
    Also check this note. It contains selection modifications in the BAdI:
    Note 376902 - SDP selector: Basis corrections for BADI
    I do not know your release and support package in your SCM, but you can find a lot of notes related to this BAdI.
    Thank you!
    Will
    SCM Support Consultant

  • Triggerring ALV-pop up

    Hi all,
             How to trigger a pop-up alv report upono double click  on a row  in a report developed using OO ALV.
    Do i need to trigger any method and call fm REUSE ALV POP UP? Please help!
    Helpful answers will be rewarded.
    Thanks,
    Sandeep

    Hi Sandeep,
                      This might help:
    User selects infotypes from a pop up alv .The details of
    *infotypes selected are displayed in a ALV dialog box.
    REPORT ZALV_POPDIALOG.
    *Type pools for ALV declarations
    TYPE-POOLS : slis.
    *Internal table and wa declarations for T582A.
    DATA : it_t582a TYPE STANDARD TABLE OF t582a INITIAL SIZE 0,
           wa_t582a TYPE t582a.
    *Internal table and wa declarations for T582S.
    DATA : it_text TYPE STANDARD TABLE OF t582s,
           wa_text TYPE t582s.
    *Structure declaration for output
    TYPES : BEGIN OF ty_output,
            infty TYPE infty,
            zeitb TYPE dzeitb,
            itext TYPE intxt,
            pnnnn TYPE pnnnn_d,
            dname TYPE dianm,
            namst TYPE namst,
            edynr TYPE edynp,
            ldynr TYPE ldynp,
            stypt TYPE stypt,
            sytxt TYPE sytxt,
            zbtab TYPE dzbtab,
            checkbox(1),
            END OF ty_output.
    *Internal table and work area declaration for output in pop up
    DATA : it_output TYPE STANDARD TABLE OF ty_output INITIAL SIZE 0,
           wa_output TYPE ty_output.
    *Internal table and workarea declaration for alv dialog display
    DATA : it_display TYPE STANDARD TABLE OF ty_output INITIAL SIZE 0,
           wa_display TYPE ty_output.
    *data declarations for ALV
    DATA:ls_fieldcat TYPE slis_fieldcat_alv,
        lt_fieldcat TYPE slis_t_fieldcat_alv,
        ls_fieldcatlog TYPE slis_fieldcat_alv,
        lt_fieldcatlog TYPE slis_t_fieldcat_alv,
        lt_layout TYPE slis_layout_alv.
    *Initialization event
    INITIALIZATION.
    *Start of selection event
    START-OF-SELECTION.
    *Select to fetch all the infotypes and details in sap system
      SELECT *
             FROM t582a
             INTO CORRESPONDING FIELDS OF TABLE it_t582a.
    *Select to fetch the infotypes text
      IF it_t582a[] IS NOT INITIAL.
        SELECT * FROM t582s INTO CORRESPONDING FIELDS OF TABLE it_text
        FOR ALL ENTRIES IN it_t582a WHERE infty = it_t582a-infty
        AND sprsl = 'E'.
      ENDIF.
    *Appending the selected values to the output table
      LOOP AT it_t582a INTO wa_t582a.
        wa_output-infty = wa_t582a-infty.
        wa_output-zeitb = wa_t582a-zeitb.
        wa_output-pnnnn = wa_t582a-pnnnn.
        wa_output-dname = wa_t582a-dname.
        wa_output-namst = wa_t582a-namst.
        wa_output-edynr = wa_t582a-edynr.
        wa_output-ldynr = wa_t582a-ldynr.
        wa_output-stypt = wa_t582a-stypt.
        wa_output-sytxt = wa_t582a-sytxt.
        wa_output-zbtab = wa_t582a-zbtab.
        READ TABLE it_text INTO wa_text WITH KEY infty = wa_t582a-infty.
        wa_output-itext = wa_text-itext.
        APPEND wa_output TO it_output.
        CLEAR wa_output.
      ENDLOOP.
    *Subroutine to display the pop up values.
      PERFORM popup_display.
    *Subroutine to display the ALV dialog display
      PERFORM alv_output.
         Form  popup_display
    FORM popup_display.
    *field catalogue for pop up
      CLEAR ls_fieldcat.
      ls_fieldcat-row_pos   = '1'.
      ls_fieldcat-col_pos   = '1'.
      ls_fieldcat-fieldname = 'CHECKBOX'.
      ls_fieldcat-tabname   = 'IT_OUTPUT'.
      ls_fieldcat-seltext_m = 'SELECT'.
      APPEND ls_fieldcat TO lt_fieldcat.
      CLEAR ls_fieldcat.
      ls_fieldcat-row_pos   = '1'.
      ls_fieldcat-col_pos   = '2'.
      ls_fieldcat-fieldname = 'ITEXT'.
      ls_fieldcat-tabname   = 'IT_OUTPUT'.
      ls_fieldcat-seltext_m = 'DESCRIPTION'.
      ls_fieldcat-outputlen = 50.
      APPEND ls_fieldcat TO lt_fieldcat.
    Display data in a POPUP
      CALL FUNCTION 'REUSE_ALV_POPUP_TO_SELECT'
        EXPORTING
          i_zebra              = 'X'
          it_fieldcat          = lt_fieldcat
          i_tabname            = 'IT_OUTPUT'
          i_checkbox_fieldname = 'CHECKBOX'
        TABLES
          t_outtab             = it_output.
    *Appending the selected infotypes only to internal table
      LOOP AT it_output INTO wa_output WHERE checkbox = 'X'.
        wa_display-itext = wa_output-itext.
        wa_display-infty = wa_output-infty.
        wa_display-zeitb = wa_output-zeitb.
        wa_display-pnnnn = wa_output-pnnnn.
        wa_display-dname = wa_output-dname.
        wa_display-namst = wa_output-namst.
        wa_display-edynr = wa_output-edynr.
        wa_display-ldynr = wa_output-ldynr.
        wa_display-sytxt = wa_output-sytxt.
        wa_display-stypt = wa_output-stypt.
        wa_display-zbtab = wa_output-zbtab.
        APPEND wa_display TO it_display.
        CLEAR wa_display.
      ENDLOOP.
    ENDFORM.                               " popup_display
    *&      Form  alv_output
    FORM alv_output .
    *fieldcatalogue for ALV dialog
      PERFORM build_fieldcat.
    *Layout for ALV dialog
      PERFORM build_layout.
    **ALV dialog output
      PERFORM alv.
    ENDFORM.                    " alv_output
    *&      Form  build_fieldcat
    FORM build_fieldcat .
    *fieldcatalogue for alv dialog
      CLEAR ls_fieldcatlog.
      ls_fieldcatlog-row_pos   = '1'.
      ls_fieldcatlog-col_pos   = '1'.
      ls_fieldcatlog-fieldname = 'INFTY'.
      ls_fieldcatlog-tabname   = 'IT_DISPLAY'.
      ls_fieldcatlog-seltext_m = 'Infotype'.
      APPEND ls_fieldcatlog TO lt_fieldcatlog.
      CLEAR ls_fieldcatlog.
      ls_fieldcatlog-row_pos   = '1'.
      ls_fieldcatlog-col_pos   = '2'.
      ls_fieldcatlog-fieldname = 'ITEXT'.
      ls_fieldcatlog-tabname   = 'IT_DISPLAY'.
      ls_fieldcatlog-seltext_m = 'Description'.
      APPEND ls_fieldcatlog TO lt_fieldcatlog.
      CLEAR ls_fieldcatlog.
      ls_fieldcatlog-row_pos   = '1'.
      ls_fieldcatlog-col_pos   = '3'.
      ls_fieldcatlog-fieldname = 'ZEITB'.
      ls_fieldcatlog-tabname   = 'IT_DISPLAY'.
      ls_fieldcatlog-seltext_m = 'TimeConstraint'.
      APPEND ls_fieldcatlog TO lt_fieldcatlog.
      CLEAR ls_fieldcatlog.
      ls_fieldcatlog-row_pos   = '1'.
      ls_fieldcatlog-col_pos   = '4'.
      ls_fieldcatlog-fieldname = 'PNNNN'.
      ls_fieldcatlog-tabname   = 'IT_DISPLAY'.
      ls_fieldcatlog-seltext_m = 'Structure'.
      APPEND ls_fieldcatlog TO lt_fieldcatlog.
      CLEAR ls_fieldcatlog.
      ls_fieldcatlog-row_pos   = '1'.
      ls_fieldcatlog-col_pos   = '5'.
      ls_fieldcatlog-fieldname = 'DNAME'.
      ls_fieldcatlog-tabname   = 'IT_DISPLAY'.
      ls_fieldcatlog-seltext_m = 'DialogModule'.
      APPEND ls_fieldcatlog TO lt_fieldcatlog.
      CLEAR ls_fieldcatlog.
      ls_fieldcatlog-row_pos   = '1'.
      ls_fieldcatlog-col_pos   = '6'.
      ls_fieldcatlog-fieldname = 'NAMST'.
      ls_fieldcatlog-tabname   = 'IT_DISPLAY'.
      ls_fieldcatlog-seltext_m = 'Subtypefield'.
      APPEND ls_fieldcatlog TO lt_fieldcatlog.
      CLEAR ls_fieldcatlog.
      ls_fieldcatlog-row_pos   = '1'.
      ls_fieldcatlog-col_pos   = '7'.
      ls_fieldcatlog-fieldname = 'EDYNR'.
      ls_fieldcatlog-tabname   = 'IT_DISPLAY'.
      ls_fieldcatlog-seltext_m = 'Singlescreenno'.
      APPEND ls_fieldcatlog TO lt_fieldcatlog.
      CLEAR ls_fieldcatlog.
      ls_fieldcatlog-row_pos   = '1'.
      ls_fieldcatlog-col_pos   = '8'.
      ls_fieldcatlog-fieldname = 'LDYNR'.
      ls_fieldcatlog-tabname   = 'IT_DISPLAY'.
      ls_fieldcatlog-seltext_m = 'Listscreenno'.
      APPEND ls_fieldcatlog TO lt_fieldcatlog.
      CLEAR ls_fieldcatlog.
      ls_fieldcatlog-row_pos   = '1'.
      ls_fieldcatlog-col_pos   = '9'.
      ls_fieldcatlog-fieldname = 'STYPT'.
      ls_fieldcatlog-tabname   = 'IT_DISPLAY'.
      ls_fieldcatlog-seltext_m = 'SubtypTable'.
      APPEND ls_fieldcatlog TO lt_fieldcatlog.
      CLEAR ls_fieldcatlog.
      ls_fieldcatlog-row_pos   = '1'.
      ls_fieldcatlog-col_pos   = '10'.
      ls_fieldcatlog-fieldname = 'SYTXT'.
      ls_fieldcatlog-tabname   = 'IT_DISPLAY'.
      ls_fieldcatlog-seltext_m = 'Subtyptexttable'.
      APPEND ls_fieldcatlog TO lt_fieldcatlog.
      CLEAR ls_fieldcatlog.
      ls_fieldcatlog-row_pos   = '1'.
      ls_fieldcatlog-col_pos   = '11'.
      ls_fieldcatlog-fieldname = 'ZBTAB'.
      ls_fieldcatlog-tabname   = 'IT_DISPLAY'.
      ls_fieldcatlog-seltext_m = 'SubtypeTCTable'.
      APPEND ls_fieldcatlog TO lt_fieldcatlog.
    ENDFORM.                    " build_fieldcat
    *&      Form  build_layout
    *Layout for ALV dialog
    FORM build_layout .
      lt_layout-zebra = 'X'.
      lt_layout-colwidth_optimize = 'X'.
    ENDFORM.                    " build_layout
    *&      Form  alv
    *Alv dialog output.
    FORM alv .
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_program    = sy-repid
          i_grid_title          = 'INFOTYPE DETAILS'
          is_layout             = lt_layout
          it_fieldcat           = lt_fieldcatlog
          i_screen_start_column = 10
          i_screen_start_line   = 20
          i_screen_end_column   = 100
          i_screen_end_line     = 40
        TABLES
          t_outtab              = it_display
        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.                    " alv

  • Problem in displaying correct data in ALV pop-up

    Hello,
    I am trying to display table contents using the class CL_GUI_ALV_GRID and method SET_TABLE_FOR_FIRST_DISPLAY.
    It works as follows. When I doule click on one entry, an ALV pop-up is displayed with the fields of the selected row. The first time it displays the correct fields, but there after it always displays the fields of the first row selected.
    I have used the event HANDLE_DOUBLE_CLICK to capture the selected row and perform further processing. All the logic is working fine till the time the method u2018SET_TABLE_FOR_FIRST_DISPLAYu2019 is called. The table passed to the method also contains the correct data, but while displaying the ALV pop-up display the old values.
    I have already tried REFRESH_TABLE_DISPLAY and the FREE destructor after displaying the ALV but nothing helps. Also the container and grid are created fresh each time the event is called.
    Please suggest possible solutions.
    Thanks in advance.

    HI,
    On se71
    In windows : declare 2 variable window.
    Add it to a page . by selecting create->element (now choose both the var window create by double clicking)
    click on the ruler by selecting particular varwindow.
    In line editor of a var window. write          
    &w_var1&                               (field string name if it is table)
    again in line editor of a var2 window. write          
    &w_var2&                             (field string name if it is table)
    Now pass the values from main program having same name as in sripts (ie w_var1 , w_var2)
    Let me know u understood it ?

  • Header in alv pop up

    Hello,
    i need to dislay header as well as item details in an alv pop up. I am using FM REUSE_ALV_POPUP_TO_SELECT. but I am not able to get the header information. I am able to get the item details for a particular Purchase order number. I need to display purchase order number in the header of alv POPUP.
    how can i achieve this using the same FM?

    hi
    hope this wil help to u
    ...tables vbak.
    data it_vbak like vbak occurs 0 with header line.
    selection-screen begin of block b1 with frame.
    parameters: alv1 radiobutton group alv, "REUSE_ALV_LIST_DISPLAY
    alv2 radiobutton group alv, "REUSE_ALV_POPUP_TO_SELECT
    alv3 radiobutton group alv, "REUSE_ALV_GRID_DISPLAY
    alv4 radiobutton group alv. " NORMAL DISPLAY
    selection-screen end of block b1.
    select * from vbak
    into corresponding fields of table it_vbak
    up to 10 rows.
    if alv1 = 'X'. perform alv_func1.
    elseif alv2 = 'X'. perform alv_func2.
    elseif alv3 = 'X'. perform alv_func3.
    elseif alv4 = 'X'. perform norm.
    endif.
    **& Form ALV_FUNC1
    *form alv_func1 .
    call function 'REUSE_ALV_LIST_DISPLAY'
    exporting
    i_structure_name = 'VBAK'
    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. " ALV_FUNC1
    **& Form ALV_FUNC2
    *form alv_func2 .
    call function 'REUSE_ALV_POPUP_TO_SELECT'
    exporting
    i_title = 'SALES ORDER INFO'
    i_zebra = 'X'
    i_tabname = 1
    i_structure_name = 'vbak'
    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. " ALV_FUNC2
    **& Form ALV_FUNC3
    *form alv_func3 .
    call function 'REUSE_ALV_GRID_DISPLAY'
    exporting
    i_structure_name = 'vbak'
    i_grid_title = 'SALES ORDER INFO'
    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. " ALV_FUNC3
    **& Form NORM
    *form norm .
    format intensified.
    skip 1.
    write: /'SALES DOC.',
    ' Created on ',
    ' Time',
    ' Created by',
    ' Valid from ',
    ' Sold-to party'.
    format intensified off. skip 2.
    loop at it_vbak.
    write: / it_vbak-vbeln,
    it_vbak-erdat,
    it_vbak-erzet,
    it_vbak-ernam,
    it_vbak-angdt,
    it_vbak-kunnr.
    endloop.
    endform. " NORM 
    Edited by: Nawanandana Edirisinghe on Sep 3, 2009 12:52 PM

  • ALV pop-up via ALV table view

    Hello Folks,
    I have an ALV table view, after selecting any line item in the view i have button "DETAIL" which would pop up another view with the details in ALV view again.
    I have done the below steps but iam unable to get the alv pop-up with details. I would really appreciate if anyone can help me with this.
    My main view <i>V_OVERVIEW</i> is the initial Table view and i have created another View <i>V_POPUP</i> which just has a Viewcontainer. <i>V_OVERVIEW</i> is embeded in window <i>W_MAIN</i> and <i>V_POPUP</i> is embeded in <i>W_POPUP</i>.
    The view V_POPUP has the following code in its MODIFYVIEW method.
    DATA:node_wage TYPE REF TO if_wd_context_node,
           node_detail type ref to if_wd_context_node,
           lt_sltd_elmnts TYPE wdr_context_element_set,
           lr_element TYPE REF TO if_wd_context_element,
           wa_detail TYPE if_v_pop_up=>element_wage_benefit,
           it_detail TYPE if_v_pop_up=>elements_wage_benefit.
      data : lt_ssn type table of ZUT_XFERRED_SSN,
             lt_return type table of bapiret2.
      node_wage = wd_context->get_child_node( 'WAGE_BENEFIT' ).
      lt_sltd_elmnts = node_wage->get_selected_elements( abap_true ).
      lr_element->get_static_attributes(
        IMPORTING static_attributes = wa_detail ).
      CALL FUNCTION 'ZZ_GET_DETAIL'
        EXPORTING
          i_ob_key = objectkey
          i_quarter  = -quarter
        TABLES
          T_DTL  = lt_dtl
          T_RETURN   = lt_return.
      navigate from <CONTEXT> to <TP_RATES> via lead selection
      node_detail = wd_context->get_child_node( name =
                       ig_componentcontroller=>wdctx_ssn_details ).
      node_detail->bind_elements( new_items = lt_dtl ).
    The main View V_OVERVIEW has the button "DETAIL" which calls the window W_POPUP to show view V_POPUP embeded in it as a popup, here is the code in the Button handler
    DATA:
        l_api_main TYPE REF TO if_wd_view_controller,
        l_window_manager TYPE REF TO if_wd_window_manager,
        l_popup TYPE REF TO if_wd_window,
        l_cmp_api TYPE REF TO if_wd_component.
    * Pop to confirm
      CLEAR : l_api_main, l_cmp_api,
              l_window_manager, l_popup.
      l_api_main = wd_this->wd_get_api( ).
      l_cmp_api = wd_comp_controller->wd_get_api( ).
      l_window_manager = l_cmp_api->get_window_manager( ).
      l_popup = l_window_manager->CREATE_WINDOW(
      WINDOW_NAME = 'W_POP_UP'
      TITLE = 'Details' ).
      l_popup->open( ).

    hey folks nevermind i got it.
    Thanks

  • Error in updating ALV field catalog in selection

    Dear all,
    I'm trying to use the standard transaction /SAPAPO/TSKEYFMAIN in order to check the TS values.
    After filling the selection variant, the system shows the following error:
    'Error in updating ALV field catalog in selection'
    Could you please provide me with further details about the error? What could be the possible solution to avoid it?
    Many thanks,
    SM

    Hi Marius,
    thanks for your answer.
    I would like to use the /SAPAPO/TSKEYFMAIN transaction to check massively the values in the time series KFs and not just the consistency of them.
    So do you know any other transaction to do it or do you have an idea about the error of /SAPAPO/TSKEYFMAIN?
    Thanks for your help!
    SM

  • "Are you sure you want to shut down your computer?" prompt pops up for no reason and continues to pop up after selecting Cancel. How can I stop this?

    "Are you sure you want to shut down your computer?" prompt pops up for no reason and continues to pop up after selecting Cancel. How can I stop this?
    Mac Pro. OS 10.6.8

    Then I suggest you read this thread regarding the 30" Apple Cinema Display and that particular message pop up... several possible causes... common denominator, the display.
    http://forums.macrumors.com/showthread.php?t=617367

  • From ALV output list to selection screen

    Hi,
    I created one ALV report.
    After executing the program, it displays an ALV list.
    When I click on the back/exit/cancel buttons on the screen, it should take me to the selection screen.
    But that is not happening. it is taking to one screen which shows the report heading. IF i click back/cancel/exit buttons in this screen, it is taking me to the selection screen.
    I checked the program for any write statement, but therre are no write statements.
    Even i tried to remove the end-of-selection event in the program. but not working.
    Can any one help me on this how to overcome this issue.
    Thank you.
    Kumar

    hi check this example...
    REPORT zalv_sel_screen .TABLES: mara.DATA: BEGIN OF i_alv OCCURS 0,
          matnr TYPE mara-matnr,
          mtart TYPE mara-mtart,
          matkl TYPE mara-matkl,
          groes TYPE mara-groes,
          maktx TYPE makt-maktx,
          END OF i_alv.DATA: alv_container  TYPE REF TO cl_gui_docking_container.
    DATA: alv_grid       TYPE REF TO cl_gui_alv_grid.
    DATA: layout    TYPE lvc_s_layo.
    DATA: fieldcat  TYPE lvc_t_fcat.PARAMETERS: p_check.INITIALIZATION.  PERFORM get_data.AT SELECTION-SCREEN OUTPUT.  DATA: variant TYPE  disvariant.
      DATA: repid TYPE sy-repid.  repid = sy-repid.  variant-report = sy-repid.
      variant-username = sy-uname.  layout-zebra = 'X'.
      layout-edit_mode = 'X'.  CHECK alv_container IS INITIAL.  CREATE OBJECT alv_container
                  EXPORTING repid     = repid
                            dynnr     = sy-dynnr
                            side      = alv_container->dock_at_left
                            extension = 1500.  CREATE OBJECT alv_grid
             EXPORTING
                   i_parent          =  alv_container.*  ALV Specific. Data selection.
    Populate Field Catalog
      PERFORM get_fieldcatalog.  CALL METHOD alv_grid->set_table_for_first_display
        EXPORTING
          is_layout        = layout
          is_variant       = variant
          i_save           = 'U'
          i_structure_name = 'I_ALV'
        CHANGING
          it_outtab        = i_alv[]
          it_fieldcatalog  = fieldcat[].
    START-OF-SELECTION.
    FORM GET_DATA
    FORM get_data.  SELECT * INTO CORRESPONDING FIELDS OF TABLE i_alv
            FROM mara
              INNER JOIN makt
                ON maramatnr = maktmatnr
                       UP TO 100 ROWS
                   WHERE makt~spras = sy-langu.  SORT i_alv ASCENDING BY matnr.ENDFORM.                    "get_data***************************************************************
         Form  Get_Fieldcatalog - Set Up Columns/Headers
    FORM get_fieldcatalog.  DATA: ls_fcat TYPE lvc_s_fcat.
      REFRESH: fieldcat.  CLEAR: ls_fcat.
      ls_fcat-reptext    = 'Material Number'.
      ls_fcat-fieldname  = 'MATNR'.
      ls_fcat-ref_table  = 'I_ALV'.
      ls_fcat-outputlen  = '18'.
      ls_fcat-fix_column = 'X'.
      ls_fcat-key        = 'X'.
      ls_fcat-col_pos    = '1'.
      APPEND ls_fcat TO fieldcat.  CLEAR: ls_fcat.
      ls_fcat-reptext    = 'Material Type'.
      ls_fcat-fieldname  = 'MTART'.
      ls_fcat-ref_table  = 'I_ALV'.
      ls_fcat-outputlen  = '10'.
      ls_fcat-fix_column = 'X'.
      ls_fcat-key        = 'X'.
      ls_fcat-col_pos    = '2'.
      APPEND ls_fcat TO fieldcat.  CLEAR: ls_fcat.
      ls_fcat-reptext    = 'Material Group'.
      ls_fcat-fieldname  = 'MATKL'.
      ls_fcat-ref_table  = 'I_ALV'.
      ls_fcat-outputlen  = '12'.
      ls_fcat-col_pos    = '3'.
      APPEND ls_fcat TO fieldcat.  CLEAR: ls_fcat.
      ls_fcat-reptext    = 'Size'.
      ls_fcat-fieldname  = 'GROES'.
      ls_fcat-ref_table  = 'I_ALV'.
      ls_fcat-outputlen  = '30'.  ls_fcat-col_pos    = '4'.
      APPEND ls_fcat TO fieldcat.  CLEAR: ls_fcat.
      ls_fcat-reptext    = 'Material Description'.
      ls_fcat-fieldname  = 'MAKTX'.
      ls_fcat-ref_table  = 'I_ALV'.
      ls_fcat-outputlen  = '40'.  ls_fcat-col_pos    = '5'.
      APPEND ls_fcat TO fieldcat.ENDFORM.                    "get_fieldcatalog
    regards,
    venkat

  • Multiple system maintenance cycles are not shown in pop up for selection

    Hi,
    In change manager, when we create a change document from a change request, we dont get a pop up for selection of maintenance cycles with multiple systems in it.
    The change document is getting created by taking the only available maintenance cycle with only that system.
    Is there any configuration for this?
    Regards,
    Dipti Sawarkar.

    Hi Christian,
    Thanks for your reply.
    I know the pop up will come only when there is more than one maintenance cycles for that production system.
    I have done configuration for Normal correction.( SDMJ) and customized it (ZDMJ).
    When I try to create a CD* from CR* for a particular production system ( CCP) , it just takes up a maintenance cycle for CCP system and doesnt show up any pop for selection of maint cycles whereas I have created 5 maintenance cycles for this system CCP.
    The other 4 maintenance cycles have multiple landscapes (CCP and EAP )in it whereas this one (which gets selected by default) just has CCP landscape in it.
    The strange part is that when I try to create a stand alone CD ( without CR ) , it will give that pop up showing all 5 maint cycles. But this is not happening when I create a CD from a CR.
    I have never done/ seen configuration for the pop up of selecting maint cycles in ChaRM.
    Looking forward to ur help,
    ( *CD - Change Document  and * CR - Change Request)
    Regards,
    Dipti Sawarkar.

  • ALV with classes for selected fields

    Hi ALL,
            Please can anybody will give the example code for
    <b>ALV with classes for selected fields</b> from database table .

    Hi,
    *& Report  YR_TANS_ALVTEST                                             *
    REPORT  yr_tans_alvtest                         .
    INCLUDE ya_yr_tans_alvtest_top.
    TABLES yttans_test.
    DATA itab LIKE yttans_test OCCURS 0.
    DATA gr_alvgrid TYPE REF TO cl_gui_alv_grid .
    DATA gc_custom_control_name TYPE scrfname.
    gc_custom_control_name = 'CC_ALV'.
    DATA gr_ccontainer TYPE REF TO cl_gui_custom_container .
    DATA gt_fieldcat TYPE lvc_t_fcat .
    DATA gs_layout TYPE lvc_s_layo .
    data wa_itab like line of itab.
    TYPES : BEGIN OF ty_help,
              roll_no LIKE yttans_test-roll_no,
              name LIKE yttans_test-name,
            END OF ty_help.
    DATA: git_returntab TYPE TABLE OF ddshretval INITIAL SIZE 0.
          CLASS lcl_event_handler DEFINITION
    CLASS lcl_event_handler DEFINITION .
      PUBLIC SECTION .
        METHODS:
    handle_double_click FOR EVENT double_click OF cl_gui_alv_grid IMPORTING
        e_row e_column es_row_no.
      PRIVATE SECTION.
    ENDCLASS.                    "lcl_event_handler DEFINITION
    DATA gr_event_handler TYPE REF TO lcl_event_handler .
    *&      Form  handle_double_click
          text
         -->I_ROW      text
         -->I_COLUMN   text
         -->IS_ROW_NO  text
    FORM handle_double_click USING i_row TYPE lvc_s_row i_column TYPE
    lvc_s_col is_row_no TYPE lvc_s_roid.
    leave to list-processing.
    read table itab index is_row_no-row_id into wa_itab.
    write:/ 'Roll no: ', wa_itab-roll_no, /'Name: ', wa_itab-name,
    /'Marks: ', wa_itab-marks.
    LEAVE SCREEN.
    ENDFORM .                    "handle_double_click
          CLASS lcl_event_handler IMPLEMENTATION
    CLASS lcl_event_handler IMPLEMENTATION .
    *--Handle Double Click
      METHOD handle_double_click .
        PERFORM handle_double_click USING e_row e_column es_row_no .
      ENDMETHOD .                    "lcl_event_handler
    ENDCLASS .                    "lcl_event_handler IMPLEMENTATION
    SELECT-OPTIONS roll FOR yttans_test-roll_no .
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR roll-low.
      DATA: lit_help TYPE TABLE OF ty_help.
      DATA: wa_returntab LIKE LINE OF git_returntab.
      SELECT roll_no name INTO TABLE lit_help FROM yttans_test.
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
        EXPORTING
          retfield        = 'ROLL_NO'
          dynpprog        = sy-repid
          dynpnr          = sy-dynnr
          dynprofield     = 'roll-low'
          value_org       = 'S'
        TABLES
          value_tab       = lit_help
          return_tab      = git_returntab
        EXCEPTIONS
          parameter_error = 1
          no_values_found = 2
          OTHERS          = 3.
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      READ TABLE git_returntab INTO wa_returntab INDEX 1.
      roll-low = wa_returntab-fieldval.
    AT SELECTION-SCREEN.
      SELECT * FROM yttans_test INTO TABLE itab WHERE roll_no IN roll.
    START-OF-SELECTION.
      CREATE OBJECT gr_event_handler .
      CALL SCREEN '9000'.
    *&      Module  STATUS_9000  OUTPUT
          text
    MODULE status_9000 OUTPUT.
      SET PF-STATUS 'STATUS_9000'.
      SET TITLEBAR 'TITLE_9000'.
    ENDMODULE.                 " STATUS_9000  OUTPUT
    *&      Module  USER_COMMAND_9000  INPUT
          text
    MODULE user_command_9000 INPUT.
      DATA: ok_code TYPE sy-ucomm,
            save_ok TYPE sy-ucomm.
      save_ok = ok_code.
      CLEAR ok_code.
      CASE save_ok.
        WHEN 'BACK' OR '%EX' OR 'RW'.
          CALL METHOD gr_ccontainer->free.
         CALL METHOD cl_gui_cfw=>flush.
          LEAVE TO SCREEN 0.
      ENDCASE.
    ENDMODULE.                 " USER_COMMAND_9000  INPUT
    *&      Module  alv_display_9000  OUTPUT
          text
    MODULE alv_display_9000 OUTPUT.
      PERFORM display_alv .
    ENDMODULE.                 " alv_display_9000  OUTPUT
    *&      Form  display_alv
          text
    FORM display_alv .
      IF gr_alvgrid IS INITIAL .
        CREATE OBJECT gr_ccontainer
          EXPORTING
       PARENT                      =
            container_name              = gc_custom_control_name
       STYLE                       =
       LIFETIME                    = lifetime_default
       REPID                       =
       DYNNR                       =
       NO_AUTODEF_PROGID_DYNNR     =
          EXCEPTIONS
            cntl_error                  = 1
            cntl_system_error           = 2
            create_error                = 3
            lifetime_error              = 4
            lifetime_dynpro_dynpro_link = 5
            OTHERS                      = 6
        IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
               WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
        CREATE OBJECT gr_alvgrid
          EXPORTING
       I_SHELLSTYLE      = 0
       I_LIFETIME        =
            i_parent          = gr_ccontainer
       I_APPL_EVENTS     = space
       I_PARENTDBG       =
       I_APPLOGPARENT    =
       I_GRAPHICSPARENT  =
       I_NAME            =
          EXCEPTIONS
            error_cntl_create = 1
            error_cntl_init   = 2
            error_cntl_link   = 3
            error_dp_create   = 4
            OTHERS            = 5
        IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
               WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
        SET HANDLER gr_event_handler->handle_double_click FOR gr_alvgrid .
        PERFORM prepare_field_catalog CHANGING gt_fieldcat .
        PERFORM prepare_layout CHANGING gs_layout .
        CALL METHOD gr_alvgrid->set_table_for_first_display
          EXPORTING
       I_BUFFER_ACTIVE               =
       I_BYPASSING_BUFFER            =
       I_CONSISTENCY_CHECK           =
       I_STRUCTURE_NAME              =
       IS_VARIANT                    =
       I_SAVE                        =
       I_DEFAULT                     = 'X'
             is_layout                     = gs_layout
       IS_PRINT                      =
       IT_SPECIAL_GROUPS             =
       IT_TOOLBAR_EXCLUDING          =
       IT_HYPERLINK                  =
       IT_ALV_GRAPHICS               =
       IT_EXCEPT_QINFO               =
          CHANGING
            it_outtab                     = itab[]
            it_fieldcatalog               = gt_fieldcat
       IT_SORT                       =
       IT_FILTER                     =
          EXCEPTIONS
            invalid_parameter_combination = 1
            program_error                 = 2
            too_many_lines                = 3
            OTHERS                        = 4
        IF sy-subrc <> 0.
          LEAVE TO LIST-PROCESSING.
          WRITE 'error'.
        ENDIF.
      ELSE.
        CALL METHOD gr_alvgrid->refresh_table_display
    EXPORTING
       IS_STABLE      =
       I_SOFT_REFRESH =
          EXCEPTIONS
            finished       = 1
            OTHERS         = 2
        IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
               WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
      ENDIF.
    ENDFORM.                    "display_alv
    *&      Form  prepare_field_catalog
          text
         <--P_GT_FIELDCAT  text
    FORM prepare_field_catalog  CHANGING p_gt_fieldcat TYPE lvc_t_fcat .
      DATA ls_fcat TYPE lvc_s_fcat .
      ls_fcat-fieldname = 'ROLL_NO'.
      ls_fcat-coltext = 'ROLL No.'.
      APPEND ls_fcat TO p_gt_fieldcat.
      ls_fcat-fieldname = 'NAME'.
      ls_fcat-coltext = 'NAME'.
      APPEND ls_fcat TO p_gt_fieldcat.
      ls_fcat-fieldname = 'MARKS'.
      ls_fcat-coltext = 'MARKS'.
      APPEND ls_fcat TO p_gt_fieldcat.
    ENDFORM.                    " prepare_field_catalog
    *&      Form  prepare_layout
          text
         <--P_GS_LAYOUT  text
    FORM prepare_layout  CHANGING ps_layout TYPE lvc_s_layo.
      ps_layout-zebra = 'X' .
      ps_layout-grid_title = 'Students Details'.
      ps_layout-smalltitle = 'X' .
    ENDFORM.                    " prepare_layout
    Regards,
    Tanveer.
    Mark helpful answers
    Message was edited by: Tanveer Shaikh

  • How to automate ALV to Excel View selection?

    How to automate ALV to Excel View selection?
    I'd like to view ALV data in Excel sheet. The standard way is to select "View" tab in "Change Layout" window, then click "Excel" radio button, then I should select document template from list, then I should select it again, then I need to press "Copy" button.
    This is very long way! Is it possible to do it automatically, without multiple selection and pressing lots of buttons.

    Hello Vladimir,
    Use FM 'XXL_SIMPLE_API ' or XXL_FULL_API .
    Also go thru the link :
    http://www.sap-img.com/abap/download-to-excel-with-format-border-color-cell-etc.htm

  • How to get rid of the loop in ALV output from At selection screen event?

    I have several push buttons on a selection screen.
    Clikc on a button, then it pops up an editable ALV report. (This gets triggered AT SELECTION SCREEN event.). REUSE_ALV_GRID_DISPLAY_LVC..
    On the ALV output, I enabled F4 for a couple of fields. Once I click on the F4 button, ONF4 method gets triggerd and a pop up appears with custom search helps.
    choose a line and it fills the cell.
    Upto this it works fine.
    Now I click on the BACK button at the ALV output, it takes me to the selection screen. I click on the button again, it show the editable ALV. Now when I click on the F4 button, the pop up comes up twice and the cell gets filled from the second pop - up.
    How to control this?
    Probably I am not refreshing something?
    (I am using REUSE_ALV_GRID_DISPLAY_LVC and tooks ome code for ONF4 event from BCALV_*DATATYPES (forgot the exact name) program.)
    Thanks,
    Ven

    Hi,
    FORM refresh_grid USING  pw_grid TYPE REF TO cl_gui_alv_grid.
    *Work area
      DATA : wal_stable TYPE lvc_s_stbl.
      CHECK NOT pw_grid IS INITIAL.
      wal_stable-col = c_check.
      wal_stable-row = c_check.
    *Method to refresh grid
      CALL METHOD  pw_grid->refresh_table_display
           EXPORTING
             is_stable      = wal_stable
             i_soft_refresh = c_check
           EXCEPTIONS
             finished       = 1
             OTHERS         = 2.
    ENDFORM.                    " refresh_grid
    Thanks,
    Sree.

  • Alv pop up

    i want to know about pop up fm and required parameters for it. plz pass simple sample code.

    here is a sample code
    report  z11_rohan_shadow_assign1   no standard page heading message-id
    z11_shadow_mess.
                       DECLARING TYPES  POOL                             *
    All the definitions of internal tables, structures  and constants
    are declared in a type-pool called SLIS.
    type-pools: slis.
                          DECLARING STRUCUTURES                          *
    *&--Final structure
    types: begin of struc_final,
           matnr     type matnr,           "Material Number
           werks     type werks_d,           "Plant
           lgort     type lgort_d,           "Storage Location
           labst type labst,         "Valuated stock with unrestricted use
           meins type meins,         "unit of measurement
           mtart type mtart,         "material type
           ersda     type ersda,           "Creation date
           maktx type maktx,         "material description
           end of struc_final.
    *&--Final structure 2 for drill
    types: begin of struc_final_2,
           matnr     type matnr,           "Material Number
           werks     type werks_d,           "Plant
           lgort     type lgort_d,           "Storage Location
           name1 type name1,
           lgobe type lgobe,
           end of struc_final_2.
    *&--mard structure
    types: begin of struc_mard,
           matnr     type matnr,           "Material Number
           werks     type werks_d,           "Plant
           lgort     type lgort_d,           "Storage Location
           labst type labst,         "Valuated stock with unrestricted use
           end of struc_mard.
    *&--mara structure
    types: begin of struc_mara,
           matnr type matnr,
           meins type meins,         "unit of measurement
           mtart type mtart,         "material type
           ersda     type ersda,           "Creation date
           end of struc_mara.
    *&--maktx structure
    types: begin of struc_maktx,
           matnr type matnr,        "material number
           maktx type maktx,        "material description
           end of struc_maktx.
    *&--t001w structure
    types: begin of struc_p_desc,
           werks type werks_d,
           name1 type name1,
           end of struc_p_desc.
    *&--t001l structure
    types: begin of struc_s_loc_desc,
           werks type werks_d,
           lgort type lgort_d,
           lgobe type lgobe,
           end of struc_s_loc_desc.
                              TABLES                                     *
    tables: mard.
                                define macros                          *
    *&-- DEFINING MACRO FOR INITIAL FIELDCATALOG
    define macro_fieldcat.
      add 1 to l_fieldcat-col_pos.
    *Defining macro reference fields
      l_fieldcat-checkbox = &1.
      l_fieldcat-fieldname = &2.
      l_fieldcat-tabname = &3.
      l_fieldcat-key = &4.
      l_fieldcat-just = &5.
      l_fieldcat-hotspot = &6.
      l_fieldcat-do_sum = &7.
      l_fieldcat-seltext_l = &8.
      l_fieldcat-outputlen = &9.
      append l_fieldcat to i_fieldcat.
    end-of-definition.
    *&-- DEFINING FIELDCATALOG FOR POPUP FIELDCATALOG
    define macro_fieldcat_popup.
      add 1 to l_fieldcat2-col_pos.
    *Defining macro reference fields
      l_fieldcat2-fieldname = &1.
      l_fieldcat2-tabname = &2.
      l_fieldcat2-key = &3.
      l_fieldcat2-just = &4.
      l_fieldcat2-seltext_l = &5.
      l_fieldcat2-outputlen = &6.
      l_fieldcat2-ref_tabname = &7.
      append l_fieldcat2 to i_fieldcat2.
    end-of-definition.
                       WORK  AREA  DECLARATION                           *
    *&---work  area for Internal Tables[population 1]
    data: wa_mard type struc_mard,
          wa_mara type struc_mara,
          wa_maktx type struc_maktx,
          wa_final type struc_final.
    *population 2
    data: wa_p_desc type struc_p_desc,
          wa_s_loc_desc type struc_s_loc_desc,
          wa_final_2 type struc_final_2.
    *&--work  area for layout
    data: wa_layout type slis_layout_alv,
          wa_layout2 type slis_layout_alv.
    Structure to display variants for improt and export
    data : it_variant like disvariant,
           it_variant1 like disvariant.
    *defining local workarea
    data: l_fieldcat type slis_fieldcat_alv.
    *defining local workarea2 for fieldcat popup
    data: l_fieldcat2 type slis_fieldcat_alv.
                     INTERNAL TABLES  DECLARATION                        *
    *&---Internal tables for storing data.[populaiton 1]
    data: i_mard  type standard table of struc_mard,
          i_mara  type standard table of struc_mara,
          i_maktx type standard table of struc_maktx,
          i_final type standard table of struc_final.
    *&--population 2
    data: i_p_desc type standard table of struc_p_desc,
          i_s_loc_desc type standard table of struc_s_loc_desc,
          i_final_2 type standard table of struc_final_2.
    *&---Internal table for field catalog
    data : i_fieldcat type slis_t_fieldcat_alv,
    *&--Internal table for drill down alvfieldcat
          i_fieldcat2 type slis_t_fieldcat_alv,
    *&---Internal table for the event catalog.
           i_eventcat type slis_t_event,
    *&---Internal table for the sorting sequence.
           i_sortinfo type slis_t_sortinfo_alv,
    *&---Internal table for the top of page event
           i_listheader type slis_t_listheader.
    DEFINING REFERENCE MACROS FOR INTITAL FIELDCATALOG
    macro_fieldcat 'X' text-009 text-005 text-029 text-030 text-029  ' '
    text-004 text-031.
    macro_fieldcat ' ' text-011 text-005   ' '    text-030   ' '     ' '
    text-007 text-032.
    macro_fieldcat ' ' text-012 text-005   ' '    text-030   ' '     ' '
    text-010 text-031.
    macro_fieldcat ' ' text-014 text-005   ' '    text-030   ' '     ' '
    text-013 text-031.
    macro_fieldcat ' ' text-015 text-005   ' '    text-030   ' '     ' '
    text-016 text-031.
    macro_fieldcat ' ' text-017 text-005   ' '    text-033 text-029
    text-029
    text-019 text-031.
    macro_fieldcat ' ' text-018 text-005   ' '    text-030   ' '     ' '
    text-022 text-031.
    macro_fieldcat ' ' text-020 text-005   ' '    text-030   ' '     ' '
    text-025 text-031.
    DEFINING REFERENCE MACROS FOR POPUP FIELDCATALOGUE
    *MACRO_FIELDCAT_POPUP TEXT-009 TEXT-040 TEXT-029 TEXT-030 TEXT-004
    *TEXT-031 TEXT-021.
    macro_fieldcat_popup text-014 text-040   ' '    text-030 text-013
    text-031 text-024.
    macro_fieldcat_popup text-041 text-040   ' '    text-030 text-036
    text-032 text-038.
    macro_fieldcat_popup text-015 text-040   ' '    text-030 text-016
    text-031 text-026.
    macro_fieldcat_popup text-042 text-040   ' '    text-030 text-037
    text-032 text-039.
                    VARIABLE   DECLARATION                               *
    data : v_progname type syrepid.
                   SELECTION SCREEN                                      *
    SCREEN FOR ENTERING INFORMATION
    selection-screen begin of block charly with frame title text-001.
    select-options: r_matnr for mard-matnr.
    select-options: r_werks for mard-werks.
    select-options: r_lgort for mard-lgort.
    selection-screen end of block charly.
    selection-screen begin of block options with frame title text-003.
    *RADIO BUTTON
    parameters: p_r01  radiobutton group rad1 default 'X',  "GRID FORMAT
                p_r02  radiobutton group rad1 .             "LIST FORMAT
    selection-screen end of block options.
    *VARIANT
    selection-screen begin of block b3 with frame title text-043.
    parameters: p_var type slis_vari.
    selection-screen end of block b3.
                    INITIALIZATION EVENT                                 *
    initialization.
    *&--assigns main program name to v_progname which becomes the calling
    program
      v_progname = sy-repid.
    Display default variant using FM REUSE_ALV_VARIANT_DEFAULT_GET
      perform zf_default_variant.
    *&--clearing workareas
      clear: wa_mard,
             wa_mara,
             wa_maktx,
             wa_final,
             wa_layout.
    *&--refreshing internal tables
      refresh: i_mard,
               i_mara,
               i_maktx,
               i_final,
               i_eventcat,
               i_sortinfo,
               i_listheader.
                AT SELECTION SCREEN ON VLAUE REQUEST                     *
    at selection-screen on value-request for p_var.
      perform zf_variant_f4.  "USING FM REUSE_ALV_VARIANT_F4
                             AT SELECTION SCREEN                         *
    at selection-screen.
    *check the material no.
      perform zf_validate_field.
    *check the variant provided
      perform zf_variant_check.
                      START OF SELECTION EVENT
    start-of-selection.
    fetch the data
      perform zf_populate_info.
                       END OF SELECTION  EVENT
    end-of-selection.
    *If Internal Table Is Populated Then Only Display Alv Report.
      if i_final is not initial.
    &---Build layout.
        perform zf_layout.
    &---build event catalogue
        perform zf_eventcat using i_eventcat.
    build sorting
        perform zf_sorting using i_sortinfo.
    &---Build Listheader for TOP OF PAGE EVENT.
        perform zf_build_listheader using i_listheader.
        if p_r01 = 'X'.     "if 1st radio button is selected
    *&---Display alv grid.
          perform zf_display_alv_grid.
        else.
    *&---Display alv grid.
          perform zf_display_alv_list.
        endif.
      else.
    *If Table is not Populated ie Records Does not exist
        message e004.
      endif.
    *&      Form  zf_validate_field
          text
    -->  p1        text
    <--  p2        text
    form zf_validate_field .
    TECHNICAL VALIDATION  [SINGLE FIELD CHECK]
    CASE 1- IF NOTHING IS ENTERED, PRINT ALL RECORDS
      if r_matnr[] is initial and r_werks[] is initial and r_lgort[] is
      initial.
        exit.
      endif.
    CASE 2- IF ONLY MATERIAL NUMBER IS ENTERED
      if r_matnr[] is not initial and r_werks[] is initial and r_lgort[] is
      initial.
    *validate material
        select matnr
               into wa_mard-matnr
               from mara
               up to 1 rows
               where matnr in r_matnr.
        endselect.
        if sy-subrc <> 0.             "if unsuccessful
          message e001.                "material does not exist
        else.
          exit.
        endif.
      endif.
    CASE 3- IF ONLY PLANT IS ENTERED
      if r_matnr[] is initial and r_werks[] is not initial and r_lgort[] is
      initial.
    *validate plants
        select werks
               into wa_mard-werks
               from marc
               up to 1 rows
               where werks in r_werks.
        endselect.
        if sy-subrc <> 0.               "if unsuccessful
          message e002.                 "plant does not exist
        else.
          exit.
        endif.
      endif.
    CASE 3- IF ONLY STORAGE IS ENTERED
      if r_matnr[] is initial and r_werks[] is initial and r_lgort[] is
      not initial.
    *validate LGORT
        select lgort
               into wa_mard-lgort
               from mard
               up to 1 rows
               where lgort in r_lgort.
        endselect.
        if sy-subrc <> 0.        "if unsuccessful
          message e003.          "storage location does not exist
        else.
          exit.
        endif.
      endif.
    CASE 4- CHECKING BUISNESS VALIDATION 1 - MATERIAL AND PLANT
      if r_matnr[] is not initial and r_werks[] is not initial.
    to see if material exist for the entered plant.
        select matnr
               into wa_mard-matnr
               from mard up to 1 rows
               where matnr in r_matnr and werks in r_werks.
        endselect.
        if sy-subrc <> 0 .            "if unsuccesful
    *No particular combination exists
          message e006.
        else.
          exit.
        endif.
      endif.
    CASE 6 - CHECKING BUISNESS VALIDATION 2 - PLANT AND STORAGE
      if r_werks[] is not initial and r_matnr[] is initial and
    r_lgort[] is not initial.
        select werks
               into wa_mard-werks
               from mard
               up to 1 rows
               where werks in r_werks and lgort in r_lgort.
        endselect.
        if sy-subrc <> 0.
    *No particular combination exists
          message e006.
        else.
          exit.
        endif.
      endif.
    CASE 7 - CHECKING BUISNESS VALIDATION 3 - MATERIAL AND STORAGE
      if r_matnr[] is not initial and r_werks[] is initial.
        select matnr
              into wa_mard-matnr
              from mard
              up to 1 rows
              where matnr in r_matnr and lgort in r_lgort.
        endselect.
        if sy-subrc <> 0.
    *No particular combination exists
          message e006.
        else.
          exit.
        endif.
      endif.
    CASE 8 - CHECKING BUISNESS VALIDATION 4 - MATERIAL,PLANT AND STORAGE
      if r_matnr[] is not initial and r_werks[] is not initial.
        select matnr
               into wa_mard-matnr
               from mard
               up to 1 rows
               where matnr in r_matnr and werks in r_werks and lgort in
               r_lgort.
        endselect.
        if sy-subrc <> 0.
    *No particular combination exists
          message e006.
        endif.
      endif.
    endform.                    " zf_validate_field
    *&      Form  zf_populate_info
          text
    -->  p1        text
    <--  p2        text
    form zf_populate_info .
    *&--fetching the data from mard table
      select  matnr
              werks
              lgort
              labst
              into table i_mard
              from mard
              where matnr in r_matnr and werks in r_werks and lgort in
              r_lgort
      if sy-subrc <> 0.  "if unsuccesful
        message e004.    "Error- Record does not exist
      endif.
    selection of material description
      if i_mard[] is not initial.
    *SELECT DISTINCT FOR UNIQUE ENTRIES ONLY
        select  distinct matnr
                         maktx
                         into table i_maktx
                         from makt
                         for all entries in i_mard
                         where matnr = i_mard-matnr and
                         spras = sy-langu.
        if sy-subrc <> 0.                    " if unsucessful
          wa_maktx-maktx = text-028.         "NO DESCRIPTION
        endif.
    *fetching information from mara
        select  distinct matnr
                         meins
                         mtart
                         ersda
                         into table i_mara
                         from mara for all entries in i_mard
                         where matnr = i_mard-matnr.
        if sy-subrc <> 0.
          message e003.
        endif.
    *&--sorting the tables
        sort: i_mard by matnr werks lgort,
              i_mara by matnr,
              i_maktx by matnr.
    *&--Clearing workareas.
        clear: wa_mard,
               wa_mara,
               wa_maktx,
               wa_final.
    *PROCESSING
        loop at i_mard into wa_mard.
    *moving values to final workarea
          wa_final = wa_mard.
          at new matnr.
            read table i_maktx into wa_maktx
            with key matnr = wa_mard-matnr binary search.
            read table i_mara into wa_mara
            with key matnr = wa_mard-matnr binary search.
          endat.
          if sy-subrc = 0.
            "if succesful then move to final workarea
            wa_final-maktx  = wa_maktx-maktx.
    *for mara values
            wa_final-meins  = wa_mara-meins.
            wa_final-mtart = wa_mara-mtart.
            wa_final-ersda  = wa_mara-ersda.
          endif.
    *append final workarea
          append wa_final to i_final.
        endloop.
        refresh: i_mard.
        clear: wa_mard.
      endif.
    endform.                    "zf_populate_info
    *ENDFORM.                    " zf_build_fieldcat
    *&      Form  zf_display_alv_grid
          text
    -->  p1        text
    <--  p2        text
    form zf_display_alv_grid .
      call function 'REUSE_ALV_GRID_DISPLAY'
        exporting
          i_callback_program = v_progname
          is_layout          = wa_layout
          it_fieldcat        = i_fieldcat
          it_events          = i_eventcat
          it_sort            = i_sortinfo
          i_default          = 'X'
          i_save             = 'A'
          is_variant         = it_variant1
        tables
          t_outtab           = i_final      "output table
        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.                    " zf_display_alv_grid
    *&      Form  zf_display_alv_list
          text
    -->  p1        text
    <--  p2        text
    form zf_display_alv_list .
      call function 'REUSE_ALV_LIST_DISPLAY'
        exporting
          i_callback_program = v_progname
          is_layout          = wa_layout
          it_fieldcat        = i_fieldcat
          it_events          = i_eventcat
          it_sort            = i_sortinfo
          i_default          = 'X'
          i_save             = 'A'
          is_variant         = it_variant1
        tables
          t_outtab           = i_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.
    endform.                    " zf_display_alv_list
    *&      Form  ZF_LAYOUT
          text
    -->  p1        text
    <--  p2        text
    form zf_layout .
      wa_layout-zebra = 'X'.
      wa_layout-totals_text = 'TOTAL'.
    endform.                    " ZF_LAYOUT
    *&      Form  ZF_EVENTCAT
          text
         -->P_I_EVENTCAT  text
    form zf_eventcat using p_i_eventcat type slis_t_event.
      data: l_eventcat type slis_alv_event.
      clear l_eventcat.
      call function 'REUSE_ALV_EVENTS_GET'
        exporting
          i_list_type     = 0
        importing
          et_events       = p_i_eventcat
        exceptions
          list_type_wrong = 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.
    TOP OF PAGE FORM
      clear l_eventcat.
      read table p_i_eventcat into l_eventcat with key
                              name = slis_ev_top_of_page.
      "(COMPONENT "NAME" of structure)
      if sy-subrc = 0.                           "if success
        move 'ZF_TOP_OF_PAGE' to l_eventcat-form.
        "matches name and moves form to workarea and modifies table
        modify p_i_eventcat from l_eventcat index sy-tabix
                                          transporting form.
      endif.
    USER_COMMAND FORM
      clear l_eventcat.
      read table p_i_eventcat into  l_eventcat with key
                               name = slis_ev_user_command.
      if sy-subrc = 0.
        move 'ZF_USER_COMMAND' to  l_eventcat-form.
        modify p_i_eventcat from l_eventcat index sy-tabix
                                          transporting form.
      endif.
    endform.                    " ZF_EVENTCAT
    *&      Form  ZF_TOP_OF_PAGE
          text
    -->  p1        text
    <--  p2        text
    form zf_top_of_page .
      call function 'REUSE_ALV_COMMENTARY_WRITE'
        exporting
          it_list_commentary = i_listheader.
    endform.                    " ZF_TOP_OF_PAGE
    *&      Form  ZF_BUILD_LISTHEADER
          text
         -->P_I_LISTHEADER  text
    form zf_build_listheader  using p_i_listheader type slis_t_listheader.
      data: l_listheader type slis_listheader,
            l_lines type i,
            l_records(10) type c.
      refresh p_i_listheader.
      clear l_listheader.
    HEADER  [PRINTS THE HEADER IN BOLD AND CAPITAL]
      l_listheader-typ = 'H'.
      l_listheader-info = 'STORAGE LOCATION WISE MATERIAL REPORT'.
      append l_listheader to p_i_listheader.
    SELECTION
    *for date
      l_listheader-typ = 'S'.
      l_listheader-key = text-035.
      concatenate sy-datum6(2) '.' sy-datum4(2) '.' sy-datum(4) into
      l_listheader-info.
      append l_listheader to p_i_listheader.
    *for Total no. of records
      describe table i_final lines l_lines.
      l_records = l_lines.
      l_listheader-typ = 'S'.
      l_listheader-key = text-034.
      l_listheader-info = l_records.
      append l_listheader to p_i_listheader.
    endform.                    " ZF_BUILD_LISTHEADER
    *&      Form  ZF_SORTING
          text
         -->P_I_SORTINFO  text
    form zf_sorting using p_i_sortinfo type slis_t_sortinfo_alv.
      data l_sortinfo type slis_sortinfo_alv.
      refresh p_i_sortinfo.
      clear l_sortinfo.
      l_sortinfo-spos = '1'.               "sorting position
      l_sortinfo-fieldname = text-009.      "fieldname
      l_sortinfo-tabname = 'I_FINAL'.      "final table
      l_sortinfo-down = 'X'.
      l_sortinfo-group = '*'.      "DONT REPEAT COMMON ITEM
      append l_sortinfo to p_i_sortinfo.
    endform.                    " ZF_SORTING
    *&      Form  ZF_USER_COMMAND
          text
    -->  p1        text
    <--  p2        text
    form zf_user_command using r_ucomm like sy-ucomm
                               rs_selfield type slis_selfield .
      case r_ucomm.
    *&-- when hotspot is clikced
        when '&IC1'.
          if rs_selfield-fieldname = 'WERKS'.
            read table i_final into wa_final index rs_selfield-tabindex.
            if sy-subrc = 0.   "if succesful
    *PERFORM FOR POPUALTING THE INITIAL FETCH OPERTAIONM
              perform zf_popualte_table_2.
            else.              "if unsuccesful
              message e004.    "Error- Record does not exist
            endif.
    *&--PERFORM FOR DATA POPUALTION OF PLANT AND STORAGE DECRIPTION
            perform zf_data_popualtion_2.
    *&--PERFORM TO Call POPUP FUNCTION
             perform zf_alv_grid_display_popup.
            perform zf_popup_display.
           PERFORM ZF_LAYOUT2.
            refresh: i_final_2.
          endif.
      endcase.
    endform.                    " ZF_USER_COMMAND
    *&      Form  ZF_POPUALTE_TABLE_2
          text
    -->  p1        text
    <--  p2        text
    form zf_popualte_table_2 .
      select matnr
             werks
             lgort
             from mard
             into corresponding fields of table i_mard
             where matnr = wa_final-matnr and werks = wa_final-werks.
    endform.                    " ZF_POPUALTE_TABLE_2
    *&      Form  ZF_DATA_POPUALTION_2
          text
    -->  p1        text
    <--  p2        text
    form zf_data_popualtion_2 .
    selection of storage location filtered by material no.of mard
      if i_mard[] is not initial.
    *SELECT PLANT DESCRIPTION
        select  werks
                name1
                into table i_p_desc
                from t001w
                for all entries in i_mard where werks = i_mard-werks.
        if sy-subrc <> 0.                    " if unsucessful
          wa_p_desc-name1 = text-028.         "NO DESCRIPTION
        endif.
    *SELECT STORAGE LOCATION DESCRIPTIONS
        select  werks
                lgort
                lgobe
                into table i_s_loc_desc
                from t001l
                for all entries in i_mard where werks =  i_mard-werks and
                lgort = i_mard-lgort.
        if sy-subrc <> 0.                         " if unsucessful
          wa_s_loc_desc-lgobe = text-028.         "NO DESCRIPTION
        endif.
    *&--sorting the tables
        sort: i_mard by matnr werks lgort,
              i_p_desc by werks,
              i_s_loc_desc by werks lgort.
    *&--Clearing workareas.
        clear: wa_mard,
               wa_p_desc,
               wa_s_loc_desc,
               wa_final_2.
    *PROCESSING [2nd time]
        loop at i_s_loc_desc into wa_s_loc_desc .
    *moving values to final workarea
          wa_final_2-werks = wa_s_loc_desc-werks .
          wa_final_2-lgort = wa_s_loc_desc-lgort .
          wa_final_2-lgobe  = wa_s_loc_desc-lgobe.
          read table i_p_desc into wa_p_desc
          with key werks = wa_s_loc_desc-werks binary search.
          read table i_mard into wa_mard
          with key werks = wa_s_loc_desc-werks binary search.
          if sy-subrc = 0.
    *for t001w  [plant desc] values
            wa_final_2-name1 = wa_p_desc-name1.
    *for matnr values
            wa_final_2-matnr = wa_mard-matnr.
          endif.
    *append final workarea
          append wa_final_2 to i_final_2.
        endloop.
      endif.
    endform.                    " ZF_DATA_POPUALTION_2
    *&      Form  ZF_POPUP_DISPLAY
          text
    -->  p1        text
    <--  p2        text
    form zf_popup_display .
      call function 'REUSE_ALV_POPUP_TO_SELECT'
        exporting
          i_title       = 'POPUP- DISPLAYING MATERIAL-STORAGE'
          i_tabname     = 'I_FINAL_2'
          it_fieldcat   = i_fieldcat2
        tables
          t_outtab      = i_final_2
        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.                    " ZF_POPUP_DISPLAY
    *&      Form  ZF_DEFAULT_VARIANT
          text
    -->  p1        text
    <--  p2        text
    form zf_default_variant .
      it_variant1-report = sy-repid.
    Search default variant for the report
      call function 'REUSE_ALV_VARIANT_DEFAULT_GET'
        exporting
          i_save        = 'A'
        changing
          cs_variant    = it_variant1
        exceptions
          wrong_input   = 1
          not_found     = 2
          program_error = 3
          others        = 4.
      if sy-subrc = 0.       "if succesful set as default.
        p_var = it_variant1-variant.
      endif.
    endform.                    " ZF_DEFAULT_VARIANT
    *&      Form  ZF_VARIANT_F4
          text
    -->  p1        text
    <--  p2        text
    form zf_variant_f4 .
      it_variant-report = sy-repid.
      call function 'REUSE_ALV_VARIANT_F4'
        exporting
          is_variant                = it_variant
          i_save                    = 'A'
       importing
      E_EXIT                    =
          es_variant                = it_variant1
       exceptions
         not_found                 = 1
         program_error             = 2
         others                    = 3
      if sy-subrc = 0.     "if sccesfully found, load the variant
        p_var = it_variant1-variant.
      endif.
    endform.                    " ZF_VARIANT_F4
    *&      Form  ZF_VARIANT_CHECK
          text
    -->  p1        text
    <--  p2        text
    form zf_variant_check .
      if not p_var is initial.
        it_variant-report = sy-repid.
        it_variant-variant = p_var.
        call function 'REUSE_ALV_VARIANT_EXISTENCE'
          exporting
            i_save        = 'A'
          changing
            cs_variant    = it_variant
          exceptions
            wrong_input   = 1
            not_found     = 2
            program_error = 3
            others        = 4.
        if sy-subrc = 0.
          clear it_variant1.
          move p_var to it_variant1-variant.
          move sy-repid to it_variant1-report.
        else.
          message e007.
        endif.
      else.
        clear it_variant.
      endif.
    endform.                    " ZF_VARIANT_CHECK
    *&      Form  ZF_ALV_GRID_DISPLAY_POPUP
          text
    -->  p1        text
    <--  p2        text
    form zf_alv_grid_display_popup .
      call function 'REUSE_ALV_GRID_DISPLAY'
       exporting
      I_INTERFACE_CHECK                 = ' '
      I_BYPASSING_BUFFER                = ' '
      I_BUFFER_ACTIVE                   = ' '
      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                       = i_fieldcat2
      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             = 10
        i_screen_start_line               = 1
        i_screen_end_column               = 50
        i_screen_end_line                 = 10
      IT_ALV_GRAPHICS                   =
      IT_HYPERLINK                      =
      IT_ADD_FIELDCAT                   =
      IT_EXCEPT_QINFO                   =
      I_HTML_HEIGHT_TOP                 =
      I_HTML_HEIGHT_END                 =
    IMPORTING
      E_EXIT_CAUSED_BY_CALLER           =
      ES_EXIT_CAUSED_BY_USER            =
        tables
          t_outtab                          = i_final_2
       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.                    " ZF_ALV_GRID_DISPLAY_POPUP
    reward if helpful
    keep rockin
    vivek

Maybe you are looking for

  • SSO from Microsoft to SAP portal

    Hi guys, I am stacked in something regarding SSO, the problem here is that I have to create and ASP.net application able to create the SAPLogOnTicket and bypass the SAP portal logon screen and everytime I am using may application I have not to log in

  • Servlet won't let go of Database

    I have a few servlets that all need to access the same database, sequentially. At the end of each, I have executed the rs.close(), stmt.close(), and con.close(). However, the applications will not let go of the database, and it is unavailable after o

  • Table For Secondary Cost Elements

    Dear Folks,               Please Help me for getting details (TABLES)  of Secondary Cost elements Actual Line items Date wise and Cost Center wise Thanks in advance Regaards ASHOK K

  • Can we delete vendor master

    Dear All, can we delete vendor master records ? if s how regds, CB

  • How do you do a screen shot in Foxfire?

    I am trying to do a screen shot and do not know how to do it in Foxfire.