Skip to Content
author's profile photo Former Member
Former Member

Reg :alv popup with check boxes

Hi Floks,

My requirement is to create dynamic search help in alv in first screen when I execute then I need to get generate an multiple check box in alv popup list box if I clicked one or two in that display its automatically append to the internal table . could you please help how write it if any pseudo code forward me .links if u have forward me regarding this.

Thanks For Advance,

Sunitha

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Posted on Sep 07, 2007 at 05:49 PM

    Hi,

    Check this

    *&---------------------------------------------------------------------*
    * Form f_f4_help_region                                                *
    *&---------------------------------------------------------------------*
    * For F4 help value                                                    *
    *&---------------------------------------------------------------------*
    form f_f4_help_region using p_plgrp.
      data: pt_grpfcat      type slis_t_fieldcat_alv,
            ps_grpfcat      like line of pt_grpfcat,
            pt_grpself      type slis_selfield,
            pt_grplayout2   type slis_layout_alv,
            pv_grptitle(20) type c,
            p_grpexcltab2   type slis_t_extab with header line,
            p_header        type  slis_formname.
    
      ps_grpfcat-fieldname = 'YBOX'.
      ps_grpfcat-checkbox  = c_x.
      ps_grpfcat-edit      = c_x.
      ps_grpfcat-seltext_m = text-272.
      ps_grpfcat-outputlen = 3.
      append ps_grpfcat to pt_grpfcat[].
      clear ps_grpfcat.
    
      ps_grpfcat-fieldname = 'WERKS'.
      ps_grpfcat-outputlen = 4.
      ps_grpfcat-seltext_m = 'Plants'.
      append ps_grpfcat to pt_grpfcat[].
      clear ps_grpfcat.
    
      ps_grpfcat-fieldname = 'NAME1'.
      ps_grpfcat-outputlen = 40.
      ps_grpfcat-seltext_m = 'Description'.
      append ps_grpfcat to pt_grpfcat[].
      clear ps_grpfcat.
    
      select * from t001w into table i_t001w_1.
    
      if not i_yfe024[] is initial.
    
        refresh : i_grpoutput. clear : i_grpoutput.
    
        pt_grplayout2-zebra = c_x.
    
        refresh i_events. clear i_events.
    
          loop at i_t001w_1 into wa_t001w_1.
           move : c_x            to i_grpoutput-ybox,
                 wa_t001w_1-werks to i_grpoutput-werks,
                 wa_t001w_1-name1 to i_grpoutput-name1.
          append i_grpoutput.
          endloop.
    
    
        p_header = text-277.
    
        call function 'REUSE_ALV_GRID_DISPLAY'
          exporting
            it_fieldcat                 = pt_grpfcat[]
            it_excluding                = p_grpexcltab2[]
            is_layout                   = pt_grplayout2
            i_callback_program          = sy-repid
            i_callback_html_top_of_page = p_header
            i_callback_pf_status_set    = v_status_set1
            i_callback_user_command     = v_user_command1
            i_screen_start_column       = 25
            i_screen_start_line         = 5
            i_screen_end_column         = 80
            i_screen_end_line           = 20
            it_events                   = i_events[]
          tables
            t_outtab                    = i_grpoutput.
      else.
        message i367(yscc) with v_plgrp..
      endif.
    endform.                                 " F_f4_help_fieldname
    *
    *&---------------------------------------------------------------------*
    * Form  f_user_command1                                                *
    *&---------------------------------------------------------------------*
    * This form will handle the user command from fm REUSE                 *
    *----------------------------------------------------------------------*
    form f_user_command1 using p_ucomm type sy-ucomm
                         rs_selfield type  slis_selfield.
    
      data p_ref1 type ref to cl_gui_alv_grid.
      call function 'GET_GLOBALS_FROM_SLVC_FULLSCR'
        importing
          e_grid = p_ref1.
      call method p_ref1->check_changed_data.
      case p_ucomm.
        when 'YCNC'.
          leave to screen 0.
        when 'YNTR'.
          perform f_upload_regions.
          leave to screen 0.
        when 'YSEL'.
          perform f_select_deselect_all using c_x.
        when 'YDEL'.
          perform f_select_deselect_all using space.
      endcase.
      rs_selfield-refresh = c_x.             " Grid refresh
    
    endform.                                 " F_user_command1
    
    

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Sep 07, 2007 at 06:02 PM

    Check out this example program.

    report zrich_0001 .
    
    type-pools: slis.
    
    data: begin of ima occurs 0,
          check type c,
          matnr type makt-matnr,
          maktx type makt-maktx,
          end of ima.
    
    data: begin of ima2 occurs 0,
          check type c,
          matnr type makt-matnr,
          maktx type makt-maktx,
          end of ima2.
    
    data: ifldc type slis_t_fieldcat_alv .
    data: xfldc type slis_fieldcat_alv .
    
    select matnr maktx into corresponding fields of table ima
             from makt up to 100 rows.
    
    clear xfldc.
    xfldc-reptext_ddic    = ' '.
    xfldc-fieldname  = 'CHECK'.
    xfldc-tabname   = 'IMA'.
    xfldc-outputlen  = '1'.
    append xfldc to ifldc.
    
    clear xfldc.
    xfldc-reptext_ddic    = 'Material Number'.
    xfldc-fieldname  = 'MATNR'.
    xfldc-tabname   = 'IMA'.
    xfldc-outputlen  = '18'.
    append xfldc to ifldc.
    
    clear xfldc.
    xfldc-reptext_ddic    = 'Material Description'.
    xfldc-fieldname  = 'MAKTX'.
    xfldc-tabname   = 'IMA'.
    xfldc-outputlen  = '40'.
    append xfldc to ifldc.
    
    call function 'REUSE_ALV_POPUP_TO_SELECT'
         exporting
              i_checkbox_fieldname = 'CHECK'
              i_tabname            = 'IMA'
              it_fieldcat          = ifldc
         tables
              t_outtab             = ima
         exceptions
              program_error        = 1
              others               = 2.
    
    check sy-subrc  = 0.
    
    
    * Write selected lines to another itab.
    loop at ima where check = 'X'.
      clear ima2.
      move ima to ima2.
      append ima2.
    endloop.
    
    
    * Write out other itab.
    
    loop at ima2.
      write:/ ima2-matnr, ima2-maktx.
    endloop.
    
    

    Regards,

    RIch Heilman

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.