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: 

Move selected records to internal table

Former Member
0 Kudos

Hai all,

I have displayed 5 rows of item details in output screen with check boxes.

if i select one check box means then the selected row should be stored in one internal table.

How can i achieve this?

Regards

8 REPLIES 8

Former Member
0 Kudos

hi

lopp on the internal table that is bein displayed on the screen chk the value of the field that is displayed as check box it where ever the value is abap_true move that record into new table.

like

loop at it_display into wa_display where chkbox = ABAP_TRUE.

move-corresponding wa_display to wa_inttable.

append wa_inttable into it_inttable.

endloop.

Former Member
0 Kudos

Try using

GET CURSOR {LINE line

Hope this helps!!

Regards,

Prashant

I355602
Advisor
Advisor
0 Kudos

Hi,

What kind of report are you using?

Is it classical report or an ALV report or in Module Pool.

Regards,

Tarun

Former Member
0 Kudos

Hi ,

You can use where condition with checkbox

like

loop at itab_display into wa_display where chkbox = ABAP_TRUE.

Regards

Former Member
0 Kudos

Hi,

do.
read line sy-index field value w_check into w_check
                                          w_name into w_name  -----> " get all the fields into the variables.
if sy-subrc NE 0.
exit.
endif.
if w_check = 'X'.
append w_name to itab.
endif.
clear w_check.
enddo.

this will resolve your purpose.

thanks

sarves

faisal_altaf2
Active Contributor
0 Kudos

HI, Kumar,

If you are using DynPro and displaying data in a table control than follow the steps bellow

--> First of all have a Flag Field in the Internal table to set Flag

--> Double Click the Table Control

--> A window will appear on the right side where you will find the Attributes

--> From Attributes Check the "w/selcolumn' check box and give the Internal Table field where you want to Set the Flag that this Record is selected or not.

than in PAI you can Check this flag and delete this record.

Hope will solve out your problem, if using Screen Painter. in Dyn Pro.

Kind Regards,

Faisal

Former Member
0 Kudos

Hi ,

You can try this code . It works -


AT USER-COMMAND .
.
.
.
 DO w_no TIMES .
    READ  LINE sy-index FIELD VALUE w_checkbox
               fs_spfli-carrid "into fs_spfli-carrid
               fs_spfli-connid. "into fs_spfli-connid

    IF w_checkbox EQ 'X'.
      fs_store-carrid = fs_spfli-carrid .
      fs_store-connid = fs_spfli-connid .
      APPEND fs_store TO t_store .
    ENDIF.                             " IF W_CHECKBOX EQ 'X'.
    FREE fs_spfli .
    CLEAR w_checkbox .
  ENDDO .                              " DO W_NO TIMES

Regards

Pinaki

Former Member
0 Kudos

TYPES: BEGIN OF t_report,

sel,

vbeln TYPE vbak-vbeln, "ORDER NUMBER

erdat TYPE vbak-erdat, "ORDER WHEN RECORDED

kunnr TYPE vbak-kunnr, "SOLD TO WHICH PARTY

posnr TYPE vbap-posnr, "ITEM NUMBER

matnr TYPE vbap-matnr, "MATERIAL NUMBER

kwmeng TYPE vbap-kwmeng, "NO. OF QUANTITY

netwr TYPE vbap-netwr,

END OF t_report,

WHEN 'BUTON'.

clear wa_report.

loop at it_report into wa_report .

if wa_report-sel = 'X'.

append wa_report to itdet.

endif.

ENDLOOP.

sel field is not getting stored in internal table when i check the checkbox