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

Regarding passing selection screen values into internal table

Former Member
0 Likes
1,531

Hi,

I have created one selection screen with fields

<b>POSNR LIKE VBAP-POSNR</b>

<b>SELECT-OPTIONS: s_posnr FOR vbap-posnr.</b>

I had created one internal table as:

<b>DATA: BEGIN OF i_item OCCURS 0,

posnr LIKE vbap-posnr,

END OF i_item.</b>

Now what i want is to pass what ever entries available in <b>s_posnr into i_item</b> internal table.

If user gives 10 in select-screen i_item should have 10,

If user gives 10 to 30 in select-screen i_item should have 10,20,30 entries.

If user gives nothing in s_posnr of selection screen

then i_item should have all the valid item no's[POSNR's]

from respective sales order.

Can anybody tell me how can i solve this issue!

Thanks in advance.

Thanks & Regards,

Prasad.

7 REPLIES 7
Read only

Former Member
0 Likes
890

Hi Prasad,

I guess somewhere on your selection screen there is also a parameter for sales order (eg. pa_vbeln)?

Then:

SELECT posnr

FROM vbap

INTO TABLE i_item

WHERE vbeln EQ pa_vbeln

AND posnr IN s_posnr.

Will get all position numbers in your internal table.

Regards,

John.

Read only

Former Member
0 Likes
890

Hi

select posnr

from vbap

into table i_item

where posnr in S_posnr.

Regards

navneeth

Read only

0 Likes
890

hi,

select posnr

from vbap

into table itab

where posnr in S_POSNR.

Reward Points if it helps

regards

Gunjan

Read only

0 Likes
890

select posnr from vbap

into table i_item

where posnr in S_posnr.

Read only

Former Member
0 Likes
890

Prasad,

You cannot directly get as you don't know the interval of the orders.

So, best thing is to get the values from the VBAK / VBAP table.

SELECT * from VBAP into ITAB where posnr = s_posnr.

Regards,

Ravi

Note : Please mark the helpful answers

Read only

former_member186741
Active Contributor
0 Likes
890

select vbap~posnr from vbap

into table i_item

where vbap where vbeln = p_vbeln

and vbap~posnr in s_posnr.

Read only

venkat_o
Active Contributor
0 Likes
890

Hi Prasad,

<b>1</b>.

Write SELECT query like this.

SELECT POSNR

FROM VBAP

into table i_item

where posnr in s_posnr.

<b>2</b>.

Moreover u should also pass VBELN in WHERE condition.

<b>Thanks,

Venkat.O</b>

Thanks,

Venkat.O