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

screen-required in screen programming

Former Member
0 Likes
1,869

I wrote the following PBO:

LOOP AT SCREEN.

IF screen-name = 'field1'.

screen-required = '1'. "set as mandatory

ENDIF.

MODIFY SCREEN.

ENDLOOP.

Will this automatically return error if it's left empty when it is executed?

Or I have to write the following in PAI:

IF field1 IS INITIAL.

MESSAGE e020.

7 REPLIES 7
Read only

Former Member
0 Likes
843

Hi,

You just need to add it in the PBO. Nothing needs to be added in the PAI.

Read only

Former Member
0 Likes
843

You have to write it in PBO.

LOOP AT SCREEN.

IF screen-name = 'field1'.

screen-required = '1'. "set as mandatory

ENDIF.

MODIFY SCREEN.

ENDLOOP.

IF field1 IS INITIAL.

MESSAGE e020.

ENDIF.

Read only

Former Member
0 Likes
843

I added the LOOP AT SCREEN part on PBO. I haven't really do anything in PAI yet. But when I execute the screen, there's no response. Anything I need to put in PAI in order to test that out? If I need to put that part of


IF field1 IS INITIAL.
  message e021.

I do not see why I need to put that screen-required = 1 at PBO.

Read only

0 Likes
843

Hi,

If you want to check the mandatory-check on some button click, then you have too write in PAI as

CASE sy-ucomm.
 WHEN 'F_BUTTON'.
  IF field1 IS INITIAL.
   message e021.
  ENDIF.
ENDCASE

Thanks,

Sri.

Read only

0 Likes
843

Hi Sri,

In that case, do I still need to write screen-required = '1' at PBO?

Read only

0 Likes
843

>

> Hi Sri,

>

> In that case, do I still need to write screen-required = '1' at PBO?

Hi,

No need to write it in PBO again.

Thanks,

Sri.

Read only

0 Likes
843

Hi, I solved my problem by setting 'required' at screen painter. With this, I do not need to write any codes in PBO nor PAI.