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

required fields in dynpro

Former Member
0 Likes
2,044

Hi

I have a dynpro with 3 fields required; each field is a code and near it I put corresponding description. I created 3 module for the field on chain-request and in this I chedck code is legal and set the description.

The problem I have is that when I enter one code and press enter key, the module is triggered and description is set, but system alert me for the other (the second field) is empty, when I set second UI Ihave the same error on third.

How is it possible to avoid this behaviour so that alert for missing required field is shown only when trying to leave dynpro ?

regards

Gabriele

Hi

I have a dynpro with 3 fields required; each field is a code and near it I put corresponding description. I created 3 module for the field on chain-request and in this I chedck code is legal and set the description.

The problem I have is that when I enter one code and press enter key, the module is triggered and description is set, but system alert me for the other (the second field) is empty, when I set second UI Ihave the same error on third.

How is it possible to avoid this behaviour so that alert for missing required field is shown only when trying to leave dynpro ?

regards

Gabriele

4 REPLIES 4
Read only

former_member242255
Active Contributor
0 Likes
1,269

You may have to write the validations at times when you click BACK or some button on the screen.

You have to remove the CHAIN ENDCHAIN validations for these fields.

Read only

Former Member
0 Likes
1,269

Hi,

Don't use chain statment. follow the below code.

FIELD fld_name1 MODULE mod1.

FIELD fld_name2 MODULE mod2.

FIELD fld_name3 MODULE mod3.

and write code in module to pick up description. you can use ON-REQUEST or ON-INPUT option in statment FIELD

Edited by: Syed Maheboob on Dec 20, 2010 10:31 AM

Read only

Former Member
0 Likes
1,269

To make fields mandatory,

LOOP AT SCREEN
  IF SCREEN-NAME = 'MY1'
  OR SCREEN-NAME = 'MY2'
  OR SCREEN-NAME = 'MY3'
  SCREEN-REQUIRED = 'X'.   "SCREEN-REQUIRED = 'X'
  ENDIF.
  MODIFY SCREEN.
ENDLOOP.

Read only

Former Member
0 Likes
1,269

I solved:

the problem was that I was using as reference in program the fields of a structure.

In this way, I don't know why, the dynpro automatically alert me in case of required field left empty. If instead I use separated variales in program as reference of dynpro field, when I hit enter key on a field, there is no alert for others field.

I passed from

* program
DATA wa TYPE struct.

* dynpro fields
wa-field1
wa-field2
wa-filed3

to

* program
DATA field1 TYPE struct-field1.
DATA field2 TYPE struct-field2.
DATA field3 TYPE struct-field3.

* dynpro fields
field1
field2
filed3

The problem in this way is that I have to check manually that required fileds are filled before leaving page, but is really better that see alert continuosly.

Hope this help

Thank you for trying answer me

Regards

Gabriele