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

Pushbutton obligatory

Former Member
0 Likes
1,197

HI

We have a pushbutton in selection screen. We need to make that an mandatory field.

Please help.

Thanks in advance.

SS

1 ACCEPTED SOLUTION
Read only

premal_mistry2
Active Participant
0 Likes
1,018

Hi,

Use OBLIGATORY key word at the end of required selection-option.

10 REPLIES 10
Read only

premal_mistry2
Active Participant
0 Likes
1,019

Hi,

Use OBLIGATORY key word at the end of required selection-option.

Read only

sridhar_meesala
Active Contributor
0 Likes
1,018

Push Button >> Mandatory Field ???

Read only

Former Member
0 Likes
1,018

Hi Swarna,

Well you cannot use it as Obligatory in the selection screen similar to the fields. You can do is put a validation in the selection screen output like:

IF sy-ucomm <> 'ABC'. "something similar to this logic

error message.

endif.

Regards,

FS

Read only

Former Member
0 Likes
1,018

Hi,

give more information.

Push button Mandatory?

regards,

Rama reddy

Read only

Former Member
0 Likes
1,018

Yes, i need to make the pushbutton mandatory.

I have already used a function code to process some logic. So i cant use as per my requirement. This button needs to be pressed some how.

Read only

0 Likes
1,018

Dear Swarna,

You can do this by using the following logic,

if sy-ucomm eq 'PUS'.
"ur logic
else.
"error message to click on push
endif.

Regards

Sajid

Read only

0 Likes
1,018

Hi,

If that's your requirement, what you could do is, Check if your SY-UCOMM value is the function code of the button that you pressed and not any other event. Also, adding to this functionality, if you want to press only button2 and not any other after an event like clicking button1, then you can store the SY-UCOMM value of the button1 in OK_CODE and then check if the OK_CODE is 'but1' and SY-UCOMM eq 'but2' and proceed accordingly.

Display an information message asking the user to click on the button before proceeding.


if sy-ucomm ne 'but1'
 "display error message
else.
 "Go ahead with your logic
endif.

Read only

Former Member
0 Likes
1,018

Hi sundararaman,

write this code in AT seelction screen.

IF sy-ucomm NE 'PUSH'.

MESSAGE 'Push button is mandatory' TYPE 'E'.

endif.

Thanks,

Ajay

Read only

Former Member
0 Likes
1,018

Is it possible to create an icon on the pushbutton if cant make it mandatory?

Read only

0 Likes
1,018