2019 Dec 31 9:31 AM
I have created a select option and a push button, when i click on the push button then according to the value in the select option the output appears, but this is not a convinent option.
Instead of the push button how can i use the enter key from keyboard to activate the usercommand and give the output?
2019 Dec 31 10:38 AM
The ENTER key has no function code, whereas the "Execute" button has the function code 'ONLI'. SO what can be done is, when the user hits the ENTER key, we can programmatically set the function code to 'ONLI'. I shall give you a very small peice of code to illustrate my point
tables sscrfields.
parameters p_vblen like vbak-vbeln obligatory.
at selection-screen.
if sscrfields-ucomm eq space.
sscrfields-ucomm = 'ONLI'.
endif.
start-of-selection.
write p_vblen.
The above code will trigger the report output on hitting the ENTER key at the selection screen.
What you only have to note here is that unlike with screen processing, in selection-screen processing, the function code will be made available in the field UCOMM of the structure SSCRFIELDS. However, you will have to declare this structure in your program ( using the TABLES statement as shown above ).
2019 Dec 31 10:00 AM
I don't understand the question. The ENTER key runs the code in the event block AT SELECTION-SCREEN (PAI) and if there's no error message sent explicitly, it runs the code in the event block AT SELECTION-SCREEN OUTPUT and the selection screen is refreshed.
2019 Dec 31 10:28 AM
Hello,
Not an usual request, but if I have understood what are you trying to accomplish, you should try something like this:
Regards,
Igor
2019 Dec 31 10:31 AM
Hi Sandra,
All I want is to use 'enter' button instead of the push button i created for the select option , in my selection screen
2019 Dec 31 10:38 AM
The ENTER key has no function code, whereas the "Execute" button has the function code 'ONLI'. SO what can be done is, when the user hits the ENTER key, we can programmatically set the function code to 'ONLI'. I shall give you a very small peice of code to illustrate my point
tables sscrfields.
parameters p_vblen like vbak-vbeln obligatory.
at selection-screen.
if sscrfields-ucomm eq space.
sscrfields-ucomm = 'ONLI'.
endif.
start-of-selection.
write p_vblen.
The above code will trigger the report output on hitting the ENTER key at the selection screen.
What you only have to note here is that unlike with screen processing, in selection-screen processing, the function code will be made available in the field UCOMM of the structure SSCRFIELDS. However, you will have to declare this structure in your program ( using the TABLES statement as shown above ).
2019 Dec 31 11:15 AM
So, did I answer your question? (you put your code in the event block AT SELECTION-SCREEN and it's done) Does the code proposed rPatel suits you?
2019 Dec 31 11:16 AM
Thankyou everyone, i just have to write 'space' instead of the constant i used for user command.(in my case i have a button 'go' and i created a constant 'GO' for sscrfields-ucomm)
2019 Dec 31 11:36 AM
tarunp241 I think your comment helped am3en99 a lot, can you convert it into an answer please?