Sales Order Copy
Hi All,
Is there anyway you can copy a sales order and not carry over reference to the customer purchase order number? I want to copy an order from an existing order but create/enter a new PO number in the new order that is created.
Thanks
A/A
you could use the copy ext package for that. see the post from me about 2 months back. Naga had provided a line or 2 of code that I was able to use to ADD a couple fields to be copied. I used the same principal to not copy data. see below
CREATE OR REPLACE PACKAGE BODY APPS.OE_COPY_UTIL_EXT AS
/* $Header: OEXCEXTB.pls 115.1 2004/02/03 23:36:57 mchavan noship $ */
G_PKG_NAME CONSTANT VARCHAR2(30) := 'OE_COPY_UTIL_EXT';
PROCEDURE Copy_Line_DFF
( p_copy_rec IN oe_order_copy_util.copy_rec_type
, p_operation IN VARCHAR2
, p_ref_line_rec IN OE_Order_PUB.Line_Rec_Type
, p_copy_line_rec IN OUT NOCOPY OE_Order_PUB.Line_Rec_Type
IS
BEGIN
-- Addtiional fields to copy--
p_copy_line_rec.shipping_instructions := p_ref_line_rec.shipping_instructions;
p_copy_line_rec.packing_instructions := p_ref_line_rec.packing_instructions;
field that need to NOT copy
p_copy_line_rec.attribute2 := '';
p_copy_line_rec.attribute3 := '';
END Copy_Line_DFF;
END OE_COPY_UTIL_EXT;
Similar Messages
-
BAPI SALES ORDER & Copy with reference
Hello,
I'm creating sales order copied with reference to an invoice. My problem is that the data item is empty. When I create the sales order manually and use the option 'Create with reference' and choose an invoice, the sales order is created with all data item. I don't know how I can get to copy the data item from the invoice in the new sales order. The code that I'm using is the following:
DATA: order_header_in LIKE bapisdhd1,
order_partners LIKE bapiparnr OCCURS 0 WITH HEADER LINE,
order_text LIKE bapisdtext OCCURS 0 WITH HEADER LINE,
order_header_inx LIKE bapisdhd1x,
order_item_in LIKE bapisditm OCCURS 0 WITH HEADER LINE,
order_schedules_in LIKE bapischdl OCCURS 0 WITH HEADER LINE,
order_conditions_in LIKE bapicond OCCURS 0 WITH HEADER LINE,
extensionin LIKE bapiparex OCCURS 0 WITH HEADER LINE,
partneraddresses LIKE bapiaddr1 OCCURS 0 WITH HEADER LINE,
order_cfgs_ref like BAPICUCFG occurs 0 with header line.
DATA: salesdocument LIKE bapivbeln-vbeln.
DATA: return LIKE bapiret2 OCCURS 0 WITH HEADER LINE.
order_header_in-doc_type = 'ZA09'.
order_header_in-sales_org = '1700'.
order_header_in-distr_chan = '01'.
order_header_in-division = '01'.
order_header_in-BILL_DATE = '20060701'.
order_header_in-ref_doc = '0900000019'.
order_header_in-refdoc_cat = 'M'.
*order_header_in-REF_DOC_L_LONG = '0900000019'.
order_header_in-purch_no_c ='prueba'.
*order_header_in-ord_reason = '003'.
*order_header_in-pmnttrms = '0002'.
*order_header_in-sales_off = '2800'.
order_header_in-ref_doc_l = 'FACTURA ES'.
*order_header_in-fix_val_dy = '20060701'.
*order_header_in-currency = 'USD'.
*order_header_in-exchg_rate = '1.2'.
order_partners-partn_role = 'AG'.
order_partners-partn_numb = '0000000001'.
order_partners-langu = 'EN'.
order_partners-name = 'El corte aleman'.
order_partners-country = 'ES'.
APPEND order_partners.
order_partners-partn_role = 'RE'.
order_partners-partn_numb = 'ARR000'.
order_partners-addr_link = '0000030044'.
APPEND order_partners.
CALL FUNCTION 'ADDR_GET_COMPLETE_ALL_TYPES'
EXPORTING
addrnumber = order_partners-addr_link
PERSNUMBER =
address_object_type = '1'
IV_CURRENT_COMM_DATA = 'X'
IMPORTING
ADDR1_COMPLETE =
ADDR2_COMPLETE =
ADDR3_COMPLETE =
ADDR1_COMPLETE_BAPI = partneraddresses
ADDR2_COMPLETE_BAPI =
ADDR3_COMPLETE_BAPI =
EXCEPTIONS
PARAMETER_ERROR = 1
ADDRESS_NOT_EXIST = 2
PERSON_NOT_EXIST = 3
INTERNAL_ERROR = 4
OTHERS = 5
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
data: vl_texto(40) value 'NUEVOOOOO'.
partneraddresses-name = vl_texto. clear vl_texto.
partneraddresses-name_2 = vl_texto.
partneraddresses-name_3 = vl_texto.
partneraddresses-name_4 = vl_texto.
partneraddresses-langu = 'E'.
APPEND partneraddresses.
DATA: vl_cantidad LIKE bapisditm-target_qty.
vl_cantidad = 1.
order_item_in-itm_number = 10.
order_item_in-material = 'HONORARIOS'.
order_item_in-ref_doc = '0900000019'.
order_item_in-ref_doc_it = 10.
order_item_in-ref_doc_ca = 'M'.
APPEND order_item_in.
order_schedules_in-itm_number = 10.
order_schedules_in-req_qty = vl_cantidad.
APPEND order_schedules_in.
order_text-text_id = 'Z001'.
order_text-ITM_NUMBER = ''.
order_text-langu = 'EN'.
order_text-text_line = 'Hola, CARACOLAcola'.
APPEND order_text.
order_text-text_id = 'Z001'.
order_text-langu = 'EN'.
order_text-text_line = 'Adios caracol'.
APPEND order_text.
order_text-itm_number = '000010'.
order_text-text_id = '0001'.
order_text-langu = 'EN'.
order_text-text_line = 'Hola, POSICIÓN'.
APPEND order_text.
extensionin-structure = 'BAPE_VBAK'.
extensionin-valuepart1 = ' BCL 7'.
APPEND extensionin.
order_cfgs_ref-posex = '10'.
order_cfgs_ref-config_id = '10'.
order_cfgs_ref-root_id = '00000001'.
append order_cfgs_ref.
CALL FUNCTION 'ZBAPI_SALESORDER_CREATEFROMDT2'
EXPORTING
SALESDOCUMENTIN = salesdocument
order_header_in = order_header_in
ORDER_HEADER_INX = order_header_inx
SENDER =
BINARY_RELATIONSHIPTYPE =
INT_NUMBER_ASSIGNMENT =
BEHAVE_WHEN_ERROR =
LOGIC_SWITCH =
TESTRUN =
CONVERT = ' '
IMPORTING
salesdocument = salesdocument
TABLES
return = return
order_items_in = order_item_in
ORDER_ITEMS_INX =
order_partners = order_partners
order_schedules_in = order_schedules_in
ORDER_SCHEDULES_INX =
order_conditions_in = order_conditions_in
ORDER_CONDITIONS_INX =
ORDER_CFGS_REF = 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_text
ORDER_KEYS =
extensionin = extensionin
partneraddresses = partneraddresses
PERFORM report TABLES return.
*DATA: salesdocument LIKE bapivbeln-vbeln.
*DATA: return LIKE bapiret2 OCCURS 0 WITH HEADER LINE.
*refresh return.
*CALL FUNCTION 'BAPI_SALESDOCUMENT_COPY'
EXPORTING
salesdocument = '0400000191'
documenttype = 'ZA04'
TESTRUN = ' '
IMPORTING
SALESDOCUMENT_EX = salesdocument
TABLES
RETURN = return
*PERFORM report TABLES return.
*write: / salesdocument.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
WAIT =
IMPORTING
RETURN =
*& Form report
text
-->P_MENSAJE text
FORM report TABLES p_mensaje STRUCTURE bapiret2.
DATA: vl_mensaje TYPE string.
LOOP AT return.
CLEAR vl_mensaje.
MESSAGE ID return-id
TYPE return-type
NUMBER return-number
INTO vl_mensaje
WITH return-message_v1
return-message_v2
return-message_v3
return-message_v4.
WRITE: / vl_mensaje.
ENDLOOP.
ENDFORM. " reportHi Manuel,
There are some function modules which is there to copy the order details. I am not sure about the function module name. But you can search in SE37. But bapi for creating the sales order does not have the functionality of copying the data from one document to another document.
You can try using this function module.
BAPI_SALESDOCUMENT_COPY
Data will be copied based on the copy control routines that is set between the two document types.
Thanks,
Arun -
How to change the price in sales order copying from contract?
Hi All,
I am creating a sales order with reference to contract & the same prices in the contract are flowing. But the validity of prices are expired & I am unable to edit the prices in the sales oerder level.
Please suggest what configuration need to do to edit prices in the sales order level.
Thanks,
MadhuHello Madhu,
I am creating a sales order with reference to contract & the same
prices in the contract are flowing. But the validity of prices are expired
& I am unable to edit the prices in the sales oerder level.
Please suggest what configuration need to do to edit prices in the sales order level.
The configurational setting for changing the pricing flow from Contract to Sales Order is in Copying control. Go to the T-code VTAA and select your relevant Contract and Sales Order. At the Item level itself, you shall find a control called PRICING TYPE. Select the option as B or C.
Please try out this approach so that your issue related to pricing flow can be avoided.
Regards,
Sarthak -
Hi developers,
does anybody know if there is a bapi to copy a sales order starting from a different order?
What I'd like to do is calling a bapi with the document number of the sales order I have to copy as input and obtain a new one identical to the first.
Is this possible?
Thanx to all of you and have a nice day.Please check in to BAPI_SALESDOCUMENT_COPY.
Regards,
Rich HEilman -
Sales Quotation to Sales Order copy to creates Duplicate values.
Hello,
I added the 2 columns in Sales Quotation (freight Charges) form and (inserted/updated) the amount. My problem is when i use the COPY TO to Sales Order , duplicate Columns are creating in Sales order(freight Charges ) Form. I inserted in QUT3 Table.
Thanks,
Y.
Edited by: Yughandar on Nov 1, 2011 3:24 AMI add the freight items( Handling charges) in Freight form in administration. And it is reflected in Freight charges form in Sales Quotation. Using code i inserted the values in QUT3 Tabel. And when i use COPY TO to sales order , everything copying to Sales order but duplicate (Handling charges) Row is adding in Freight charges form . Means 2 Handling charges rows are displaying..
-
Sales order Copying Requirement
Dear Experts,
I went to transaction VOFM to maintain the Copying Requirement for the Sales Order. When I create a new Routine number, I found out that some has the importing parameter BY_SUBRC in the Subroutine and some do not, I want to ask when the variable BY_SUBRC will be present and when will be absent. Thanks
Thanks.Hello,
There will be scenarios where (as in your requirement), just copying the Sales and Distribution Document will be sufficient. In this case, we'll not require any SUBRC Checks to see if the document is actually copied or not.
However, there are scenarios where you do not want to COPY a particular Line Item in the Sales Order. Then, in such kind of scenarios, where the access to the Actual Data is limited, we'll use the Parameter BP_SUBRC and make it a non-zero to forcefully fail that routine so that the Line Item is not Copied (requirement is not fulfilled).
Hope it was clear and helpful.
Thanks and Regards,
Venkat Phani Prasad Konduri -
Disable Document Flow in Sales Order copy control
Hello,
We have a request where the customer doesn't want the docflow to appear when you copy a sales order to another sales order? I know that you can disable the flag for the item categories however, when you do this, there is still a link between a sales order when it's created by referencing another. Is there a way to create a sales order via "copy with reference" and to not have them linked in the docflow? Possibly one of the configuation settings in the copying control? We are on 6.0.
Thanks,
ChrisHi,
I think It is not possible through configuration.
Pl try screen exit
or
change in standard program,which is not advisable.
Thanks,
Vrajesh
Edited by: Vrajesh G. Nayak on May 4, 2010 1:36 PM -
Cannot edit header price when sales order copied from sales order
I have a requirement to copy a sales order with Freight manually added in Header Pricing to another sales order. The Header Price for Freight is grayed out on the target document and the requirement is to have that price field open to edit. I've tried several copy control settings to no avail. Will a copy control routine need to be written in order to open the freight price field for edit in the target document?
I very much appreciate your assistance.
NPHi Nancy,
Validate the Pricing Type in the copy control at item category level, by default Pricing type is equal to A (Copy price components and redetermine scale), which can be adjusted to adjust your requirement in copying from another sales order.
Make sure your setting in the condition type under "Changes which can be made" are supporting the necessary changes a user needs to make.
Regards,
Naveen Aggarwal -
Sales Order Copying from reference of sales contract
Hi all..,
In my scenario sales order is created with reference to sales contract.
all the fields except sales order item account assignment profit segment withing this WBS element is there in sales contract
but it is not reflecting while referencing in sales order .
Please help me out ...,
Regards,
Mohd.hi,
i am working in sales module to extract sales contract data to bi.
Please give me guidance to extract data from ecc to bi.
I will very much thankful to you.
Regards,
Dharani -
Pricing Type D to work for sales order to sales order copy controls
Hi,
Issue: Pricing type D does not work while creating a debit memo request in reference to the credit memo request.
Credit memo request and debit memo request have identical pricing procedures.
But in this case, the credit memo was created with reference to a billing document which had a different pricing procedure and the pricing procedure components of the billing document was copied entirely into the credit memo request with pricing type D in the copy control.
But when this credit memo request is referenced to create a debit memo request with the pricing type D in the copy control, the price is re-determined in the debit memo request. But the scenario requires, the pricing elements to be copied completely from the credit memo request.
Please advise for the corrections or on the changes to be made to the requirement.
Thanks and Regards,
Gopinath
Edited by: Gopinath Naik R on May 18, 2009 5:31 PMThis is due to the Coopy Routine in Billing to Sales Doc.
In the Copy control routine of the Item , you find the routine being used, Inside this Routine , you will find a statement like
MOVE-CORROSPONDING CVBRK to VBAP
This statement is actually transfering all feilds from billing document to the Order with the Billing Pricing Procedure.
Just add one line before this statement " LOCAL CVBRK-KALSM
or
CVBRK-KALSM = VBAK-KALSM
This will give you the new Determined Pricing Procedure.
this is a change in code of the Routine , may be you need to copy and create a new routine to add this line. -
Regarding Sales order Copy Through BAPI
HI SAP Gurus,
My requirement is to create a new SO from existing SO.
I have tried BAPI_SALESDOCUMENT_COPY by passing SO No. and Doc. Type, It is working fine, but the header details like PO Number, PO Date and Shp.Mode. (In Shipping Tab)are not appearing in the newly created SO.
Is there any other BAPI to copy an existing SO,
Please suggest,
Regards,
Pavan.hi
You can use ORDER_ITEMS_IN. For further details use the documentation of the function module.This must help you in your requirement.
regards
Aakash Banga -
Copy control from Sales order to Credit memo-VTAA
Hi
We have a below requirement..
While copying from sales order to Credit memo order type,defualt payment terms in credit memo order type should be always change to NT00(payable immdtly due date)
So we had written a routine under sales order copying .VOFM-901
In VTAA we have set 901 instead of 101 under Copying requirements for transferring business data-under change header view..
But while creating sales order type CR with reference to normal sales order,it is not copying the NT00 payment term..
Can u tell us whether any other settings required in VTAA.
Note:We had copied existing 101 to 901 with addition logic -
IF VBAK-AUART = 'CR'.
VBKD-ZTERM = 'NT00'.
ENDIF.
Regards
SudhaHi Sudha,
The coding added in 101 is not enough to achieve your requirement, because of the fact that the VBKD-ZTERM will be filled again with the original value from CVBKD in the copy routine on the item level. (For example 102 for OR to OR in standard system)
Could you please create another routine 902(adding the addition coding to 102) and replace it on copy control for item level?
It should work then.
Regards,
Smile -
Sales order status is not Closed when copy to AR Invoice
Hi,
Are there any known scenarios where sales order status is not changed to Closed and SO open qty not changed to zero after SO is fully copied to AR Invoice?
Please advise. Thanks.
Regards,
PriscillaHi Jitin,
1. For this case, the sales order line status is not closed and the open qty is also not zero although the SO qty are fully invoiced
2. Customer SBO version is 8.8 PL13.
3. There is no SP_TransactionNotification created in this customer environment.
FYI, there is no target entry shown in the sales order document as well. Hence, customer is not able to trace which open sales order has been copied to an AR Invoice target document.
Customer has a few scenarios for the above issue:
1. Multiple Sales orders copied to 1 AR Invoice.
2. One sales order to many AR Invoice.
Since there is no target entry updated in the sales order, is there any SQL query to check which sales order has been copied to a AR Invoice document to rectify the above issue.
Thanks.
Regards,
Priscilla -
Would like solution for Copy Control Between Quotation and Sales Order
Hi Expert,
My customer requirement are the following topic:
1. need condition type (item) to input FIX AMOUNT in Quotation
2. once copy Quotation to Sales Order Condition have to copy not depend on quantity
for example
QUOTATION#1
=item#1 quantity 20 PC
=condition#1 fix amount 100 USD
================================ copy Quotation to SO
SO#1
=item#1 quantity 2 PC
=condition#1 fix amount 100 USD <----- full copy and not depend on quantity
But on my setting I get Sales Order 2 PC with condition#1 10 USD ....
I need the way to Configure or Customize (need configure if have)
Many thanks for Advise me
Best Regard,
Atom
Edited by: korakoj chantarasupawong on Mar 25, 2011 7:28 AMThank you very much,
for my customer requirement for this condition is handing charge.
This handing charge is agreement between my customer and thier customer to keep fix amount per sales order.
such as 1 quotations per item has handing charge 100 usd per 10 TON product
if thier customer would like to split delivery (open sales order) 10 times, they have to earn 100 usd / 10 times.
so this is the meaning for this condition.
so
QUO#1
item#1
- mat A 10 TON (handing charge 100 USD per 1 sales order)
- mat B 20 TON (handing charge 20 USD per 1 sales order)
--> copy to sales order 1
SO#1
item#1
- mat A 2 TON (handing charge 100 USD per 1 sales order)
- mat B 1 TON (handing charge 20 USD per 1 sales order)
--> copy to sales order 2
SO#2
item#1
- mat A 8 TON (handing charge 100 USD per 1 sales order)
- mat B 19 TON (handing charge 20 USD per 1 sales order)
some thing like that's
many thank expert
please carry on advise me thanks -
Formatted Search for Sales Order
Hi,
I setup a formatted search in Sales Order unit price field.
Condition required:
If Sales Order is copied from Sales Quotation, unit price remains as per Sales Quotation unit price, else formula to calculate mininum selling price appllies.
Here's the query:
DECLARE @BASE_ENTRY INT
DECLARE @PRICE NUMERIC(19,6)
SET @BASE_ENTRY = ISNULL($[$38.45.0],0)
SET @PRICE = $[$38.14.0]
IF @BASE_ENTRY = 0
BEGIN
SELECT T0.[AvgPrice]*(1+T0.[U_SPFactor])
FROM OITM T0
WHERE T0.[ItemCode]=$[$38.1.0]
END
ELSE
BEGIN
SELECT @PRICE
END
l have no issue if the Sales Order copied from Sales Quotation, however when enter the Sales Order manually the formatted search having error message:
1). [Microsoft][SQL Server Native Client 10.0][SQL Server]Error converting data type nvarchar to numeric.
FMS execution failed on field '' with query name 'Get Minimum Selling Price (SO)'
Looks like my query has error...Hi ,
Try this below query and let me know your feedback,
DECLARE @BASE_ENTRY INT
DECLARE @PRICE NUMERIC(19,6)
SET @BASE_ENTRY = ISNULL($[$38.45.0],0)
SET @PRICE = $[$38.14.Number]
IF @BASE_ENTRY = 0
BEGIN
SELECT T0.[AvgPrice]*(1+T0.[U_SPFactor])
FROM OITM T0
WHERE T0.[ItemCode]=$[$38.1.0]
END
ELSE
BEGIN
SELECT @PRICE
END
Maybe you are looking for
-
How to get compatibility mode or notify ff browser of HTML4
I manage an old but large and constantly changing commercial website. The site was originally done in HTML2 and has long been at HTML4, with no plans yet to move to HTML5, which would break huge amounts of code using <font> tags, etc. I use <!DOCTYPE
-
How the text elements of the SMARTFORMS can generate a field?
Hello guys I have got this problem of not getting the value of the fields from the smartform. i wrote the text element to populate the field by inserting as the following &IV_BID_HEADER-PROCESS_TYPE& first it comes with the shaded background bu
-
Can someone send me a link to elements 11 please
i bought a new i mac and i can't seem to be able to find a link to download elements 11
-
CCM 2.0 Item Deletion and Old Shopping Carts
Hi everyone! We delete an item of the catalogue and then we publish it again. If then we go to SRM Shopping Tool and buy using and OLD SHOPPING CART that contain the item. We can buy the item without problems (alhough it's not existing anymore). We h
-
Added Mailboxes Don't Appear in Sidebar?
I added several new mailboxes through the "+" symbol at the bottom of the sidebar box. They aren't showing up in the side bar under the "On My Mac" header where I placed them. When I go into Finder and follow User/Library/Mailboxes/ they show up alon