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

select-options

Former Member
0 Likes
668

Hi,

I want to move values from select option to an internal table.

eg. select-option : mat for mara-matnr.

if user gives value for matnr as 50000 to 50003.

now the value 50001, 50002, 50003 should be moved to an internal table which has the above values as individual record.

Regards,

Phyrose.

7 REPLIES 7
Read only

Former Member
0 Likes
642

Hi

select-options: s_matnr for mara-matnr.

loop at s_matnr.

itab-matnr = s_matnr-low.

append itab.

clear itab.

endloop.

or try as

ITAB[] = s_matnr[].

regards

Anji

Read only

JozsefSzikszai
Active Contributor
0 Likes
642

hi Camila,

you have to do:

SELECT matnr

INTO TABLE gt_mara

FROM mara

WHERE matnr IN s_matnr.

gt_mara is internal table with one field (matnr). Of course you have to modify, if you want to put into table which has more fields.

hope this helps

ec

Read only

former_member194669
Active Contributor
0 Likes
642

Hi,

May be this way.


start-of-selection.
select matnr from mara into table itab where matnr in s_matnr.

after this itab contains the values of 50000, 50001 50002 50003.

a®

Read only

varma_narayana
Active Contributor
0 Likes
642

hI..

tables MARA.

select-option : mat for mara-matnr.

DATA: BEGIN OF ITAB OCCURS 0,

MATNR TYPE MARA-MATNR,

END OF ITAB.

START-OF-SELECTION.

LOOP AT MAT.

MOVE MAT-LOW TO ITAB-MANTR.

APPEND ITAB.

ENDLOOP.

<b>reward if Helpful.</b>

Read only

Former Member
0 Likes
642

Hi

Try this

l_var = mat-low.

do

if l_var lt mat-high.

itab-matnr = l_var.

l_var = l_var + 1.

else.

exit.

endif.

Read only

Former Member
0 Likes
642

Hi,

You can use the below code :

tables : bsis.

data : count type i.

data : begin of itab occurs 0,

buzei like bsis-buzei,

end of itab.

select-OPTIONS : num for bsis-buzei.

start-of-SELECTION.

count = 1.

do num-high times.

if count = 1.

count = num-low.

  • write : / count.

itab-buzei = count.

count = count + 1.

append itab.

clear itab.

else.

  • write : / count.

itab-buzei = count.

count = count + 1.

append itab.

clear itab.

endif.

if count GT num-high.

exit.

ENDIF.

enddo.

if num-high is initial.

  • write : / num-low.

ITAB-BUZEI = NUM-LOW.

APPEND ITAB.

CLEAR ITAB.

endif.

loop at itab.

write : / itab-buzei.

ENDLOOP.

Thanks,

Sriram Ponna.

Message was edited by:

Sriram Ponna

Read only

Former Member
0 Likes
642

Hi,

The best way is doing with out complex logic.

**

select matnr from mara into table it_mara where matnr in s_matnr.

The internal table it_mara now filled with required materials.

regards,

Kishore