Skip to Content
avatar image
Former Member

Problem with PI_OPT_PERSONALDATA parameter of BAPI_CUSTOMER_CREATEFROMDATA1

Hi.

I'm trying to load the customer master from Legacy to SAP. I'm required to use the BAPI named BAPI_CUSTOMER_CREATEFROMDATA1.

I have thoroughly read the documentation for this BAPI.

There are two mandatory import parameters: PI_PERSONALDATA and PI_COPYREFERENCE, and I filled both these parameters with values. Then I tested the BAPI with these values,and it ran fine (i.e. without any error), and a customer number was returned via the export parameter CUSTOMERNO.

Here is the problem:

There is an OPTIONAL parameter named: PI_OPT_PERSONALDATA. It is clearly mentioned in the BAPI documentation that "If values exist for the fields in this structure, these values take priority over any equivalent values for the reference customer." However, when I assign my own values to the components, e.g PI_OPT_PERSONALDATA-CONTROL_ACCOUNT = '1234' , I get an error message (when i run the BAPI) stating "" Account 1234 does not exist in company code <PI_COPYREFERENCE-SALESORG>".

In other words, in the optional parameter PI_OPT_PERSONALDATA, I can only give values from KNB1 which correspond to the company code specified in PI_COPYREFERENCE-SALESORG.

Why is this happening? Please help!

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • avatar image
    Former Member
    Aug 22, 2011 at 09:43 AM

    Hi

    As writtn in the previous post,

    This BAPI is not intended to be used out of its original process context. One fo the main effect you will face is limitations and data inconsistencies.

    For the maintenance of customers, there is NO BAPI and NO direct function module.

    There are some functions modules like the one above where the name is looking nice. But these should not be used.

    • Below ECC 2005 (6.00), the only solution was batch input and DEBMAS idocs. See [note 384462|https://service.sap.com/sap/support/notes/384462]

    • Starting with ECC 2005 (6.00) and above: a synchronisation tool has been introduced. See class CMD_EI_API and VMD_EI_API

    If you really plan to write your own loading functionality, definitively jump to CMD_EI_API class.

    If you need a BAPI, just write your wrapper BAPI that will trigger calls to that class.

    Alternatively, there is also class CL_ERP_SALES_LCM_INTERACTION. It is easier to use but more limited.

    I clearly understand the above is not the answer you are expecting, but it will clearly saves you time and efforts

    Best regards

    Alain

    Add comment
    10|10000 characters needed characters exceeded