Showing results for 
Search instead for 
Did you mean: 

Error -5000 (No Description) Relating SAP Documents

Former Member
0 Kudos

I have created a Purchase Order using the DI API and want to create and relate a Goods Receipt PO back to that Purchase Order. I can create both docs without fail but as soon as I try to relate my GRPO line item back to the PO I receive an error -5000 with no description.

My code to relate the docs:

docGRPO.Lines.BaseEntry = Convert.ToInt32(poEntry);

docGRPO.Lines.BaseType = Convert.ToInt32(Constants.PURCHASE_ORDER_OBJ_TYPE);

docGRPO.Lines.BaseLine = baseLine;

I have made sure the items on both docs have the same code, currency, rate and quantity but still no luck. The BP is also the same in both docs. Are there some other restrictions that are stopping me from relating my 2 docs to each other?

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Well, I took out all my code except for the code which sets the header information and then simply my 3 lines of code to base my first line item on my PO. This works fine. My problem with that is that I need to be able to both base the line item on the PO and be able to edit some of the base information (ie) Quantity and Price.

Is there anyway to do both or am I stuck with the original information if I base my line item on the PO line item? In some cases I will need to edit even the item code/description because I am creating the PO with an expected generic item and then the GRPO may contain one or more specific items that should be based on my PO item.

Active Contributor
0 Kudos

Hi David,

As a general rule: What you can do through DI API is the same or less than what you can do in the application.

E.g. when you change the item code in the application, you loose the connection between that line and the base document (though the remark is not updated...).

I found that currently you apparently can only set the item description to ""; I am not sure whether or not this is a bug.

Still you could use the "Free text" field - or a UDF to store the information you would like to be in a particular line...

If this does not help you, please post some more code so that we can find the problem.



Former Member
0 Kudos

Hi Frank and David,

I have same problem and I can not solve it.

Otherwise I have another question: compiling these 3 fields that refer to previous document is only a better navigating issue or does it cause something else?

For example I need that the invoice doesn't make another stock transfer, gone out of items as there has already been with the previous delivery and it would be double.

Thank you

Former Member
0 Kudos

I found this error was happening because the BaseType was being set incorrectly...

The following fixed the error:

poReceipt.Lines.BaseType = int.Parse(po.DocObjectCodeEx);