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: 

Problem in Modulepool Screen validation

Former Member
0 Kudos

Hi friends,

In my Prog. i am using Modulepool screen with 10 fields on it.

Using this screen i am updating the Ztable.

In these fields if i enter the wrong data then it is displaying the system defined error message like <b>'Entry xx is defined in T178 table, check your entry'</b>.

But in my requirment i need to get my own Error Message insted of system message.

Is it possible or not.

Iam sending the code which i designed in Modulescreen .

<b>PROCESS BEFORE OUTPUT.

MODULE clear .

MODULE status.

PROCESS AFTER INPUT.

MODULE exit AT EXIT-COMMAND.

CHAIN .

FIELD zmjbr_det-spg.

FIELD zmjbr_det-brand MODULE validation_brand.

FIELD zmjbr_det-flavor MODULE validation_flavor.

FIELD zmjbr_det-beverage_prod MODULE validation_beverage_prod.

FIELD zmjbr_det-pack_type .

FIELD zmjbr_det-pack_size .

FIELD zmjbr_det-tragr .

FIELD zmjbr_det-to_eff_date MODULE validation_to_date.

FIELD zmjbr_det-from_eff_date MODULE validation_from_date.

FIELD zmjbr_det-major_brand MODULE validation_major_brand.

ENDCHAIN .

MODULE user_command.

PROCESS ON VALUE-REQUEST .

FIELD zmjbr_det-brand MODULE value_req_brand .

FIELD zmjbr_det-flavor MODULE value_req_flavor .

FIELD zmjbr_det-beverage_prod MODULE value_req_beverage_prod .</b>

in above code for the following fields i need own error messages.

spg (T178-KONDM) ,

pack_type (TMFG-MFRGR),

pack_size (TVM1-MVGR1) ,

tragr (TTGR-TRAGR) ,

major_brand (TVBO-BONUS).

    • Reward is Sure.

Thanks,

Anil.

8 REPLIES 8

naveen1241
Participant
0 Kudos

hi.....u have not given ur own modules 4 checking or giving ur own messages.

u can check

FIELD zmjbr_det-spg.

FIELD zmjbr_det-brand MODULE validation_brand.

FIELD zmjbr_det-flavor MODULE validation_flavor.

FIELD zmjbr_det-beverage_prod MODULE validation_beverage_prod.

FIELD zmjbr_det-pack_type .

FIELD zmjbr_det-pack_size .

FIELD zmjbr_det-tragr .

FIELD zmjbr_det-to_eff_date MODULE validation_to_date.

FIELD zmjbr_det-from_eff_date MODULE validation_from_date.

FIELD zmjbr_det-major_brand MODULE validation_major_brand.

wherever u have given module after field <field name> u r getting own msgs

u should use module for all fields wherever u require ur custom msgs.....

bye

naveen

0 Kudos

Hi Naveen,

Thanks for u r reply,

I tried like that also but system message is triggering before comming to chain and endchain itself.

so ever i write the Module validation for these fields no use.

Other fields like Brand, Flavor... are zdataelements in ztable.

Thanks,

Anil.

Former Member
0 Kudos

hi,

I guess you had tried to give the same key field which already exists in ZTABLE and tried to save

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

Sure, just create new modules for those fields and do your check within the modules and issue your own error messages.

Write the MODULE extension in the FIELD statement.

FIELD zmjbr_det-spg <b>MODULE VALIDATION_SPG</b>.

FIELD zmjbr_det-pack_type <b>MODULE VALIDATION_PACK_TYPE.</b> .

FIELD zmjbr_det-pack_size <b>MODULE VALIDATION_PACK_SIZE</b>.

FIELD zmjbr_det-tragr <b>MODULE VALIDATION_TRAGR</b> .

Now you can double click the module in the statement, the system will ask if you want to create it, say yes. It will create it in the ABAP program, now you can simply put your code in the MODULE. Like this.

MODULE VALIDATION_SPG.

If zmjbr_det-spg    is initial.
  message e001(00) with 'This field is not filled in!'.
endif.


ENDMODULE.

.

Regards,

Rich Heilman

Former Member
0 Kudos

Hi,

Do one thing

CHAIN .

FIELD zmjbr_det-spg.

FIELD zmjbr_det-brand MODULE validation_brand.

FIELD zmjbr_det-flavor MODULE validation_flavor.

FIELD zmjbr_det-beverage_prod MODULE validation_beverage_prod.

FIELD zmjbr_det-pack_type .

FIELD zmjbr_det-pack_size .

FIELD zmjbr_det-tragr .

FIELD zmjbr_det-to_eff_date MODULE validation_to_date.

FIELD zmjbr_det-from_eff_date MODULE validation_from_date.

FIELD zmjbr_det-major_brand MODULE validation_major_brand.

<b>MODULE user_command.</b>

ENDCHAIN .

and you will be wiht the solution

Hope this will solve your probelm.

Assign reward points if it helps.

-Gaurang

Former Member
0 Kudos

Hi Anil,

In the PAI event, <b>the PAI modules are called in the sequence in which they occur in the screen flow logic,</b><b> after the automatic field checks</b>. This means that the input on the screen must satisfy the automatic checks before the first module can be called. In particular, all required fields must be filled, and any checks against value lists or check tables defined for the field in the ABAP Dictionary must be successful.

For details click here .....

http://help.sap.com/saphelp_nw04s/helpdata/en/9f/dbaa9535c111d1829f0000e829fbfe/frameset.htm

<b>

I am Sure that it is not possible to so........</b>

<b>

Reward if helpful.

Hope your problem is solved</b>.

Regards,

V.Raghavender.

Former Member
0 Kudos

Write the MODULE extension in the FIELD statement.

FIELD zmjbr_det-spg MODULE VALIDATION_SPG.

FIELD zmjbr_det-pack_type MODULE VALIDATION_PACK_TYPE. .

FIELD zmjbr_det-pack_size MODULE VALIDATION_PACK_SIZE.

FIELD zmjbr_det-tragr MODULE VALIDATION_TRAGR .

use the above code

naveen1241
Participant
0 Kudos

hi Anil Kumar Reddy ,

which error is triggered when u enter wrong values.....

it might be u have some value table for tht field...i mean at domain level.

if tht's the case u cannot handle using chain endchain..

tht's the system wud first check in the value table ( value range )

and it wont allow u 2 proceed with further checks until and after u

enter some value tht falls in the specified domain value range....or value table specified...

if u still want to give ur custom message either dont use the dictionary field and

add a new field.....or else...in the field properties in the screen layout uncheck

the foriegn key check field.

hope u got me.....

bye....