‎2006 Jun 21 7:36 AM
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.
‎2006 Jun 21 7:39 AM
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.
‎2006 Jun 21 7:39 AM
Hi
select posnr
from vbap
into table i_item
where posnr in S_posnr.
Regards
navneeth
‎2006 Jun 21 7:41 AM
hi,
select posnr
from vbap
into table itab
where posnr in S_POSNR.
Reward Points if it helps
regards
Gunjan
‎2006 Jun 21 7:42 AM
select posnr from vbap
into table i_item
where posnr in S_posnr.
‎2006 Jun 21 7:41 AM
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
‎2006 Jun 21 7:43 AM
select vbap~posnr from vbap
into table i_item
where vbap where vbeln = p_vbeln
and vbap~posnr in s_posnr.
‎2006 Jun 21 7:52 AM
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