Application Development 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: 

Sales Order Simulation

Former Member
0 Kudos

Hi.

I am simulating a sales order using the function BAPI_SALESORDER_SIMULATE. This is working fine, but i don't have access to sales order header conditions, i only have access to item conditions. Is this normal? How can i have access to sales order header conditions when simulating a sales order?

Thanks

5 REPLIES 5

Former Member
0 Kudos

set bapicond-itm_number to '000000' and try .

(Note : use conditions which are allowed at header level, like Freight ..etc)

Regards,

Siva

0 Kudos

I'm sorry Siva, but the BAPI_SALESORDER_SIMULATE doesn't have a table for condition entries but only a table for Condition output so where do you entry your header conditions ?

The BAPI_SALESORDER_CREATEFROMDAT2 in TESTRUN mode can simulate and has a table ORDER_CONDITIONS_IN where you can put itm_number to '000000' for header conditions. But I need to use BAPI_SALESORDER_SIMULATE.

Pati, Do you have found your answer ?

And do you have succeed to entry several conditions on the same item ? If yes, how do you do ?

Thanks a lot.

0 Kudos

No... i didn't found the solution yet..

0 Kudos

Hi,

Here is a sample code to get the conditions in all its details. This one is for header conditions, but if you have them at item level, you need to do the same but give an item number instead of '000000' that I have in here.

DATA: comm_head_i LIKE komk,

comm_head_e LIKE komk,

i_skomv LIKE komv OCCURS 0 WITH HEADER LINE,

i_tkomv LIKE komv OCCURS 0 WITH HEADER LINE,

i_skomp LIKE komp OCCURS 0 WITH HEADER LINE,

i_skonh LIKE konh OCCURS 0 WITH HEADER LINE,

i_skonp LIKE konp OCCURS 0 WITH HEADER LINE,

i_skonm LIKE konm OCCURS 0 WITH HEADER LINE,

i_skonw LIKE konw OCCURS 0 WITH HEADER LINE.

CALL FUNCTION 'SD_SALES_PRICING_INFORMATION'

EXPORTING

  • I_POSNR = '000000'

i_read_doc = 'X'

i_vbeln = p_vbeln

IMPORTING

e_komk = comm_head_i

  • E_KOMP =

  • TABLES

  • FXKONV =

  • FTKOMV =

.

CALL FUNCTION 'PRICING_GET_CONDITIONS'

EXPORTING

comm_head_i = comm_head_i

read_conditions = 'X'

IMPORTING

comm_head_e = comm_head_e

TABLES

skomv = i_skomv

tkomv = i_tkomv

skomp = i_skomp

skonh = i_skonh

skonp = i_skonp

skonm = i_skonm

skonw = i_skonw.

<b>Reward points</b>

Regards

0 Kudos

We just want to simulate header & items pricing conditions with BAPI_SALESORDER_SIMULATE