‎2008 Nov 08 9:47 PM
Hi All,
I am working on module pool program.
In the first screen i have to place 2 fields and i have to do validation. second one is a date field
.I am facing 2 problems here
1)if the first field is wrongly enterd ,in validation it is giving error message, but the second date field is becoming disabled.In F4 of date field I can't find the 'Choose' button.
Can you tell me how to avoid this?
2)if date field is failed in validation, as per my requirement cursor should be in date field only, but it is moving to the first field?how can I keep the cursor in 2n'd field ?
Thanks,
Suresh.
‎2008 Nov 09 4:31 AM
Hi,
Please use CHAIN...ENDCHAIN in your PAI module and call your VALIDATION Module/Subroutine between the Chain ...Endchain statement in the PAI.
Though it is not required but For explicitly setting the Focuus/Cursor...you can use set Cursor Statement.
Its going to be something like this:
PAI
....
Chain.
Field: F1, F2 Module Z_VAL_F1_F2.
Endchain.
Subroutine Include.
Form Z_VAL_F1_F2.
Validate F1.
Set Cursor FIELD F1.
Throw Error Message.
Validate F2
SET CURSOR FIELD F2.
Throw Error Message.
Endform.
Refer:
http://help.sap.com/saphelp_nw04/helpdata/en/9f/dbaa4735c111d1829f0000e829fbfe/content.htm
http://help.sap.com/saphelp_nw04/Helpdata/EN/9f/dbac0b35c111d1829f0000e829fbfe/content.htm
Edited by: AJAY TIWARI on Nov 9, 2008 5:31 AM
‎2008 Nov 08 10:13 PM
‎2008 Nov 09 12:46 AM
Hi,
As you are validating in the select statement if you use select single may erase your issue.
write the select query like the below and test in PAI.
data: l_first type <dataelement of first field>.
select single <first field name> from <tablename> into l_first where <first field name> = <tablename> - <<first field name>
and <date field name> = <tablename> - <date field name>.
Cheers!!
VEnk@
‎2008 Nov 09 2:34 AM
you have to use chain and endchain in this case, see the example DEMO_DYNPRO_FIELD_CHAIN
‎2008 Nov 09 4:31 AM
Hi,
Please use CHAIN...ENDCHAIN in your PAI module and call your VALIDATION Module/Subroutine between the Chain ...Endchain statement in the PAI.
Though it is not required but For explicitly setting the Focuus/Cursor...you can use set Cursor Statement.
Its going to be something like this:
PAI
....
Chain.
Field: F1, F2 Module Z_VAL_F1_F2.
Endchain.
Subroutine Include.
Form Z_VAL_F1_F2.
Validate F1.
Set Cursor FIELD F1.
Throw Error Message.
Validate F2
SET CURSOR FIELD F2.
Throw Error Message.
Endform.
Refer:
http://help.sap.com/saphelp_nw04/helpdata/en/9f/dbaa4735c111d1829f0000e829fbfe/content.htm
http://help.sap.com/saphelp_nw04/Helpdata/EN/9f/dbac0b35c111d1829f0000e829fbfe/content.htm
Edited by: AJAY TIWARI on Nov 9, 2008 5:31 AM