Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

BOPF model for SAP business partner

ceedee666
SAP Champion
SAP Champion
0 Kudos
1,566

Hi all,

I started playing with the BOPF again. The reason is that we are about to develop a set of custom APIs to cread, update and read some common SAP business object like business partner or contract account. The goal is to have in SAP IS-U some standardized APIs similar to the BOL/GenIL in SAP CRM for common business objects. So I thought this sounds like a good use case to apply BOPF.

Has anyone any experiences using the BOPF to read, create and update business partners? So far I had a look at the /BOBF/CONF_UI and it seems that the provided object model for business partner is only a stub (e.g. I can't create BPs using the test UI, some important data like bank data is missing). How difficult would it be to create a more complete BOPF model of the SAP business partner? Is it worth the effort?

Best,

Christian

1 ACCEPTED SOLUTION

cyclingfisch_
SAP Mentor
SAP Mentor
0 Kudos
798

Hi Christian,

I'm really not the expert for Business Partners and we do not use the BPs in our project, but anyway, I try to answer your question. I assume you had a look on the shipped model /BOFU/BUSINESSPARTNER. I just had a look on it and agree with you, it seems as that it has only limited functionality. As it was created in 2009 I assume it's not intended to be used by customers (BOPF was not generaly available at that time).

Furthermore, I'm a bit confused because of the "ID Mapping Class" which is displayed on the Conf UI for the root-node. I have never seen this field on the Conf UI so far. I guess it's the class which does the mapping between the BP database structures and the structures which are used to handle the BP within BOPF (the GUIDs for the key, root key and parent key must be added).

To be able to use BOPF with standard tables which do not have these fields, you can create a mapping database table where you map the existing keys for the standard table with GUIDs. wrote a blog post on that last year:

So to answer your question your raised on Twitter: yes, it's possible and not too complicated but I would not reuse the existing /BOFU/BUSINESSPARTNER.

Cheers Martin

6 REPLIES 6

cyclingfisch_
SAP Mentor
SAP Mentor
0 Kudos
799

Hi Christian,

I'm really not the expert for Business Partners and we do not use the BPs in our project, but anyway, I try to answer your question. I assume you had a look on the shipped model /BOFU/BUSINESSPARTNER. I just had a look on it and agree with you, it seems as that it has only limited functionality. As it was created in 2009 I assume it's not intended to be used by customers (BOPF was not generaly available at that time).

Furthermore, I'm a bit confused because of the "ID Mapping Class" which is displayed on the Conf UI for the root-node. I have never seen this field on the Conf UI so far. I guess it's the class which does the mapping between the BP database structures and the structures which are used to handle the BP within BOPF (the GUIDs for the key, root key and parent key must be added).

To be able to use BOPF with standard tables which do not have these fields, you can create a mapping database table where you map the existing keys for the standard table with GUIDs. wrote a blog post on that last year:

So to answer your question your raised on Twitter: yes, it's possible and not too complicated but I would not reuse the existing /BOFU/BUSINESSPARTNER.

Cheers Martin

0 Kudos
798

Hi Martin,

thanks for the response. Unfortunately it is the answer I suspected.

The problem I have, which I currently can't get my head around, is how to integrate the existing BP APIs (e.g. BAPI_BUPA_* FuBas) into the BOPF. What I don't want to do is to create a model on the business partner DB level. That would mean that I'd have to reimplement all the consistency checks already implemented by SAP. Coseqeuntly, this doesn't seem to be a reasonable approach.

Perhaps I simply need to try to create a BOPF model for some part of the BP myself. Currently I'd expect running into trouble when trying to integrate the BOPF transaction model with the existing function modules. However, somehow SAP manage to integrate the BP into BOL/GenIL as well. So technically it should be possible. Have you ever tried to implement a BOPF model based on an existing (function module based) API?

In summary, its a pity that there are no default model for at least some of the basic SAP business objects.

Christian

0 Kudos
798

Hi Christian,

I agree with you, I would also not recommend to implement the validations done by the SAP function modules on my own neither I would go for a reimplementation on DB level. For reading the data, I think it is possible to implement that.

But for creating and updating the data I see some problems:

  • in BOPF you should separate the validations (implement a validation for that) of the data and the acutal change of the data
  • if the change function modules trigger a commit this would end your BOPF transaction and I would expect that would cause a dump in the framework
  • You would need to call the change function modules within the data access class. To be honest, I never looked into how that could be implemented

Cheers,

Martin

0 Kudos
798

Hi,

Are you looking only for APIs released to customers? There are of course IS-U BAPIs for BP and CA, but I feel that one would quickly run in to "update model" (perform on commit) limitations when trying to use them. Examples: create a BP and a CA in one LUW. Add a bank account to BP, add a SEPA mandate and assign them to CA in one LUW. Set up SEPA direct debit for a CA in one LUW, in other words. To my knowledge, that is impossible using BAPIs...

If "all or nothing" is not possible at DB level, application needs a mechanism that guarantees execution of "distributed transaction" in right order (maybe tRFC?), or a "process container", where to keep the state, and the process restart and "rollback" capabilities. And in the end one also needs "Utility Check Cockpit" to look over those failed transactions - definitely not an example of "running simple" . Whereas IS-U internal APIs (and SEPA Mandate internal API) would permit to do those things in one LUW, I believe.

cheers

Jānis

0 Kudos
798

Hi Christian,

As Martin wrote the business partner wrapper BO exists, but this is only a read-only encapsulation of the BuPa model. Therefore, you cannot create a new instance in the test-ui.

In addition to what Martin said, when it come to high volume processing, I'm a bit reluctant to consume the change function modules in the data access class (only): It's likely that the changed data shall be available transactionally for non-bopf-consumers as well. At  the same time, it would be good not to buffer redundantly during the transaction. This means that - if the function modules allow - an own buffer class might be reasonable. But this is a hell of a contract which needs to be fulfilled.

So what to do if you want to read/write business partners? If you control the consumers (if you can make all consumers access your business object instead of expecting the updated data in the BuPa buffer), I'd really go for an own redundant implementation: You could reduce the model to your needs and update the BuPa in a determination on finalize (most probably with a save-preventing validation which executes the save-consistency-checks). Of course, redundant data is bad, but unless SAP comes up with an own BOPF model of the BuPa (still hoping for some simplification as side-effect of S/4), I guess the effort of encapsulating the complete BuPa read/write is way too expensive.

Cheers,

Oliver

ceedee666
SAP Champion
SAP Champion
0 Kudos
798

Hi all,

thanks for the input.

I've been thinking a little bit about the whole topic. As you all pointed out creating a BOPF model for the complete BP functionality might be quite an effort. So I decided to take a step back and not start with the business partner.

As the business partner actually is a collection of business objects (partner data, address data, bank data, SEPA mandate) it poses numerous difficulties like the one Janis pointed out. Instead I'll start to create BOPF model for simpler business objects (e.g. the contract account or the IS-U contract) and check is the BOPF model is useful for what we are trying to achieve. If the results are positive I hopefully have learned enough about BOPF to decide how to implement the reauierd BP functionality effectively.

Christian