Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

select-option value processing

Former Member
0 Likes
1,086

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

10 REPLIES 10
Read only

Former Member
0 Likes
1,053

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

Read only

0 Likes
1,053

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

Read only

0 Likes
1,053

Did you get a chance to debug...May be that can help you more.

If no luck, paste the code.

Manas M.

Read only

0 Likes
1,053

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

Read only

0 Likes
1,053

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

Read only

0 Likes
1,053

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.

Read only

0 Likes
1,053

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

Read only

0 Likes
1,053

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.

Read only

0 Likes
1,053

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

Read only

0 Likes
1,053

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 ...