Error : Add Delivery/Invoice based on order
Hello
I try to add deliveries (or invoices) based on a range of orders (via SDK). Everything works fine, except for one order, where I get the error message:
"-5002 Quantity falls below minimum stock [DLN1.ItemCode][Line:2]"
If I try to add a delivery (or an invoice) based on the same order in SBO itself (so not via SDK), I also get a message concerning the minimum stock, but I have the option to continue and ignore the message.
Is it possible via the SDK to work around this message and to let SBO know that it doesn't bother me that we fall below minimum stock?
Thank you very much
Iris Spenninck
Hello Iris,
When sth. works in the application - showing a warning or not - it should also work through DI API.
Anything else is a bug that you should report to SAP Support via SAP Service Marketplace!
Regards,
Frank
Similar Messages
-
How to Add Delivery Note based on sales Order
How to add a delivery note based on sales order.
say i have a order no. 10 and linenumber 0 to 3.
each time i book with order no 10 and line no.3,i need to add to delivery note.
i also in need of adding just one Header and Multiple lines(Header for order Number - 10 and multiple lines for each Booking ).
How can i achieve this.Hi
You can search the samples....C:\-->Program files->SAP----->SDK->Samples->DiAPI----->OrderandInvoice...
Here invoice is added for a particular sales order.....the same can be done for delivery.....
Hope it helps -
Trying to create a Invoice based on Order need help Error -5002
the dreaded -5002 error is haunting me too! and I could not find a matching solution for this in the forum....
I need help quickly on this. I am trying to create invoices for some orders so the Base - Target relationship is retained. The orders I pick are all Open (DocStatus = O and the lines are all Open LineStatus = O)
here is my code
oInvoice.Lines.BaseEntry = 48
oInvoice.Lines.BaseLine = 0
oInvoice.Lines.BaseType = SAPbobsCOM.BoObjectTypes.oOrders
oInvoice.Lines.ItemCode = "A00001"
oInvoice.Lines.ItemDescription = "IBM Infoprint 1312"
'adding Line
oInvoice.Lines.Add
oInvoice.Lines.BaseEntry = 48
oInvoice.Lines.BaseLine = 1
oInvoice.Lines.BaseType = SAPbobsCOM.BoObjectTypes.oOrders
oInvoice.Lines.ItemCode = "A00002"
oInvoice.Lines.ItemDescription = "IBM Inforprint 1222"
'adding Line
oInvoice.Lines.Add
lRetCode = oInvoice.Add
If lRetCode <> 0 Then
gObjCompany.GetLastError lErrCode, sErrMsg
MsgBox (lErrCode & " " & sErrMsg)
End IfIndika,
Only set your base types...
(not items & description)
oInvoice.Lines.BaseEntry = 48
oInvoice.Lines.BaseLine = 0
oInvoice.Lines.BaseType = SAPbobsCOM.BoObjectTypes.oOrders
oInvoice.Lines.ItemCode = "A00001"
oInvoice.Lines.ItemDescription = "IBM Infoprint 1312"
'adding Line (to fill the second item line)
' the 1st line item is there by default
oInvoice.Lines.Add
oInvoice.Lines.BaseEntry = 48
oInvoice.Lines.BaseLine = 1
oInvoice.Lines.BaseType = SAPbobsCOM.BoObjectTypes.oOrders
oInvoice.Lines.ItemCode = "A00002"
oInvoice.Lines.ItemDescription = "IBM Inforprint 1222"
'DO NOT Add THIS line
' (only if you want to add a 3rd line item)
'''oInvoice.Lines.Add -> Don't add this
lRetCode = oInvoice.Add
If lRetCode <> 0 Then
gObjCompany.GetLastError lErrCode, sErrMsg
MsgBox (lErrCode & " " & sErrMsg)
End If
remember to add :
oInvoice.CardCode = "your BP"
oInvoice.DocDueDate = Now
oInvoiceDoc.CardCode = txtDOCBPCode.Text -
User forgot to add delivery costs to purchase order
Got a user that forgot to add delivery costs to a purchase order, now it has been GR and IRd, now they want to add the delivery costs, of course they have to reverse the IR and possibly the GR as well, go to change mode and add this missing condition manually
any other options for doing this?? dont think the invoice has been paid yet
ThanksDear Mark Ojo.
Try to think of this missing activity, User/Client can mistake/forget this delivery cost
at anytime. so, you can consider for solving this missing amount as below ;
- If already this finished the GR and IR procedures, (but invoice has not been paid yet),
best way is also cancellation of entire posted document, but i think that you just try to
apply this delivery cost to MIRO (--> Unplanned delivery costs).
1) MIRO --> "Unplanned delivery costs" on the Detail Tab Screen.
If you are using the conventional Invoice Verification component, the system splits up the
delivery costs entered among the individual items, based on the amounts invoiced so far
plus those in the invoice being entered.
If you are using Logistics Invoice Verification, how the unplanned delivery costs are posted
depends on the Customizing settings. There are two possibilities:
- Unplanned delivery costs are split up as in conventional Invoice Verification.
- Unplanned delivery costs are posted in a separate posting line to a G/L account set
up for this.
2) MIRO --> "Subsequent Debit" on the first screen.
Specifies which transaction you can choose "Subsequent Debit" for such as when you
received an invoice from your vendor for delivered goods.Delivery costs are to be charged.
on the other hand, if you received a credit memo for delivered goods(previously charged
delivery costs are to be credited) , you can choose "Subsequent Credit".
Regards,
Jeong, Yeong-Chul -
8.8 Invoice based on Order
Hi all,
I am trying to create an invoice based on a sales order.
I have this code which worked fine in SBO 2007 but now in 8.8 I get -2010 : Internal error
oDoc = (SAPbobsCOM.Documents) oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oInvoices);
oDoc.CardCode = sCardcode;
oDoc.Lines.BaseType = 17;
oDoc.Lines.BaseEntry = int.Parse(docentry);
oDoc.Lines.BaseLine = 0;
Can anyone help me with this?
ThanksHi Gordon,
It is a variable, but that is not the issue I think.
But just in case: here is the complete code
oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset);
try
SAPbobsCOM.Documents oDoc = (SAPbobsCOM.Documents) oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oInvoices);
Matrix matrix = Matrix.GetFromUID(pVal.Form, "10");
int rowcount = matrix.Rows.Count;
string prev_docnum = "";
string docnum = "";
string docentry = "";
string cardcode = "";
int retval = 0;
for(int i = 0;i <= rowcount-1;i++)
docnum = matrix.GetValue("11", i);
cardcode = matrix.GetValue("10", i);
string regel = matrix.GetValue("12", i);
string itemcode = matrix.GetValue("8", i);
if(prev_docnum != docnum)
if(prev_docnum != "")
retval = oDoc.Add();
if(retval != 0)
int errcode;
string errmsg;
oCompany.GetLastError(out errcode, out errmsg);
StatusBar.WriteError(String.Format("Fout bij verkooporder {0} - {1}: [{2}] {3}",
docnum,
cardcode,
errcode.ToString(),
errmsg));
else
string newdoc;
oCompany.GetNewObjectCode(out newdoc);
SAPbobsCOM.Recordset oRs = (SAPbobsCOM.Recordset) oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset);
try
oRs.DoQuery(String.Format("SELECT DocNum, convert(varchar(8),DocDate,112), CardName FROM OINV WHERE DocEntry = '{0}'", newdoc));
StatusBar.WriteSucess(String.Format("Nieuwe factuur aangemaakt: {0} - {1}",
oRs.Fields.Item(0).Value.ToString(),
oRs.Fields.Item(2).Value.ToString()));
finally
System.Runtime.InteropServices.Marshal.ReleaseComObject(oRs);
oRs = null;
GC.Collect();
oDoc = null;
oDoc = (SAPbobsCOM.Documents) oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oInvoices);
// GET DOCENTRY
SAPbobsCOM.Recordset oRsDoc = (SAPbobsCOM.Recordset) oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset);
try
oRsDoc.DoQuery(String.Format("SELECT DocEntry FROM ORDR WHERE DocNum = '{0}'", docnum));
docentry = oRsDoc.Fields.Item(0).Value.ToString();
finally
System.Runtime.InteropServices.Marshal.ReleaseComObject(oRsDoc);
oRsDoc = null;
GC.Collect();
oDoc.CardCode = cardcode;
oDoc.DocDate = DateTime.Now;
oDoc.Lines.BaseType = 17;
oDoc.Lines.BaseEntry = int.Parse(docentry);
oDoc.Lines.BaseLine = int.Parse(regel) - 1;
oDoc.Lines.Add();
oDoc.Lines.SetCurrentLine(int.Parse(regel) - 1);
prev_docnum = docnum;
// ADD LAST INVOICE
retval = oDoc.Add();
if(retval != 0)
int errcode;
string errmsg;
oCompany.GetLastError(out errcode, out errmsg);
StatusBar.WriteError(String.Format("Fout bij verkooporder {0} - {1}: [{2}] {3}",
docnum,
cardcode,
errcode.ToString(),
errmsg));
else
string newdoc;
oCompany.GetNewObjectCode(out newdoc);
SAPbobsCOM.Recordset oRs = (SAPbobsCOM.Recordset) oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset);
try
oRs.DoQuery(String.Format("SELECT DocNum, convert(varchar(8),DocDate,112), CardName FROM OINV WHERE DocEntry = '{0}'", newdoc));
StatusBar.WriteSucess(String.Format("Nieuwe factuur aangemaakt: {0} - {1}",
oRs.Fields.Item(0).Value.ToString(),
oRs.Fields.Item(2).Value.ToString()));
finally
System.Runtime.InteropServices.Marshal.ReleaseComObject(oRs);
oRs = null;
GC.Collect();
oDoc = null;
catch(Exception ex)
StatusBar.WriteError(ex.Message); -
Creation of invoices based on orders
Hi All,
Can anybody explain me about below point:
<b>The System's orders listed are in OPEN status and ready to Invoice.
Please create Invoice against these orders</b>
Can anybody tell me steps in creating the <b>Invoice from the given Sales Order's</b>.
The way i am doing is:
<b>1. Goto VA02 given Open Sales Order and then Hit Enter.
2. Then from Menu Path Sales Document -> Billing hit on Billing
3. It will then take us to VF01 screen with all the data filled in.
4. Then i am hitting on the SAVE Button then an Invoice Number is getting created.</b>
<b>Is it the way to create Invoice from Order.</b>
Can anybody give your sujjestions!
Thanks in advance.
Thanks,
Deep.Hi!
To create an invoice for an SD order, is reuiring the correct customizing for that order type.
Invoices can be made from orders, or deliveries.
The standard way to create an invoice, is to call the transaction VF01, then enter the reference document number in the table (order or delivery).
The way, you wrote is correct also.
Regards
Tamá -
Warning/Error Message delivery unit in sales order
Hello,
how is it possible to throw a warning or error message in the sales order, when the entered quantity is not a multiple of the delivery unit specified in material master sales tab 1?
Thanks
AnneHi,
Please take the help of your abaper and modify the user exit for sales order . Put a validation check at the time of entering the order quantity w . r .t delivery unit mentioned in the material master for that sales area and through a warning or error message as per your requirement.
For user exit please go through the below link:
http://help.sap.com/saphelp_46c/helpdata/en/1c/f62c7dd435d1118b3f0060b03ca329/content.htm
Hope this will help you to resolve your issue.
Regards,
Krishna O -
Synch of invoice based on delivery (without Delivery doc)
I've created in SBO Invoice based on Order (without Delivery document). Such Invoice act like delivery document and make stock postings. Why my order after synchronization doesn't change status to <i>send</i>? I've checked SHIPMENT table and there is no such document like my invoice.
Hello John,
I think the most simple way is to create a delivery first in SBO. After you have created all your deliveries you can use the Document Genaration Wizard to create all your invoices. After that you can use the option Document Printing to print all the invoices.
This way you only have to enter all the information once and the information (delivery) will be synchronized with Webtools.
Tim -
Unable to add AP Invoice based on a Purchase order or even directly for one particular item.
We get the following error
Stock Account is not defined [ AP Invoice Rows- Warehouse Code] Line 2 'Item Code' Message Message 173-77
We are unable to create goods issue,goods transfer or Goods Receipt for this item
Regards
FarheenHi Rekha........
As you know there are three types of GL Accounting Method.
1. Warehouse
2. Item Group
3. Item Level
If you are doing Purchase Invoice or GRN then you have to set all the stock related accounts.
For GRN at least set Inventory account, Allocation Account, Purchase Account and Purchase Offset Account.
For AP Invoice Based on GRN Sundry Creditors, Tax Accounts, Cenvat Clearing Account, Rounding Off.
For Delivery set Cost of goods sold, Inventory account,
For AR Invoice set Sundry debtors, Revenue account, Rounding Off
If ur GL method is set by Warehouse then define those acocunts at warehouse level.
If ur GL method is set by Item Group then define those acocunts at Group level.
If ur GL method is set by Item then define those acocunts at Item level.
This will solve your problem.....
Regards,
Rahul -
Ristrict user not to go for delivery with out sale order.
Hi,
I need some Help in ristricting the user from entering the Delivery document with any sale order.
As per the requirement all the documents should run in a proper fassion.
sale order> Delivery> Invoice.
Purchase Order> GRPO> Invoice.
If any change in the flow the user should not be allowed.
Is there any possibility to implement this can you please help me in doing such.
Thanks,
Mahi.Hello Mahi,
Is it not a trigger, it is inside store procedure of SBO_SP_TransactionNotification, which is standard part of the SAP B1 installation...
read the following blog of Lisa :
/people/lisa.mulchinock/blog/2009/05/22/the-sptransactionnotification-stored-procedure
ALTER proc [dbo].[SBO_SP_TransactionNotification]
@object_type nvarchar(20), -- SBO Object Type
@transaction_type nchar(1), -- [A]dd, <u>pdate, [D]elete, [C]ancel, C[L]ose
@num_of_cols_in_key int,
@list_of_key_cols_tab_del nvarchar(255),
@list_of_cols_val_tab_del nvarchar(255)
AS
BEGIN
-- Return VALUES
declare @error int -- Result (0 for no error)
declare @error_message nvarchar (200) -- Error string to be displayed
SELECT @error = 0
SELECT @error_message = N'Ok'
DECLARE @docnum nvarchar(50)
-- ADD YOUR CODE HERE
if @object_type='15' and @transaction_type='A'
BEGIN
if exists(select top 1 'A' from dln1 T0 where T0.BaseType != '17' and T0.DocEntry = @list_of_cols_val_tab_del)
begin
set @error = '-1'
set @error_message = 'delivery without sales order is not allowed!'
end
END
-- SELECTthe return VALUES
SELECT @error, @error_message
END
Regards,
J. -
hi
I am Show Reddy. Whenever, i want to deliver the item i.e in vl01n, I am getting error "No delivery-relevant items in order 0000015138, order type OR" The long text is "The sales order you want to deliver, sales order 0000015138 with order type OR, either contains no delivery-relevant items or its delivery-relevant items have already been delivered." . I have executed number of deliveries with same material and customer. when i starting simple credit check and dynamic credit check this problem occurred. I am herewith attaching screen shot of the error. can anybody help me.
Regards
Show Reddy TummaI did only one small change in item cat config setting( TAN)
" item relevant for delivery" in TAN config ( activated)
Your statement is wrong. It is not just because of activating the field item relevant for deliver in TAN.
Am sure it is because either you or your trainer must have activated the field in Item Rel for delivery in your respective schedule line category ( example for CP in VOV6).
For testing you just deactivate the field " item rel for Delivery" for your item cat (TAN) and make sure that item rel for del is activated in schedule line category ( in VOV6 ). Then system allow to create delivery then Invoice.
Please Note: read the F1 help of the fields once again.
We never activate the field "Item rel for delivery" for the standard items ( TAN), we activate it for Text item example ( for item category TATX).
For standard items we always check the field item rel for Delivery in Schedule line category ( VOV6) (then only system allow to create the delivery and Invoice) not in Item category (VOV7).
Am sure in your case also as i already mentioned in my earlier post it is because of your Schedule line category the field Item rel for Delivery is deactivated hence it caused the issue. It is not because of the item rel for delivery is de activated for (TAN).
Let me know if you need any further clarity?
thanks,
Srinu. -
No delivery-relevant items in order 0060000120, order type ZNRE, Message no
Hi Experts
I am trying to do return delivery( Sales Return) through the transaction code "VL01N" but I am getting the error "No delivery-relevant items in order 0060000120, order type ZNRE, Message no. VL455".
1) I did Check the Sales Order Document "ZNRE" at Transaction Code VOV8, there Delivery Type "LR" is assigned, both the order and delivery related billing are assigned with "RE-Credit For Returns and Sales Document Category is "H-Returns".
2) I did check the Item Category "REV" at Transaction Code "VOV7", there both Schedule Line and Returns box are with check and Item Relv f Delv is Uncheck.
3) I did check Schedule Line Category "ZZ-No MRP" at Transaction Code "VOV6", there Item relv f Del is check and movement type 651-Good Ret. Del Returns.
4) I did check Copy Control at VTLA, LR is delivery type and ZNRE is order type is maintained properly both the side at header level and item level.
5) I did check at Return Sales Order Document Flow, it is as follows below
Document Quantity Unit Ref.Value Currency On Statutus
Narmada Qtn 0020000043/10 1 EA 350000 NZD 04.10.2011 Completed
Narmada Std Order 0000012229/10 1 EA 350000 NZD 04.10.2011 Completed
Delivery 00815249/10 1 EA 05.10.2011 Completed
Invoice (F2) 0090036433/10 1 EA 350000 NZD 05.10.2011 F1 Document Created
Narmada Return 0060000120/10 1 EA 350000 NZD 12.10.2011 Open
Kindly help me to resolve this error.
Thanks and Regards
M.Dheerendar JainDear DHEERENDAR JAIN ,
Please check few things.
whether the immediate delivery switch is clicked for the document type (just to make sure delivery is not actually created in the background). or else check and confirm in the doc.flow.
Then keep item category as relevant for delivery.
Now in table VBUK or VBUP , you check whats the delivery relevance . give your sales order no as VBELN .
I hope you know to use SE11 /SE16N etc
It will be NOT RELEVANT FOR DELIVERY.
now comes to va02, make some changes in the qty and save.
Check whether VBUK/VBUP-delivery relevance field is updated.
Even if you have made a change in the item category - relevance for delivery , it will not affec the documents which were already created.
Now if its a DEV or QAS, make a fresh order and test. It should work.
If its prdn, please let us know. We will have to edit 2 fields in the table VBUK and VBUP.
Thanks & Regards,
Hegal K Charles -
DELIVERY Billing class and ORDER Billing class
Hi,
I am maintiang an custom table and I Need to add DELIVERY Billing class and ORDER Billing class entries for a list of country.I am not sure where I can find this info in customising or is there any table which hold this info per country wise can you help.
Regards,
AmandaHi Shiva ,
Thank you for your reply, could you help me like what is the billing class maintained I need to mintained Billing class in the table .
Client ID Billing class Country Billing type
"D = Delivery Related
O = Order Related"
Regards,
Amy -
No delivery-relevant items in order 0060000119, order type ZNRE
Hi Experts
I am working on "Create Return Delviery" through the transaction code VL01N with reference to return sales order no "60000119". I am getting error "No delivery-relevant items in order 0060000119, order type ZNRE", even though i have created return sales order with reference to billing document no but still getting this error. Kindly help with the solution for this.
Thanks and Regards
M.Dheerendar JainDear DHEERENDARJAIN,
This error might be many reasons.
Check in VOV8 return delivery type(LR) has been assigned or not.
Try to look after in to the copy controls in between Return sales document(RE) to return delivery document(LR).(VTLA)
Check item category return indicator has to be activated.
Schedulines allowed in indicator has to be activated.
Please revert if you have any further clarifications
Thanks&Regards
Raghu.k -
Add DeliveyNotes and Invoice based on Sales Order
i can manage to do it but..the Sales Order is not closed..why?
when i try to do it manual, when it make Delivery..the respective Sales Order is Closed..
below some of my code
For Each FirstScanRow As DataRow In _oDataset.Tables(FIRSTSCAN_TABLE).Rows
With oDeliveryNotes
Select Case iBasedDoc
Case 0
iBasedDoc = FirstScanRow("DocNum")
Case Is = CInt(FirstScanRow("DocNum"))
.Lines.Add()
isAddedHeader = False
End Select
' make an Invoice and Sales Delivery Order
If isAddedHeader Then
.DocDate = Today.Date
.DocDueDate = Today.Date
.TaxDate = Today.Date
.CardCode = FirstScanRow("CardCode")
End If
.Lines.BaseLine = i
.Lines.BaseType = SAPbobsCOM.BoObjectTypes.oOrders
.Lines.BaseEntry = iBasedDoc
'.Lines.ItemCode = FirstScanRow("ItemCode")
'.Lines.Quantity = FirstScanRow("Quantity")
'.Lines.VatGroup = "ZO"
If FirstScanRow("IsUseBatch") Then
' Add Batch
For x = 0 To FirstScanRow("Quantity") - 1
.Lines.BatchNumbers.BatchNumber = FirstScanRow("Scanned")
.Lines.BatchNumbers.Quantity = 1
.Lines.BatchNumbers.SetCurrentLine(x)
If x < FirstScanRow("Quantity") - 1 Then .Lines.BatchNumbers.Add()
Next
Else
' Add Serial
For x = 0 To FirstScanRow("Quantity") - 1
.Lines.SerialNumbers.SystemSerialNumber = FirstScanRow("SysSerial")
.Lines.SerialNumbers.InternalSerialNumber = FirstScanRow("Scanned")
.Lines.SerialNumbers.SetCurrentLine(x)
If x < FirstScanRow("Quantity") - 1 Then .Lines.SerialNumbers.Add()
Next
End If
End With
i = i + 1
Next
any insight?
thanks,
erick
Edited by: Erick Widya on May 13, 2008 10:52 AMNot sure if this will help or not, however some things I have in similar code that does appear to close the order are:
1. Set the Reference1 field in the "header" to the order the delivery is based on
delivery.Reference1 = salesOrderDocumentId.ToString();
2. I had to add all the additional expenses to the delivery too - you may not have any, so this may be mute.
Robin
Maybe you are looking for
-
Any one having , ABAP Check list for unicode conversion
Now I am in one upgrade project. Its new to me. Can anyone have ABAP checklist for unicode conversion in upgrade projects
-
Problem with my macbook pro start-up !!!
I have a macbook pro 13 linch running on OS X. Last night the battery of my laptop when dead and it got off. Today when i plugged in the laptop it was crashing while starting up. I started the laptop while holding the option key and it works fine but
-
Communication with EJB Server old address,Help!
I meet a Strange problem in weblogic 61 I use some IP address at 3 ejb server(cluster),that is ok,but at one time I changed the IP address and changed config.xml and delete all of ejb caches and temp classes,but when I u
-
Hi experts, i have attached a workflow scenario i created. i used the flow condition and my purpose is for invoice to be created only if the Delivery has been approved. i used the authorisation status and set it to dasapproved. CurrentProcess.B1Obj('
-
My ipad 2 suddenly quit retrieving my Yahoomail. I have checked my settings and done all suggestions, except deleting and restarting my Yahoo acct. Yahoo says I would loose all my data. Please fix this. What to do?