Call BAPI_SALESORDER_SIMULATE
Hello
I am trying to use the BAPI_SALESORDER_SIMULATE get price and availabilty of a specified Item .
I'm trying to use the bapi from delphi is thsi syntaxe correct
order := ctrlBAPI.GetSAPObject('SalesOrder');
header := ctrlBAPI.DimAs(order, 'OrderSalesSimulate', 'OrderHeaderIn');
items := ctrlBAPI.DimAs(order, 'OrderSalesSimulate', 'OrderItemsIn');
partners := ctrlBAPI.DimAs(order, 'OrderSalesSimulate', 'OrderPartners');
ret := ctrlBAPI.DimAs(order, 'OrderSalesSimulate', 'Return');
and then how can I get the desired infos from ret?
Does anyone have any advice or experience of doing this ?
Regards
Could you check this problem in Webdynpro forum.
Similar Messages
-
Visual Basic code genration for calling BAPI_SALESORDER_SIMULATE
Hi gurus,
Someone asked me how to generate the visual basic code for calling BAPI_SALESORDER_SIMULATE via RFC. I thought this function was available in SE37 but I can't find it...
Can someone help me ?
Thank you
Jean-Michel** プログラムID       : ZBAPI_SALESORDER_CREATE *
** プログラム名称      : Upload Sales Order Creation *
** 処理概要         : *
** 作成者           : Karthik.P *
** 作成日           : 2006/08/10 *
REPORT ZBAPI_SALESORDER_CREATE LINE-SIZE 132 MESSAGE-ID ZMMBAPI .
Internal table definition *
****<<<<<Communication Fields: Sales and Distribution Document Header>>>>>>>>
DATA: GT_ORDER_HEADER_IN LIKE BAPISDHD1,
*******<<<Checkbox Fields for Sales and Distribution Document Header>>>>>>>>>
GT_ORDER_HEADER_INX LIKE BAPISDHD1X,
*****<<<<<Return Parameter>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
GT_RETURN LIKE BAPIRET2 OCCURS 0 WITH HEADER LINE, " Return Messages
*********<<<Communication Fields: Sales and Distribution Document Item<>>>>>
GT_ORDER_ITEMS_IN LIKE BAPISDITM OCCURS 0 WITH HEADER LINE, " Item Data
*********<<<Communication Fields: Sales and Distribution Document Item>>>>>>>
GT_ORDER_ITEMS_INX LIKE BAPISDITMX OCCURS 0 WITH HEADER LINE, "Item Data Checkbox
*********<<<Communication Fields: Sales and Distribution Document Item>>>>>>>
GT_SALESDOCUMENT LIKE BAPIVBELN-VBELN , "Number of Generated Document
*********<<<Communications Fields: SD Document Partner: WWW>>>>>>>>>>>>>>>>>>
GT_ORDER_PARTNERS LIKE BAPIPARNR OCCURS 0 WITH HEADER LINE, "Document Partner
********<<<<Communications Fields: SD Document Partner: WWW>>>>>>>>>>>>>>>>>>
GT_ORDER_SCHEDULES_IN LIKE BAPISCHDL OCCURS 0 WITH HEADER LINE, "Schedule Line Data
****<<<<<<<<Checkbox List for Maintaining Sales Document Schedule Line>>>>>>>>
GT_ORDER_SCHEDULES_INX LIKE BAPISCHDLX OCCURS 0 WITH HEADER LINE, " Checkbox Schedule Line Data
*******Communication Fields for Maintaining Conditions in the Order
GT_ORDER_CONDITIONS_IN LIKE BAPICOND OCCURS 0 WITH HEADER LINE,
******Communication Fields for Maintaining Conditions in the Order
GT_ORDER_CONDITIONS_INX LIKE BAPICONDX OCCURS 0 WITH HEADER LINE.
Data definition *
DATA: BEGIN OF GT_FT_SALES OCCURS 0,
DOC_TYPE(4) , "Sales Document Type
SALES_ORG(4) , "Sales Organization
DISTR_CHAN(2) , "Distribution Channel
DIVISION(2) , "DIVISION(2)
SALES_DIST(6) , "Sales district
INCOTERMS1(3) , "Incoterms (part 1)
INCOTERMS2(28) , "Incoterms (part 2)
PMNTTRMS(4) , "Terms of payment key
PRICE_DATE(8) , "Date for pricing and exchange rate
PURCH_NO_C(35) , "Customer purchase order number
PURCH_NO_S(35) , "Ship-to Party's Purchase Order Number
EXCHG_RATE(8) , "Directly quoted exchange rate for pricing and statistics
CURRENCY(5) , "SD document currency
MATERIAL(18), "MATERIAL
TARGET_QTY(13) , "Target quantity in sales units
ITEM_CATEG(4) , "Sales document item category
MATL_GROUP(8) , "Material Group
PURCH_NO_C1(35), "Customer purchase order number
SALES_DIST1(6) , "Sales district
INCOTERMS11(3) , "Incoterms (part 1)
INCOTERMS21(28), "Incoterms (part 2)
PMNTTRMS1(4) , "Terms of payment key
EXCHG_RATE1(8) , "Directly quoted exchange rate for pricing and statistics
PRICE_DATE1(8) , "Date for pricing and exchange rate
TRG_QTY_NO(5) , "Factor for converting sales units to base units (target qty)
DIVISION1(2) , "DIVISION1
SALQTYNUM(5) , "Numerator (factor) for conversion of sales quantity into SKU
GROSS_WGHT(3) , "Gross Weight of the Item
NET_WEIGHT(15) , "Net Weight of the Item
UNTOF_WGHT(3) ,"Weight Unit
PARTN_ROLE(2) ,"Partner function
PARTN_NUMB(10) ,"Customer Number 1
********<<<<Communications Fields: SD Document Partner: WWW>>>>>>>>>>>>>>>>>>
ITM_NUMBER(6) ,"Item number of the SD document
REQ_QTY(8) , "Schedule line date
DLV_DATE(8) , "Schedule line date
MS_DATE(8) , "Material availability date
LOAD_DATE(8) , "Loading time (local time with reference to a shipping point)
GI_DATE(8), "Time of goods issue (local DATE, with reference to a plant)
TP_DATE(8) , "Transportation planning -time (local w/ref. to shipping pnt)
ITM_NUMBER2(6) , "Condition item number
END OF GT_FT_SALES,
MSG(240) TYPE C, " Return Message
E_REC(8) TYPE C, " Error Records Counter
REC_NO(8) TYPE C, " Records Number Indicator
S_REC(8) TYPE C, " Successful Records Counter
T_REC(8) TYPE C. " Total Records Counter
selection block for EXCEL UPLOAD FILE>>>>>>>>>>>>>>>>>>>>>>>>
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-000.
PARAMETERS FILE TYPE IBIPPARMS-PATH OBLIGATORY.
SELECTION-SCREEN END OF BLOCK B1.
*<<<<AT SELECTION-SCREEN ON VALUE-REQUEST FOR FILE .>>>>>>>>>>>>
AT SELECTION-SCREEN ON VALUE-REQUEST FOR FILE .
CALL FUNCTION 'F4_FILENAME'
EXPORTING
PROGRAM_NAME = SYST-CPROG
DYNPRO_NUMBER = SYST-DYNNR
IMPORTING
FILE_NAME = FILE.
**<<<<<<<<<<<<<<<<<START-OF-SELECTION.>>>>>>>>>>>>>>>>>>>>>>>>>>>
START-OF-SELECTION.
CALL FUNCTION 'WS_UPLOAD' "#EC *
EXPORTING
FILENAME = FILE
FILETYPE = 'DAT'
TABLES
DATA_TAB = GT_FT_SALES
EXCEPTIONS
CONVERSION_ERROR = 1
FILE_OPEN_ERROR = 2
FILE_READ_ERROR = 3
INVALID_TYPE = 4
NO_BATCH = 5
UNKNOWN_ERROR = 6
INVALID_TABLE_WIDTH = 7
GUI_REFUSE_FILETRANSFER = 8
CUSTOMER_ERROR = 9
NO_AUTHORITY = 10
OTHERS = 11.
IF SY-SUBRC <> 0 .
MESSAGE E000.
ENDIF.
SKIP 3.
FORMAT COLOR COL_HEADING INVERSE ON.
WRITE 40 TEXT-001.
FORMAT COLOR COL_HEADING INVERSE OFF.
SKIP 1.
FORMAT COLOR COL_NEGATIVE INVERSE ON.
WRITE :/ TEXT-002, 13 SY-MANDT , 104 TEXT-003, 111 SY-UNAME,
/ TEXT-004, 13 SY-DATUM , 104 TEXT-005, 111 SY-UZEIT.
FORMAT COLOR COL_NEGATIVE INVERSE OFF.
SKIP 3.
LOOP AT GT_FT_SALES.
PERFORM SLALE_UPLOAD_DATA.
ENDLOOP.
T_REC = E_REC + S_REC.
SKIP 3.
FORMAT COLOR COL_TOTAL INVERSE ON.
WRITE: /38 TEXT-007, T_REC.
FORMAT COLOR COL_TOTAL INVERSE OFF.
FORMAT COLOR COL_NEGATIVE INVERSE ON.
WRITE: /38 TEXT-008, E_REC.
FORMAT COLOR COL_NEGATIVE INVERSE OFF.
FORMAT COLOR COL_TOTAL INVERSE ON.
WRITE: /38 TEXT-009, S_REC.
FORMAT COLOR COL_TOTAL INVERSE OFF.
*& Form SLALE_UPLOAD_DATA
text
--> p1 text
<-- p2 text
FORM SLALE_UPLOAD_DATA .
*******<<<<<<<<<<Communication Fields: Sales and Distribution Document Header>>>>>>
GT_ORDER_HEADER_IN-DOC_TYPE = 'TA'.
GT_ORDER_HEADER_IN-SALES_ORG = GT_FT_SALES-SALES_ORG . "'0001'
GT_ORDER_HEADER_IN-DISTR_CHAN = GT_FT_SALES-DISTR_CHAN. "'01'
GT_ORDER_HEADER_IN-DIVISION = GT_FT_SALES-DIVISION. " '01'
GT_ORDER_HEADER_IN-SALES_DIST = GT_FT_SALES-SALES_DIST ."'000001'
GT_ORDER_HEADER_IN-INCOTERMS1 = GT_FT_SALES-INCOTERMS1. "'CFR'
GT_ORDER_HEADER_IN-INCOTERMS2 = GT_FT_SALES-INCOTERMS2 . "'HAMBURG'
GT_ORDER_HEADER_IN-PMNTTRMS = GT_FT_SALES-PMNTTRMS . "'0001'
GT_ORDER_HEADER_IN-PRICE_DATE = GT_FT_SALES-PRICE_DATE ."'20060818'
GT_ORDER_HEADER_IN-PURCH_NO_C = '32'.
GT_ORDER_HEADER_IN-PURCH_NO_S = '32'.
GT_ORDER_HEADER_IN-EXCHG_RATE = GT_FT_SALES-EXCHG_RATE ."'1.00000'
GT_ORDER_HEADER_IN-CURRENCY = GT_FT_SALES-CURRENCY . " 'EUR'
********<<<Checkbox Fields for Sales and Distribution Document Header>>>>>>>>>
GT_ORDER_HEADER_INX-DOC_TYPE = 'X'.
GT_ORDER_HEADER_INX-SALES_ORG = 'X'.
GT_ORDER_HEADER_INX-DISTR_CHAN = 'X'.
GT_ORDER_HEADER_INX-DIVISION = 'X'.
GT_ORDER_HEADER_INX-SALES_DIST = 'X'.
GT_ORDER_HEADER_INX-INCOTERMS1 = 'X'.
GT_ORDER_HEADER_INX-INCOTERMS2 = 'X'.
GT_ORDER_HEADER_INX-PMNTTRMS = 'X'.
GT_ORDER_HEADER_INX-PRICE_DATE = 'X'.
GT_ORDER_HEADER_INX-PURCH_NO_C = 'X'.
GT_ORDER_HEADER_INX-PURCH_NO_S = 'X'.
GT_ORDER_HEADER_INX-EXCHG_RATE = 'X'.
GT_ORDER_HEADER_INX-CURRENCY = 'X'.
*****<<<<<<Communication Fields: Sales and Distribution Document Item>>>
GT_ORDER_ITEMS_IN-ITM_NUMBER = '000010'.
GT_ORDER_ITEMS_IN-MATERIAL = GT_FT_SALES-MATERIAL .
GT_ORDER_ITEMS_IN-PO_ITM_NO = '32'.
GT_ORDER_ITEMS_IN-CUST_MAT22 = 'AGNI-IV'.
GT_ORDER_ITEMS_IN-BILL_DATE = '20060808'.
GT_ORDER_ITEMS_IN-PLANT = '0001'.
*GT_ORDER_ITEMS_IN-STORE_LOC = '0001'.
GT_ORDER_ITEMS_IN-TARGET_QTY = GT_FT_SALES-TARGET_QTY . "'1000'
GT_ORDER_ITEMS_IN-ITEM_CATEG = GT_FT_SALES-ITEM_CATEG . "'TAN'
GT_ORDER_ITEMS_IN-MATL_GROUP = GT_FT_SALES-MATL_GROUP . "'01'
GT_ORDER_ITEMS_IN-PURCH_NO_C = GT_FT_SALES-PURCH_NO_C . "'32'
GT_ORDER_ITEMS_IN-SALES_DIST = GT_FT_SALES-SALES_DIST . "'000001'
GT_ORDER_ITEMS_IN-INCOTERMS1 = GT_FT_SALES-INCOTERMS1 . "'CFR'
GT_ORDER_ITEMS_IN-INCOTERMS2 = GT_FT_SALES-INCOTERMS2 . "'HAMBURG'
GT_ORDER_ITEMS_IN-PMNTTRMS = GT_FT_SALES-PMNTTRMS . "'0001'.
GT_ORDER_ITEMS_IN-EXCHG_RATE = GT_FT_SALES-EXCHG_RATE . "'1.00000'
GT_ORDER_ITEMS_IN-PRICE_DATE = GT_FT_SALES-PRICE_DATE . "'20060808'
*GT_ORDER_ITEMS_IN-SALES_UNIT = 'DZ'.
GT_ORDER_ITEMS_IN-TRG_QTY_NO = GT_FT_SALES-TRG_QTY_NO . "'23'
GT_ORDER_ITEMS_IN-DIVISION = GT_FT_SALES-DIVISION . "'01'
GT_ORDER_ITEMS_IN-SALQTYNUM = GT_FT_SALES-SALQTYNUM . "'32'
GT_ORDER_ITEMS_IN-GROSS_WGHT = GT_FT_SALES-GROSS_WGHT. " ' 25272000'
GT_ORDER_ITEMS_IN-NET_WEIGHT = GT_FT_SALES-NET_WEIGHT. "'24464000'
GT_ORDER_ITEMS_IN-UNTOF_WGHT = GT_FT_SALES-UNTOF_WGHT . " 'KG'
*GT_ORDER_ITEMS_IN-CURRENCY = 'EUR'.
APPEND GT_ORDER_ITEMS_IN.
****<<<<<<Communication Fields: Sales and Distribution Document Item>>>
GT_ORDER_ITEMS_INX-ITM_NUMBER = '000010'.
GT_ORDER_ITEMS_INX-MATERIAL = 'X'.
*GT_ORDER_ITEMS_INX-PO_ITM_NO = 'X'.
GT_ORDER_ITEMS_INX-CUST_MAT22 = 'X'.
GT_ORDER_ITEMS_INX-BILL_DATE = 'X'.
GT_ORDER_ITEMS_INX-PLANT = 'X'.
*GT_ORDER_ITEMS_INX-STORE_LOC = 'X'.
GT_ORDER_ITEMS_INX-TARGET_QTY = 'X'.
GT_ORDER_ITEMS_INX-ITEM_CATEG = 'X'.
GT_ORDER_ITEMS_INX-MATL_GROUP = 'X'.
GT_ORDER_ITEMS_INX-PURCH_NO_C = 'X'.
GT_ORDER_ITEMS_INX-SALES_DIST = 'X'.
GT_ORDER_ITEMS_INX-INCOTERMS1 = 'X'.
GT_ORDER_ITEMS_INX-INCOTERMS2 = 'X'.
GT_ORDER_ITEMS_INX-PMNTTRMS = 'X'.
GT_ORDER_ITEMS_INX-EXCHG_RATE = 'X'.
GT_ORDER_ITEMS_INX-PRICE_DATE = 'X'.
*GT_ORDER_ITEMS_INX-SALES_UNIT = 'X'.
GT_ORDER_ITEMS_INX-TRG_QTY_NO = 'X'.
GT_ORDER_ITEMS_INX-DIVISION = 'X'.
GT_ORDER_ITEMS_INX-SALQTYNUM = 'X'.
GT_ORDER_ITEMS_INX-GROSS_WGHT = 'X'.
GT_ORDER_ITEMS_INX-NET_WEIGHT = 'X'.
GT_ORDER_ITEMS_INX-UNTOF_WGHT = 'X'.
*GT_ORDER_ITEMS_IN-CURRENCY = 'x'.
APPEND GT_ORDER_ITEMS_INX.
*****<<<<<<Communications Fields: SD Document Partner: WWW
GT_ORDER_PARTNERS-PARTN_ROLE = 'WE'.
GT_ORDER_PARTNERS-PARTN_NUMB = '0000000057'.
***GT_ORDER_PARTNERS-ITM_NUMBER = GT_FT_SALES-ITM_NUMBER . " '000010'.
APPEND GT_ORDER_PARTNERS.
*********<<<<Communications Fields: SD Document Partner: WWW>>>>>>>>>>>>>>>>>>
GT_ORDER_SCHEDULES_IN-ITM_NUMBER = GT_FT_SALES-ITM_NUMBER." '000010'
GT_ORDER_SCHEDULES_IN-REQ_QTY = GT_FT_SALES-REQ_QTY . "'234'
GT_ORDER_SCHEDULES_IN-DLV_DATE = GT_FT_SALES-DLV_DATE ." '20060824'.
GT_ORDER_SCHEDULES_IN-MS_DATE = GT_FT_SALES-MS_DATE . "'20060808'
GT_ORDER_SCHEDULES_IN-LOAD_DATE = GT_FT_SALES-LOAD_DATE. " '20060822'
GT_ORDER_SCHEDULES_IN-GI_DATE = GT_FT_SALES-GI_DATE . " '20060823'
GT_ORDER_SCHEDULES_IN-TP_DATE = GT_FT_SALES-TP_DATE . "'20060821'
APPEND gt_ORDER_SCHEDULES_IN.
*********<<<<Communications Fields: SD Document Partner: WWW FLAG>>>>>>>>>>>>>>>>>>
GT_ORDER_SCHEDULES_INX-ITM_NUMBER = '000010'.
GT_ORDER_SCHEDULES_INX-REQ_QTY = 'X'.
GT_ORDER_SCHEDULES_INX-DLV_DATE = 'X'.
GT_ORDER_SCHEDULES_INX-MS_DATE = 'X'.
GT_ORDER_SCHEDULES_INX-LOAD_DATE = 'X'.
GT_ORDER_SCHEDULES_INX-GI_DATE = 'X'.
GT_ORDER_SCHEDULES_INX-DLV_DATE = 'X'.
APPEND gt_ORDER_SCHEDULES_INX.
********Communication Fields for Maintaining Conditions in the Order
GT_ORDER_CONDITIONS_IN-ITM_NUMBER = GT_FT_SALES-ITM_NUMBER ." '000010'
APPEND GT_ORDER_CONDITIONS_IN.
***Communication Fields for Maintaining Conditions in the Order
GT_ORDER_CONDITIONS_INX-ITM_NUMBER = '000010'.
APPEND GT_ORDER_CONDITIONS_INX.
CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'
EXPORTING
SALESDOCUMENTIN =
ORDER_HEADER_IN = GT_ORDER_HEADER_IN
ORDER_HEADER_INX = GT_ORDER_HEADER_INX
SENDER =
BINARY_RELATIONSHIPTYPE =
INT_NUMBER_ASSIGNMENT =
BEHAVE_WHEN_ERROR =
LOGIC_SWITCH =
TESTRUN =
CONVERT = ' '
IMPORTING
SALESDOCUMENT = GT_SALESDOCUMENT
TABLES
RETURN = GT_RETURN
ORDER_ITEMS_IN = GT_ORDER_ITEMS_IN
ORDER_ITEMS_INX = GT_ORDER_ITEMS_INX
ORDER_PARTNERS = GT_ORDER_PARTNERS
ORDER_SCHEDULES_IN = GT_ORDER_SCHEDULES_IN
ORDER_SCHEDULES_INX = GT_ORDER_SCHEDULES_INX
ORDER_CONDITIONS_IN = GT_ORDER_CONDITIONS_IN
ORDER_CONDITIONS_INX = GT_ORDER_CONDITIONS_INX
ORDER_CFGS_REF =
ORDER_CFGS_INST =
ORDER_CFGS_PART_OF =
ORDER_CFGS_VALUE =
ORDER_CFGS_BLOB =
ORDER_CFGS_VK =
ORDER_CFGS_REFINST =
ORDER_CCARD =
ORDER_TEXT =
ORDER_KEYS =
EXTENSIONIN =
PARTNERADDRESSES =
IF GT_RETURN-TYPE EQ 'E' .
E_REC = E_REC + 1.
READ TABLE GT_RETURN WITH KEY ID = 'V1'.
FORMAT COLOR COL_NEGATIVE INVERSE ON.
REC_NO = E_REC + S_REC.
CONCATENATE TEXT-006 REC_NO ':'
GT_RETURN-MESSAGE INTO MSG SEPARATED BY SPACE .
CONDENSE MSG.
WRITE: / MSG.
FORMAT COLOR COL_NEGATIVE INVERSE OFF.
ELSEIF GT_RETURN-TYPE EQ 'S'.
S_REC = S_REC + 1.
FORMAT COLOR COL_POSITIVE INVERSE ON.
MSG = GT_RETURN-MESSAGE.
CONDENSE MSG.
WRITE: / MSG .
FORMAT COLOR COL_POSITIVE INVERSE OFF.
PERFORM COMMIT_MM.
ENDIF.
CLEAR: GT_RETURN[], MSG.
ENDFORM. " SLALE_UPLOAD_DATA
*& Form COMMIT_MM
text
--> p1 text
<-- p2 text
FORM COMMIT_MM .
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
WAIT = 'X'
IMPORTING
RETURN = GT_RETURN.
clear: GT_ORDER_ITEMS_IN[],GT_ORDER_CONDITIONS_IN[].
ENDFORM. " COMMIT_MM -
Call BAPI_SALESORDER_SIMULATE from delphi to get ipricing and availability
Hello
I am trying to use the BAPI_SALESORDER_SIMULATE get price and availabilty of a specified Item .
I'm trying to use the bapi from delphi is thsi syntaxe correct
order := ctrlBAPI.GetSAPObject('SalesOrder');
header := ctrlBAPI.DimAs(order, 'OrderSalesSimulate', 'OrderHeaderIn');
items := ctrlBAPI.DimAs(order, 'OrderSalesSimulate', 'OrderItemsIn');
partners := ctrlBAPI.DimAs(order, 'OrderSalesSimulate', 'OrderPartners');
ret := ctrlBAPI.DimAs(order, 'OrderSalesSimulate', 'Return');
and then how can I get the desired infos from ret?
Does anyone have any advice or experience of doing this ?
RegardsHello Fatiha,
I am afraid, there is only a slim chance to find an expert on this matter here in the Web Dynpro ABAP forum. My suggestion to post this question to a forum more suitable.
Best regards,
Thomas -
How to use " BAPI_SALESORDER_SIMULATE "
hi,all
now have such requirement ,as below:
I need get price by call "BAPI_SALESORDER_SIMULATE".
But how to set the parameter " ORDER_ITEMS_IN ". i don't know where normal got "CUST_MAT" ,"REQ_QTY".
plz give me a hand, some sample is good for me
thanks in advance.
kevinHello Kevin,
take this one:
REPORT z_salesorder_simulate.
DATA: order_header_in LIKE bapisdhead,
order_items_in LIKE TABLE OF bapiitemin,
return LIKE bapireturn,
wa_order_items_in LIKE LINE OF order_items_in,
order_partners LIKE TABLE OF bapipartnr,
wa_order_partners LIKE LINE OF order_partners,
order_items_out LIKE TABLE OF bapiitemex,
wa_order_items_out LIKE LINE OF order_items_out.
* Fill order_header_in
order_header_in-doc_type = 'TA'.
* Fill order_items_in
wa_order_items_in-material = '000000000000000001'.
wa_order_items_in-req_qty = '1000'.
APPEND wa_order_items_in TO order_items_in.
* Fill order_items_in
wa_order_partners-partn_role = 'AG'.
wa_order_partners-partn_numb = '0000000001'.
APPEND wa_order_partners TO order_partners.
* Execute Function Module BAPI_SALESORDER_SIMULATE
CALL FUNCTION 'BAPI_SALESORDER_SIMULATE'
EXPORTING
order_header_in = order_header_in
IMPORTING
return = return
TABLES
order_items_in = order_items_in
order_partners = order_partners
order_items_out = order_items_out.
* The return structure gives any error messages
WRITE: return-message.
* Print out the order items
LOOP AT order_items_out INTO wa_order_items_out.
WRITE: wa_order_items_out-material,
wa_order_items_out-short_text,
wa_order_items_out-subtotal_2.
ENDLOOP.
Regards
Gregor -
Payment Terms in Simulate BAPI
Hello Experts
I'm new to SDN and I don't know if this is the correct place for my question. But please try to help me out.
We have a .Net application where we call BAPI_SALESORDER_SIMULATE and it does work great. It default the payment terms to configured values in case user does not send in payment term code which is great too. My only problem that the bapi does not return the payment term code used. I need to display the payment term code/description used, how could I acheive it? Your help will be very much appreciated!Hi,
as a suggestion, once the sales order is created (and thus knowing the sales order number) why don´t you try to read it with another bapi like BAPI_SALESORDER_GET.
in this way you could retrieve the payment term.
Best regards. -
Pricing Simulation based in a Manual Condition
Hello Dear Gurus,
I'm facing the following problem:
I need to simulate the net value of an Sales Order using ABAP code. But the net value is based in 2 manual conditions: FREIGHT and MANUAL PRICE.
I tried the FM BAPI_SALESORDER_SIMULATE. But in this case I'm not able to specify the manual conditions.
So I tried the FM PRICING_GET_CONDITIONS but it didn't return all the conditions.
Thank you in advance.
Fabio PurcinoHi,
how did you solve your problem?
I also need pricing with manual conditions. If I call SD_SALESDOCUMENT_CREATE with all the parameters I used to call BAPI_SALESORDER_SIMULATE I don't get a netprice / netvalue in the items return table.
header: doc_type, sales_org, distr_chan, division
logic_switch-pricing: 'B' or 'C'
partners: sold to and ship to party
item: itm_number, material, target_qty, target_qu, sales_unit
The only difference using the BAPI is that I hafe to fill different quantity fields.
What could be missing?
thanks,
Christian -
RFC Sales order create production order create
Hi all,
I use BAPI_SALESORDER_CREATEFROMDAT2 to create sales order with
- schedule lines
- configurable items.
Before, I call BAPI_SALESORDER_SIMULATE in order to anticipate material availability and fill scheduling accordingly.
The problem is that the system is configured so that a sales order creation causes a production order.
With manuel creation in VA01 (corresponding to my BAPI call), many popups appear warning us about capacity production problems and I'm prompted to validate calculated possible production dates.
In BAPI call mode, no messages appear and if production capacity is not sufficient for my production request, production order is created but with the MCAP status (Missing capacity)
Is a solution exist to anticipate these problems of production capacity before sales order creation to integrate it in BAPI schedule parameters ?
Thanks a lot.Hi,
It sounds like you may want to first call BAPI_SALESORDER_SIMULATE. The documentation for this BAPI (in 4.6C) states:
<i>"This method has the same interface definition as the BAPI_SALESORDER_CREATEFROMDAT1 function but differs from it in that here the sales order is not updated. Here you can determine availability and pricing. This data is displayed in the ORDER_ITEMS_OUT table.
For 46A, the following enhancements have been made:
New output tables:
ORDER_SCHEDULE_IN Schedule line data input
ORDER_CCARD_EX Credit card data output
ORDER_SCHEDULE_EX Schedule line data output
ORDER_CONDITION_EX Conditions output
MESSAGETABLE Warning table (XVBFS)
Sales area determination
Order entry with ship-to party
</i>
This may give you an idea of the errors you might need to anticipate prior to calling BAPI_SALESORDER_CREATEFROMDAT2.
Best Regards,
James Gaddis -
Sales order simulation bapi and material price group???
Hello every one...
I am calling BAPI_SALESORDER_SIMULATE to get the pricing simulation of a sales order, My requirement is that I want to enter Material Pricing group (KONDM) so that pricing be simulated according to the material pricing group I enter..... but the simulation bapi does not provide this field,,, I cannot use sales order create from data2 bapi,, as it does not provide condition table as output, which is also my core requirement,,, my question is that is there some bapi/fm where I can provide material pricing group along with other info and retrieve complete simulation of sales order pricing with condition details aswell....
thanksManaged it using abap memory and prepare hearder info user exit routine
-
URGENT - BAPI_SALESORDER_SIMULATE- FREE GOODS - ORDER_CONDITION_EX
Hi Gurus,
I am using standard Function module : BAPI_SALESORDER_SIMULATE to simulate pricing conditions.
I am trying to figure out the reason for the function module: BAPI_SALESORDER_SIMULATE not giving values in CONDITIONS EX when I use it to <b>simulate free goods</b> .
<b>It is only not giving ORDER_CONDITION_EX for free goods materials.</b>
BAPI simulates Bill of material, regular orders properly.
Example : one material has on free good .
Should give output in ORDER_CONDITION_EX
It is giving an output in ORDER_ITEMS_OUT - two materials line item 10 , 15 .
However in ORDER_CONDITION_EX it does not return anything , number of entries is zero .
What could be the reason. What is the correct input for the BAPI for it to give conditions in ORDER_CONDITION_EX for free goods.
I know my data for input are correct as I can make a sale order with the same data.
Please help me at the earliest to solve this problem.
<b>BAPIs reference : standard BAPI_SALESORDER_SIMULATE'</b>
CALL FUNCTION 'BAPI_SALESORDER_SIMULATE'
EXPORTING
ORDER_HEADER_IN = order_header_in
CONVERT_PARVW_AUART = ' '
DELAY = 0
IMPORTING
SALESDOCUMENT =
ORDER_HEADER_EX =
SOLD_TO_PARTY =
SHIP_TO_PARTY =
BILLING_PARTY =
RETURN =
ORDER_HEADER =
TABLES
ORDER_ITEMS_IN = order_items_in
ORDER_PARTNERS = order_partners
ORDER_SCHEDULE_IN = order_schedule_in
ORDER_CONDITIONS_IN =
ORDER_ITEMS_OUT =
ORDER_CFGS_REF =
ORDER_CFGS_INST =
ORDER_CFGS_PART_OF =
ORDER_CFGS_VALUE =
ORDER_CFGS_BLOB =
ORDER_CCARD =
ORDER_CCARD_EX =
ORDER_SCHEDULE_EX =
ORDER_CONDITION_EX = order_condition_ex
ORDER_INCOMPLETE =
MESSAGETABLE = messagetable
EXTENSIONIN =
PARTNERADDRESSES =
WMDVSX =
WMDVEX =
AVAIL_OUT =
ORDER_SCHEDULE_IN2 =
ORDER_SCHEDULE_EX2 =
ORDER_ITEMS_IN2 =
ORDER_PARTNERS2
Program being developed based on this BAPI
selection-screen begin of block b1 with frame title text-001.
parameters : p_kunnr like kna1-kunnr,
p_matnr like vbap-matnr,
p_vkorg like vbak-vkorg,
p_vtweg like vbak-vtweg,
p_spart like vbak-spart.
selection-screen end of block b1.
data: doctype like bapisdhead-doc_type value 'OR',
itemno like bapiitemin-itm_number value '000010',
quantity(13) type N value '0000000000001',
partnertype like knvp-parvw value 'AG'.
data :count type i.
data : begin of order_condition_ex occurs 0.
include structure bapicond.
data: end of order_condition_ex.
data: begin of order_header_in.
include structure bapisdhead.
data: end of order_header_in.
data: begin of order_items_in occurs 1.
include structure bapiitemin.
data: end of order_items_in.
data: begin of order_partners occurs 1.
include structure bapipartnr.
data:end of order_partners.
data: begin of order_schedule_in occurs 1.
include structure bapischdl.
data:end of order_schedule_in.
data: begin of messagetable occurs 0 .
Include structure bapiret2.
data: end of messagetable.
order_header_in-doc_type = doctype.
order_header_in-sales_org = p_vkorg.
order_header_in-distr_chan = p_vtweg.
order_header_in-division = p_spart.
order_header_in-purch_date = sy-datum .
order_header_in-req_date_h = sy-datum.
order_items_in-itm_number = itemno.
order_items_in-material = p_matnr.
order_items_in-req_qty = quantity.
append order_items_in.
order_schedule_in-itm_number = itemno.
order_schedule_in-req_qty = quantity.
append order_schedule_in.
order_schedule_in-req_date = sy-datum.
order_partners-partn_role = partnertype.
order_partners-partn_numb = p_kunnr.
append order_partners.
order_partners-itm_number = itemno.
CALL FUNCTION 'Z_BAPI_SALESORDER_SIMULATE'
EXPORTING
ORDER_HEADER_IN = order_header_in
CONVERT_PARVW_AUART = ' '
DELAY = 0
IMPORTING
SALESDOCUMENT =
ORDER_HEADER_EX =
SOLD_TO_PARTY =
SHIP_TO_PARTY =
BILLING_PARTY =
RETURN =
ORDER_HEADER =
TABLES
ORDER_ITEMS_IN = order_items_in
ORDER_PARTNERS = order_partners
ORDER_SCHEDULE_IN = order_schedule_in
ORDER_CONDITIONS_IN =
ORDER_ITEMS_OUT =
ORDER_CFGS_REF =
ORDER_CFGS_INST =
ORDER_CFGS_PART_OF =
ORDER_CFGS_VALUE =
ORDER_CFGS_BLOB =
ORDER_CCARD =
ORDER_CCARD_EX =
ORDER_SCHEDULE_EX =
ORDER_CONDITION_EX = order_condition_ex
ORDER_INCOMPLETE =
MESSAGETABLE = messagetable
EXTENSIONIN =
PARTNERADDRESSES =
WMDVSX =
WMDVEX =
Z_AVAIL_OUT =
ORDER_SCHEDULE_IN2 =
ORDER_SCHEDULE_EX2 =
ORDER_ITEMS_IN2 =
ORDER_PARTNERS2this is not solving it Ashish ,
I am using a BAPI: Z_BAPI_SALESORDER_SIMULATE, this Bapi is similar to the BAPI_SALESORDER_SIMULATE. It has customizations that are similar to the customizations done for order in the SAP system at my organization.
Checking CONDITIONS EX , for free goods
I am using Function module :Z_BAPI_SALESORDER_SIMULATE to simulate pricing conditions.
I am trying to figure out the reason for the function module: Z_BAPI_SALESORDER_SIMULATE not giving values in CONDITIONS EX when I use it to simulate free goods .
It is only not giving ORDER_CONDITION_EX for free goods materials.
BAPI simulates Bill of material, regular orders properly.
Example : one material has on free good .
Should give output in ORDER_CONDITION_EX
It is giving an output in ORDER_ITEMS_OUT - two materials line item 10 , 15 .
However in ORDER_CONDITION_EX it does not return anything , number of entries is zero .
I know my data for input are correct as I can make a sale order with the same data.
In the Output in the MESSAGETABLE I get the message
T ID NUM MESSAGE
W V4 160 Minimum quantity 1 EA of free goods has not been reached
Please help me with : What is the reason for this message? I am able to make a sale order with the same data
I am using exactly the same data in VA01 to create a sale order as I am using to test this BAPI: Z_BAPI_SALESORDER_SIMULATE
Please help me at the earliest to solve this problem
BAPI INPUT :
ORDER_HEADER_IN OR
CONVERT_PARVW_AUART
Tables Value
ORDER_ITEMS_IN 1 Entry
ORDER_PARTNERS 2 Entries
ORDER_SCHEDULE_IN 1 Entry
ORDER_CONDITIONS_IN 0 Entries
ORDER_ITEMS_OUT 0 Entries
ORDER_CFGS_REF 0 Entries
ORDER_CFGS_INST 0 Entries
ORDER_CFGS_PART_OF 0 Entries
ORDER_CFGS_VALUE 0 Entries
ORDER_CFGS_BLOB 0 Entries
ORDER_CCARD 1 Entry
ORDER_CCARD_EX 0 Entries
ORDER_SCHEDULE_EX 0 Entries
ORDER_CONDITION_EX 0 Entries
ORDER_INCOMPLETE 0 Entries
MESSAGETABLE 0 Entries
EXTENSIONIN 0 Entries
PARTNERADDRESSES 1 Entry
WMDVSX 0 Entries
WMDVEX 0 Entries
Z_AVAIL_OUT 0 Entries
ORDER_SCHEDULE_IN2 0 Entries
ORDER_SCHEDULE_EX2 0 Entries
ORDER_ITEMS_IN2 0 Entries
ORDER_PARTNERS2 0 Entries
BAPI Output is :
Import parameters Value
ORDER_HEADER_IN OR I have this filled in
CONVERT_PARVW_AUART
DELAY 0
Export parameters Value
SALESDOCUMENT
ORDER_HEADER_EX OR
SOLD_TO_PARTY
SHIP_TO_PARTY
BILLING_PARTY
RETURN
ORDER_HEADER OR sales area 00/00/0000 00/00/0000
Tables Value
ORDER_ITEMS_IN 1 Entry
Result: 1 Entry
ORDER_PARTNERS 2 Entries
Result: 2 Entries
ORDER_SCHEDULE_IN 1 Entry
Result: 1 Entry
ORDER_CONDITIONS_IN 0 Entries
Result: 0 Entries
ORDER_ITEMS_OUT 0 Entries
Result: 2 Entries
ORDER_CFGS_REF 0 Entries
Result: 0 Entries
ORDER_CFGS_INST 0 Entries
Result: 0 Entries
ORDER_CFGS_PART_OF 0 Entries
Result: 0 Entries
ORDER_CFGS_VALUE 0 Entries
Result: 0 Entries
ORDER_CFGS_BLOB 0 Entries
Result: 0 Entries
ORDER_CCARD 1 Entry
Result: 1 Entry
ORDER_CCARD_EX 0 Entries
Result: 0 Entries
ORDER_SCHEDULE_EX 0 Entries
Result: 2 Entries
ORDER_CONDITION_EX 0 Entries
Result: 0 Entries
ORDER_INCOMPLETE 0 Entries
Result: 0 Entries
MESSAGETABLE 0 Entries
Result: 1 Entry
EXTENSIONIN 0 Entries
Result: 0 Entries
PARTNERADDRESSES 1 Entry
Result: 3 Entries
WMDVSX 0 Entries
Result: 0 Entries
WMDVEX 0 Entries
Result: 0 Entries
Z_AVAIL_OUT 0 Entries
Result: 0 Entries
ORDER_SCHEDULE_IN2 0 Entries
Result: 0 Entries
ORDER_SCHEDULE_EX2 0 Entries
Result: 0 Entries
ORDER_ITEMS_IN2 0 Entries
Result: 1 Entry
ORDER_PARTNERS2 0 Entries
Result: 2 Entries -
BAPI_SALESORDER_SIMULATE- FREE GOODS - ORDER_CONDITION_EX
Hi Gurus,
I am using standard Function module : BAPI_SALESORDER_SIMULATE to simulate pricing conditions.
I am trying to figure out the reason for the function module: BAPI_SALESORDER_SIMULATE not giving values in CONDITIONS EX when I use it to <b>simulate free goods</b> .
It is only not giving ORDER_CONDITION_EX for <b>free goods</b> materials.
BAPI simulates Bill of material, regular orders properly.
Example : one material has on free good .
Should give output in ORDER_CONDITION_EX
It is giving an output in ORDER_ITEMS_OUT - two materials line item 10 , 15 .
However in ORDER_CONDITION_EX it does not return anything , number of entries is zero .
What could be the reason. What is the correct input for the BAPI for it to give conditions in ORDER_CONDITION_EX for free goods.
I know my data for input are correct as I can make a sale order with the same data.
Please help me at the earliest to solve this problem.
<u>BAPIs reference : standard BAPI_SALESORDER_SIMULATE'</u>
CALL FUNCTION 'BAPI_SALESORDER_SIMULATE'
EXPORTING
ORDER_HEADER_IN = order_header_in
CONVERT_PARVW_AUART = ' '
DELAY = 0
IMPORTING
SALESDOCUMENT =
ORDER_HEADER_EX =
SOLD_TO_PARTY =
SHIP_TO_PARTY =
BILLING_PARTY =
RETURN =
ORDER_HEADER =
TABLES
ORDER_ITEMS_IN = order_items_in
ORDER_PARTNERS = order_partners
ORDER_SCHEDULE_IN = order_schedule_in
ORDER_CONDITIONS_IN =
ORDER_ITEMS_OUT =
ORDER_CFGS_REF =
ORDER_CFGS_INST =
ORDER_CFGS_PART_OF =
ORDER_CFGS_VALUE =
ORDER_CFGS_BLOB =
ORDER_CCARD =
ORDER_CCARD_EX =
ORDER_SCHEDULE_EX =
ORDER_CONDITION_EX = order_condition_ex
ORDER_INCOMPLETE =
MESSAGETABLE = messagetable
EXTENSIONIN =
PARTNERADDRESSES =
WMDVSX =
WMDVEX =
AVAIL_OUT =
ORDER_SCHEDULE_IN2 =
ORDER_SCHEDULE_EX2 =
ORDER_ITEMS_IN2 =
ORDER_PARTNERS2
<u>Program being developed based on this BAPI</u>
selection-screen begin of block b1 with frame title text-001.
parameters : p_kunnr like kna1-kunnr,
p_matnr like vbap-matnr,
p_vkorg like vbak-vkorg,
p_vtweg like vbak-vtweg,
p_spart like vbak-spart.
selection-screen end of block b1.
data: doctype like bapisdhead-doc_type value 'OR',
itemno like bapiitemin-itm_number value '000010',
quantity(13) type N value '0000000000001',
partnertype like knvp-parvw value 'AG'.
data :count type i.
data : begin of order_condition_ex occurs 0.
include structure bapicond.
data: end of order_condition_ex.
data: begin of order_header_in.
include structure bapisdhead.
data: end of order_header_in.
data: begin of order_items_in occurs 1.
include structure bapiitemin.
data: end of order_items_in.
data: begin of order_partners occurs 1.
include structure bapipartnr.
data:end of order_partners.
data: begin of order_schedule_in occurs 1.
include structure bapischdl.
data:end of order_schedule_in.
data: begin of messagetable occurs 0 .
Include structure bapiret2.
data: end of messagetable.
order_header_in-doc_type = doctype.
order_header_in-sales_org = p_vkorg.
order_header_in-distr_chan = p_vtweg.
order_header_in-division = p_spart.
order_header_in-purch_date = sy-datum .
order_header_in-req_date_h = sy-datum.
order_items_in-itm_number = itemno.
order_items_in-material = p_matnr.
order_items_in-req_qty = quantity.
append order_items_in.
order_schedule_in-itm_number = itemno.
order_schedule_in-req_qty = quantity.
append order_schedule_in.
order_schedule_in-req_date = sy-datum.
order_partners-partn_role = partnertype.
order_partners-partn_numb = p_kunnr.
append order_partners.
order_partners-itm_number = itemno.
CALL FUNCTION 'Z_BAPI_SALESORDER_SIMULATE'
EXPORTING
ORDER_HEADER_IN = order_header_in
CONVERT_PARVW_AUART = ' '
DELAY = 0
IMPORTING
SALESDOCUMENT =
ORDER_HEADER_EX =
SOLD_TO_PARTY =
SHIP_TO_PARTY =
BILLING_PARTY =
RETURN =
ORDER_HEADER =
TABLES
ORDER_ITEMS_IN = order_items_in
ORDER_PARTNERS = order_partners
ORDER_SCHEDULE_IN = order_schedule_in
ORDER_CONDITIONS_IN =
ORDER_ITEMS_OUT =
ORDER_CFGS_REF =
ORDER_CFGS_INST =
ORDER_CFGS_PART_OF =
ORDER_CFGS_VALUE =
ORDER_CFGS_BLOB =
ORDER_CCARD =
ORDER_CCARD_EX =
ORDER_SCHEDULE_EX =
ORDER_CONDITION_EX = order_condition_ex
ORDER_INCOMPLETE =
MESSAGETABLE = messagetable
EXTENSIONIN =
PARTNERADDRESSES =
WMDVSX =
WMDVEX =
Z_AVAIL_OUT =
ORDER_SCHEDULE_IN2 =
ORDER_SCHEDULE_EX2 =
ORDER_ITEMS_IN2 =
ORDER_PARTNERS2Hi Eswar and friends,
I am using a BAPI : Z_BAPI_SALESORDER_SIMULATE , this Bapi is similar to the BAPI_SALESORDER_SIMULATE . It has customizations that are similar to the customizations done for order in the SAP system at my organization.
<b>
In the Output in the MESSAGETABLE I get the message
<b>
T ID NUM MESSAGE
W V4 160 Minimum quantity 1 EA of free goods has not been reached
</b>
Please help me with : What is the reason for this message?</b> I am able to make a sale order with the same data
<b>I am using exactly the same data in VA01 to create a sale order as I am using to test this BAPI: Z_BAPI_SALESORDER_SIMULATE </b>
Please help me at the earliest to solve this problem
BAPI INPUT :
ORDER_HEADER_IN OR
CONVERT_PARVW_AUART
Tables Value
ORDER_ITEMS_IN 1 Entry
ORDER_PARTNERS 2 Entries
ORDER_SCHEDULE_IN 1 Entry
ORDER_CONDITIONS_IN 0 Entries
ORDER_ITEMS_OUT 0 Entries
ORDER_CFGS_REF 0 Entries
ORDER_CFGS_INST 0 Entries
ORDER_CFGS_PART_OF 0 Entries
ORDER_CFGS_VALUE 0 Entries
ORDER_CFGS_BLOB 0 Entries
ORDER_CCARD 1 Entry
ORDER_CCARD_EX 0 Entries
ORDER_SCHEDULE_EX 0 Entries
ORDER_CONDITION_EX 0 Entries
ORDER_INCOMPLETE 0 Entries
MESSAGETABLE 0 Entries
EXTENSIONIN 0 Entries
PARTNERADDRESSES 1 Entry
WMDVSX 0 Entries
WMDVEX 0 Entries
Z_AVAIL_OUT 0 Entries
ORDER_SCHEDULE_IN2 0 Entries
ORDER_SCHEDULE_EX2 0 Entries
ORDER_ITEMS_IN2 0 Entries
ORDER_PARTNERS2 0 Entries
BAPI Output is :
Import parameters Value
ORDER_HEADER_IN OR I have this filled in
CONVERT_PARVW_AUART
DELAY 0
Export parameters Value
SALESDOCUMENT
ORDER_HEADER_EX OR
SOLD_TO_PARTY
SHIP_TO_PARTY
BILLING_PARTY
RETURN
ORDER_HEADER OR SO500750 00/00/0000 00/00/0000
Tables Value
ORDER_ITEMS_IN 1 Entry
Result: 1 Entry
ORDER_PARTNERS 2 Entries
Result: 2 Entries
ORDER_SCHEDULE_IN 1 Entry
Result: 1 Entry
ORDER_CONDITIONS_IN 0 Entries
Result: 0 Entries
ORDER_ITEMS_OUT 0 Entries
Result: 2 Entries
ORDER_CFGS_REF 0 Entries
Result: 0 Entries
ORDER_CFGS_INST 0 Entries
Result: 0 Entries
ORDER_CFGS_PART_OF 0 Entries
Result: 0 Entries
ORDER_CFGS_VALUE 0 Entries
Result: 0 Entries
ORDER_CFGS_BLOB 0 Entries
Result: 0 Entries
ORDER_CCARD 1 Entry
Result: 1 Entry
ORDER_CCARD_EX 0 Entries
Result: 0 Entries
ORDER_SCHEDULE_EX 0 Entries
Result: 2 Entries
ORDER_CONDITION_EX 0 Entries
Result: 0 Entries
ORDER_INCOMPLETE 0 Entries
Result: 0 Entries
MESSAGETABLE 0 Entries
Result: 1 Entry
EXTENSIONIN 0 Entries
Result: 0 Entries
PARTNERADDRESSES 1 Entry
Result: 3 Entries
WMDVSX 0 Entries
Result: 0 Entries
WMDVEX 0 Entries
Result: 0 Entries
Z_AVAIL_OUT 0 Entries
Result: 0 Entries
ORDER_SCHEDULE_IN2 0 Entries
Result: 0 Entries
ORDER_SCHEDULE_EX2 0 Entries
Result: 0 Entries
ORDER_ITEMS_IN2 0 Entries
Result: 1 Entry
ORDER_PARTNERS2 0 Entries
Result: 2 Entries
<b>Additional Note :</b>
<b>Checking CONDITIONS EX , for free goods</b>
I am using Function module :Z_BAPI_SALESORDER_SIMULATE to simulate pricing conditions.
I am trying to figure out the reason for the function module: Z_BAPI_SALESORDER_SIMULATE not giving values in CONDITIONS EX when I use it to simulate free goods .
It is only not giving ORDER_CONDITION_EX for free goods materials.
BAPI simulates Bill of material, regular orders properly.
Example : one material has on free good .
Should give output in ORDER_CONDITION_EX
It is giving an output in ORDER_ITEMS_OUT - two materials line item 10 , 15 .
However in ORDER_CONDITION_EX it does not return anything , number of entries is zero .
I<b> know my data for input are correct as I can make a sale order with the same data.</b> -
BAPI_SALESORDER_SIMULATE vs GN_INVOICE_CREATE
Hi
there is a SAP standard program SDNETPR0 that can be used to list Prices for Customer and range of Materials.
This uses function module GN_INVOICE_CREATE to bring back the Prices.
I was going to use that program as a base of a new Z program to extend some of the selection criteria.
Now I am wondering if in my new Report I should be using BAPI_SALESORDER_SIMULATE or GN_INVOICE_CREATE.
Both seem to do the same result. But GN_INVOICE_CREATE is much much faster.
What is your experience on this.
Should I be using that or the BAPI...?Hello,
When using GN_INVOICE_CREATE and if you are using the user exit to populate the custom fields in pricing communication structure, it has to be implemented in this function call as well.
However BAPI_SALESORDER_SIMULATE works out of the box.
Refer : SAP OSS: 536806 -
Error V0104 in BAPI_SALESORDER_SIMULATE
Hello,
While executing BAPI BAPI_SALESORDER_SIMULATE I end up with error V0104 and processing terminates. This has got to do with the screen sequence and entries are missing in table T185D. Is it not that this table has to be maintained using transaction VFBS? If so what are the entries to be passed? The fcode is ENT1. I have searched for a relevant note but to no avail. Looking forward to help from the experts.
Kind Regards,
InduShekarHello Lakshmipathi,
Thanks for your reply.
I have gone through the suggested note. We are working in ECC 6 and the note is not of use.
To explain the process:
We are calling BAPI - "BAPI_SALESORDER_SIMULATE" passing it all the necessary values. The processing gets terminated - dumped. While debugging we noticed the entries missing in table T185D. We are not sure of the entries to be passed.
We have the same issue while trying to edit an existing sales order using VA02: This happens during deriving profitability segments. The process was : For an item Select icon "Position" which pops up a screen. We enter the PO item number (POSNR) and upon pressing Enter the transaction gets dumped: Dynapro does not exist. This happens in include "MV45AO0T_TAXI_INITIALIZE_CARRI".
The screen sequence is missing.
What are the entries we need to pass for overcoming this error?
Kind Regards,
InduShekar -
What is the purpose of BAPI_SALESORDER_SIMULATE
Hi Experts,
can u please call me what is the purpose of BAPI_SALESORDER_SIMULATE.
Thanks in AdvanceHi,
<b>Functionality</b>
This method has the same interface definition as the BAPI_SALESORDER_CREATEFROMDAT1 function but differs from it in that here the sales order is not updated.
Here you can determine availability and pricing. This data is displayed in the ORDER_ITEMS_OUT table.
Even you can look at the Documentation of bapi in SE37
Regards
Sudheer -
BAPI_SALESORDER_SIMULATE Performance Problem
HI All,
My requirement is to select all Materials from MARA (as per certain condition), may be this can be some 50000 materials.....!!
After this i have to use BAPI_SALESORDER_SIMULATE to simulate the creation of a sale order to check whether the material is correct or not. This BAPI stops when it finds an incorrect material. I will check the material and delete from my internal table. After deleting this material, i will run the BAPI for the rest of materials. I will do this till the BAPI returns a success message. This will help me give the success Materials.
This program of min eis running for 8 hours, when i am giving all the materials to select.
I did a performance check, and it is telling that the most time taken one is MARA_ARRAY_READ function module and this function module is calling the subroutine "PERFORM SPERREN_MARA USING SY-SUBRC". If you see in the subroutine, the time consuming one is this function module "ENQUEUE_EMMARAS". This one is called for each material.
Please let me know if anything can be done to by pass this check...or to improve the performance..
Regards
Rakesh.HI Rakesh
I guess you can expect better solutions if you can let us know the exact requirement...
<b>After this i have to use BAPI_SALESORDER_SIMULATE to simulate the creation of a sale order to check whether the material is correct or not.</b>
What do u mean by correct or not???
If you can provide a clear requirement, i guess friends here can give better advises and alternatives if any...
Kind Regards
Eswar -
BAPI_SALESORDER_SIMULATE & AFS 6.0
Hi experts:
Iam currently involved in an AFS migration from v3.0 to v6.0, and I,ve found an include that uses BAPI_SALESORDER_SIMULATE.
The problem is that in the old code we use the
order_sizes_in and order_sizes_out tables of this BAPIand I can´t find the correct BAPI to replace the old one :
CALL FUNCTION 'BAPI_SALESORDER_SIMULATE'
EXPORTING
order_header_in = le_order_header_in
IMPORTING
return = le_return
TABLES
order_items_in = lt_order_items_in
order_partners = lt_order_partners
order_items_out = lt_order_items_out
order_schedule_ex = lt_order_sched_ex
messagetable = lt_return
order_sizes_in = lt_order_sizes_in
order_sizes_out = lt_order_sizes_out
order_condition_ex = lt_order_conditions.
I`ve found the /AFS/BAPI_SALESORD_CREATEFDATA, but these two tables don´t have equivalent ones.
Does anybody know a solution to this problem
Thanks in advance for your help.Hi again:
The question is to find the way to do the same as before, doesn´t matter if i have to use one or more FM.
It´s VERY importan to solve this problem as soon as possible
Thanks for your help.
Maybe you are looking for
-
How to autofill a date/time field on a print event?
I am trying to have a read only field auto populate the date and time when a form is printed. How do I set up a script to initiate on a prePrint event? I am very new to trying to script my own events. Thank you for your help! S.
-
Hiding exceeded data in h:dataTable columns
hi, my requirement is I have to display some data in dataTable and I need to put fixed height for the columns.if the data in that column exceeds then the data should hide and onmouseover one tooltip should come showing the exceeded data. but the jsf
-
X220: can't get sound w/ DP to HDMI adapter
I bought this adapter: http://www.monoprice.com/products/product.asp?c_id=104&cp_id=10428&cs_id=1042801&p_id=4826&seq=1&for... However, I can't get sound to go to my LG HDTV thorugh HDMI. Is there an additional setting I need to change on the X220?
-
10.1.2.0.2 problem
Hi, I have installed 10.1.2.0.2 infra and mt but on oc4j_portal no applications are loaded, thus portal is not opening. Any clues? Thanks in advance Mak
-
How do I convert staruml data model diagram into XML DB datamodel
I'm trying to find out if i could convert starUML data model diagram into XML DB datamodel. I'm planning to use Jdev for the same. Let me if it is possible