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: 

How to validate screen field

Former Member
0 Kudos

hello all,

can any one tell to me how to validate screen field

e.g.. ych_met-matnr screen field. i.e. i want to check material no present in this or not.

Thanks.

Rajesh.

7 REPLIES 7

laxmanakumar_appana
Active Contributor
0 Kudos

Hi,

use CHAIN-ENDCHAIN under PBO event to validate screen field.

code :

CHAIN.
  FIELD : MATNR.
  module validate_matnr.
ENDCHAIN.

 module validate_matnr input.  
    if ych_met-matnr is initial.
      message e000 with 'error'.
     endif.
endmodule.

<b>

select single maktx from <table> into ych_mer-maktx

where matnr eq ych_mer-matnr.

then use FM : DYNP_VALUES_UPDATE to update description field by reading material number</b>

Regards

Appana

Message was edited by: L Appana

Manohar2u
Active Contributor
0 Kudos

in PAI flow logic

chain.

module ych_met-matnr.

endchaing.

in this module you can write a logic to check whether it exits or not.

Regds

Manohar

Former Member
0 Kudos

Hi,

If your selection criteria depends on the material number, make the screen field as obligatory.

Now, in the PAI do the following on the flow logic.

FIELD YCH_MET-MATNR MODULE TEST.

Save ur program and double-click on the Module name TEST, system automatically creates the module in your program.

MODULE TEST.

Select single matnr from mara where matnr = ych_met-matnr.
if sy-subrc <> 0.
message ....'ENTER VALID MATERIAL NUMBER' TYPE S
endif.

endmodule.

This should solve ur problem, reward points if convinced.

Regards

0 Kudos

I HAVE NOT GOT RESULT PLESE GIVE ME SOLUTION. CAN YOU CHECK YOUR CODE PLESE AND REPLY ME.

RAJESH

0 Kudos

Dear friend.

I got the result and i have given points to you also

and i have other problem.

i have some screen fields, i want when i leave screen field ych_mer-matnr. then automatecilly i want to display meterial desc. on field ych-maktx.

regards

rajesh

0 Kudos

hi

you can fetch the material description from the table MAKT based on MATNR in the PBO Event of the screen.

Note you need to press the enter or carry out any PAI Activity after entering the material number in the MATNR field..

Cheers,

Abdul Hakim

Former Member
0 Kudos

Hi,

In the PBO write the following code :

if ych_met-matnr is not initial.
Select single matnr from mara....
if sy-subrc = 0.
select single maktx from makt into ych_met-maktx
where matnr = ych_met-matnr and spras = 'EN'.
endif.
endif.

Reward points if problem solved.

Regards