Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Sales Blanket Agreement Documents generation by DI

Hello.

Is it possible to programmatically add entries to Documents table of Sales Blanket Agreement objects.

Regards,

Pawel

replied

Hi Pawel,

For you associate your sales blanket agreement to your sales order you need note some things.

In your sales blanket agreement:

     1. Your sales blanket agreement should be with status Approved

In your sales order:

  1. Your customer must be equals the customer that describe in sales blanket agreement.
  2. The DocDueDate must be between Start Date and End Date in sales blanket agreement.
  3. The item that you associate with the sales agreement must be contains in sales blanket agreement.

Now, a sample code with information in hardcode:

                Documents order = (SAPbobsCOM.Documents)oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oOrders);

                order.CardCode = "C20000";

                order.DocDueDate = DateTime.Now;

                order.Lines.ItemCode = "A00001";

                order.Lines.Quantity = 3;

                order.Lines.AgreementNo = 28;

                if (order.Add() != 0)

                {

                    MessageBox.Show(oCompany.GetLastErrorDescription());

                    return;

                }

                else

                {

                    MessageBox.Show("Order [" + oCompany.GetNewObjectKey() + "] created!");

                }

The result:

Hope it helps.

Regards,

Diego

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question