08-12-2006 9:05 AM
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.
08-12-2006 9:06 AM
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
08-12-2006 9:07 AM
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
08-12-2006 9:43 AM
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
08-12-2006 10:09 AM
I HAVE NOT GOT RESULT PLESE GIVE ME SOLUTION. CAN YOU CHECK YOUR CODE PLESE AND REPLY ME.
RAJESH
08-12-2006 10:29 AM
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
08-12-2006 10:49 AM
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
08-12-2006 10:47 AM
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