Skip to Content
0
Former Member
Jan 12, 2011 at 12:57 PM

Validation while creating entries

164 Views

Hi Experts,

I've created a custom table with table maintenance generator and want to perform validations while creating new records using SM30.

For this I've created one event of type 05.

Now while creating new entries, it performs the validation and shows the error message in the status bar, but in that screen it is not allowing me to modify that data and save again.

How can I do this please suggest.

Code snippet:form validate_input .

data: v_vendor type lifnr,

v_cust type kunnr.

select single lifnr

from lfa1

into v_vendor

where lifnr = zmm_co_cus_ven-vendor_id.

if sy-subrc ne 0.

message 'Vendor does not exist in LFA1.' type 'E'.

endif.

select single kunnr

from kna1

into v_cust

where kunnr = zmm_co_cus_ven-cust_id.

if sy-subrc ne 0.

message 'Customer does not exist in KNA1.' type 'E'.

endif.

endform. " VALIDATE_INPUT

Thanks in advance.

Anirban.