Ansicht
Dokumentation

BAPI_PR_AR_CREATEFROMDATA - SAP-PR, BAPI for BUS20200: Create a Product Association Rule

BAPI_PR_AR_CREATEFROMDATA - SAP-PR, BAPI for BUS20200: Create a Product Association Rule

BAL Application Log Documentation   Addresses (Business Address Services)  
This documentation is copyright by SAP AG.
SAP E-Book

Functionality

This BAPI is used to create a product association rule on the database.

With the help of the BAPI you can create rules which are either related to a target group or to a profile. This is determined by the object type (parameter 'Objtype'). The description of the parameter contains the permitted values.

If the rule is related to a target group you have to enter the GUID of the target group in the parameter 'Objguid'. In the case of a profile-related rule you have to enter the GUID of the profile.

In accordance with the rule type you use parameter 'Rtype' to determine whether you want to create an up-/down-selling or a cross-selling rule. The description of the parameter contains the permitted values.

The rule status in parameter 'State' specifies whether the rule is to be created as active or as inactive. The description of the parameter contains the permitted values.

The BAPI first checks whether the rule is consistent, i.e. whether it is valid. Among the checks it makes are to ascertain whether the GUIDS belonging to the target group and products in the system exist and are therefore valid.

A check is then made as to whether the rule already exists. If the rule exists an error message is displayed. If the rule does not exist, a new rule is created on the database.

Via parameter 'TestRun' you can start the BAPI in simulation mode.

If the creation of the rule was successful a success message of messsage type 'S', message ID 'BAPI' and message number '000' is created in the message log. The export parameter 'AssociationGuid' in this case contains the GUID of the newly created product association rule, unless the BAPI was started in simulation mode.

If the creation of the rule failed an error message of message type 'E', message ID 'BAPI' and message number '001' is created in the message log. In this case the export parameter 'AssociationGuid' contains an initial value.

Example

Notes

For up-/down-selling rules the leading products do not need to be entered. If such entries are nevertheless transferred in this import table they will be ignored in the course of further processing. "Ranking value" is a required entry for up/down-selling rules.

The changed rule can be displayed on the association rule maintenance screen (transaction CRMD_AR_MAINTAIN). The message log will contain information on whether the BAPI was started in simulation mode.

The message log contains information on whether the BAPI was started in simulation mode.





Parameters

ASSOCIATIONGUID
ASSOCRULEHEADER
ASSOCRULERESULT
ASSOCRULESOURCE
RETURN
TESTRUN

Exceptions

Function Group

CRM_MKTPR_AR_BAPI

Vendor Master (General Section)   CPI1466 during Backup  
This documentation is copyright by SAP AG.

Length: 3443 Date: 20240523 Time: 164010     sap01-206 ( 59 ms )