Ansicht
Dokumentation

BAPI_PPR_MAINTAIN_40 - CRM 4.0 Method "Maintain Partner/Product Ranges (PPRs)"

BAPI_PPR_MAINTAIN_40 - CRM 4.0 Method "Maintain Partner/Product Ranges (PPRs)"

PERFORM Short Reference   SUBST_MERGE_LIST - merge external lists to one complete list with #if... logic for R3up  
This documentation is copyright by SAP AG.
SAP E-Book

Functionality

This method allows the independentmaintenance (create/change/delete) of the following objects of Partner/Product Ranges (PPRs):

  • Headers (input table HeaderData),
  • Header descriptions (input table HeaderDescription),
  • Header organisational data (input table HeaderOrganisationalData),
  • Header organisational data extension fields (input table HeaderExtensionFields),
  • Items (input table ItemData)
  • Item descriptions (input table ItemDescription),
  • Item business partner data (input table ItemBusinessPartnerData),
  • Item product data (input table ItemProductData),
  • Item validity period data (input table ItemValidityPeriodData),
  • Item rule parameter data (input table ItemRuleParameterData) and
  • Item business partner / product / validity period data extension fields (input table ItemExtensionFields).

All input parameters and input tables are optional, except the success/error message log Return.

An authority check is performed using the authorization object CRM_PRP_BP. Depending on the PPR types defined in the Customizing of the CRM Online System, it is checked, which activities (Create, Change and/or Delete) are allowed.

General Remarks

  • Each line of the below mentioned input data tables must contain a valid PPR type defined in the CRM Customizing. If, at least, one wrong PPR type is contained, all input data is rejected and nothing will be posted to the database.
  • For each PPR type used within this method, an authorization profile using the authorization object CRM_PRP_BP must be maintained in the CRM system. Possible activities are 'Create', 'Change' and 'Delete'.
  • For each line of the below mentioned input data tables, the field Processing_Mode mustbe filled with one of the following values:
  • 'A' (for creating data),

  • 'B' (for changing data) and

  • 'D' (for deleting data).

  • For each object (header, item, descriptions, organisational data, business partner / product / validity period references, extension fields, rule parameter data) of a PPR that is to be created or changed, a corresponding line in the input data table InputFieldData must exist.
  • If PPR data is to be created in the database,
  • each input table line must either contain a value for the field Handle to identify it or contain a value for the field GUIDtogether withthe value 'X' for the field Foreign_Source_System, if an already existing GUID of an external system is to be used

  • for each input table line - except header data, org. data extensions and business partner / product / validity period extensions -, the field Reference_Handle or Reference_Guidmust be filled with the value of the respective field Handleor GUID(Globally Unique ID) of the related PPR header or item.

  • If existing PPR data is to be changed/deleted in the database,
  • each input table line must contain the value of the respective field Guidof the related entry in the database in the input table field Guid.

  • each input table line - except header data, org. data extensions and business partner / product / validity period extensions - must contain the value of the respective field Guidof the related PPR header or item in the input table field Reference_Guid.

  • If existing PPR Data is to be changed, only those fields of the respective input data line are to be filled, whose values are to be changed in the database.
  • In case of updating an existing PPR, the tables HeaderData and ItemData, respectively, have only to be filled, if header administrative data or item administrative data is to be modified. If any other PPR object is to be modified, for example a product entry is updated or newly created, it is sufficient to make an entry in the respective input table, in this example ItemProductData.
  • Note that false input data is reported in the error message log Return, but the data is nevertheless posted to the database. Therefore, the error message log must be carefully considered and checked to recognize wrong data. The erroneous lines have to be corrected and posted again, so that the data in the database is correct and consistent.
  • For defined and allowed input values, have a look at the data elements contained in the Data Dictionary structures BAPI40_<OBJECT>_COMwith
    • PRPADM_H (for PPR Headers),

    • PRP_DESCR_H (for PPR Header Descriptions),

    • PRP_ORG_H (for PPR Header Organisational Data),

    • PRP_EXT_H (for PPR Header Organisational Data Extension Fields),

    • PRPADM_I (for PPR Items),

    • PRP_DESCR_I (for PPR Item Descriptions),

    • PRP_BUPA_I (for PPR Item Business Partners),

    • PRP_PROD_I (for PPR Item Products),

    • PRP_TS_I (for PPR Item Validity Periods),

    • PRP_EXT_I (for PPR Item Business Partner / Product / Validity Period Data Extension Fields) and

    • PRP_PAR_I (for PPR Rule Parameter Data).

    Import Parameters

    • For the parameter CheckMode, the values 'X' (= 'Yes' or 'True') or ' ' (= 'No' or 'False') are possible. If this flag is set equal to 'X', the input data is only checked and contained errors are then reported in the Error Message Log (table Return), but no data is posted to the database.
    • A language is necessary to retrieve the text of the messages of the Success/Error Message Log Return. Specify this language via the input parameter Language for a language key or - alternatively - via the input parameter LanguageIso for the ISO code of a language key.
    If both import parameters Languageand LanguageIso are not specified, there will be a corresponding message in the Succes/Error Message Log.

    Import Tables

    HeaderData

    With this table, the administrative data of Partner/Product Range (PPR) headers can be entered. When the provided PPR type has no internal PPR ID generation (defined in the CRM Customizing), a PPR ID must be provided if the processing mode is equal to 'A' (create), otherwise a message is created and stored in the Error Message Log Return.

    Either the field Guid(Globally Unique ID) or the field Handlemust be filled, depending on the value of the field Processing_Mode.

    The PPR status (structure field PPR_Status) can have the values

    • '1' (In Process),

    • '2' (Active),

    • '3' (To be Deleted) or

    • '4' (To be Archived and Deleted).

    Status changes are allowed

    • from 'In Process' to 'Active',

    • from 'In Process' or 'Active' to 'To be Deleted' or 'To be Archived and Deleted' and

    • from 'To be Deleted' to 'To be Archived and Deleted'.

    Status changes are notallowed

    • from 'Active', 'To be Deleted' or 'To be Archived and Deleted' to 'In Process' ,

    • from 'To be Deleted' or 'To be Archived' to 'Active' and

    • from 'To be Archived and Deleted' or 'To be Archived' to 'Active' .

    In case of updating an existing PPR, this table has only to be filled, if header data is to be modified. If any other PPR object is to be modified, for example a product entry is updated or newly created, it is sufficient to make an entry in the respective input table, in this example ItemProductData.

    HeaderDescription

    The field Reference_Handle must contain the value of the field Handle of the related PPR header to be created, if the field Processing_Mode is equal to 'A' (create).

    The field Reference_Guid must contain the value of the Guid of the related, existing PPR header, if the field Processing_Mode is equal to 'A' (create), 'B' (change) or 'D' (delete).

    The field Language or Language_Iso must be filled and an entry for this fieldname must be maintained in the input table InputFieldData.

    HeaderOrganisationalData

    The field Reference_Handle must contain the value of the field Handle of the related PPR header to be created, if the field Processing_Mode is equal to 'A' (create).

    The field Reference_Guid must contain the value of the Guid of the related, existing PPR header, if the field Processing_Mode is equal to 'A' (create), 'B' (change) or 'D' (delete).

    The field Reference_Type must be filled and an entry for this fieldname must be maintained in the input table InputFieldData.

    HeaderExtensionFields

    If the field Processing_Mode is equal to 'A' (create),

    • the field Handle must contain the value of the field Handle of the related PPR header organisational data record to which the extension fields are related, if this organisational data entry is to be created in the same run of the BAPI or
    • the field GUID must contain the value of the field GUID of the related PPR header organisational data record to which the extension fields are related, if this organisational data still exists in the database and
    • the field Reference_Handle must contain the value of the field Handle of the related PPR header organisational data record to which the extension fields are related, if this organisational data entry is to be created in the same run of the BAPI or
    • the field Reference_GUID must contain the value of the field GUID of the related PPR header organisational data record to which the extension fields are related, if this organisational data still exists in the database.

    If the field Processing_Mode is equal to 'B' (change) or 'D' (delete),

    • the field GUID must contain the value of the field GUID of the related PPR header organisational data record to which the extension fields are related and
    • the field Reference_GUID must contain the value of the field GUID of the related PPR header organisational data record to which the extension fields are related.

    • The field Object_Name must be filled with the constant 'PRP_ORG_H',
    • the field Reference_Type with the same value of the reference type of the related PPR header organisational data record to which the extension fields are related,
    • the field Settype_ID with the related PPR Set Type ID and
    • the field Tablename with the name of the DDIC Include structure name (Z)PRP__EXT containing the extension fields of the PPR set type database table.
    • the field Fieldname with the name of the field of the DDIC Include structure name (Z)PRP__EXT (containing the extension fields of the PPR set type database table), for which a value is to be maintained.
    • the field Value with the value that is to be maintained for the field with the name contained in Fieldname.
    • Entries for the fieldnames Object_Name, Reference_Type, Settype_ID, Tablename and Value must be maintained in the input table InputFieldData.

    ItemData

    The field Reference_Handle must contain the value of the field Handle of the related PPR header to be created, if the field Processing_Mode is equal to 'A' (create).

    The field Reference_Guid must contain the value of the Guid of the related, existing PPR header, if the field Processing_Mode is equal to 'A' (create), 'B' (change) or 'D' (delete).

    The field PPR_Item_Type must be filled and an entry for this fieldname must be maintained in the input table InputFieldData.

    The possible and allowed item types ('1': 'Combination of Business Partners, Products and Validity Periods' or '2': 'Reference other PPRs') depend on the CRM Customizing Settings of the respective PPR type.

    In case of updating an existing PPR, this table has only to be filled, if item data is to be modified. If any other PPR object is to be modified, for example an item description entry is updated or newly created, it is sufficient to make an entry in the respective input table, in this example ItemDescription.

    ItemDescription

    The field Reference_Handle must contain the value of the field Handle of the related PPR item to be created, if the field Processing_Mode is equal to 'A' (create).

    The field Reference_Guid must contain the value of the Guid of the related, existing PPR item, if the field Processing_Mode is equal to 'A' (create), 'B' (change) or 'D' (delete).

    The field Language or Language_Iso must be filled and an entry for this fieldname must be maintained in the input table InputFieldData.

    ItemBusinessPartnerData

    The field Reference_Handle must contain the value of the field Handle of the related PPR item to be created, if the field Processing_Mode is equal to 'A' (create).

    The field Reference_Guid must contain the value of the Guid of the related, existing PPR item, if the field Processing_Mode is equal to 'A' (create), 'B' (change) or 'D' (delete).

    The field Reference_Type must be filled and an entry for this fieldname must be maintained in the input table InputFieldData.

    The possible business partner reference types (e. g. '1': 'Business Partner', '2': 'Business Partner Group Hierarchy', '88': 'Rule', etc.) depend on the CRM Customizing Settings of the respective PPR type.

    ItemProductData

    The field Reference_Handle must contain the value of the field Handle of the related PPR item to be created, if the field Processing_Mode is equal to 'A' (create).

    The field Reference_Guid must contain the value of the Guid of the related, existing PPR item, if the field Processing_Mode is equal to 'A' (create), 'B' (change) or 'D' (delete).

    The field Reference_Type must be filled and an entry for this fieldname must be maintained in the input table InputFieldData.

    The possible product reference types (e. g. '1': 'Product', '2': 'Product Category', '88': 'Rule', etc.) depend on the CRM Customizing Settings of the respective PPR type.

    ItemValidityPeriodData

    The field Reference_Handle must contain the value of the field Handle of the related PPR item to be created, if the field Processing_Mode is equal to 'A' (create).

    The field Reference_Guid must contain the value of the Guid of the related, existing PPR item, if the field Processing_Mode is equal to 'A' (create), 'B' (change) or 'D' (delete).

    The field Reference_Type must be filled and an entry for this fieldname must be maintained in the input table InputFieldData.

    The possible validity period reference types (e. g. '1': 'Date: From / To', '88': 'Rule', etc.) depend on the CRM Customizing Settings of the respective PPR type.

    ItemRuleParameterData

    With the help of this table, values for PPR Rule Parameter Objects (defined in the CRM Customizing) can be entered.

    • If the parameters belong to a PPR Business Partner Rule,
    • the field Reference_Handle must contain the value of the field Handle of the related PPR item business partner entry defining the rule to be created, if the field Processing_Mode is equal to 'A' (create).

    • the field Reference_Guid must contain the value of the Guid of the related, existing PPR item business partner entry defining the rule, if the field Processing_Mode is equal to 'A' (create), 'B' (change) or 'D' (delete).

    • an input line for the corresponding PPR Business Partner Rule must be contained in the input table ItemBusinessPartnerDatawith the same value for the field Processing_Modeof this input line.

    • the field Rule_ID must be filled.

    • the field Object_Type must be equal to 'PA'.

    • If the parameters belong to a PPR Product Rule,
    • The field Reference_Handle must contain the value of the field Handle of the related PPR item product entry defining the rule to be created, if the field Processing_Mode is equal to 'A' (create).

    • The field Reference_Guid must contain the value of the Guid of the related, existing PPR item product entry defining the rule, if the field Processing_Mode is equal to 'A' (create), 'B' (change) or 'D' (delete).

    • an input line for the corresponding PPR Product Rule must be contained in the input table ItemProductDatawith the same value for the field Processing_Modeof this input line.

    • the field Rule_ID must be filled.

    • the field Object_Type must be equal to 'PB'.

    • If the parameters belong to a PPR Validity Period Rule,
    • The field Reference_Handle must contain the value of the field Handle of the related PPR item validity period entry defining the rule to be created, if the field Processing_Mode is equal to 'A' (create).

    • The field Reference_Guid must contain the value of the Guid of the related, existing PPR item validity period entry defining the rule, if the field Processing_Mode is equal to 'A' (create), 'B' (change) or 'D' (delete).

    • an input line for the corresponding PPR Validity Period Rule must be contained in the input table ItemValidityPeriodData with the same value for the field Processing_Modeof this input line.

    • the field Rule_ID must be filled.

    • the field Object_Type must be equal to 'PC'.

    • The fields Tablename and Fieldname must be filled and contain the name of the respective parameter object assigned to the rule ID - contained in the field Rule_ID mentioned above -, for which values are to be maintained.
    • The values which are to be maintained for the current parameter object must be filled into the fields Rule_Sign, Rule_Option, Rule_Low and Rule_High.
    • Entries for the fieldnames Rule_ID, Object_Type, Tablename, Fieldname, Rule_Sign, Rule_Option, Rule_Low and Rule_High (only if a value is passed for the field Rule_High) must be maintained in the input table InputFieldData.

    ItemExtensionFields

    If the field Processing_Mode is equal to 'A' (create),

    • the field Handle must contain the value of the field Handle of the related PPR item business partner / product / validity period data record to which the extension fields are related, if this item business partner / product / validity period data entry is to be created in the same run of the BAPI or
    • the field GUID must contain the value of the field GUID of the related PPR item business partner / product / validity period data record to which the extension fields are related, if this item business partner / product / validity period data still exists in the database and
    • the field Reference_Handle must contain the value of the field Handle of the related PPR item business partner / product / validity period data record to which the extension fields are related, if this item business partner / product / validity period data entry is to be created in the same run of the BAPI or
    • the field Reference_GUID must contain the value of the field GUID of the related PPR item business partner / product / validity period data record to which the extension fields are related, if this item business partner / product / validity period data still exists in the database.

    If the field Processing_Mode is equal to 'B' (change) or 'D' (delete),

    • the field GUID must contain the value of the field GUID of the related PPR item business partner / product / validity period data record to which the extension fields are related and
    • the field Reference_GUID must contain the value of the field GUID of the related PPR item business partner / product / validity period data record to which the extension fields are related.

    • The field Object_Name must be filled with the constant
    • 'PRP_BUPA_I' for business partner extension fields,

    • 'PRP_PROD_I' for product extension fields or

    • 'PRP_TS_I' for validity period extension fields,

    • the field Reference_Type with the same value of the reference type of the related PPR item business partner / product / validity period data record to which the extension fields are related,
    • the field Settype_ID with the related PPR Set Type ID and
    • the field Tablename with the name of the DDIC Include structure name (Z)PRP__EXT containing the extension fields of the PPR set type database table.
    • the field Fieldname with the name of the field of the DDIC Include structure name (Z)PRP__EXT (containing the extension fields of the PPR set type database table), for which a value is to be maintained.
    • the field Value with the value that is to be maintained for the field with the name contained in Fieldname.
    • Entries for the fieldnames Object_Name, Reference_Type, Settype_ID, Tablename and Value must be maintained in the input table InputFieldData.

    InputFieldData

    This table is used to specify

    • which field values of an input data line are to be entered into the database and checked by the system for validity and consistency, if the processing mode is equal to 'A' (create).
    • which field values of an input data line are changed/modified with respect to the current values in the database and whose entered values must be checked by the system, if the processing mode is equal to 'B' (change).

    Such a line of the table InputFieldData must be available for each field of an object (PRPADM_H, PRP_DESCR_H, PRP_ORG_H, PRP_EXT_H, PRPADM_I, PRP_DESCR_I, PRP_BUPA_I, PRP_PROD_I, PRP_TS_I, PRP_PAR_I and PRP_EXT_I) to be created/changed of an existing PPR Header / Item or a PPR Header / Item to be created.

    • For the objects PRPADM_H, PRP_DESCR_H, PRP_ORG_H and PRPADM_I,
    • the field Reference_Handle of an input line for table InputFieldData must contain the value of the field Handle of the related PPR header to be created, if the field Processing_Mode is equal to 'A' (create).

    • the field Reference_Guid of an input line for table InputFieldDatamustcontain the value of the Guid of the related, existing PPR header, if the field Processing_Mode is equal to ''B' (change) or 'D' (delete).

    • For the objects PRP_DESCR_I, PRP_BUPA_I, PRP_PROD_I, PRP_TS_I and PRP_PAR_I,
    • the field Reference_Handle of an input line for table InputFieldData must contain the value of the field Handle of the related PPR item to be created, if the field Processing_Mode is equal to 'A' (create).

    • the field Reference_Guid of an input line for table InputFieldDatamustcontain the value of the Guid of the related, existing PPR item, if the field Processing_Mode is equal to 'B' (change) or 'D' (delete).

    • For the object PRP_EXT_H
    • and Processing_Mode 'A' (Create), the field Reference_Handle of an input line for table InputFieldDatamustcontain the value of the field Handle of the related PPR header organisational data record to which the extension fields are related, if this organisational data entry is to be created in the same run of the BAPI.

    • and Processing_Mode 'B' (Change) or 'D' (Delete), the field Reference_GUID must contain the value of the field GUID of the related PPR header organisational data record to which the extension fields are related, if this organisational data still exists in the database.

    • The field Reference_Kind must be filled with the constant 'C'.

    • For the Object 'PRP_EXT_I'
    • and Processing_Mode 'A' (Create), the field Reference_Handle must contain the value of the field Handle of the related PPR item business partner / product / validity period data record to which the extension fields are related, if this item business partner / product / validity period data entry is to be created in the same run of the BAPI or

    • the field Reference_GUID must contain the value of the field GUID of the related PPR item business partner / product / validity period data data record to which the extension fields are related, if this item business partner / product / validity period data still exists in the database.

    • The field Reference_Kind must be filled with the constant 'D'.

    The field Fieldname must contain the related fieldname of the SAP-internal communication structures, to which the structures BAPI40__COM (see above) refer:

    • BAPI40_PRPADM_H_COM refers to CRMT_PRPADM_H_COM,
    • BAPI40_PRP_DESCR_H_COM refers to CRMT_PRP_DESCR_H_COM,
    • BAPI40_PRP_ORG_H_COM refers to CRMT_PRP_ORG_H_COM,
    • BAPI40_PRP_EXT_H_COM refers to CRMT_PRP_EXT_H_COM,
    • BAPI40_PRPADM_I_COM refers to CRMT_PRPADM_I_COM,
    • BAPI40_PRP_DESCR_I_COM refers to CRMT_PRP_DESCR_I_COM,
    • BAPI40_PRP_BUPA_I_COM refers to CRMT_PRP_BUPA_I_COM,
    • BAPI40_PRP_PROD_I_COM refers to CRMT_PRP_PROD_I_COM,
    • BAPI40_PRP_TS_I_COM refers to CRMT_PRP_TS_I_COM,
    • BAPI40_PRP_EXT_I_COM refers to CRMT_PRP_EXT_I_COM and
    • BAPI40_PRP_PAR_I_COM refers to CRMT_PRP_PAR_I_COM.

    Success / Error Message Log

    The Success / Error Message Log of the method Maintain will be returned in the output table Return.

    Example

    Notes

    Further information





    Parameters

    CHECKMODE
    HEADER_DATA
    HEADER_DESCRIPTION
    HEADER_EXTENSION_FIELDS
    HEADER_ORGANISATIONAL_DATA
    INPUT_FIELD_DATA
    ITEM_BUSINESS_PARTNER_DATA
    ITEM_DATA
    ITEM_DESCRIPTION
    ITEM_EXTENSION_FIELDS
    ITEM_PRODUCT_DATA
    ITEM_RULE_PARAMETER_DATA
    ITEM_VALIDITY_PERIOD_DATA
    LANGUAGE
    LANGUAGEISO
    RETURN

    Exceptions

    Function Group

    CRM_PRP_BAPI_40

    ROGBILLS - Synchronize billing plans   Vendor Master (General Section)  
    This documentation is copyright by SAP AG.

    Length: 37871 Date: 20240523 Time: 174449     sap01-206 ( 509 ms )