‎2009 Jul 25 12:48 PM
Hi,
I've to design the selection screen as shown below as per the requirement.
parameters : p_lifnr like lfa1-lifnr.
select-options : s_lifnr for lfa1-lifnr.
so could anyone let me know how to handle this situation while writing select query. if possible with sample select query.
thanks
natasha ss.
‎2009 Jul 25 2:22 PM
Hi,
If you are using parameter,you have to give the condition in "where" should be like this,
select matnr makt
from makt
into table it_makt
where matnr = matnr.
See,here you should use the "=,<>,<,>,<+,>=" logic,
If you are using select-options,you have to code in "where" condition like ,
select matnr makt
from makt
into table it_makt
where matnr in matnr.
See,here you can give any condition like =, EQ, <>, NE, <, LT, >, GT, <, LE, >=, GE, <=, LE ,BETWEEN
,LIKE ,IN,....,if you want to know these conditions,plz press 'F1' in "where" keyword,from this you can get all the conditions.
Main difference is ,
Parameter --> it checks only single conitions from single value,
select-options --. it will check the logical conditions from the value range(ie.,between the Low and high value).....
I hope,It will help you...
<=<< Sharing Knowledge is a way to Innovative >=>>
By,
Yoga
‎2009 Jul 25 12:54 PM
Hi,
This requirement seems wierd if you are passing the vendor number in both the parameters as well as select-options.
Incase you still want to use the same in your select query then make use of the select-options only.
Just pass the parameter value to the select-options before the select statement as follows:-
s_lifnr-sign = 'I'.
s_lifnr-OPTION = 'EQ'.
s_LIFNR-LOW = p_lifnr.
append S_LIFNR.
Now S_LIFNR will contain its original values as well as the parameter value.
Regards,
Ankur Parab
‎2009 Jul 25 1:34 PM
Hi,
Check this code.. if p_r1 is selected it behaves like select option..if p_r2 is selected it behaves like parameter.
TABLES lfa1.
SELECT-OPTIONS : s_lifnr FOR lfa1-lifnr no-extension.
PARAMETERS : p_r1 TYPE c RADIOBUTTON GROUP gr1 user-command us1,
p_r2 TYPE c RADIOBUTTON GROUP gr1.
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF p_r2 EQ 'X'.
IF screen-name CS 'S_LIFNR-HIGH'
OR screen-name EQ '%_S_LIFNR_%_APP_%-TO_TEXT'.
screen-output = '0'.
screen-input = '0'.
screen-active = '0'.
modify screen. clear screen.
ENDIF.
ENDIF.
ENDLOOP.
‎2009 Jul 25 2:22 PM
Hi,
If you are using parameter,you have to give the condition in "where" should be like this,
select matnr makt
from makt
into table it_makt
where matnr = matnr.
See,here you should use the "=,<>,<,>,<+,>=" logic,
If you are using select-options,you have to code in "where" condition like ,
select matnr makt
from makt
into table it_makt
where matnr in matnr.
See,here you can give any condition like =, EQ, <>, NE, <, LT, >, GT, <, LE, >=, GE, <=, LE ,BETWEEN
,LIKE ,IN,....,if you want to know these conditions,plz press 'F1' in "where" keyword,from this you can get all the conditions.
Main difference is ,
Parameter --> it checks only single conitions from single value,
select-options --. it will check the logical conditions from the value range(ie.,between the Low and high value).....
I hope,It will help you...
<=<< Sharing Knowledge is a way to Innovative >=>>
By,
Yoga