this is my BAPI code..
CALL FUNCTION 'BAPI_MATERIAL_SAVEDATA'
headdata = bapimathead
CLIENTDATA = bapi_mara
CLIENTDATAX = bapi_marax
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.
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?