cancel
Showing results for 
Search instead for 
Did you mean: 

FM to assign Business Partner Relationship a Sales Area in SAP CRM BP?

0 Kudos

Hi Experts,

I have gone through the other blogs and I have seen that we can use the FM : BUPR_RELATIONSHIP_CREATE to add a Business Partner Relationship.

My question is a bit further after that.

When You add a Relationship to the BP in SAP CRM it gives you the option to add the Sales Area to the added Relationship also.

And I would like to know which FM can I use to add this Sales Area to the Added Business Partner Relation.

I have already checked the FM BAPI_BUPA_FRG0030_ADD which is not useful here as it is used to add the SALES AREA to a BP. Here I am referring the assignment to the RELATIONSHIP with Sales Area.

Please take a look at the screenshot which shows the Place where I am trying to add the Sales Area.

Tcode: BP

Click on Relationship Tab

Select Relationship Category as " Has BUP"

Give an Employee Number and then Click Enter Key.

You will get a Pop up where you can add the Sales Area.

Here I have added it manually by selecting the Sales Area.

What is the FM which can be used to add this Sales Area to the BP relationship programatically.         

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

Syed Mustaq Ali

You can use FM BUPA_PFCT_ADDFUNCTION for you requirement

CALL FUNCTION 'BUPA_PFCT_ADDFUNCTION'

EXPORTING

  IV_PARTNER1           =  partner1

  IV_PARTNERGUID1       = partner1guid

   IV_SALES_AREA         =  sales area data

   IV_BPFUNCTION         =  partner function

   IV_PARTNER2           =  partner2

  IV_PARTNERGUID2  = partner2 guid

   IV_TESTRUN            =  ' '

   IV_X_SAVE             =  'X'

TABLES

   ET_RETURN             = LT_RET

Regards,

Deepz

0 Kudos

Thanks Deepz Malhotra.

I was able to resolve the issue using the FM that you mentioned. 🙂

Hereby my code with the FM that You suggested.


I encountered an issue with the Sales Organization, so I got the Sales Organization Details from the Table: HRP1000 with the Selection field OTYPE = O.

Then I was getting an Error Message that the relationship is not maintained.

So I realized that the relationship has to be Created first and only then we should assign the Sales Area.

Thanks.

DATA : IT_SALESORG TYPE STANDARD TABLE OF BAPIBUS1006_SALES_AREA,

WA_SALESORG LIKE LINE OF IT_SALESORG,

IT_RETURN TYPE TABLE OF BAPIRET2,

WA_RETURN TYPE BAPIRET2.

*Assign the required values

WA_SALESORG-SALES_ORGANIZATION = 'O 50000608'.

WA_SALESORG-DISTRIBUTION_CHANNEL = '01'.

WA_SALESORG-DIVISION = '01'.

CALL FUNCTION 'BUPA_PFCT_ADDFUNCTION'

   EXPORTING

    IV_PARTNER1           = '0000800090'

*  IV_PARTNERGUID1       =

    IV_SALES_AREA         WA_SALESORG

     IV_BPFUNCTION         = 'Z0000010'

    IV_PARTNER2           = '0009000010'

*  IV_PARTNERGUID2       =

*  IV_STANDARD           = 'X'

    IV_TESTRUN            = ' '

    IV_X_SAVE             = 'X'

TABLES

    ET_RETURN             = IT_RETURN.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

EXPORTING

    WAIT          = 'X'.

LOOP AT IT_RETURN INTO WA_RETURN.

   WRITE:/ WA_RETURN-TYPE,

           WA_RETURN-MESSAGE,

           WA_RETURN-MESSAGE_V1.

   ENDLOOP.

Answers (0)