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

Doubt in module pool

Former Member
0 Likes
614

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.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
585

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

4 REPLIES 4
Read only

Former Member
0 Likes
585

show your code you have in PAI of the screen.

Read only

Former Member
0 Likes
585

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@

Read only

Former Member
0 Likes
585

you have to use chain and endchain in this case, see the example DEMO_DYNPRO_FIELD_CHAIN

Read only

Former Member
0 Likes
586

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