‎2007 May 31 4:51 PM
HI,
In module pool i have to validate the ztable fields from table control.
Requirement is
i have 3 fields in which 2 are key fields (plant and base) other one is base_high.
for each plant the records should be
base < base_high and
the next record of same plant shoul have
base > base_high of previous record.
please respond me immedietly,
Thanks in advance,
Navneeth.
‎2007 May 31 4:59 PM
Write down in your internal table loop and endloop by using chain and endchain
see the example code :
LOOP AT t_tcdata. " Looping the internal table
CHAIN.
FIELD t_tcdata-matnr MODULE validate_matnr.
FIELD t_tcdata-kdmat MODULE validate_kdmat.
FIELD t_tcdata-kwmeng MODULE validate_quan.
FIELD t_tcdata-charg MODULE validate_charg .
ENDCHAIN.
MODULE validate_matnr INPUT.
IF NOT t_tcdata-matnr IS INITIAL.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = t_tcdata-matnr
IMPORTING
output = t_tcdata-matnr.
SELECT SINGLE matnr FROM mvke INTO t_tcdata-matnr
WHERE matnr EQ t_tcdata-matnr
AND vkorg EQ c_vkorg
AND vtweg EQ c_vtweg
AND mvgr2 EQ c_mvgr2.
IF sy-subrc <> 0.
MESSAGE e000 WITH 'Please enter the material code'(t08)
'for which material group is Z91'(t09).
ENDIF.
ENDIF.
ENDMODULE. " VALIDATE_MATNR INPUT
Reward Points if it is helpful
Thanks
Seshu
‎2007 May 31 5:02 PM
Hi
If u want to do a field validation for a field then use FIELD statement.
If u want to do validation for group of fields then u should use CHAIN ... ENDCHAIN.
Reward points if its helpful.
Regards
Ravi
‎2007 May 31 5:09 PM
in the PAI,,,,,between loop and endloop.....
write a field staement for base.....and include a module.
inside the module...select the previous base and check for the contidition....if not satsified then raise an error msg.