2013 Dec 05 3:21 PM
hi forum ,how can we validate the fields in the output screen whether the values can be accepted or not and if any invalid name is entered it should show error message that it is invalid in selection screen.
2013 Dec 06 3:57 AM
Hi
You can do validation in the PAI for the fields
For multiple fields validation you can use CHAIN..ENDCHAIN
Include the fields in a FIELD statement, and enclose it in a CHAIN-ENDCHAIN block statment. Eg. Screen flow logic: CHAIN. FIELD: SPFLI-CARRID, SPFLI-CONNID. MODULE CHECK_FLIGHT. ENDCHAIN. When an error is found inside a chain, the screen is re-displayed, and all fields found anywhere in the chain are input-enabled. All non-chain fields remain disabled.
2013 Dec 05 3:56 PM
Hi
I'm not sure to understand your problem, anyway try to check the help for statament FIELD in PAI:
PROCESS PAI.
FIELD <field> MODULE <module>.
In rhe module you can write all validations you need
Max
2013 Dec 05 5:22 PM
Hi,
Check the Demo report for module pool screen checks.
DEMO_DYNPRO_AUTOMATIC_CHECKS
DEMO_DYNPRO_AT_EXIT_COMMAND
Thanks,
Kiran
2013 Dec 05 5:23 PM
Hi ,
Consider you have created a DP screen 100.
To validate the screen fields, after the user input.
You have to code your logic in
PROCESS AFTER INPUT.
FIELD mara-matnr MODULE matnr ON INPUT.
*&---------------------------------------------------------------------*
*& Module MATNR INPUT
*&---------------------------------------------------------------------*
MODULE matnr INPUT.
" Your validation Logic
ENDMODULE. " MATNR INPUT
To validate group of fields, use Chain - End Chain
" validate start date is greater than end date.
CHAIN.
FIELD proj-plfaz.
FIELD proj-plsez MODULE compare_dates ON CHAIN-INPUT.
ENDCHAIN.
*&---------------------------------------------------------------------*
*& Module COMPARE_DATES INPUT
*&---------------------------------------------------------------------*
MODULE compare_dates INPUT.
" Your validation Logic
ENDMODULE. " COMPARE_DATES INPUT
Regards,
Vel
2013 Dec 05 6:26 PM
Hi Sk
Suppose you have two field in your program
Field1 .
field2 .
in the PAI.
if you want to use the same fresh value for both the field then use the both field in the chain & end chain.
field1 module. " in this module you didn't get the value of the field2 means if you specify any module for that particular field in the module pool you didn't get the value in all module which are called before the field2.
field2 module1
So be carefull while working.
Regards.
Nishant Bansal
2013 Dec 06 3:57 AM
Hi
You can do validation in the PAI for the fields
For multiple fields validation you can use CHAIN..ENDCHAIN
Include the fields in a FIELD statement, and enclose it in a CHAIN-ENDCHAIN block statment. Eg. Screen flow logic: CHAIN. FIELD: SPFLI-CARRID, SPFLI-CONNID. MODULE CHECK_FLIGHT. ENDCHAIN. When an error is found inside a chain, the screen is re-displayed, and all fields found anywhere in the chain are input-enabled. All non-chain fields remain disabled.
2013 Dec 06 3:59 AM
Hi,
Try Like this
PROCESS AFTER INPUT.
FIELD <field_name> MODULE <module_name>.
Inside the module.
*&---------------------------------------------------------------------*
*& Module YOUR MODULE NAME
*&---------------------------------------------------------------------*
*
*----------------------------------------------------------------------*
MODULE convert_to_upper_case INPUT.
"Your logic to validate the screen goes here
ENDMODULE.
Regards,
Riju Thomas.