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

Similar Messages

  • 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

  • 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

  • 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

  • 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

  • Handling Double click on a Pop-up screen with ALV Grid

    Hello Experts,
    I have an issue handling double click on ALV Pop-up screen. I tried to achive this using following steps.
    1. I defined a local class in Top-include to handle double click and implemented it in the following way.
    CLASS lcl_alv_event_handler DEFINITION.
    PUBLIC SECTION.
    CLASS-METHODS:
    on_double_click FOR EVENT double_click
    OF cl_gui_alv_grid
    IMPORTING e_row
    e_column
    es_row_no.
    ENDCLASS. "lcl_alv_event_handler DEFINITION
    *~~~ Implementation code
    CLASS lcl_alv_event_handler IMPLEMENTATION.
    To handle Selection of Issue data on Screen 100
    METHOD on_double_click.
    DATA: lt_row_no TYPE lvc_t_roid,
    ls_req TYPE zcst_zirt_seltab.
    READ TABLE gt_req
    INTO ls_req
    INDEX e_row-index.
    g_req_id = ls_req-zzrequest_id.
    gv_selected = true.
    CALL METHOD go_alv->dispatch
    EXPORTING
    cargo = 'OK'
    eventid = 3
    is_shellevent = ' '
    is_systemdispatch = 'X'
    EXCEPTIONS
    cntl_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.
    ENDMETHOD. "on_double_click
    ENDCLASS. "lcl_alv_event_handler IMPLEMENTATION
    2. Registered the event in the PBO module of the screen
    ls_events-eventid = 3.
    ls_events-appl_event = gc_true.
    APPEND ls_events TO lt_events.
    CALL METHOD co_alv->set_registered_events
    EXPORTING
    events = lt_events
    EXCEPTIONS
    cntl_error = 1
    cntl_system_error = 2
    illegal_event_combination = 3
    OTHERS = 4.
    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 co_alv_event_handler.
    SET HANDLER: co_alv_event_handler->on_double_click FOR co_alv.
    CALL METHOD co_alv->set_toolbar_interactive.
    3. In the PAI module of Screen, tried to handle the event 'OK' that waqs registred in PBO.
    CASE save_ok.
    WHEN 'OK'.
    Get selected line
    CALL METHOD io_alv->get_selected_rows
    IMPORTING
    et_index_rows = lt_rows
    et_row_no = lt_rows_no.
    IF NOT lt_rows IS INITIAL.
    READ TABLE lt_rows INTO ls_rows INDEX 1.
    IF sy-subrc EQ 0.
    gv_selected = 'X'.
    READ TABLE it_req
    INTO ls_req
    INDEX ls_rows-index.
    e_req_id = ls_req-zzrequest_id.
    SET SCREEN 0.
    ENDIF.
    ELSE.
    SET SCREEN 0.
    ENDIF.
    With this code what is happening is, when user double clicks a line on Pop-up screen with ALV grid data, the program is able to successfully get into the class implementation but the control is not going to PAI module to execute the OK_code handling part.
    Am I doing this in the right way? Appreciate quick suggestions. Proper posts will be thoroughly awarded with points.
    Thx.
    Minni

    Put your code into the Event handler Implementation of Double Click which is there in the PAI Module.
    Regards,
    Naimesh Patel

  • ALV OM. Avoiding pop-up closure

    I created an ALV pop-up using the ALV OM.
    I have to detect the moment when the user closes the window so to make some checks; according to the result of these checks the ALV pop-up must stay open so the user can make other changes.
    Until now I don't succeed in avoiding the window closure when the user, for example, clicks on the close window icon.
    What are the objects to use, or whatever else steps to make, to avoid the window closure?
    Thanks in advance,
    Antonino

  • Logical Database o/p in ALV

    Dear Expert.
    I have to call AFI logical database in ZPROGRAM. If I write GET DIAUFK (root node)
    How do I fetch data form parent and child node?
    O/p should come as ALV on that alv pop-up will come on that pop up list of transaction displayed which will work on click.
    Please suggest.
    START-OF-SELECTION.
    GET DIAUFK  .
    *get late
    *GET DIIHPA.
    GET DIIFLO .
    *GET DIQMEL.
      MOVE-CORRESPONDING DIAUFK TO ITAB.
    *MOVE-CORRESPONDING DIQMEL TO ITAB.
      APPEND ITAB.
    GET DIAUFK LATE.
    IF S_ERDAT NE SPACE AND S_WERKS NE SPACE.
      ITAB-ERDAT = S_ERDAT .
      ITAB-WERKS = S_WERKS .
    ENDIF.
    END-OF-SELECTION.
      LOOP AT ITAB.
        IT_FINAL = ITAB.
        APPEND IT_FINAL.
      ENDLOOP.

    Try exploring FM 'LDB_PROCESS'
    <removed by moderator>
    Edited by: Thomas Zloch on Aug 9, 2010 2:56 PM - don't ask for ...

  • Assertion failed Dump in ALV

    Hello,
    I am displaying a ALV report as POP-UP . Its developed based on OOPS ( gr_table->Display).
    The ALV displaying the output perfectly when the records are less. For example, the ALV pop-up  able to show the 50 records perfectly . If the records are more than 50 (example 500), then i have to scroll down to see the records  from 51 to 500. When the records are high , the Alv trying to display the output.. but in a second, its throwing the dump((ASSERTION_FAILED)). Few times, its able to display the data, when i am trying to scroll down to see the below records..its throwing the dump (ASSERTION_FAILED). I tried with all possibilities but no luck. And no idea about ASSERTION FAILED DUMP.
    Kindly help.
    Regards,
    Venkat

    Hello Both,
    Thanks for the reply. Please find the error details
    The ASSERT condition was violated.
    Error analysis
        The following checkpoint group was used: "No checkpoint group specified"
        If in the ASSERT statement the addition FIELDS was used, you can find
        the content of the first 8 specified fields in the following overview:
        " (not used) "
        " (not used) "
        " (not used) "
        " (not used) "
        " (not used) "
        " (not used) "
        " (not used) "
        " (not used) "
    Probably the only way to eliminate the error is to correct the program.
    If the error occures in a non-modified SAP program, you may be able to
    find an interim solution in an SAP Note.
    If you have access to SAP Notes, carry out a search with the following
    keywords:
    "ASSERTION_FAILED" " "
    "CL_DATAPTABLECACHE============CP" or "CL_DATAPTABLECACHE============CM00P"
    "TRANSMIT_PACKET"
    Any clue. Please.
    Venkat

  • Print in alv

    Re: Printing in ALV  
    Posted: Jan 29, 2008 10:18 AM    in response to: J Are     Edit      E-mail this message      Reply 
    hi,
    i have got one  problem can any body  help me out....my requirement is
    if an alv output(oops or normal ) has 30 coloumns in the output,
    if i give print option in the output(in alv tool bar)and in spool if i check it has only 13 coloumns generated other coloumns are not at displayed. how to get all the coloumns print in the spool if alv has more than 30 coloumns.
    one thing is we can set the printer configuration by using spad transaction before it gets printed but how to do it programatically in alv itself as u alv pop up to select for setting printer properties before printing how to do that.
    regards,
    narsimha.

    Hi Dana,
    This thread answers ur question..
    alv REPORT PRINTING
    cheers,
    Prashanth
    P.S Please mark helpful answers

  • Would you please summarize what the difference between tc and alv?

    hi, experts,
      would you please summarize what the difference between table control and alv base on the function and usage practice.
    for example, as i know:
    1.edit
      tc: can edit in the same screen and save.
      alv: pop up a sub screen to let user edit, so this is unconvenient.
    2.functional button
      alv: can have many functional button as default ,eg. sort, summary and so on
      tc:  developers must implements by himself.
    3.color
      alv: can have and change color
      tc:  cann't changed color
    some client may required the data displayed in alv and edit in tc ,such as example BCALV_EDIT_02.
    above are my idea, experts, would you give me some comments on my opinion and summarize what the difference between those two components? i should make it clear in order to consult the UI with my client.hunger for your advice, thanks!
    Message was edited by:
            liu shaochang

    ALV Grid is basically used for display puropse. It is more user friendly. There are arious features ( such as coloring, sorting, saving to a local file, sedning by mail etc. ) These featurs make ALV Grid a very good option to display the data .
    However , the table control is not only used to display data take from the database table, but also you can do operation such as deletion of data from database table, insertion of data into the database table and updation also. Yeah it has not got the various features whihc ALV has.
    So table control and ALV Grid , if you are just using for display purpose, then ALV Grid is a better option due to its layout and attractive features. But if you want to do the database operations other than display, table control can be used.
    As far as execution is concerned, I think ALV Grid is faster.
    ALV grid control is faster when compared to Table control. But the comaprision is Negligible .
    One of the major differences comes in taking of line items - ALV has an advantage over Table Control when it comes to update database from it.Table control only allows maximum of 999 records at a time where as this limitation is not there in ALV.
    Also,a main feature of ALV Grid is that it contains a standard set of functions. These functions extend beyond the functions of a table control.
    These two UI elements require different keyboard navigation, with ALV Grid being more user-friendly.
    An application can display table data in ALV Grid or in a table control. In some applications you can choose between displaying and editing data in either ALV Grid or a table control. If a configurable button () appears in the right upper corner of the table, it is a table control.
    Basically ALV is a way to display the output and Table Control is designed in screen painter through which you can get entries in Table Control, can delete some records etc for further processing and its not use only for Display.
    ALV is Application List viewer:-
    Sap provides a set of ALV (ABAP LIST VIEWER) function modules which can be put into use to embellish the output of a report. This set of ALV functions is used to enhance the readability and functionality of any report output. Cases arise in sap when the output of a report contains columns extending more than 255 characters in length.
    In such cases, this set of ALV functions can help choose selected columns and arrange the different columns from a report output and also save different variants for report display. This is a very efficient tool for dynamically sorting and arranging the columns from a report output.
    TABLE CONTROL:-
    ABAP offers two mechanisms for displaying and using table data in a screen. These mechanisms are table controls and step loops. Table controls and step loops are types of screen tables you can add to a screen in the Screen Painter.

  • Check_Changed_Data not working

    Hi all,
    In my BADI i am triggering an ALV grid pop-up to select values with check box. For getting the changed data i am using check_changed_data method. Even after selecting the check boxes in ALV pop i am not able to get the changed data.
    program code :
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_program    = sy-repid
          i_grid_title          = 'Select MAil ID'
          is_layout             = lt_layout
          it_fieldcat           = t_fieldcat
          i_screen_start_column = 20
          i_screen_start_line   = 5
          i_screen_end_column   = 70
          i_screen_end_line     = 15
          I_SAVE                = 'A'
        TABLES
          t_outtab              = it_ZEMAIL
        EXCEPTIONS
          program_error         = 1
          OTHERS                = 2.
      IF sy-subrc <> 0.
      ENDIF.
    data: gd_repid like sy-repid,
            ref_grid type ref to cl_gui_alv_grid.
      if ref_grid is initial.
        call function 'GET_GLOBALS_FROM_SLVC_FULLSCR'
          importing
            e_grid = ref_grid.
      endif.
      if not ref_grid is initial.
        call method ref_grid->check_changed_data .
      endif.
    while debugging i found that the ref_grid remains initial after the function GET_GLOBALS_FROM_SLVC_FULLSCR.
    so  call method ref_grid->check_changed_data  is not executed.
    So how can i solve this problem.
    Thanks in advance.
    Venkat.

    Hi,
    u need to use user command
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_program    = sy-repid
          i_grid_title          = 'Select MAil ID'
         i_callback_user_command  = 'USER_COMMAND'
          is_layout             = lt_layout
          it_fieldcat           = t_fieldcat
          i_screen_start_column = 20
          i_screen_start_line   = 5
          i_screen_end_column   = 70
          i_screen_end_line     = 15
          I_SAVE                = 'A'
        TABLES
          t_outtab              = it_ZEMAIL
        EXCEPTIONS
          program_error         = 1
          OTHERS                = 2.
      IF sy-subrc  0.
      ENDIF.
    FORM user_command USING lv_ucomm LIKE sy-ucomm
                      rs_selfield TYPE slis_selfield.
    Declaration of local Variables
      DATA : lv_ref1 TYPE REF TO cl_gui_alv_grid.
    Event
        WHEN <event>
          CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
            IMPORTING
              e_grid = lv_ref1.
          CALL METHOD lv_ref1->check_changed_data.
    Now try this...
    Regards,
    Nagaraj

  • How to create Pager Number for Customer contact in VAP1 or XD02

    HI ,
       I am trying to mass upload Customer contact data , there is pager number to be uploaded . but when i do it through BDC . Its doesnt record the ALV pop up as there no screen fields as it is not a program screen .
      So BDC selects only the first item in the list , which is FAX number . So i cant upload Pager number through BDC .
      Does there any method available to do the same ? i tried direct upload also but seems tedious .
    Waiting for reply ,

    You would do it the way I created it:
    Select the Text tool in Photoshop and set the font and parameters as I have listed.  Then enter whatever text you like.  It will be rendered over the top of the lower layers you may have in the document.  Save as an image of the appropriate type and you're there.
    Note that "lower layers you may have in the document" could conceivably be none at all (i.e., you render the text over a transparent document).  You could imagine saving that as a .png with transparency and get light text in an image that could then be put over the top of anything else.  The alpha mixing will see to it that the edges smoothly blend with the background.  I haven't actually tried this (I usually do try my own suggestions) because of lack of time right now.
    -Noel
    Edit:  Markerline and I seem to be on the same crystal-controlled wavelength. 

Maybe you are looking for

  • Palm Desktop Date Book/Layout

    I have Palm Desktop 4.2.2.  In month view of date book, there are blanks between entries.  Sometimes entries are obscured/out of view but would be viewable if I could move them into empty space for that day.  Any way to move entries into blank lines/

  • RGB, Composite, Firewire and S-video capture device for FCP

    Hi, I was just wondering if anyone could suggest some of the better capture cards that support RGB composite, firewire and s-video inputs that will work with FCP. The set up is on Mac Pro and the device needs to be as reliable and noise free as possi

  • IDVD exporting low resolution

    I made 5 slideshows on iMovie and exported them HD quality, and they look great on my iMac. I put them on a basic iDVD menu and burnt them onto a DVD (burnt 3 seperate disks as best performance, high quality AND professional quality) and the entire t

  • Mail SMTP rogers authentication problem or bug?

    I'm setting up multiple email accounts in Mail. Internet provider is with Rogers Rogers blocks SMTP ports so the only SMTP I can use with all my mail accounts is smtp.broadband.rogers.com Having a problem with Mail where one of the accounts is using

  • Nokia 6300 driving me crazy

    Hi,just got a nokia 6300 about 3months back only for me to notice yesterday that it was rebooting itself and when i turned it off and tried putting it on back but everytime i press the power button, the blue lights on the side stay on. After much att