Change price in Sales Order created with reference with Quote
Hi Experts,
Need to change price (eg..1000USD to 1100USD) in sales order (va02). Here Sales Order is created (va01)with reference with Quote(va21) where price in maintained (as 1000USD). so price in Sales Order is copied from Quote. Now, If I want to do the change in Sales Order (from 1000USD to 1100USD) kindly suggest me what are all the possible ways. Can I do the changes within the existing documents rather than creating new docs. due to the change.
Note: User is creating new Quote with 1100USD and creating subsequent new Sales Order with new Quote.
Thanks
Viswanathan
Hi,
In va02 you double-click on the material that has been entered, then in the new screen goto the condition tab, here u will find the $1000 that you have entered, and then change it to $1100.
Swapnil
Similar Messages
-
Problem in Sales order create using BAPI with reference to quotation
Hi,
I am creating a sales order from Quotation using BAPI /AFS/BAPI_SALESORD_CREATEFDATA.
The Sale order is getting created and the document flow is updated. When i check the status of quotation it is "OPEN".
Ideally when a sale order is created in VA01 with reference to a quotation and if all items are added in the order from quotation, then the status of the quotation must be "Complete".
When i use the BAPI, the status of the quotation is sill "Open". Has anyone faced this issue?
Even if anyone has faced this issue with BAPI_SALESORDER_CREATEFROMDAT2, please let me know...
RegardsHi RV,
I am using BAPI to create order reference to contracts. I am facing same issue. Its not updating document flow (vbfa-plmin field). After creating orders I am forcing to update plmin field in vbfa. This worked fine. But now status in reference document not updating properly. I saw your thread. It looks like similar issue. I saw your comments "Customization was not maintained properly for the Order types ". Please can you explain little bit more about your solution. It will helps us lot.
Thanks,
srini -
How to change price in Sales order using user exit ?
The scenario is - when the user creates a sales order, there has to be an RFC called to another system to get the price of the materials in that system. Then it has to overwrite that price in this S.O.
Which exit in S.O can be used for this and then what processing needs to be done after the RFC call to get price. Like how the price can be overwritten on this S.O ? (Lets say to get price we use some BAPI to the other system). Any help ?Dear Theodorous,
1)Please check the Material has been extended to the second plant.
2) Assign the second Plant to Sales Org and Dist Channel
If you have any concern revert back the same
Regards
Amjath -
Help to change the price in sales order create bapi
hi,
i am able to change the price but not what i am trying to do.
can anybody please help . here i am submitting the code.
i am trying to enter the 40 into price field but it is takeing 400
<b>report zmybapi1 .
data : my_order_header_in like bapisdhd1 occurs 0 with header line,
my_order_header_ix like bapisdhd1x occurs 0 with header line.
data : my_orderitemsin like bapisditm occurs 0 with header line,
my_orderitemsix like bapisditmx occurs 0 with header line.
data : my_order_partners like bapiparnr occurs 0 with header line.
data : my_return like bapiret2 occurs 0 with header line.
data : w_vbeln like bapivbeln-vbeln.
data:
my_orderschedulesin like bapischdl occurs 0 with header line,
my_orderschedulesinx like bapischdlx occurs 0 with header line.
data : my_orderconditionsin like bapicond occurs 0 with header line,
my_orderconditionsinx like bapicondx occurs 0 with header line.
start-of-selection.
this is to assign values to internal table my_order_header_in
my_order_header_in-doc_type = 'TA'.
my_order_header_in-sales_org = 'JNJ1'.
my_order_header_in-distr_chan = '02'.
my_order_header_in-division = 'J1'.
my_order_header_in-sales_off = 'JNJ1'.
my_order_header_in-purch_no_c = 'testbapipo'.
my_order_header_in-purch_date = sy-datum.
my_order_header_in-req_date_h = sy-datum.
append my_order_header_in.
this is to assign values to internal table my_orderitemsin
my_orderitemsin-material = '000000000000000727'.
my_orderitemsin-plant = 'JNJ1'.
my_orderitemsin-target_qu = 'EA'.
my_orderitemsin-target_qty = '10'.
append my_orderitemsin.
this is to assign values to internal table my_order_partners
my_order_partners-partn_role = 'AG'.
my_order_partners-partn_numb = '0000000011'.
append my_order_partners.
my_order_partners-partn_role = 'WE'.
my_order_partners-partn_numb = '0000000011'.
append my_order_partners.
This is to assign values to internal table my_orderschedulesin
my_orderschedulesin-itm_number = '10'.
my_orderschedulesin-itm_number = '000010'.
my_orderschedulesin-req_qty = '10'.
my_orderschedulesin-SCHED_LINE = '0001'.
append my_orderschedulesin.
*This is to assign values to internal table my_orderconditionin
my_orderconditionsin-itm_number = '000010'.
my_orderconditionsin-cond_type = 'ZPR1'.
my_orderconditionsin-cond_value = '40'.
append my_orderconditionsin.
my_order_header_ix-updateflag = 'I'.
my_order_header_ix-doc_type = 'X'.
my_order_header_ix-sales_org = 'X'.
my_order_header_ix-distr_chan = 'X'.
my_order_header_ix-division = 'X'.
my_order_header_ix-sales_off = 'X'.
my_order_header_ix-purch_no_c = 'X'.
my_order_header_ix-purch_date = 'X'.
my_order_header_ix-req_date_h = 'X'.
append my_order_header_ix.
my_orderitemsix-updateflag = 'I'.
my_orderitemsix-material = 'X'.
my_orderitemsix-target_qty = 'X'.
my_orderitemsix-plant = 'X'.
my_orderitemsix-target_qu = 'X'.
append my_orderitemsix.
my_orderschedulesinx-updateflag = 'I'.
my_orderschedulesinx-sched_line = '0001'.
my_orderschedulesinx-req_qty = 'x'.
append my_orderschedulesinx.
my_orderconditionsinx-itm_number = '000010'.
my_orderconditionsinx-cond_type = 'ZPR1'.
my_orderconditionsinx-updateflag = 'U'.
my_orderconditionsinx-cond_value = 'X'.
append my_orderconditionsinx.
call function 'BAPI_SALESORDER_CREATEFROMDAT2'
exporting
SALESDOCUMENTIN =
order_header_in = my_order_header_in
order_header_inx = my_order_header_ix
SENDER =
BINARY_RELATIONSHIPTYPE =
INT_NUMBER_ASSIGNMENT =
BEHAVE_WHEN_ERROR =
LOGIC_SWITCH =
TESTRUN =
CONVERT = ' '
importing
salesdocument = w_vbeln
tables
return = my_return
order_items_in = my_orderitemsin
order_items_inx = my_orderitemsix
order_partners = my_order_partners
ORDER_SCHEDULES_IN = my_orderschedulesin
order_schedules_inx = my_orderschedulesinx
ORDER_CONDITIONS_IN = my_orderconditionsin
ORDER_CONDITIONS_INX = my_orderconditionsinx
ORDER_CFGS_REF =
if sy-subrc ne 0.
write: my_return-message, my_return-number, my_return-type.
else.
call function 'BAPI_TRANSACTION_COMMIT'
EXPORTING
WAIT =
IMPORTING
RETURN =
write: my_return-message, my_return-number, my_return-type.
endif.</b>
Message was edited by: pavan kumar pisipatiIs there any Multiplication happening in the condition type or any other conditions executes. Please check those..
Another way is, if always a multiplication of 10 is happening then pass the value by dividing it by 10. But this way is not a nice way or programming...
Check out both and let me know if not working.
Cheers,
Thomas. -
Change of Sold to Party in Sales order created with Reference to Contract
Dear Gurus
I want to change the sold to party in Sales Order created with reference to contract.
When I create a Sales order with reference to contract the system copies all the partner functions- Sold to, Ship to, Bill to and Payer alongwith other data.
However Sold to is marked as "Grey" and not changable, rest of the partners can be changed.
There is no subsiquent document created with reference to this Sales Order.
Please advice.
Thanks a lot.
Regards
RaghuHi ,
Please follow the below mentioned step.
1) Create a partner function letts say Authorized SP .
2) Assign all the possible authorised SP (customer) in the contract.
3) When you create sales order with reff to Contract. Put the customer for whom you wish to create a sales order in release partner tab.
Hop this will resolve our problem
Regards,
Krishna O -
BAPI Sales order create with reference
Hi
I need to use BAPI to create sales order with reference to Quantity Contract. The line item material quantity would be less than or equal to quantity contract quantity.
Sales order needs to be created with new quantity.
Quantity contract quantity change needs to be maintained.
Document flow needs to be maintained.
Is any one aware if this is possible using BAPI_SALESORDER_CREATEFROMDAT2. If yes, how?
Any insights would be highly appreciated.Hi Maninder,
The BAPI does not allow the Pricing Conditions to be sourced from the Contract. I debugged the BAPI and it uses a piece of code (don't recall which subroutine though) from SAPMV45A which is relevant for dialog processing where it reads from the VBAP and *VBAP structures. Well this structure is only populated when you are using the Front End transaction (VA41, VA42, etc). Because this structure is empty, pricing conditions do not flow across.
Here is a little prototype program I whipped up to test my method of creating a Sales order and then changing the Sales Order:
REPORT ypat_salesorder_create LINE-SIZE 256.
* This program will create a ZOC Sales Order with Reference to Contract
* 20000720 / 10. This will be done via BAPI. There are 2 BAPi calls,
* BAPI_SALESORDER_CREATEFROMDAT2 and BAPI_SALESORDER_CHANGE. We need to
* perform 2 BAPI calls as the BAPI to create the Sales Order does not
* bring across the Pricing Conditions properly. To get around this we
* create the Order with reference to the Contract, then we get the
* related Pricing Conditions from the COntract and then update the newly
* created Order.
* Constants
CONSTANTS: c_contract LIKE vbak-vbeln VALUE '0020000720',
c_item LIKE vbap-posnr VALUE '000010'.
* Structures
* Structure to hold BAPI Header
DATA: st_bapisdhd1 LIKE bapisdhd1.
* Internal Tables
* Sales Order Create BAPI Return Messages
DATA: tbl_return TYPE STANDARD TABLE OF bapiret2
WITH HEADER LINE.
* Sales Order BAPI Line Item
DATA: tbl_bapisditm TYPE STANDARD TABLE OF bapisditm
WITH HEADER LINE.
* Sales Order BAPI Line Item
DATA: tbl_bapisditmx TYPE STANDARD TABLE OF bapisditmx
WITH HEADER LINE.
* Sales Order BAPI Pricing Conditions
DATA: tbl_bapicond TYPE STANDARD TABLE OF bapicond
WITH HEADER LINE.
* Sales Order BAPI Partner Functions
DATA: tbl_bapiparnr TYPE STANDARD TABLE OF bapiparnr
WITH HEADER LINE.
* Sales Order BAPI Schedule Lines
DATA: tbl_bapischdl TYPE STANDARD TABLE OF bapischdl
WITH HEADER LINE.
* Sales Order BAPI Schedule Lines
DATA: tbl_bapischdlx TYPE STANDARD TABLE OF bapischdlx
WITH HEADER LINE.
* Sales Order BAPI Pricing Conditions
DATA: tbl_bapicondx TYPE STANDARD TABLE OF bapicondx
WITH HEADER LINE.
* Customer Enhancement for VBAK, VBAP, VBEP
DATA: tbl_bapiparex TYPE STANDARD TABLE OF bapiparex
WITH HEADER LINE.
* Table to hold BAPI Detail Conditions
DATA: tbl_bapisdcond TYPE STANDARD TABLE OF bapisdcond
WITH HEADER LINE.
* Table to hold Return Messages from Sales Order Change BAPI
DATA: tbl_return_chg TYPE STANDARD TABLE OF bapiret2
WITH HEADER LINE.
* Variables
DATA: g_vbeln_created LIKE vbak-vbeln,
g_valid_contract TYPE c,
g_cont_price_date TYPE d.
* Start of Selection
START-OF-SELECTION.
PERFORM validate_contract.
PERFORM create_sales_ord.
PERFORM update_sales_ord.
* End of Selection
END-OF-SELECTION.
PERFORM write_output_report.
* Subroutines
*& Form create_sales_ord
* Create the Sales Order
FORM create_sales_ord .
PERFORM populate_bapi_tables.
PERFORM call_create_sales_ord_bapi.
ENDFORM. " create_sales_ord
*& Form populate_bapi_tables
* Fill up the BAPI Tables
FORM populate_bapi_tables .
PERFORM populate_bapi_header.
PERFORM build_bapi_partners.
PERFORM build_bapi_items.
PERFORM build_bapi_sched_lines.
ENDFORM. " populate_bapi_tables
*& Form populate_bapi_header
* Build BAPI Header Details
FORM populate_bapi_header .
CLEAR st_bapisdhd1.
st_bapisdhd1-doc_type = 'ZOC'. "Order type
st_bapisdhd1-sales_org = '026'. "Sales Org
st_bapisdhd1-distr_chan = '00'. "Dist Channel
st_bapisdhd1-division = '00'. "Division
st_bapisdhd1-purch_no_c = 'Cust Po No'. "Cust PO No
st_bapisdhd1-name = 'Orderer'. "Name of Orderer
st_bapisdhd1-ord_reason = ''. "Order Reason
st_bapisdhd1-sales_off = '3001'. "Sales Office
st_bapisdhd1-sales_grp = '301'. "Market Area
IF g_valid_contract = 'X'.
st_bapisdhd1-price_date = g_cont_price_date.
ENDIF.
ENDFORM. " populate_bapi_header
*& Form build_bapi_partners
* Build BAPI Partner Functions
FORM build_bapi_partners .
CLEAR tbl_bapiparnr.
tbl_bapiparnr-partn_role = 'AG'.
tbl_bapiparnr-partn_numb = '0000100750'.
APPEND tbl_bapiparnr.
CLEAR tbl_bapiparnr.
tbl_bapiparnr-partn_role = 'WE'.
tbl_bapiparnr-partn_numb = '0000504472'.
APPEND tbl_bapiparnr.
ENDFORM. " build_bapi_partners
*& Form build_bapi_items
* Build The BAPI Line Items
FORM build_bapi_items .
DATA: l_matnr LIKE mara-matnr.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = '10000072'
IMPORTING
output = l_matnr.
CLEAR tbl_bapisditm.
tbl_bapisditm-itm_number = c_item.
IF g_valid_contract = 'X'.
tbl_bapisditm-ref_doc = c_contract.
tbl_bapisditm-ref_doc_it = c_item.
tbl_bapisditm-ref_doc_ca = 'G'. "Contract
ENDIF.
tbl_bapisditm-material = l_matnr.
tbl_bapisditm-plant = '3012'.
tbl_bapisditm-target_qty = '5.000'.
tbl_bapisditm-target_qu = 'M3'.
tbl_bapisditm-item_categ = 'ZZOC'.
tbl_bapisditm-sales_dist = '301'.
tbl_bapisditm-dlv_prio = '02'.
tbl_bapisditm-prc_group5 = '080'.
tbl_bapisditm-cust_mat35 = 'kdmat'.
tbl_bapisditm-route = 'TESYS'.
tbl_bapisditm-usage_ind = 'CIV'.
APPEND tbl_bapisditm.
CLEAR tbl_bapisditmx.
tbl_bapisditmx-itm_number = c_item.
tbl_bapisditmx-ref_doc = 'X'.
tbl_bapisditmx-ref_doc_it = 'X'.
tbl_bapisditmx-ref_doc_ca = 'X'.
tbl_bapisditmx-material = 'X'.
tbl_bapisditmx-updateflag = 'I'.
tbl_bapisditmx-plant = 'X'.
tbl_bapisditmx-target_qty = 'X'.
tbl_bapisditmx-target_qu = 'X'.
tbl_bapisditmx-item_categ = 'X'.
tbl_bapisditmx-sales_dist = 'X'.
tbl_bapisditmx-dlv_prio = 'X'.
tbl_bapisditmx-prc_group5 = 'X'.
tbl_bapisditmx-cust_mat35 = 'X'.
tbl_bapisditmx-usage_ind = 'X'.
tbl_bapisditmx-route = 'X'.
APPEND tbl_bapisditmx.
ENDFORM. " build_bapi_items
*& Form build_bapi_sched_lines
* Build the BAPI Schedule Lines
FORM build_bapi_sched_lines .
CLEAR tbl_bapischdl.
tbl_bapischdl-itm_number = c_item.
tbl_bapischdl-req_qty = '1'.
tbl_bapischdl-req_date = sy-datum.
APPEND tbl_bapischdl.
ENDFORM. " build_bapi_sched_lines
*& Form build_bapi_conditions
* Pull the BAPI Pricing Conditions from the Contract
FORM build_bapi_conditions .
LOOP AT tbl_bapisdcond.
CLEAR tbl_bapicond.
MOVE-CORRESPONDING tbl_bapisdcond TO tbl_bapicond.
APPEND tbl_bapicond.
CLEAR tbl_bapicondx.
tbl_bapicondx-itm_number = tbl_bapicond-itm_number.
tbl_bapicondx-cond_st_no = tbl_bapicond-cond_st_no.
tbl_bapicondx-cond_count = tbl_bapicond-cond_count.
tbl_bapicondx-cond_type = tbl_bapicond-cond_type.
tbl_bapicondx-updateflag = 'I'.
tbl_bapicondx-cond_value = 'X'.
tbl_bapicondx-currency = 'X'.
tbl_bapicondx-cond_unit = 'X'.
tbl_bapicondx-cond_p_unt = 'X'.
tbl_bapicondx-varcond = tbl_bapicond-varcond.
APPEND tbl_bapicondx.
ENDLOOP.
ENDFORM. " build_bapi_conditions
*& Form call_create_sales_ord_bapi
* Call the Sales Order Create BAPI
FORM call_create_sales_ord_bapi .
CLEAR g_vbeln_created.
CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'
EXPORTING
order_header_in = st_bapisdhd1
IMPORTING
salesdocument = g_vbeln_created
TABLES
return = tbl_return
order_items_in = tbl_bapisditm
order_items_inx = tbl_bapisditmx
order_partners = tbl_bapiparnr
order_schedules_in = tbl_bapischdl.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'.
ENDFORM. " call_create_sales_ord_bapi
*& Form update_sales_ord
* Update the newly created Sales Order with the Pricing Conditions
* from the Contract
FORM update_sales_ord .
CHECK g_valid_contract EQ 'X'.
PERFORM get_contract_details.
PERFORM build_bapi_conditions.
PERFORM call_change_sales_ord_bapi.
ENDFORM. " update_sales_ord
*& Form get_contract_details
* Get Contract Details
FORM get_contract_details .
* Need to manually get the relevant Pricing Conditions as the BAPI
* BAPISDORDER_GETDETAILEDLIST causes problems when we call the BAPI
* BAPI_SALESORDER_CREATEFROMDAT2 and BAPI_SALESORDER_CHANGE (I think
* this is due to the fact that these BAPIs belong to the same Function
* Group and there must be some common structures that are not cleared
* causing us all sorts of grief when we try and call the next BAPI)
DATA: tbl_konv TYPE STANDARD TABLE OF konv WITH HEADER LINE.
DATA: tbl_komv TYPE STANDARD TABLE OF komv WITH HEADER LINE.
DATA: tbl_vbak TYPE STANDARD TABLE OF vbak WITH HEADER LINE.
* Pricing Condition Master
DATA: BEGIN OF tbl_t685a OCCURS 0,
kschl LIKE t685a-kschl,
kaend_wrt LIKE t685a-kaend_wrt,
END OF tbl_t685a.
SELECT *
INTO TABLE tbl_vbak
FROM vbak
WHERE vbeln = c_contract.
READ TABLE tbl_vbak INDEX 1.
SELECT *
INTO TABLE tbl_konv
FROM konv
WHERE knumv = tbl_vbak-knumv AND
kposn = c_item.
CHECK sy-subrc EQ 0.
* We now need to make sure we only bring across the Condition Types that
* are EDITABLE. If we bring across non editable conditions (such as
* 'ZPR1') the Change Sales Order BAPI will fail
SELECT kschl kaend_wrt
INTO TABLE tbl_t685a
FROM t685a
FOR ALL ENTRIES IN tbl_konv
WHERE kappl EQ 'V' AND "Sales
kschl EQ tbl_konv-kschl AND
kaend_wrt EQ 'X' AND "Value is Editable
kmanu NE 'D'. "Process manually
* Prepare for Binary Search
SORT tbl_t685a BY kschl.
LOOP AT tbl_konv.
READ TABLE tbl_t685a WITH KEY kschl = tbl_konv-kschl BINARY SEARCH.
IF sy-subrc EQ 0.
MOVE-CORRESPONDING tbl_konv TO tbl_komv.
APPEND tbl_komv.
ENDIF.
ENDLOOP.
CHECK NOT tbl_komv[] IS INITIAL.
* Map KOMV into the more BAPI friendly BAPISDCOND structure
CALL FUNCTION 'MAP_INT_TO_EXT_STRUCTURE'
TABLES
fxvbak = tbl_vbak
fxkomv = tbl_komv
fxbapikomv = tbl_bapisdcond
EXCEPTIONS
entry_missing = 1
OTHERS = 2.
ENDFORM. " get_contract_details
*& Form call_change_sales_ord_bapi
* Call the Change Sales Order BAPI
FORM call_change_sales_ord_bapi .
DATA: st_head_chg LIKE bapisdh1x,
st_logic_switch TYPE bapisdls.
CHECK NOT g_vbeln_created IS INITIAL.
CHECK g_valid_contract EQ 'X'.
st_head_chg-updateflag = 'U'.
st_logic_switch-cond_handl = 'X'.
CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
EXPORTING
salesdocument = g_vbeln_created
order_header_inx = st_head_chg
logic_switch = st_logic_switch
TABLES
return = tbl_return_chg
conditions_in = tbl_bapicond
conditions_inx = tbl_bapicondx.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'.
ENDFORM. " call_change_sales_ord_bapi
*& Form write_output_report
* Produce Output Report
FORM write_output_report .
IF NOT g_vbeln_created IS INITIAL.
WRITE:/ 'Success! Sales Order', g_vbeln_created, 'was created!'.
ELSE.
WRITE:/ 'Failure! Sales Order was not created!'.
ENDIF.
SKIP.
WRITE:/ 'Sales Order Create Log'.
LOOP AT tbl_return.
WRITE:/ tbl_return-type, tbl_return-id, tbl_return-number,
tbl_return-message.
ENDLOOP.
SKIP.
WRITE:/ 'Sales Order Change Log'.
LOOP AT tbl_return_chg.
WRITE:/ tbl_return_chg-type, tbl_return_chg-id,
tbl_return_chg-number, tbl_return_chg-message.
ENDLOOP.
ENDFORM. " write_output_report
*& Form validate_contract
* Make sure that the Contract is Valid
FORM validate_contract .
DATA: l_gueen LIKE vbak-gueen,
l_prsdt LIKE vbkd-prsdt.
SELECT SINGLE vbak~gueen vbkd~prsdt
INTO (l_gueen, l_prsdt)
FROM vbak
INNER JOIN vbkd
ON vbak~vbeln = vbkd~vbeln
WHERE vbak~vbeln = c_contract AND
vbkd~posnr = '000000'.
IF sy-datum LE l_gueen.
* Contract is valid! Set Order Price Date
g_valid_contract = 'X'.
g_cont_price_date = l_prsdt.
ENDIF.
ENDFORM. " validate_contract
Hope this helps.
Cheers,
Pat. -
Changing quantities in sales order with reference to quotation
Hi,
Quotation has been created for Product -- A, 10 quantities.
Sales order created with reference to quotation, system copies 10 quantity in sales order.
How do you restrict in sales order end user should not change quantities, system should not allow for changes by end user. If end user changes Qty system should give an "Error message", so that sales can not be saved.
Could you suggest solution ASAP.
Thanks in Advance.
Regards,
vamsi.Normally You will have a warning message set for this. under class V1. if you want the error to be hard error then you would have to hard code it in a user exit under mv45afzz "userexit_save_document_prepare" where u can check if the quantities in the quote and sales order are different and create a hard error.
the other option which I am not sure if it is possible is to propose the eror in message class v4 which you can control thru customisation under SPRO>SD>message settings
reward points if it helps
regards
Biju -
Sales Order Created with reference to Contract - Exchange rate Issue
When Sales Order created with reference to contract VBKD fields KURSK and KURSK_DAT gets copied from contract and not redetrmined based on pricing date and Exchange rate type. I expected it to be determined based on pricing date is standard. What I am missing, should it be controlled by data transfers
If Document currency and condition currency are different it cause problems with incorrect condition values are calculated, as KOMP-KURSK are copied from VBKD-KURSK
Any help or directions would be greatly appreciated . We are on 4.7 ISOIL
Sincerely JuliettaWell,
and if we have the same issue, but we don't have OIL Version, but simple 4.6C, which solution has to be applied then?
Thank you
Standa -
Error : Sales order 'create with Reference' to the contract
We have made a value contract. Now we are trying to make a Sales order 'create with Reference' to the contract.
when we do that, we am getting error 'copying material in any value contract item is not permitted'
Any help or directions would be greatly appreciated . We are on Ecc 6.0
RohitAs of now my value contract has just one material. so i dont need assortment module settings. right?
in VTAA settings are as follows
Target type: OR
Source type: ZK1
there is only on item category
Target item category: TAN
Source item category: WKN
Copying requirement : 301
update doc flow : 2
pricing type : C
cont item copy mode : A
DataT am using 151,102,002
There are no schedule line.
Rohit
Edited by: rohit kumar on May 15, 2008 7:36 PM -
Need to pull INITIAL(vbap)net price of Sales Order, after changing viaVA02
Hi Experts,
Mine is differetnt requirement..........
I created a my_Sales_order_12345678 with 2 items, as follows,(all following values/entries r for my_Sales_order_12345678)
line item_10---->net_value_netpr = $100
line item_20---->net_value_netpr = $200
Then the VBAP entries as r as follows,
POSNR -
>NETPR
10----
> $100
20----
> $200
I changed first time as via VA02 tx, as
line item_10---->net_value_netpr = $300
line item_20---->net_value_netpr = $400
Then the VBAP entries as r as follows,
POSNR -
>NETPR
10----
> $300
20----
> $400
I changed second time as via VA02 tx, as
line item_10---->net_value_netpr = $500
line item_20---->net_value_netpr = $600
Then the VBAP entries as r as follows,
POSNR -
>NETPR
10----
> $500
20----
> $600
My requirement: for some reason, I need the initial values, I mean
the VBAP entries of,
POSNR -
>NETPR
10----
> $100
20----
> $200
I tried with CDHDR & CDPOS tbls, but no use? So, from Where Can I get/pull them??
thanq
Edited by: Srinivas on Jan 24, 2008 12:22 AMhi sirnivas..
Thanq you for the points..these are the first i ever recieved..
if you are working on peice of code which can get the price history do me a favour if you have finished the code just explain it to me who did u do that...
i have been working on an object from last two weeks to get the latest price...
the thing is even though the price for condition items has been changed it wont get updated in the Sales orders unless new pricing fot the document is done...
so i have to get all the sales orders who condition items price has been changed and display them in an ALV...so if you can get the exact old values...for the conditions i guess the opposite also can be done.....
Here i have suggestion for you...in condition items there is a process called SCHEMA ( pricing Schema) which you can see using Condition Analysis button at the bottom of the condition item window...
you can see all the price changes to the condition when you parse the tree structure of the procedure..EXAMPLE :- R0000 etc...
so some Sales orders if the Schema has been changed all the existing condition are replaced by New ones from the changed Schema...so i guess that would play an important role in deciding the Price of Sales order...
I know this is bit long but .....if you did finsish your program do let me know how you did it...
Thankyou very much and good luck. -
Create and Change functionality for Sales order
Hii All,
Can any one please suggest me any Standard program or BAPI or IDOC for Sales order, it should cover create as well as change fuctionality of Sales order.
this is very urgent to me.
Suitable Answer will be Rewarded.
Thankyou,
Shobha.For change you can use:
BAPI_SALESORDER_CHANGE Sales order: Change Sales Order
For create you have the following choices:
BAPI_SALESORDER_CREATEFROMDAT1 Sales order: Create Sales Order
BAPI_SALESORDER_CREATEFROMDAT2 Sales order: Create Sales Order
BAPI_SALESORDER_CREATEFROMDATA Create Sales Order, No More Maintenance
BAPI_SALESDOCU_CREATEFROMDATA with business object 'BUS2032'
The difference between the create ones is the functionality you get e.g. create_from_data2 is the 'most powerful' but you also have to provide the most data. It just depends on what you want it to do.
In terms of IDOCS:
message type:
SALESORDER_CREATEFROMDAT201 or
SALESORDER_CREATEFROMDAT202 or
ORDERS05
Hope that helps,
Michael
Here is an example we use, you might want to populate additional fields or leave fields out in case you want different data to be transferred to the IDOC - however some fields are mandatory.
create the order header structure
ls_header-doc_type = ls_screen-order_type.
ls_header-sales_org = gc_vkorg_aa01.
ls_header-distr_chan = gc_distr_aa.
ls_header-division = gc_divis_aa.
ls_header-purch_no = ls_screen-po_num.
ls_header-po_method = ls_screen-po_source.
ls_header-ship_cond = ls_screen-ship_cond.
create partner input table (sold to)
ls_partner-partn_role = gc_role_sold.
ls_partner-partn_numb = ls_screen-sold_to.
APPEND ls_partner TO lt_partner.
create partner input table (ship to)
ls_partner-partn_role = gc_role_ship.
ls_partner-partn_numb = ls_screen-ship_to.
APPEND ls_partner TO lt_partner.
items are added by looping at a table
ls_item-material = <fs_upload>-matnr.
ls_item-req_qty = <fs_upload>-quantity.
process the quantity, it needs to be three decimals, because it
will be moved into a string in the BAPI and divided by 1000 before
it is moved back into a number field (1.500 => 001500 => 1.5)
ls_item-req_qty = ls_item-req_qty * 1000.
truncate remaining decimal places if exist (1.2525 => 1252.5 => 1252 => 1.252)
ls_item-req_qty = trunc( ls_item-req_qty ).
price is taken from the file
ls_item-cond_type = gc_cond_so_upld_price.
ls_item-cond_val1 = <fs_upload>-price.
condition one (price) is multiplied by 10 in the BAPI
ls_item-cond_val1 = ls_item-cond_val1 / 10.
no discount
ls_item-cd_type2 = gc_cond_so_upld_disc.
ls_item-cd_value2 = 0.
ls_item-item_categ = ls_screen-item_cat.
APPEND ls_item TO lt_item.
then BAPI is called
CALL FUNCTION 'BAPI_SALESDOCU_CREATEFROMDATA'
EXPORTING
order_header_in = ls_header
business_object = gc_bus_obj
IMPORTING
SALESDOCUMENT = lv_vbeln
RETURN = ls_return
tables
order_items_in = lt_item
order_partners = lt_partner.
IF ls_return-type NE gc_msgty_error AND
ls_return-type NE gc_msgty_abend.
No errors where found
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
ELSE.
There was an error or abend
CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
ENDIF. -
Change of Net Price in Sales Order
Hello Experts!
I wanted to know how the "Net Price" of a sales order can be "changed" by the system or "indirectly" by the user. I have an issue with the net price that changed in the sales order, and wanted to know how this could have happened; <b>besides</b> changing the pricing conditions, price adjustments, and order surcharge. Is there someway the system could have changed it or user "indirectly"? Please advise. Thank you in advance!
WCNet price is not changed directly.
It's chanegd via changes to pricing only unless you have some code which updates this field AFTER SAP calculated it based on pricing conditions.
NOTE: if you reject line items it's vlaue is substracted form order net value, the same is true if any of your pricing conditions is made inactive due to various reasons.
Changes to pricing condiitons are not shown in order change history, you can see changes per condition record, but if any of your conditions in sales order was made inactive - you won't see it in change log. One of the options may be - if you generate any outputs (IDOCs) which send pricing info - you can check those IDOCs to determine when & what was changed in the pricing of your order. -
Sales order creation with reference to quote using BAPI
Hi All,
I am trying to create a sales order with reference to quote using BAPI BAPI_SALESORDER_CREATEFROMDAT2.
I am passing the Quote number and preceding doc.category (B) at the header level and
at item level I am passing the quote number and the line item number in the quote for REF_DOC and REF_DOC_IT.
The order is created but there seems to be some issue with the document flow.
I do not see the Reference Doc number at the header level from the Sales order document flow whereas I can see the Reference Doc for each line item.
In VBFA I can see the Ref.Doc number at the header level along with the Ref.Doc at the line item level.
Why do you think it is not showing at the header level from Sales Document Document Flow?
Is there any bug in the standard BAPI or is there any OSS note?
Any answer would be greatly appreciated.
Thanks
Sandeephi,
Are you giving different quotation numbers in the different line items, if that is the case you will not get that in the header document flow, as it cann't point to all the quotations.
Thanks,
Mahesh. -
KE30 doesn't match with sales order gross and net prices of sales order
KE30 for sales anlysis by sales document amounts are not matching with actual sales order..that too only for credit memo request type of documents,rest of other type of docs match...my controlling area in USD currency where as the sales documnets are created in canadian currency, report is being converted in mean conversion rate..all other documnets are matching, except credit memo request. Do you guys have any idea, where and what to to check? thanks
Hi,
Thanks but that is not a soluction. When the sales order is created by DP90, if there is a field mandatory the incompletion log should be activated as when you create the sales order by transaction VA01.
It's clear that if you go out of the sales order created by DP90 without any change, the incompletion log doesn't active.
Any idea o reason? Possibly I will send a oss note but I previously hope your considerations.
Thanks in advance -
Address change to trigger new price in Sales Order
I need to have a re-price triggered every time an address has been changed in the sales order. The userexits in MV45AFZB USEREXIT_NEW_PRICING_VBAP and USEREXIT_NEW_PRICING_VBKD aren't triggered when an address is changed, only when the partner itself is changed.
Does somebody know of a way I can do this?
ThanksI actually found where in the source code is checking whether or not an an address is changed: this is MV45AF0P_PARTNER_CALL_BACK.
One of the reasons I had been having a problem with this is that re-pricing only occurs if the City, State, Tax Jurisdiction code, Country or transportation zone changes. If it is something like a street name change (for example, we ship to the customer in the same city/zip but to a different street), this did not trigger the reprice.
It is coded like this:
when part_call_back_roletype_we.
loop at t_changes where fieldname eq 'PARNR' or
fieldname eq 'COUNTRY' or
fieldname eq 'TRANSPZONE' or
fieldname eq 'REGION' or
fieldname cp 'CITY*' or
fieldname cp 'PO*' or
fieldname eq 'TAXJURCODE' or
fieldname eq 'STCEG'.
rv02p-weupd = charx.
exit.
endloop.
rv02p-weupd is the flag that is used to trigger the status for repricing, etc.
So, I suppose, I could change it here to add the street or something. But I've decided that this situation (for us) is a very unlikely that we would ship to a location that just so happened to be in a different street from our customer's warehouse.
Maybe you are looking for
-
Error while trying to access shopping cart
When trying to add songs to my cart, I keep receiving this message: We could not complete your iTunes request. There is not enough memoryavailable. What does this mean? How do I correct this? Thanks.
-
Our company is using NetWeaver release 7.1, the database is MAXDB, recently found to cause the system to slow down hard disk space exception In D: \ sapdb \ data \ wrk \ EPP \ path, found that many EPP_LOG_Auto.xxx files, each file is nearly 700MB, 2
-
PO,MIGO zero value item, not picking in MIRO
HI All, In my Vendor Return Po one line item(Sample good) is created with Zero value. GR and the entry is zero value. There is no issue at all. But upon MIRO, it is automatically not seen in the line item Can any one tell is it standard....or we cab
-
Posting-problems - WAS: avi.dll and pop-up
Hi everyone! I recently posted a question regarding the handling of a dll here and was asked to post the dll and the calling-code here, so help can be provided. However, i tried several times to post the dll and code, but was rejected by the server e
-
Creative cloud wont download. Help!
when downloading the creative cloud desktop the bar only fills i quarter of the way and then the window disappears and nothing happens.