‎2007 May 11 8:38 PM
Hi Experts,
I hv code like,
Code 1:
SELECT SINGLE MATNR ARKTX INTO (VBAP-MATNR, VBAP-ARKTX) FROM VBAP WHERE VSTEL = P_VSTEL.
So,
I hv to change the selection criteria from Parameters(single value) to Select-options(range)!
Code 2:
SELECT SINGLE MATNR ARKTX INTO (VBAP-MATNR, VBAP-ARKTX) FROM VBAP WHERE VSTEL = S_VSTEL.
As I hv to put the heading as ''The Shipping Point is'' WA_S_VSTEL_NAME
I will sort by VSTEL.
So, pls. clarify that,
1- If I change simply the code from 1 to 2, Does it works? I mean, Is the SAP automatically, pulls the all selected shipping points MATNRS?
2 - Or I need to go for SELECT-OPTIONS table and there by, loading down all values from select options table to my_select_options_table and then writing the code/looping based one the values I moved from select-options table? like,
S_VSTEL( ) = my_select_options_table( ).
(S_VSTEL-LOW
S_VSTEL-HIGH
SIGN etc.)
ThanQ.
Message was edited by:
Sridhar
‎2007 May 11 8:45 PM
Hi,
So, Does SAP pulls all the records?
NO. SELECT SINGLE statement selects the first row in the database that it finds that fulfils the 'WHERE' clause.
If this results in multiple records then only the first one will be returned and therefore may not be unique.
Regards,
Ferry Lianto
‎2007 May 11 8:40 PM
Hi,
Code 2:
SELECT SINGLE MATNR ARKTX INTO (VBAP-MATNR, VBAP-ARKTX) FROM VBAP WHERE VBELN = ITVBAK-VBELN AND POSNR = ITVBFA-POSNV
AND VSTEL = S_VSTEL. " <-- Change here
Please replace AND VSTEL = S_VSTEL with AND VSTEL IN S_VSTEL.
Regards,
Ferry Lianto
‎2007 May 11 8:42 PM
Ooops, sorry, in copying, this mistake happened!
yes, its IN operator.
So, Does SAP pulls all the records?
‎2007 May 11 8:42 PM
Hi sridhar,
You have to change your code to:
SELECT MATNR ARKTX INTO table itab FROM VBAP WHERE VSTEL in S_VSTEL.itab must be declare as follows:
data: begin of itab occurs 0,
matnr type vbap-matnr,
arktx type VBAP-ARKTX,
end of itab.
Regards,
Ravi
‎2007 May 11 8:45 PM
Hi Sridhar,
can you give us a bigger picture,
YOu are selection from VBAP table, which are actually sales order items, there will be many records for vbap for a single shipping point,.
You should pass the Sales Order number and Item nnumber to get unique records for each item.
Regards,
ravi
‎2007 May 11 8:45 PM
Hi,
So, Does SAP pulls all the records?
NO. SELECT SINGLE statement selects the first row in the database that it finds that fulfils the 'WHERE' clause.
If this results in multiple records then only the first one will be returned and therefore may not be unique.
Regards,
Ferry Lianto
‎2007 Aug 07 6:44 AM
i am using select - option statement in dis way : -
SELECT-OPTIONS : PO_DATE FOR AUFK-ERDAT,
PO_TYPE FOR AUFK-AUART,
PO_CO_M FOR RESB-MATNR.
but i want to write po_date as PRODUCTION ORDER DATE , as i know d default value is 8 characters,i want to know the solution problem.plz help me its urgent.