Update sales order qty through BAPI_SALESORDER_CREATEFROMDAT2
HI
Can anybody help me out. I have the requirement for creating sales order through BAPI_SALESORDER_CREATEFROMDAT2. The sales order is created but with 0 quantity.
I am using fields RNDDLV_QTY and TARGET_QTY and REQ_QTY in schedule lines & also setting the update indicator to 'X' in the corresponding itemx structures.
In fact it used to work earlier and has stopped now. I am also checking if there could be any change in configuration but don't think this should be the reason.
Can someone guide me as to which quantity fields of the BAPI are the right ones to update sales order qty?
thanks
Hi,
You are using the correct fields i.e. TARGET_QTY and REQ_QTY. Just check if you are passing the same Item Number in both the tables.
Hope it helps...
Lokesh
Similar Messages
-
Sales order qty not updated in copa
Hi Gurus,
My client has activated Costing based COPA.
We have activated Incoming sales orders with option
Transfer with date of deliery/scheduled billing date.
When We are posting sales order we are able to see a copa document with record type A.
In that document we want to see the Sales order quantity or delivery quantity, delivery date fileds.Please let me know what all the value fields We need to assign.
Do I need to write any derivation rule for incoming sales arders also.
we are able to capture the total price, material etc from the sales order in COPA document.We need only sales order qty or Delivery qty or delivery date to be updated in COPA document.
Please suggest me
Regards
ChaitanyaHi Chait,
Pl check whether your client has assigned SD Qty Fields to COPA Quantity fields in KE4M. Sd quantity fields are FKIMG- Billed Quantity, KWMENG-Order Quantity and the same shall be assigned to ABSMG-Sales Quantity. If not, please maintain the same. Otherwise, we need to look for some other work around solution.
Trust this resolve your problem!
Cheers! -
Update Sale Order Header Text through Enhancement
Hi Experts,
I Have a requirement to update the sale order Header Text , when the sale order is opened in VA02 and saved.
Here in I tried using edit_text, it updates sale order header text directly in DB during run time even before the save action is completed.
But I need to just fill the header text and that has to be saved during the save action only.
I tried coding the same in the user exit (userexit_save_document) but this user exit gets triggered only when there is some changes made to the document when opened in VA02 & Saved.
Is there any user exist to pass sale Order Header text and save when save button is clicked irrespective of the document been changed or not.
Thanks in advance
SathishHi Brad Bohn,
My actual requirement is to trigger an Idoc when the user goes to VA02 transaction and clicks save.
IDoc gets triggered only when there is some changes to that document, that is through NAST table entry based on the output configurations in NACE transaction.
Now that the user wants to trigger an IDoc even if there is no change (ie. to reprocess the IDoc) when he just opens a sale order in VA02 and click save.
It is not possible to trigger an IDoc through configurations when there is no actual change in VA02 and saved.
So it has to be forcefully sent by making some additions to the Order through coding, so I choose that Text box to fill some additional data and save .
Kindly Let me Know any thing could be done for this scenario.
Thanks in advance
Sathish -
Update sales order through workflow
Hi,
i developed one workflow for sales order. after all aprovals the sales order is updating upto 2nd change. but 3rd change is not updating sales order.
For updating sales order i am using BAPI_SALES ORDER_CHANGE function module.
Thanks.Hi Abdullah Azzouni
my scenario is when sales order is created or changed my workflow should trigger and make sales order as incomplete with (Z field) by using incompletion Procedure.
Also some other custom fields there for other workflows in salesorder.
In METHOD
select single zfield1
zfield2
zfield3
Zfield4 <- for my workflow
INTO wa_ext_hdr
FROM vbak
WHERE vbeln = object-key-salesdocument.
wa_ext_hdr-zfield ='X'.
wa_ext_hdrx = 'XXXX'.
MOVE 'U' TO wa_headerx-updateflag.
MOVE: BAPE_VBAK TO wa_extflds-structure.
CONCATENATE object-key-salesdocument
wa_ext_hdr INTO
wa_extflds-valuepart1.
APPEND wa_extflds TO i_extflds.
MOVE: BAPE_VBAKX TO wa_extflds-structure.
CONCATENATE object-key-salesdocument
wa_ext_hdrx INTO
wa_extflds-valuepart1.
APPEND wa_extflds TO i_extflds.
CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
EXPORTING
salesdocument = object-key-salesdocument
order_header_in = wa_header
order_header_inx = wa_headerx
behave_when_error = 'P'
TABLES
return = i_return
extensionin = i_extflds.
READ TABLE i_return INTO wa_return WITH KEY type = 'E'.
iF sy-subrc EQ 0.
ELSE.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
ENDIF.
Can you help on this.
Please suggest me where i am wrong or if you know any other way to achieve this functionality guide me.
Thanks in Advance.
Raj -
Sales order qty not confirmed when delivery done with partial qty
Hi Guru's
Need your help............
We have issue in drop shipment scenario process. Sales order created with 10 line items from CRM and order released from CRM and replicated order to ECC and backend created PR also. After that user set reject status for all items so that PR line items also deleted, again user released rejection status for all items and line items updated in the same PR with different line item number for materials then PO & GR also done in ECC and stock also allocated for sales order line items but still sales order qty not confirmed in CRM sales order.
I checked all configurations regarding availability check but could not found.
Example:
Sales order line item qty: 4 - 2 qty confirmed (delivered).
For remaining qty (2 items)I have done GR. After GR It is allocated to sales order but it is not confirming the order quantity.
plz help me to fix this issue?
regards
saiHi,
Please check In ERP transaction OVZJ, for the sales org, distribution channel, and division that is being used in the affected sales orders, set the Avail. Check Rule to 'E'. Then retest the issue, as this might help.
Regards
Gavin -
How to update sales orders using B1WS in SAP 8.8 PL18
Hello all.
We are having a problem updating sales orders using Sap Business One Web Service ( B1WS ).
We are running SBO 8.8 PL18, MS-SQL 2008, and all is fine when using the SBO client.
But when it comes to updating sales orders through B1WS we just cannot get it to work.
We can add new orders easily without problems. Updating orders always gives this error:
\[ORDR.PayDuMonth\]\[line: 0\] , 'Field cannot be updated (ODBC -1029)'
We have checked and verified multiple times that our setup is correct.
Also the WDSL files are verified.
We can update orders just fine using the sboclient.
And using B1WS we can basically do everything, besides updating.
We have also tried this on different company db's, so we are quite sure this is not
something related to some general setting we missed, but who knows?
We have tried different ways to "assemble" the order before updating, but it always
ends with the above error.
Here is an example of one of the tests, where we load an order by docentry,
increment the quantity of all open lines by '1', and then try to update it.
protected void Page_Load(object sender, EventArgs e)
// First we login
string sessionId = "";
LoginService.LoginService l_login = new LoginService.LoginService();
LoginService.LoginDatabaseType l_dbtype = LoginService.LoginDatabaseType.dst_MSSQL2008;
LoginService.LoginLanguage _lang = LoginService.LoginLanguage.ln_English;
string _server = "SAP-8_8PL18";
string _licserver = "SAP-8_8PL18:30000";
string _db = "my_test_company";
string _user = "manager";
string _pass = "********";
try
sessionId = l_login.Login(_server, _db, l_dbtype, true, _user, _pass,
_lang, true, _licserver);
catch (Exception ex)
Response.Clear();
Response.Write(ex.Message);
Response.End();
if (sessionId == "")
Response.Clear();
Response.Write("No sessionId");
Response.End();
// We are logged in and have a sessionId
// Now load a valid open order by docentry
try
OrdersServiceRef.OrdersService orderService = new OrdersServiceRef.OrdersService();
orderService.MsgHeaderValue = new OrdersServiceRef.MsgHeader();
orderService.MsgHeaderValue.SessionID = sessionId;
orderService.MsgHeaderValue.ServiceName = OrdersServiceRef.MsgHeaderServiceName.OrdersService;
orderService.MsgHeaderValue.ServiceNameSpecified = true;
OrdersServiceRef.DocumentParams docParams = new OrdersServiceRef.DocumentParams();
docParams.DocEntry = 31; // Docentry of a known open order
docParams.DocEntrySpecified = true;
OrdersServiceRef.Document order = orderService.GetByParams(docParams);
OrdersServiceRef.DocumentDocumentLine line = null;
for (int i = 0; i < order.DocumentLines.Length; i++)
line = order.DocumentLines<i>;
if (line.LineStatus == OrdersServiceRef.DocumentDocumentLineLineStatus.bost_Open)
line.Quantity += 1;
orderService.Update(order);
catch (System.Web.Services.Protocols.SoapException ex)
Response.Clear();
Response.Write(ex.Message);
Response.End();
catch (Exception ex)
Response.Clear();
Response.Write(ex.Message);
Response.End();
Response.Clear();
Response.Write("All OK");
Response.End();
I hope that someone has an idea as to why this happens.
The customer often changes quantity or adds lines on their orders,
and the only way to solve it so far has been to make a new order and
close the old one.
Thanks in advance
J. ThomsenHi,
Welcome you post on the forum.
Have you checked if you only update a specific line instead of a loop?
Thanks,
Gordon -
Error while updating Sales Order : Another user Modified Table (RDR1 )
Hi All,
I am getting an error message while running the following steps.
Steps
1) Pull an entry from sales order.
2) Add new data to line.
3) Update the sales order.
a) Sap updated the data.
b) Through code using DI API we updated some UDF.
4) With out closing / Pressing OK button
5) We added new data to line.
6) Then Press update.
An Error will through by B1 as Another user modified the table(RDR1 ). Before going to the code where we are handling the update of UDF.
But after the 3rd step above when we do
4) Close the window or pressed ok
5) take the sales order window again pull the data
6) Add new Data to line.
7) Update sales order then it will go smoothly.(Updating by B1 and from code )
Can anybody tell me why this happens?And any workarounds to solve this?
Deepeshare u adding a matrix row thru the code? I get this error when I am adding rows and I get the rownumber out of sync.
if so get the max (lineid) from rdr1 and then check against the matrix.rowcount before adding a row. if lineid is greater that matrix.rowcount take lineid + 1 and assign it to the matrix.row, else take the rowcount + 1
if not, and as a workaround, then you can try using the SBO_SP_transactionnotification stored procedure. -
Updating Sales Order Retrospectively with PGI figure
Hi
Does anyone know if there is a way of retrospectively updating sales order with the value that has actually been POST GOODS ISSUED
Thanks
TonyWhat do you mean by Value? does the Value of the item change during PGI?
If you mean to say, quantity, then yes, After PGI, go back to your order and change the order qty = PGI qty.
Regards
Sai -
Any standard process to update Sales Order in SAP via XI / Idoc ?
Hello,
Currently one of our end customer is creating Sales Order in Oracle system. Once the Order is created there, they send the Order information to our XI system via flat file. XI system processes the flat file and then it calls order creation function using rfc / BAPI - BAPI_SALESORDER_CREATEFROMDAT2. This works just fine.
But now the customer wants an ability to update sales order, cancel certain line or even cancel the whole order in their Orcale system. And once that happens, they want the same thing to happen in SAP via some kind of interface automatically in the background.
So my question is :
what is the best way to do it ?
Is it possible to do via idoc ? The reason I am asking it via idoc is because it sounds that's the most standard way of doing it in SAP.
What idocs can I use ?
Has any one implemented such interface ? And if so, can you share some info ?
Any response is highly appreciate.
thanks,
DipankarI woudl suggest you check ORDERS05 IDOC type (ORDCHG message type).
FM - idoc_input_ordchg -
FiX lot size & minimum sale order qty .
hi all
We maintained minimum order quantity for material ; can we put massage sale oraganization wise
ie for SO IN01 Massage type is 'E"
& for IN02 massage type is 'W"
If my minimum order qty. is 10 then SAP will accept the sale order qty. with multiple of 10 .
Eg. If customer placed order qty. 15 Nos. Dose SAP convert it into 20 automatically ?
PL. suggest me how to configure this scnerioHello,
Min sales order qty is controlled through MMR Sales Org 1 - if you want it to round up or down to the correct order quantity then you will need to create a rounding profile (see below).
Otherwise to change your message from a info or warning to an error goto transaction OVAH message V4 082 and change to E = error.
Rounding Profile
Key that the system uses to adjust the order proposal quantity to deliverable units.
Procedure
In Customizing, enter a threshold value from which the system should round up to the next value per deliverable unit:
If the requirements value exceeds the first threshold value, the system always rounds up to the next multiple of the level found
If the requirements value falls below the first threshold value, the system copies the original requirements value.
Two other types of rounding exist:
Dynamic rounding profile:
These profiles are used to round up quantities to logistical units of measure (for example, layers). The contents of a logistical unit of measure does not have to be know when creating the rounding profile. It is determined by the master data from the material master.
Rounding profile with quantity to be added/subtracted
With these profiles, the given quantity is changed either by adding a percentage or subtracting a percentage.
Only static rounding profiles are taken into account in requirements planning. Neither dynamic rounding profiles not quantity addition/ subtraction are taken into account.
Examples
A material's base unit of measure is 1 unit; the purchase order is to be delivered in layers (1 layer corresponds to 5 units) or in pallets (1 pallet corresponds to 8 layers which contains 40 units).
You maintain the profile as follows:
From a requirements of 2 units, the system is to round up to 5; from a requirement of 32 units, the system is to round up to 40.
This results in the following order proposal quantities:
Requirement from 1 -> 1 requirement from 31 -> 30
Requirement from 2 -> 5 requirement from 32 -> 40
Requirement from 6 -> 10 requirement from 74 -> 80
Requirement from 7 -> 10
Dependencies
If no rounding profile has been entered, the system uses the rounding value entered in the material master record for the planning run
Kind regards
Sue -
Delivery qty should not exceede Sales order qty
Dera Friends,
System is allowing to create delivery for a higher quantity than in sales order. For eg. The sales order is created for 10 pieces and delivery is created for 20 pieces.
We want to have a check on this. Pls guide where we can configure this. Our requiremnt is that Delivery qty should not exceede the sales order qty.
points assured
Krishna>Chi,
Go to VTLA, select your order type and delivery type and select item category and see whether you have maintained the following:-
Order requirements:::::101
Item Data:::::::::::::::::::101
Updata Document flow:::X
Pos./neg.quantity::::::::::+ -
Regarding sales order creation with "BAPI_SALESORDER_CREATEFROMDAT2"
Hi Experts,
I am facing an issue when creating a sales order with FM "BAPI_SALESORDER_CREATEFROMDAT2" it is showing the error
V1 -761 as " unpermitted combination of BUS 2032 with Sales document category L" .
In VA01 ,if i provide the fallowing details
Sales org 1000
dist 10
div 10
item no 10 material-52 plant 1000 shipping point -0001 target qty-1,uOM-EA,weight unit-KG
billing date 11022011
pricing date-11022011
currency - GBP
shipping party -1
sold to party -1
buyer - 1
bill-to-party -1
it is creating the sales order.
what could be the problem with this BAPI..
Please help.
Regards
VishnuHi Vishnu,
First try with minimum data for header and item .Check the documentation of that bapi.
DATA:
Order partners
li_order_partners TYPE STANDARD TABLE OF bapiparnr,l_order_partners LIKE bapiparnr,l_order_header_in LIKE bapisdhd1,
li_order_items_in TYPE STANDARD TABLE OF bapisditm,l_order_items_in LIKE bapisditm,li_order_items_inx TYPE STANDARD TABLE OF bapisditmx,l_order_items_inx LIKE bapisditmx,return TYPE STANDARD TABLE OF bapiret2,l_return TYPE bapiret2,
l_vbeln LIKE bapivbeln-vbeln,
CLEAR l_order_partners.
l_order_partners-partn_role = 'AG'. "Remember German codes !
l_order_partners-partn_numb = '0000001032'.
APPEND l_order_partners TO li_order_partners.
Sales document type
l_order_header_in-doc_type = 'TA'. "Remember German codes !
l_order_header_inx-doc_type = 'X'.
Sales organization
l_order_header_in-sales_org = '1000'.
l_order_header_in-distr_chan = '10'.
l_order_header_in-division = '00'.
l_order_items_in-itm_number = '10'.
l_order_items_in-material = 'abcmaterial'.
l_order_items_in-comp_quant = '1'.
APPEND l_order_items_in TO li_order_items_in.
CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'
EXPORTING
order_header_in = l_order_header_in
IMPORTING
salesdocument = l_vbeln
TABLES
return = li_return
order_items_in = li_order_items_in
order_partners = li_order_part
WRITE: / l_vbeln.
IF l_errflag IS INITIAL.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
ENDIF.
For the above document type , sales organisation,distribution channel,division,customer,material check with you functional consultants and take the exact combination of data. That combination is very important.Please ask t if you need more help in this.
Regards,
Madhu.
Edited by: madhurao123 on Mar 3, 2011 5:11 AM -
Logic for Open Sales order qty
What should be the logic given to determine "open sales order qty" during designing a report.
Note the criterias are as under:
1) Open sales order qty is the confirmed qty less the delivery qty.
2) The delivery qty should be delivery order qty (The delivery should not necessarily be pick, packed & PGI)sorry it doesn't work for services, since they do not create requirements.
in this case you can use VBFA table, subracting all the delivered quantities VBFA-RFMNG with VBFA-VBTYP_N = J and VBFA-VBELV/VBFA-POSNV = to your order/item from the ordered quantities
hope this help you.
Roberto -
Sales order qty not possible to change.
hi experts
i have created a sales order with suppersession material for 2 qty and we deliver only 1 qty to customer.
now i want change the sales order qty 1 so that status gets completed.
but in VA02 material qty is in hidden mode cant possible to make changes. this is happening with suppersession material only.
need your support
thank youhi dear
thanks for the reply again
schedule line is also in grey mode. cant possible to make changes.
let me add on this
when we create order suppersession material entered with item cat. TAPA which generate automated second line item cat TAN. when we make delivery TAN gets copied in the DO and Billing afterthat.
but issue is once delivery created. in VA02 order oty field (KWMENG) become in grey mode. cant possible make any changes ?
i have checked both the item categories completion rule which is (not relevent for completion) -
On my sales order qty only 'four digit' numbers show up.
For example, 1000 will show up on the print out.
However, 10000 will not show up and will be desplayed as *000 with an *
How do i get all digits to display?
Edited by: ManjeetSingh on Mar 16, 2010 1:42 AMAsk your ABAPer to do the changes in the Smart Form of Sales Order.It is due to settings maintained in the Smart Form which allow to show only 4 digit for Sales Order Quantity.
Best Regards,
Ankur
Maybe you are looking for
-
How can I update an object and its nested collection- Agengy, SMP 3.0
Hello Gurus, I have two objects: PurchaseOrders and PurchaseItems. 1 PurchaseOrder has more than 1 PurchaseItems. In my Java code, I create a Item array in PurchaseOrder object to store the PurchaseItems. What I want to do is to update the PurchaseOr
-
I need to learn how to add a page at the end of my video to put credits?
I am editing for the first time EVER and need to know how to add credits to the end of a video
-
PP CC 2014 & Memory RAM - BUG?
Hello Everyone I have some problems with PP CC 2014 that were not previously One. Problem of memory after a few hours the computer's memory jumps gradually to a maximum 16G Two. 'Auto Save' to Cloud does NOT work - I get a message that I need to inst
-
How can i download photoshop elements and premiere elements 10 using the serial number not the cd? I tried downloading the trial elements 11 and entering the serial number but it wouldn't work, i cannot find a trial for elements 10. Thanks
-
QT 7.7 plugin in Firefox 8 not working
Under SN 10.6.8 QuickTime is not playing movies. Any suggestions for a fix. Working fine in Safari. No Ad blocker, just suddenly no QT playback.