cancel
Showing results for 
Search instead for 
Did you mean: 

Create Good Receipt via Copy From button in c#

0 Kudos

Hi,

I am creating Receipts Good via this code

SAPbobsCOM.Documents oRceipt =

(SAPbobsCOM.Documents)company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oPurchaseDeliveryNotes);

oRceipt.CardCode = "7498";

oRceipt.DocDate = Convert.ToDateTime(DateTime.Now.ToString("MM/dd/yyyy"));

oRceipt.DocDueDate = Convert.ToDateTime(DateTime.Now.ToString("MM/dd/yyyy"));

oRceipt.Lines.ItemCode = "1657-7";

oRceipt.Lines.Quantity = 1;

oRceipt.Lines.WarehouseCode = "01";

oRceipt.Lines.UnitPrice = 165;

oRceipt.Lines.TaxCode = "NY";

oRceipt.Lines.LineTotal = 16.5;

if (oRceipt.Add() == 0)

{

Console.WriteLine("successful");

Console.ReadKey();

}

It perfectly works, but I have one requirement that need to be implemented in code :

When I create Receipt Goods in SAP interface there is button named "Copy From" at left corner down, which allows to select Purchase Order in combox

After I choose some item here the Receipt Good Item's line is created based on Purchase Order data

after I approved everything in dialog windows Receipt Good Item's line is created and this Purchase Order item which I used for this became closed, I can not use it anymore for another Good receipts creation.

How to do this all in c# code ?

Thanks in advance

Accepted Solutions (0)

Answers (0)