Error while posting a sales order in SAP from .net application


Note that sold to party and ship to party are mandate fields. You need to add the created structures and tables to the function as shown in below code:

RfcRepository repo = destination.Repository;
IRfcFunction salesDoc = repo.CreateFunction("BAPI_SALESORDER_CREATEFROMDAT1");
IRfcStructure salesHeader = salesDoc.GetStructure("ORDER_HEADER_IN");
salesHeader.SetValue("DOC_TYPE", "ZDLR");
salesDoc.SetStructure(salesHeader);
salesDoc.Invoke(destination);

For more details you can check BAPI_SALESORDER_CREATEFROMDAT1 or below link:

BAPI_SALESORDER_CREATEFROMDAT1


Updated on: 04-Dec-2019

83 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements