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

modulepool program

0 Likes
884

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.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
847

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.

6 REPLIES 6
Read only

Former Member
0 Likes
847

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

Read only

Former Member
0 Likes
847

Hi,

Check the Demo report for module pool screen checks.

DEMO_DYNPRO_AUTOMATIC_CHECKS

DEMO_DYNPRO_AT_EXIT_COMMAND

Thanks,

Kiran

Read only

marvelmurugan
Explorer
0 Likes
847

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

Read only

nishantbansal91
Active Contributor
0 Likes
847

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

Read only

Former Member
0 Likes
848

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.

Read only

Former Member
0 Likes
847

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.