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: 
Read only

Problems with running BAPI BAPI_SALESORDER_CREATEFROMDAT2

Former Member
0 Likes
944

Hi all,

I’ve got a problem running BAPIs in SD invironment.

I’m creating contract releases in SD via BAPI.

First I run BAPI BAPISORDER_GETDETAILEDLIST in my program to get detaildata of the contract.

Then I run the BAPI   BAPI_SALESORDER_CREATEFROMDAT2 filled with contract reference data and in addition with order data to create the contract release.This works properly so far. On both sides in the contract and in he contract release I find the correct document flow. Means: in document flow of the contract I find all the releases created . Also I find the contract in the documentflow of the releases.

But…something does not work: In the contract the released values are not updated. When I create a release manually, the release values are accumulated  in the contract in field  ‘value released’ under flag ‘item detail’. But this does not work, when the leases are created via BAPI. However I checked several parameters in the BAPIS but I cannot find something that leads to an update .

Can somebody help me and can tell me what is to be done to get this field updated? Thanks in advance.

same in German...

Ich habe ein Problem mit BAPIs im SD.

Ich erzeuge Abrufe zum Kontrakt im SD mittels BAPIs.

Zuerst lasse ich den BAPI BAPISORDER_GETDETAILEDLIST laufen, um mittels Kontraktnummer alle Daten zum Kontrakt zu bekommen. Dann lasse ich den BAPI   BAPI_SALESORDER_CREATEFROMDAT2 gefüllt mit SD-Abrufdaten und den Referenzdaten des Kontraktes laufen Dies funktioniert soweit sehr gut. Sowohl im Kontrakt als auch im Abruf sind jeweils die übergeordneten bzw. untergeordneten Vertiebsbelege zu sehen. Die Referenz wird also hergestellt. Jedoch wird im Kontrakt nicht die Abrufwerte aufsummiert. Normalerweise wird bei manueller Erstellung der Abrufe im Kontrakt die jeweilgen abgerufenen Werte gegen den Kontraktwert aufsummiert (Feld abgerufene Werte im Kontrakt unter Reiter ‚Positionsdetail‘. Ich habe alle möglichen Parameter im BAPI geprüft und getestet aber nichts gefunden, was mir die abgerufenen Werten aufsummiert.

Kann mir dazu einen Tip geben, was ich tun kann, damit auch die Werte richtig referenzieren ? Danke im Voraus.

3 REPLIES 3
Read only

Former Member
0 Likes
690

Hi,

maybe you got the wrong BAPIs for contracts.

Please have a look at BAPI list BAPI*CONTRACT* and BAPI BAPI_SALES_DEL_SCHEDULE_CREATE.

Regards,

Klaus

Read only

0 Likes
690

the usage of exactly this BAPIs in the way I described  is in according to SAP note 370988.

BAPI_SALES_DEL_SCHEDULE_CREATE ist for SD schedule agreements and not for SD contracts and does not offer Input parameters for e.g.  adding price conditions what is needed for my task.

The field in contract I mentioned e.g. in Transaction VA42 VA43 is filled / gets its Information out of Infostructure/table S135. The BAPI seems not be able to fill this structure while creating the contract release.

I'm looking for example an input parameter I did not found already or any other option that leads to an update of infostructure S135 while creating/posting a release via BAPI.

Read only

Former Member
0 Likes
690

Did you check the fields: "w_items_in-val_contr" and "w_items_in-val_con_i" and also the corresponding fields: "w_items_inx-val_contr" and "w_items_inx-val_con_i" in the form: "SET_ITEMS" of the bapi?

Normally these fields are neccessary for the contract.

Bets regards,

Julian