cancel
Showing results for 
Search instead for 
Did you mean: 

Trying to do a production receipt

Former Member
0 Kudos

I'm programming a production receipt in SAP. AS you know, sap doesn't have objtects to work with receipts, so i do an inventory entry and then i make this update to IGN1:

Rs.DoQuery "UPDATE IGN1 set BaseType=202, baseentry = " & DocNum & ", baseline = 0 where docentry = " & NewCode

Where newcode is the new code for the last inventory entry.

That works OK, but yesterday, when a did an inventoryentry.Add, this error surprise me!

.Add= -10

Error Message= No Price[OIGN.Doctotal]

If i add a value to DocTotal, this error doesn't happens, but my question is why now i need to use doctotal to avoid this error, and i don't want to use it, because doctotal is a value that i don't have so i put any value.

This is the code:

BoIGE.CardCode = CardCode

BoIGE.DocDate = DocDate

BoIGE.DocDueDate = DocDueDate

' **********************************

' *********** PRUEBA ***************

'BoIGE.DocTotal = Coste * Quantity1

' ************* FIN PRUEBA **********

'campos de usuario a nivel de cabecera en Recibo

BoIGE.Lines.ItemCode = ItemCode

BoIGE.Lines.Quantity = Quantity1

BoIGE.Lines.AccountCode = "61020001"

BoIGE.Lines.WarehouseCode = WhsCode

BoIGE.Lines.BaseType = 0

BoIGE.Lines.BaseLine = 0

BoIGE.Lines.BaseEntry = BaseEntry

BoIGE.Lines.Add

BoIGE.Add

After that, i do the SQL Update.(but BoiGE.Add gives me the error)

Any idea?

Accepted Solutions (1)

Accepted Solutions (1)

FOA
Advisor
Advisor
0 Kudos

Hi Natalia,

It's not allowed to update Business One tables using the RecordSet. You can have lot of problems with it as the objects update more than one table automatically.

This object is exposed indeed. Go to the Documents object, and then to the Document_Lines Object, you will find a description like this:

For IGN1 table, select Inventory --> Inventory Transactions --> Goods Receipt.

Or, in case of receipt from production, select Production --> Receipt from Production (see ProductionOrders).

I know that the "update" method is not yet exposed. You can enter a DRQ to ask for this feature, but in the meanwhile you will have to evaluate if this update is really needed or you can avoid it. Do you think you can set another business process that can handle your case with out updating lines directly?

Best regards,

Felipe

Former Member
0 Kudos

I think you're using SAP 2005, because in the 2004 version the object ProductionOrders doesn't exists, so i have to use SQL to make this opearation.

Thanks for your help!

FOA
Advisor
Advisor
0 Kudos

Yes you are right Nalatia, but this object is planned to be downgraded in the patch of August.

Best regards,

Felipe

former_member185703
Active Contributor
0 Kudos

You might wish to checkout this parallel thread as well...

Regards,

Frank

Answers (2)

Answers (2)

Former Member
0 Kudos

Ok, i think i found the solution, correct me if i'm wrong

<b>Problem:</b> to make a production receipt, we don't have an object in the 2004 version that do it.

<b>Solution:</b> use an inventorygenentry and after that, using SQL update IGN1 as this:

Rs.DoQuery "UPDATE IGN1 set BaseType=202, baseentry = " & DocNum & ", baseline = 0 where docentry = " & NewCode

<b>SecondProblem:</b> Method inventoygenentry.add gives th error descripted:Error Message= No Price[OIGN.Doctotal]

This is caused because when you're doing an inventorygenentry, it takes the price from the last purchase price. If this price is null, then you get the error.

<b>Second Solution</b>: Verify that this price is not null.

Trinidad
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi,

If your objective is to create a Production receipt from a ProductionOrder you can do it by creating an InventoryGenEntry pointing to the ProductionOrder. You don't need then any update on the IGN1 table, the production Receipt is automatically created.

Regards

Trinidad.

Former Member
0 Kudos

I think the error in the method InventoryGenEntry.Add is caused because the item has not the last purchase price.