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

sy-ucomm checking in if condition

Former Member
0 Likes
3,493

hi i want to check for

if sy-ucomm not equal to any of these then i want to prompt up error msg { 'SAVE' or 'BACK' or 'ME' or 'DT' or 'EXIT' or 'CHANGE' or 'SELECT' or 'DESELECT' or 'DEL' or 'FIRST' or 'LAST' or 'NEXT' or 'PREV' or 'NEW1' or 'POSI' or 'SORT_ASC' or 'SORT_DSC' or 'NEXT_LINE' or 'PREV_LINE' or 'FIRST_PAGE' or 'LAST_PAGE' } .

please give me code how to write if conditon as i use if sy-ucomm <> save or back or ...so on its not working give me code how to check fo this

regards

Arora

1 ACCEPTED SOLUTION
Read only

Former Member
2,372

Hi,

Double click on the GUI status and then go to the menu painter..

in the function key section...

there will be input field for enter button..the first input button..with a green tick mark

There you can give the function code for enter..

Thanks

Naren

hi i want to check for

if sy-ucomm not equal to any of these then i want to prompt up error msg { 'SAVE' or 'BACK' or 'ME' or 'DT' or 'EXIT' or 'CHANGE' or 'SELECT' or 'DESELECT' or 'DEL' or 'FIRST' or 'LAST' or 'NEXT' or 'PREV' or 'NEW1' or 'POSI' or 'SORT_ASC' or 'SORT_DSC' or 'NEXT_LINE' or 'PREV_LINE' or 'FIRST_PAGE' or 'LAST_PAGE' } .

please give me code how to write if conditon as i use if sy-ucomm <> save or back or ...so on its not working give me code how to check fo this

regards

Arora

8 REPLIES 8
Read only

Former Member
0 Likes
2,372

Hi,

Use AND instead of OR

If sy-ucomm <> 'SAVE' AND

sy-ucomm <> 'BACK' AND

sy-ucomm <> 'ME' AND

sy-ucomm <> 'DT' AND

sy-ucomm <> 'EXIT' AND

sy-ucomm <> 'CHANGE' AND

sy-ucomm <> 'SELECT' AND

sy-ucomm <> 'DESELECT' AND

sy-ucomm <> 'DEL' AND

sy-ucomm <> 'FIRST' AND

sy-ucomm <> 'LAST' AND

sy-ucomm <> 'NEXT' AND

sy-ucomm <> 'PREV' AND

sy-ucomm <> 'NEW1' AND

sy-ucomm <> 'POSI' AND

sy-ucomm <> 'SORT_ASC' AND

sy-ucomm <> 'SORT_DSC' AND

sy-ucomm <> 'NEXT_LINE' AND

sy-ucomm <> 'PREV_LINE' AND

sy-ucomm <> 'FIRST_PAGE' AND

sy-ucomm <> 'LAST_PAGE'.

MESSAGE E208(00) WITH 'Invalid ucomm'.

endif.

Thanks

Naren

Read only

0 Likes
2,372

hi all what my purpose in doing so it that i want to avoid use pressing enter and only save or buttons

so is there any specific code for enter which i can check if that is checked i give error msg instead of all these

regards

|Nishant

Read only

0 Likes
2,372

Just look at GUI Status ,if you do not see any function code for enter then it will take space as enter button function code

IF SY-UCOMM EQ SPACE OR SY-UCOMM EQ 'ENTR'.

ERROR MESSAGE.

ENDIF.

For testing purpose ,use /H in Command bar ,now press enter.

in debug see the enter button value for sy-ucomm.

based on this you can write the code

Thanks

Seshu

Read only

0 Likes
2,372

hi all

thanks for all tips let me check on it i will reward points once i get it solved suppose nt it should be

one more problem i have if u can suggest

hi

i am using a funtion module as below but<b> i dont want the 'convert to upper case</b> part in this funtion module as its pop up is also displaying a check box which says convert to upper case lettters i dont want this check box to be shown can any one sugges how to hide this or

suggest some other similar funtion module .

the pupost it to search for value in internal table....

CALL FUNCTION 'POPUP_TO_SEARCH_VALUE'

EXPORTING

TEXTLINE1 = text-f02 ( customer if gave) ie to search for cutomer number in

TITEL = text-f01 ( antoehr text title )

VALUELENGTH = 30

IMPORTING

ACTION = w_action

VALUE = w_value value of cutomer number inputed by user

EXCEPTIONS

TITEL_TOO_LONG = 1

OTHERS = 2.

i need only this above jsut to serch but the funtion module also give check box saying convert to upper case and i dont need it pls suggest...

regards

nishant

Read only

Former Member
0 Likes
2,372

Hi Arora,

As you want to check so many conditions better create a range for all this and check

create a range of type sy-ucomm.

IF sy-ucomm NOT IN range_ucomm.

..Error.

ENDIF.

regards,

Atish

Read only

Former Member
0 Likes
2,372

Yes You can write simple code :

if sy-ucomm ne 'SAVE' or sy-ucomm ne 'BACK' or sy-ucomm = ''.

raise error message.

endif.

Value should be within single quotation and should be upper case.

you can write if condition for all function code

Thanks

Seshu

Read only

Former Member
2,373

Hi,

Double click on the GUI status and then go to the menu painter..

in the function key section...

there will be input field for enter button..the first input button..with a green tick mark

There you can give the function code for enter..

Thanks

Naren

Read only

0 Likes
2,372

Thank you!