Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

REUSE_ALV_POPUP_TO_SELECT

Former Member
0 Kudos

i ask again:

i get a list of itab.

i get 'X' of the row i want, now how i can apeend the new rows into new itab.

2. how i can add a buttton of all the rows,and none like in sm30

1 ACCEPTED SOLUTION

Former Member
0 Kudos

i use this FM i get

check matnr maktx

11 eee

22 eee

i put X into check, what event could catch the line and insert into itab

2 REPLIES 2

Former Member
0 Kudos

i use this FM i get

check matnr maktx

11 eee

22 eee

i put X into check, what event could catch the line and insert into itab

0 Kudos

Please check this sample 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 anther 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