05-21-2007 3:15 PM
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
05-22-2007 2:01 AM
set bapicond-itm_number to '000000' and try .
(Note : use conditions which are allowed at header level, like Freight ..etc)
Regards,
Siva
06-20-2007 5:06 PM
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.
06-21-2007 6:25 AM
06-21-2007 6:33 AM
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
06-21-2007 9:02 AM
We just want to simulate header & items pricing conditions with BAPI_SALESORDER_SIMULATE