To understand these rules please go through BAPI Wrapper section of MDK documentation. Click here
Here is a snap shot :
General rule : 1. In case of any error or execution , Bapi wrapper should always fill the Type field of return parameter with E ,X or A.
2. If BAPI wrapper is defined in the local system ( the system where SyncBO is created) then return message should always have the mesasge class. If message class is not returned by the BAPI Wrapper ( in case of error ) the outbound return message on worklist monitor will be the unexpected one .
GetList Bapi Wrapper Rules:
·It should never return duplicate header record. ·It should never return any header record with object key as Initial value.
GetDetail Bapi wrapper Rules:
·It should never return initial ( Blank ) object key (r3key) for header record.
·It Should never return the item rows with duplicate object key or initial (Blank) object key.
·Header record object key in the export parameter of getdetail should be always same as the object key of the import parameter at runtime .
Create Bapi Wrapper rules :
·It Should never return Initial (Blank ) object key for Header record .
·It should always return a unique key in other words it should never return a key which already exist in the middleware.
·It should return the error message if the Object Key is already exists in the backend.
·It should always return the headers object key which is created in the backend.
Modify Bapi Wrapper rules:
·Table Parameter Should contains all the items exists in the backend.(changed as well as unchanged) ·Header data in the export parameter is not required .
·If the header record does not exists in the backend, Bapi wrapper should fill the return parameter with error message .
Delete Bapi Wrapper rules:
·If the record does not exist in the backend, Bapi wrapper should fill the return parameter with error message .