‎2010 Jan 25 7:26 AM
Hello experts,
I have a selection screen with multiple select-options to get values from user, and based on that I am displaying fetched data(by select query) in the ALV grid.
The issue is with the selection screen, it is getting displayed correctly with multiple select-options, but query works correcly when I press 'enter' from keyboard after entering value in select-option box. If I doesnt press enter button before executing, the query fetches all the records from db table instead of selected values.(where cond in select query)
Any helpful suggestion/idea/info that why is it happening so?
Advance thanks...
Regards,
Viral Patel
‎2010 Jan 25 7:30 AM
Hi,
please catch execute button through its function code in user-command perform and then it should work for given conditions as well.
Rgds/Abhi
‎2010 Jan 25 7:38 AM
Thanks Abhi for quick response.
Well I am doing the same thing as You suggested, it is performing it on 'CRET'(Execute button). Still its displaying all the records.
Regards,
Viral Patel
‎2010 Jan 25 7:46 AM
Did you get a chance to debug...May be that can help you more.
If no luck, paste the code.
Manas M.
‎2010 Jan 25 7:51 AM
Hello Viral,
In the above case i would suggest to use PBO even
AT SELECTION-SCREEN OUTPUT.
Put a breakpoint and
and check the ranges of your select option ( Actual values...you are getting )
The function Code or the button would not help you much this will help you even if you have a enter butoon hit or a explisit execute button on you screen
‎2010 Jan 25 8:22 AM
hi,
code im using...
FORM sel_xpra.
CLEAR xpra_read.
SELECT *
FROM zxpra_ovrview
INTO CORRESPONDING FIELDS OF TABLE xpra_read
WHERE ( ( NAME IN xpra )
AND ( BASE_RELEASE IN xpra_rel )
AND ( COMPONENT IN xpra_cmp )
AND ( PERSON_RESPONSIB IN xpra_res ) ).
ENDFORM.
Is this correct way to process multiple select-options values.
Regards,
Viral Patel
‎2010 Jan 25 8:26 AM
Remove the braces
Code snippet for you:-
SELECT werks lgort iblnr gjahr zldat sobkz bldat gidat budat
FROM ikpf
INTO CORRESPONDING FIELDS OF TABLE it_ikpf
WHERE werks IN s_werks AND
lgort IN s_lgort AND
iblnr IN s_iblnr AND
gjahr IN s_gjahr AND
zldat IN s_zldat .
DESCRIBE TABLE it_ikpf LINES res.
IF res = 0.
WRITE:/ 'No records matching the selection criteria'.
EXIT.
ENDIF.
‎2010 Jan 25 8:37 AM
hello,
The query still doesnt work.
actually i want to use it with OR option in query, still it selects all the records.
Regards,
Viral
‎2010 Jan 25 8:48 AM
1) Please debug the select query applying OR as per your requirement.
2) Provide the same inputs in the table in SE11 and see how many records it fetches.
‎2010 Jan 25 8:54 AM
hi Manas,
I did the same thing, but it stil didnt fetch the required result. If I oress 'Enter' key after entering value in select-option then It worls fine.
Do I need to use LOW or HIGH value in query?
Regards,
Viral Patel
‎2010 Jan 25 9:13 AM
No you need not use the high low in your code just check the table if the sign and all getting populated properly in debugging mode...thats it you do what ever in the query it should not matter ...