cancel
Showing results for 
Search instead for 
Did you mean: 

Creating a document with partners: partner not added when creating from ERP (RFC call)

Former Member
0 Kudos

Hello,

can anyone please help me with this problem:
In CRM system i have a function module that creates a document and attaches partners to it. When running this FM on CRM, the document and the partners are created correctly. But when i call this FM from ERP system (RFC call) with exactly the same parameters, a certain partner is not added to the document. The FM is not system dependent, it should work identically on both systems.

For creating a document im using a standard SAP FM CRM_ORDER_MAINTAIN:

CALL FUNCTION 'CRM_ORDER_MAINTAIN'
       EXPORTING
         IT_PARTNER        = lt_partner_com
         IT_PRODUCT_I      = lt_product
         IT_SCHEDLIN_I     = lt_schedlin_i
         IT_ACTIVE_SWITCH  = lt_active_switch
       IMPORTING
         ET_EXCEPTION      = lt_exception
       CHANGING
         CT_ORDERADM_H     = lt_orderadm_h_com
         CT_ORDERADM_I     = lt_orderadm_i_com
         CT_INPUT_FIELDS   = lt_input_fields2
       EXCEPTIONS
         ERROR_OCCURRED    = 1
         DOCUMENT_LOCKED   = 2
         NO_CHANGE_ALLOWED = 3
         NO_AUTHORITY      = 4
         OTHERS            = 5.

By debugging i compared all the tables and values on both systems and they are all identical.

Tell me please, why the FM is not working correctly (certain partner is not added) when the FM is run from ERP ? What should i do ?

Thank you!

Accepted Solutions (1)

Accepted Solutions (1)

former_member182421
Active Contributor
0 Kudos

In which process from CRM are you using your FM (custom Report, BADI, etc) ? Did you check the RFC user authorizations?

Cheers!

Luis

Former Member
0 Kudos

Hi Luis, thanks for the reply.

Im running the CRM FM like this:

- CRM ... directly (SE37)

- ERP ... i made a new FM that does a RFC call of my CRM FM. This ERP FM is also ran directly (SE37)

I dont think the RFC authorizations are the problem:

- Values in the internal tables before caling CRM_ORDER_MAINTAIN are the same on both systems

- Only one partner with a certain partner function is not created

BGarcia
Active Contributor
0 Kudos

Hi Zoran,

Is the user the same when you execute it with SE37 and from ERP through RFC?

If not, can you make sure is the same just for testing purposes? When you create a document some partner determination might occur that might explain the problem you're facing on.

Kind regards,

Bruno

former_member182421
Active Contributor
0 Kudos

That's a very good point, maybe the PDP takes the source of document as part of the determination (?) I also would check that.

Former Member
0 Kudos

Hi Bruno, thanks for the reply.

Yes, the partner with the problematic partner function is the same (same partner number). As a matter of fact its an employee. Could it be that HRM data on ERP is not the same as on CRM and that is causing the problems ? All the data is determined on the CRM side, nothing is done in ERP (only the RFC call). Could it be that SAP has some additional checks that the bussiness partner has to be determined on both systems ?

BGarcia
Active Contributor
0 Kudos

Hi Zoran,

Can you try to check instead the user id (maintained in SU01) that is being used to create the document?

Example: Can you go to ERP side and check which user is being used to call CRM in your RFC connection (transaction SM59)? If this is not the same user that you use to login in CRM to execute the function module call, it can explain the problems you're facing (two different users creating a document may have different results in partner determination).

Kind regards,

Bruno

Former Member
0 Kudos

I checked it:

ERP:

- Before RFC call: user = X

- RFC call: user = Y

- After RFC call: user = X

CRM:

User = X

So this is the difference. When CRM_ORDER_MAINTAIN gets called (inside CRM FM) the users are different. Is this the authorization problem for user Y ? But that would mean that user Y can create partners with only certain partner functions. Is that even possible ?

BGarcia
Active Contributor
0 Kudos

Hi Zoran,

In my perspective yes, It can be authorization or it can be also business transaction corresponding partner profile, where you define the rules for each partner function determination (you might have some rules that are user-dependent).

But maybe you can change your RFC connection call user from 'Y' to 'X' just to make sure that this is the problem, so you can proceed further afterwards, what do you think?

Kind regards,

Bruno

Former Member
0 Kudos

While debugging i changed the user to X inside of a RFC call and the missing partner got correctly determined.

Thank you Luis and Bruno! I tried giving "Correct answer" to both of you, but its not allowed. Luis, since you were the first to mention RFC user authorization i awarded you with the "Correct answer". Bruno, i hope no hard feelings!

Thanks again.

Regards, Zoran

BGarcia
Active Contributor
0 Kudos

Hi Zoran,

Of course not (I totally agree with you) and you didn't had to justify, but thanks for your concern

Just glad that we were able to help you solve your issue, I believe helping (or trying to help) on SDN it's also a good exercise for us (hope that Luis doesn't mind that I'm writing 'us')!

Take care!

Kind regards,

Bruno

former_member182421
Active Contributor
0 Kudos

Well, to be fair, I don't think It's a problem regarding the authorization, I believe the problem is in your Org, Structure, probably your RFC user is not or correctly assigned  and that's why PDP fails.

To ensure If the problem was regarding in the Authorizations, I would try to change the RFC user to On line user, Log on into CRM and execute the FM, once is executed I would check the SU53, but as I said probably is not an authorization issue, so I believe Bruno's answer is more accurate.

Answers (0)