2013 Jan 07 1:38 PM
Hello experts,
we implemented a report where we create business partner relationships. Each credit manager (business partner; not many) takes care of a lot of customers (business partners; many).
For the creation of the relationship, we used the function as you can see here:
CALL FUNCTION 'BAPI_BUPR_RELATIONSHIP_CREATE'
EXPORTING
businesspartner1 = wa_but050-partner1
businesspartner2 = wa_but050-partner2
relationshipcategory = wa_but050-relationship
validfromdate = wa_but050-date_from
validuntildate = wa_but050-date_to
differentiationtypevalue = wa_but050-difftype
EXCEPTIONS
error_message = 1
OTHERS = 2.
After 500 creations we commit with the following function, because if the report aborts, we already have some data saved:
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXCEPTIONS
error_message = 1
OTHERS = 2.
As we run the report for the first time it took about 10 days(!) for about 230.000 relationships. I don't know the exact time, but it was very slow. We also think that the more relationships are created the longer it takes to create new one's.
So:
Is there another way to create the relationships or is there a way to improve the report, because we will have to create more relationships in the future.
I am quite sure, that the performance problems come from the function 'BAPI_BUPR_RELATIONSHIP_CREATE'.
We already tried a simply UPDATE but while testing we had problems with the deletion of the relationships (We also aren't sure, how SAP generates the relationshipnumber ...).
Thanks in advance for your help.
Hello experts,
we implemented a report where we create business partner relationships. Each credit manager (business partner; not many) takes care of a lot of customers (business partners; many).
For the creation of the relationship, we used the function as you can see here:
CALL FUNCTION 'BAPI_BUPR_RELATIONSHIP_CREATE'
EXPORTING
businesspartner1 = wa_but050-partner1
businesspartner2 = wa_but050-partner2
relationshipcategory = wa_but050-relationship
validfromdate = wa_but050-date_from
validuntildate = wa_but050-date_to
differentiationtypevalue = wa_but050-difftype
EXCEPTIONS
error_message = 1
OTHERS = 2.
After 500 creations we commit with the following function, because if the report aborts, we already have some data saved:
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXCEPTIONS
error_message = 1
OTHERS = 2.
As we run the report for the first time it took about 10 days(!) for about 230.000 relationships. I don't know the exact time, but it was very slow. We also think that the more relationships are created the longer it takes to create new one's.
So:
Is there another way to create the relationships or is there a way to improve the report, because we will have to create more relationships in the future.
I am quite sure, that the performance problems come from the function 'BAPI_BUPR_RELATIONSHIP_CREATE'.
We already tried a simply UPDATE but while testing we had problems with the deletion of the relationships (We also aren't sure, how SAP generates the relationshipnumber ...).
Thanks in advance for your help.
2013 Jan 07 1:42 PM
Hi,
did you try to put a SQL trace (ST05) for a low quantity of lines ? (sometimes performance issues occurs with table set to buffer)
Regards
Fred
2013 Jan 09 12:37 PM
Thank you for your Answer, Frédéric. I've checked whether the buffer is set to table but050 and it isn't:
So do you still suggest to put a SQL trace?
2013 Jan 10 9:49 AM
yes you will have the information of which table made that.
ST05 --> Trace ON
launch your program
ST05 --> Trace Off
ST05 --> Trace list
in the menu --> summarize
and check the top time
Fred
2013 Jan 10 12:38 PM
You could try some parallelism (if not too much lock problem)
For performance analysis, use as already written ST05 SQL trace, also use SAT/SE30 to determine if performance comes from database or abap coding or lock waits or memory consumption, also check SM13 during execution, the update processes may be saturated, or SM21 for system warnings during execution. Did you look for OSS notes ?
Regards,
Raymond
2013 May 03 7:22 AM
Thank you for your answers.
Meanwhile I was in contact with SAP.
The result was that this function module is the only one to create such relationships and the optimization for mass udpate of that FM is not possible, because it's the "heart" for creating relationships ...