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

Issue using Chain End Chain Statement in Module Pool Programming

ayaz1
Explorer
0 Likes
4,560

Dear Experts,

I need to do field validation so that user can re-enter values if wrong values are passed in zfield let say zdate.

Issue is when using chain endchain statement for validation, ZDATE field contains no data in debugger and it shows 00000000 in the field.

Attached are the screen shots of code containing PAI Code, the MODULE FIELD and MODULE USER_COMI01.

Please suggest.

Thanks

AN

1 ACCEPTED SOLUTION
Read only

former_member185116
Active Participant
0 Likes
3,288

hi,

since your using only one field in between chain and endchain

in your MODULE_FIELD INPUT

write clear :itab-badli_date above Message 'NO BADLI can be done ' type 'E'.

this will clears the date field and it will not be set to zeros as you said.

this will solve your problem...

i have checked it,

any problem get back to me,

regards,

vinay..

8 REPLIES 8
Read only

RaymondGiuseppi
Active Contributor
0 Likes
3,288

IMHO CHAIN/ENDCHAIN with a single FIELD has no interest?

Use CHAIN/ENDCHAIN with at least two fielss, so a MODULE statement, and not the MODULE option of a single FIELD statement,  can be executed with values of all the mentionned fields available.


  chain.

    field field1 module check_field1 on request. " with field1 available

    field field2.

    field field3.

    module check_chain on chain-request.  " with field1, 2, 3 available

  endchain.

Hint: Also put a MODELE AT EXIT-COMMAND before the CHAIN and FIELD statements, so to be able to leave screen before some check raise an error, and the MODULE for user command after those, to not allow work with wrong data.

Regards,

Raymond

Read only

Former Member
0 Likes
3,288

Hi

Raymond is right

and also you need to consider the values from screen to variable will be transfered after command FIELD, that means you should use FIELD option for all i/o fields managed in your module FIELD

Max

Read only

D_Chia
Active Participant
0 Likes
3,288

is there any particular reason why you have to execute the logic in MODULE USER_COMMAND_9010 1st in your current flow?

(during PAI) only fields NOT inside FIELD statement(s) will be transferred 1st to the program.  that's why it is empty when you are just at the first module.

P/S:  there is an exception to this transfer sequence for table control

Read only

former_member185116
Active Participant
0 Likes
3,289

hi,

since your using only one field in between chain and endchain

in your MODULE_FIELD INPUT

write clear :itab-badli_date above Message 'NO BADLI can be done ' type 'E'.

this will clears the date field and it will not be set to zeros as you said.

this will solve your problem...

i have checked it,

any problem get back to me,

regards,

vinay..

Read only

0 Likes
3,288

Dear Vinay,

I need to use another fields ITAB-FOR_EMPLOYEE and ITAB-TO_EMPLOYEE as well in the CHAIN ENDCHAIN statement.

Please suggest.

Read only

0 Likes
3,288

Hi

As it was suggested before you need to manage both fields in CHAIN/ENDCHAIN:


CHAIN.

   FIELD ITAB-FOR_EMPLOYEE.

   FIELD ITAB-BADLI_DATE.

   MODULE FIELD.

ENDCHAIN.

Max

Read only

0 Likes
3,288

yes you can use other field also,

see my sample code,

now let us test the code,

i have shown the error if created date is greater than todays date

now see the result

Read only

ayaz1
Explorer
0 Likes
3,288

Dear Experts,

Thank you for your replies. Issue resolved.

Regards,
AN