2009 Apr 30 6:44 AM
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
2009 Apr 30 6:48 AM
Dont commit after BAPI_SAVEDATA..
check for return type
IF return-type = 'E'.
WRITE: /'ERROR',return-message, 'for material:',bapimathead-material.
ELSEIF return-type = 'S'.
BAPI_TRANSACTION_COMMIT/commit work and wait.
endif.
2009 Apr 30 6:48 AM
Dont commit after BAPI_SAVEDATA..
check for return type
IF return-type = 'E'.
WRITE: /'ERROR',return-message, 'for material:',bapimathead-material.
ELSEIF return-type = 'S'.
BAPI_TRANSACTION_COMMIT/commit work and wait.
endif.
2009 Apr 30 6:48 AM
Hi smitha,
The same function module can be used for extension of material also. so plz make sure that the input ur giving to the FM are plant specific and already exists.
Regards,
Anil N.
2009 May 04 5:20 AM