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

field validation in dialog programing

Former Member
0 Likes
1,378

Hi all,

How can i validate a field in dialog programing

kindly describe it.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,327

Hi TArun,

In PAI if you want to validate group of fields put in

chain and End chain statement .

You can declare fields in the chain enchain .

CHAIN.
FIELD chk_ABC.
FIELD chk_DEF.
FIELD chk_GHI.
FIELD CHK-JKL.
MODULE CHK_screenfields.
ENDCHAIN.


MODULE CHK_screenfields INPUT.
CLEAR okcode.
okcode = sy-ucomm.
CASE okcode.
WHEN 'ENTER' OR 'EXECUTE'.
 
IF chk_ABC IS INITIAL AND chk_DEF  IS INITIAL AND CHK_GHI 
IS INITIAL .
MESSAGE e000(zo_spa) WITH text-017. " Enter VALUES'
ELSE.
  .....
ENDIF.
ENDIF.
 
ENDMODULE. " modify_screenfields INPUT

[link|http://help.sap.com/saphelp_nw04/helpdata/en/9f/dbaa4735c111d1829f0000e829fbfe/content.htm]

[Link|http://help.sap.com/saphelp_nw04/Helpdata/EN/9f/dbabbd35c111d1829f0000e829fbfe/content.htm]

Regards,

Sandeep Patel

8 REPLIES 8
Read only

former_member200872
Active Participant
0 Likes
1,327

Hi,

Go through the documentation for the keywords CHAIN, FIELD, MODULE (F1 Help).

Regards,

Wajid Hussain P.

Read only

Former Member
0 Likes
1,328

Hi TArun,

In PAI if you want to validate group of fields put in

chain and End chain statement .

You can declare fields in the chain enchain .

CHAIN.
FIELD chk_ABC.
FIELD chk_DEF.
FIELD chk_GHI.
FIELD CHK-JKL.
MODULE CHK_screenfields.
ENDCHAIN.


MODULE CHK_screenfields INPUT.
CLEAR okcode.
okcode = sy-ucomm.
CASE okcode.
WHEN 'ENTER' OR 'EXECUTE'.
 
IF chk_ABC IS INITIAL AND chk_DEF  IS INITIAL AND CHK_GHI 
IS INITIAL .
MESSAGE e000(zo_spa) WITH text-017. " Enter VALUES'
ELSE.
  .....
ENDIF.
ENDIF.
 
ENDMODULE. " modify_screenfields INPUT

[link|http://help.sap.com/saphelp_nw04/helpdata/en/9f/dbaa4735c111d1829f0000e829fbfe/content.htm]

[Link|http://help.sap.com/saphelp_nw04/Helpdata/EN/9f/dbabbd35c111d1829f0000e829fbfe/content.htm]

Regards,

Sandeep Patel

Read only

Former Member
0 Likes
1,327

Check Tcodes.....

TZ60

TZ50

TZ70

Read only

Former Member
0 Likes
1,327

HI,

SAMPLE CODE IF U HAVE OF DIALOG PROGRAME THAT'S EASSY TO UNDERSTAND. JUST PROGRAME AND FLOW LOGIC ONLY.

Read only

Former Member
0 Likes
1,327

Check the Below Demo Programs.

demo_dynpro_automatic_checks 
demo_dynpro_value_select
demo_dynpro_field_chain

They are very simple and small

Read only

former_member787646
Contributor
0 Likes
1,327

Hi

Using FIELD Statement in the Flow Logic we can validate a field in the Module Pool Programming.

Eg. FIELD <fieldname> MODULE <module_name>.

Hope this would help you.

Murthy

Read only

0 Likes
1,327

Hi.....

If you want to validate a perticuler field and display erroir message if user enters wrong input...

Do like this....

say P_F1 is field attribute name.... in layout...,

Now write this syntax for the next actions in that screen after enters the input into that field...in PAI event

Decalere itab with that field...

> select * from <check table of that field> into correspoding fields of tabel itab where F1 = P_F1.

>

> If sy-subrc <> 0

> message 'P_F1 does not exists' type 'E'.

> Endif.

>

We can do field validation like this also...in module pools..

Thanks,

Naveen.I

Read only

Former Member
0 Likes
1,327

thanks