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

Former Member
0 Likes
398

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.

3 REPLIES 3
Read only

Former Member
0 Likes
378

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

Read only

Former Member
0 Likes
378

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

Read only

Former Member
0 Likes
378

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.