Application Development 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: 

validation on table maintenance screen 2 fields.

Former Member
0 Kudos

Hi All.

I have a custom table developed and table maintenance generated for it. On screen 2 of the table maintenance , i have two fiedls zqty1 and zqty2.

When user enters data on this screen 2 , i have to validate in such a way that zqty1 is always <= zqty2 and both zqty1 and zqty2 are always greater than zero.

Can some one help me out how to write this validation and at what place of the flowlogic. Any sample code is appreciated.

Thanks.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi

You need to code in the PAI event. Have modules between CHAIN...ENDCHAIN. In these modules, you code for validating the values entered in zqty1 and zqty2.

CHAIN.

FIELD: <f1>, <f 2>,...

MODULE <mod1> ON CHAIN-INPUT|CHAIN-REQUEST.

FIELD: <g1>, <g 2>,...

MODULE <mod2> ON CHAIN-INPUT|CHAIN-REQUEST.

...

ENDCHAIN.

When this command is used, all of the fields on the screen that belong to the processing chain (all of the fields listed in the field statements) are made ready for input again. Other fields are not ready for input. Whenever the MODULE statement appears within a processing chain, even if there is only one FIELD attached to it, all of the fields in the chain (not only the affected field) are made ready for input again, allowing the user to enter new values. If the fields in the processing chain are only checked once, the PAI processing continues directly after the FIELD statement, and the preceding modules are not called again.

Check the demo example

<b>DEMO_DYNPRO_FIELD_CHAIN</b>

Also, Check these out

http://help.sap.com/saphelp_nw04/helpdata/en/9f/dbabbd35c111d1829f0000e829fbfe/content.htm

http://help.sap.com/saphelp_47x200/helpdata/en/d1/801ca2454211d189710000e8322d00/frameset.htm

Regards

Raj

3 REPLIES 3

Former Member
0 Kudos

Hi

You need to code in the PAI event. Have modules between CHAIN...ENDCHAIN. In these modules, you code for validating the values entered in zqty1 and zqty2.

CHAIN.

FIELD: <f1>, <f 2>,...

MODULE <mod1> ON CHAIN-INPUT|CHAIN-REQUEST.

FIELD: <g1>, <g 2>,...

MODULE <mod2> ON CHAIN-INPUT|CHAIN-REQUEST.

...

ENDCHAIN.

When this command is used, all of the fields on the screen that belong to the processing chain (all of the fields listed in the field statements) are made ready for input again. Other fields are not ready for input. Whenever the MODULE statement appears within a processing chain, even if there is only one FIELD attached to it, all of the fields in the chain (not only the affected field) are made ready for input again, allowing the user to enter new values. If the fields in the processing chain are only checked once, the PAI processing continues directly after the FIELD statement, and the preceding modules are not called again.

Check the demo example

<b>DEMO_DYNPRO_FIELD_CHAIN</b>

Also, Check these out

http://help.sap.com/saphelp_nw04/helpdata/en/9f/dbabbd35c111d1829f0000e829fbfe/content.htm

http://help.sap.com/saphelp_47x200/helpdata/en/d1/801ca2454211d189710000e8322d00/frameset.htm

Regards

Raj

Former Member
0 Kudos

Hi,

U need to validate in the PAI event.

Write the code in the PAI event between Chain...Endchain.

Take the variable and code accordingly over there.

Save n activate.

This solves the issue.

example :

table is ztab.

If ztab-field1 <= ztab-field2 AND ztab-field1 = 0 AND ztab-field2 = 0.

COMMIT WORK.

Else.

message(e001) zpn.

endif.

Regards,

Priyanka.

0 Kudos

Thanks for your answers.

One more thing is that i have another field say zfeild1 whose data type is Dec(6,2).

I want this field to accept the negative values as well if user enters on the screen field.

Right now it says only positive values allowed. How can i achieve this ??

Appreciate your help..

Thanks.