Skip to Content
0
Apr 30, 2009 at 05:44 AM

Error msg in BAPI

16 Views

Hi

this is my BAPI code..

CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'

EXPORTING

headdata = bapimathead

CLIENTDATA = bapi_mara

CLIENTDATAX = bapi_marax

TABLES

MATERIALDESCRIPTION = it_bapi

RETURNMESSAGES = return .

commit work AND WAIT.

IF return-type = 'E'.

WRITE: /'ERROR',return-message, 'for material:',bapimathead-material.

ELSEIF return-type = 'S'.

WRITE: 'material is created successfully',bapimathead-material.

ENDIF.

my problm is if the material already exists i should get the error msg as "Material already Exists" other wise it should upload the material successfully....

Bt in my program if the material exists then alos it is uploading the same material once again....

how to do this?

Regards

Smitha