2010 Dec 20 9:26 AM
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
2010 Dec 20 9:30 AM
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.
2010 Dec 20 9:31 AM
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
2010 Dec 20 9:38 AM
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.
2010 Dec 20 10:21 AM
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-filed3to
* program
DATA field1 TYPE struct-field1.
DATA field2 TYPE struct-field2.
DATA field3 TYPE struct-field3.
* dynpro fields
field1
field2
filed3The 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
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |