Application Development and Automation 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: 
Read only

display only selected rows

Former Member
0 Likes
2,675

Hi All,

for my 1st selection , i'm finding some output. let it be 5 rows.

now i want to select 2 rows of this output and put them in one more internal table.in the next screen i want to see only those 2 rows not all. How to go about that?

i have given check box in the 1st column.

but still its not working....

PLz help.

Thanks in advance.

14 REPLIES 14
Read only

Former Member
0 Likes
1,563

Hi,

use the method get_selected_rows

this will capture the selected row

regards,

siva chalasani.

Read only

Former Member
0 Likes
1,563

can you send your code plz....

i can suggest one solution...

write your code under the part where you are putting checkbox logic.

Read only

Former Member
0 Likes
1,563

data: cnt(2) ,

mark.

case sy-ucomm.

when 'SELE'.

loop at t_final where mark = 'X'.

move: t_final to b_final.

append b_final.

endloop.

endcase.

clear t_final.

delete adjacent duplicates from b_final.

loop at b_final.

write:/ b_final-idnrk.

endloop.

Read only

Former Member
0 Likes
1,563

Hi,

use append lines of

regards,

siva

Read only

Former Member
0 Likes
1,563

sorry siva, but append lines of is not working.

Read only

0 Likes
1,563

Hi

did you try like this

APPEND LINES OF ITAB1 TO ITAB2.

this will append new lines into the table itab2 from itab1

what the error you are getting

regards,

siva chalasani

Read only

0 Likes
1,563

Hi

sorry my ans was wrong ignore it

this will append new lines other than wat you have

regards,

siva.

Read only

0 Likes
1,563

Hi

can you tell me the output you are getting you are getting null values in the output ?

regards,

siva

Edited by: siva chalasani (vizac) on Dec 31, 2007 12:04 PM

Read only

0 Likes
1,563

my output is like this.

00000140 000000000002100021 F101 00002100020

00000138 000000000002100020 F101 00002100021

00000139 000000000002100021 F101 0002100022

here in the 1st column i have given check box.

now i want to select only 1st and 3rd rows.

how to do?

Read only

0 Likes
1,563

Hi

use the method given below this will update the internal table

with check box field back

call method ref1->check_changed_data.

now use the code you have written

Nothing to do with above menctioned method this will upodate your internal table

Regards,

siva

Read only

Former Member
0 Likes
1,563

Hi deepika,

Use move-corresponding t_final to b_final.

instead of move: t_final to b_final.

Edited by: venkat reddy on Dec 31, 2007 12:02 PM

Read only

0 Likes
1,563

move-corresponding is also not working

Read only

Former Member
0 Likes
1,563

HI deepika,

Try this.

REFRESH gt_final.

  • CASE sy-ucomm.

  • WHEN 'PRIN'.

  • gv_chk = space. --> Check Box variable

  • DO gv_lines TIMES.

  • READ LINE sy-index FIELD VALUE gv_chk.

  • IF gv_chk = 'X'.

  • gt_final-kunnr = gwa_final-kunnr.

  • gt_final-knuma_ag = gwa_final-knuma_ag.

  • gt_final-oldcost = gwa_final-oldcost.

  • gt_final-change = gwa_final-change.

  • gt_final-matnr = gwa_final-matnr.

  • gt_final-mfrnr = gwa_final-mfrnr.

  • gt_final-maktx = gwa_final-maktx.

  • gt_final-ean11 = gwa_final-ean11.

  • gt_final-ppdate = gwa_final-ppdate.

*

  • APPEND gt_final.

  • CLEAR gt_final.

  • ENDIF.

  • ENDDO.

  • ENDCASE.

This is a part of my code.

Awrd Points if useful

Bhupal

Read only

Former Member
0 Likes
1,563

try this sample code...

TABLES : makt.

DATA : itab LIKE makt OCCURS 0 WITH HEADER LINE.

DATA : itab2 LIKE makt OCCURS 0 WITH HEADER LINE.

DATA : pick.

AT LINE-SELECTION.

DO. "lines times.

READ LINE sy-index.

IF pick EQ 'X'.

itab2-matnr = itab-matnr.

itab2-maktx = itab-maktx.

APPEND itab2.

MOVE space TO pick.

MODIFY CURRENT LINE FIELD VALUE pick.

ENDIF.

IF sy-subrc NE 0.

EXIT.

ENDIF.

ENDDO.

START-OF-SELECTION.

SELECT * INTO CORRESPONDING FIELDS OF TABLE itab FROM marc UP TO 10 ROWS.

LOOP AT itab .

WRITE 😕 pick AS CHECKBOX, itab-matnr, itab-maktx.

"make sure you've used hide statment in basic list.

HIDE : itab-matnr, itab-maktx.

ENDLOOP.