Quantcast
Channel: SCN : Discussion List - SAP for Mobile
Viewing all articles
Browse latest Browse all 5806

SUP BAPI - Create Operation Return Value

$
0
0

Hi there,

 

currently I'm facing some issues with SUP 2.1.0 in a native iPad Application.

 

Long story short:

- one A has many B's

- create object A locally

- A has no primary key

- create object B locally

- since A has no primary key, B can't have this as a foreign key

- submit pending changes

- A gets a primary key

- B doesn't get his foreign key value, because the "create" of B is called at a time where A didn't have a primary key value

 

This is the Szenario:

 

I have two MBOs based on two search BAPIs. The MBOs have create operations based on create BAPIs

BAPI_SEARCH_BUSINESSPARTNER

In

- City

 

Out

- *BP Number

- Name 1

- Name 2

- etc.

 

BAPI_CREATE_BUSINESSPARTNER

In

- Name 1

- Name 2

- etc.

 

and

BAPI_SEARCH_OPPORTUNITIES

In

- BP Number

 

Out

- *Op Number

- Description

- Start Date

- etc.

 

BAPI_CREATE_OPPORTUNITIY

In

- BP Number

- Description

- Start Date

- etc.

 

For the Input Parameter of the BAPI_SEARCH_BUSINESSPARTNER I created a Personalization Key. So the Application gets Data based on the given City. Between MBO_BP and MBO_OPP is a relationship (one-to-many). The BP Number of MBO_BP is mapped to the Load Parameter (BP Number) of MBO_OPP.

 

Reading data is working good. I can access the relevant business partners and their opportunities.

 

I also want to create data. Therefore, I have create Operations in MBO_BP and MBO_OPP which are bound to create BAPIs. This is also working.

 

Here is the problem:

 

If I'm offline with the iPad and create a business partner, a local entitiy is created. This entitiy doesn't have a BP_Number because BP_Number is generated in the SAP backend system. Now I want to add an opportunity to this business partner. In the iPad Application I instantiate a new Opportunity, set the reference to the business partner and call create.

 

[newOpp setBusinessPartner:[self bp]]

[newOpp create]

 

this creates the local entity. Locally, the data is fine: A business partner is created which has the new opportunity.

 

When the application goes online again, the new local data will be submitted to the server. The problem: since the local bp_number of the new business partner is empty (because it's generated by SAP), a empty value will be passed for the create operation of the opportunity.

 

So the BAPI_CREATE_OPPORTUNITY will be called without the BP Number.

 

I added a Diagram of my Project (I hope it's not extremely confusing). Maybe you can see an error in my modeling.

 

Thanks,

 

Christian Hoff


Viewing all articles
Browse latest Browse all 5806

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>