03-08-2017 2:21 AM - edited 02-03-2024 10:01 PM
Hi everyone,
I'm trying to create AR Invoices with Kits and assigning bin location to the child items, but it seems that I'm missing something.
To reproduce it on the Demo DB (SAP Version: 9.1 PL09 and SQL Server 2012):
- Create a new Item "PARENT" as a sales & non stock
- Create the Bill of material with child items: C00001 & C00002; warehouse 05
- For warehouse 05, tab "Bin Locations", change the field: Auto Alloc on Issue to "Single Choice"
- Optional: Transfer stock to Bin: 05-A01-S01-L01 for items C00001 & C00002; (fyi: BinAbsEntry=2)
Simplified code:
SAP_Document = (SAPbobsCOM.Documents) ocompany.GetBusinessObject((BoObjectTypes)SAPbobsCOM.BoObjectTypes.oInvoices); SAP_Document.CardCode = "C20000";
SAP_Document.Lines.ItemCode = "PARENT"; // BOM Parent
SAP_Document.Lines.Quantity = 1;
SAP_Document.Lines.WarehouseCode = "05"; SAP_Document.Lines.BinAllocations.Quantity = 1; SAP_Document.Lines.BinAllocations.BinAbsEntry = 2; SAP_Document.Lines.BinAllocations.BaseLineNumber = 1; // Invoice Line Child C00001 SAP_Document.Lines.BinAllocations.Add();
SAP_Document.Lines.BinAllocations.Quantity = 1; SAP_Document.Lines.BinAllocations.BinAbsEntry = 2; SAP_Document.Lines.BinAllocations.BaseLineNumber = 2; // Invoice Line Child C00002
int Result = SAP_Document.Add();
string Error = ocompany.GetLastErrorDescription();
If I run the script without the BinAllocations section, I receive the error: "1470000341 - Fully allocate item \"C00001\" to bin locations in warehouse \"05\"" -> which is correct
If I run the script using the first three lines of the BinAllocation section (Quantity, BinAbsEntry and BaseLineNumber), then I receive the error: "1470000341 - Fully allocate item \"C00002\" to bin locations in warehouse \"05\"" -> which is correct, I have successfully assigned the bin for the first child, pending to assign the bin for the second child.
If I run the script using all the code, then I receive the error: External component has thrown an exception.
I have tried multiple options (BinAllocation.Add; Lines.Add, SetCurrentLine, etc); but I have been unable to create the document.
Note.- I have been able to create the document using DTW (DocumentLinesBinAllocation) with the same data, including BaseLineNumber 1 & 2.
Does someone know how to fix this problem?
Regards,
Hugo
Hello to everyone!
I have the same case, someone with a solution?
Regards,
José Fabián.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Dear Hugo,
Hello! I know this is an old post but did you find any solution regarding this?
I am facing a similar issue.
Regards,
Alexandra
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
91 | |
8 | |
7 | |
4 | |
4 | |
3 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.