‎2006 Oct 24 11:22 AM
Hi all,
1)parameters p_mara like mara-matnr.
2)select-option p_mara for mara-matnr no-extention no interval.
Is there any difference between this two declaration though look & feel is same?
‎2006 Oct 24 11:23 AM
Yes, there is a minor difference...
Since the second is a select-option you would be able to use IN operation and the blanks would be interpreted as all...while it is not the case in Parameters.
Message was edited by: Anurag Bankley
‎2006 Oct 24 11:24 AM
Hi samiran,
Though the look and feel is the same,
you can still manipulate the select-option in the code like this:
s_matnr-low = <Some value>.
s_matnr-high = <Some value>.
s_matnr-sign = 'I'.
s_matnr-option = 'BT'.
append s_matnr.
clear s_matnr.
REgards,
ravi
‎2006 Oct 24 11:25 AM
There is a lot of difference.
parameters statement gives you only a variable of the assigned type.
But select options though you supress the extention and multiple entries, it is a table.
In your program you can mainipulate
eg : you want to set an end date as constantly end of month, you give only the start date in the selection screen and fill the second field(end date) in your program.
regards,
Sandeep Josyula
*Reward helpful answers
‎2006 Oct 24 11:25 AM
Hi,
select-options p_mara for mara-matnr no-extension no intervals.
In this,it is possible to choose >,<,=,<>,<=,>= by double clicking.But only = is possible in parameters.
Including and excluding is allowed.
But only including is possible in parameters.
‎2006 Oct 24 11:27 AM
Hi,
Yes,
If you don't pass any value for 1), SELECT statement fails.
If you don't pass any value for 2), SELECT statement takes global range.
Eg:
1)parameters p_MATNR like mara-matnr.
2)select-option S_MATNR for mara-matnr no-extention no interval.
SELECT * INTO TABLE IT_MARA
FROM MARA
WHERE MATNR = P_MATNR.
If you don't enter any value, it don't fetches any records. YOu have to use EQ inthe WHERE clause.
SELECT * INTO TABLE IT_MARA
FROM MARA
WHERE MATNR IN S_MATNR.
If you don't enter any value, it fetches all records. YOu have to use IN inthe WHERE clause.
Thanks,
Ramakrishna
‎2006 Oct 24 2:09 PM
Hi
Read SAP Application help or online help from http://help.sap.com for both the keywords Selectio-option and parameters you will get detailed differences among them.
Let me kno if it helps.
Regards
- Atul
‎2006 Oct 24 9:00 PM
Hi,
1)Select-options will form an internal table with header line and it has different fields like SIGN, OPTION, LOW , HIGH.
1) Parameter will not form any internal table.
2) Selec-option can store more than one value.
2) Parameter will store only one value.
Try to debug the below code you will learn more.
REPORT ZSREE_TEMP.
TABLES: MARA.
PARAMETERS: P_MATNR LIKE MARA-MATNR.
SELECT-OPTIONS: S_MATNR FOR MARA-MATNR NO-EXTENSION NO INTERVALS.
INITIALIZATION.
P_MATNR = 'P123'.
START-OF-SELECTION.
S_MATNR-SIGN = 'I'.
S_MATNR-OPTION = 'EQ'.
S_MATNR-LOW = 'S23456'.
APPEND S_MATNR.
CLEAR S_MATNR.
S_MATNR-SIGN = 'I'.
S_MATNR-OPTION = 'EQ'.
S_MATNR-LOW = 'abcdef'.
APPEND S_MATNR.
END-OF-SELECTION.
WRITE:/ 'PARAMETER VALUE:', P_MATNR.
WRITE:/ 'SELECT-OPTION VALUES:'.
LOOP AT S_MATNR.
WRITE: S_MATNR-LOW.
ENDLOOP.
Thanks,
Sreekanth
‎2006 Nov 17 10:34 AM
yes there is a difference between these two.
1.parameters p_mara like mara-matnr.
when u give like this and write a query like this:
select matnr ersda into table itab where matnr eq p_matnr.
only those records that match your selection criteria would be displayed.
If no values are given in the parameter field nothing gets displayed.
2.select-option p_mara for mara-matnr no-extention no interval.
when u give like this and write a query like this:
select matnr ersda into table itab where matnr in p_matnr.
when you give a value in the select-option ,those records that match the condition would be displayed.
WHEN NO VALUES ARE GIVEN FOR SELECT-OPTIONS and if u execute all the records would be displayed.THIS IS THE DIFFERENCE BETWEEN THE TWO that you were asking for.
Do reward points after trying out.
‎2006 Nov 18 6:57 AM
hi
yep it has difference when we are referring the values in the SELECT clause.
For parameters we will use EQ and for Select options we will use IN Operator.
Cheers,
Abdul Hakim