This sample shows how to create equipment in SAP using the BAPI BAPI_EQMT_MODIFY.
About
The BAI BAPI_EQMT_MODIFY can be used to create or change equipment in SAP.
To create equipment using the BAPI BAPI_EQMT_MODIFY the equipment name (equi_master["EQUIPMENT"]) must be written in uppercase. The fields EQUITYPE,INVENTORY and MANFACTURE are optional.
Call BAPI_EQMT_MODIFY
The following sample code creates equipment in SAP using the BAPI BAPI_EQMT_MODIFY:
usingSystem;usingERPConnect;// Set your ERPConnect licenseLIC.SetLic("xxxx");usingvarconnection=newR3Connection(host:"server.acme.org",systemNumber:00,userName:"user",password:"passwd",language:"EN",client:"001"){Protocol=ClientProtocol.NWRFC,};connection.Open();RFCFunctionfunc=connection.CreateFunction("BAPI_EQMT_CREATE");RFCStructureequi_master=func.Exports["EQUIMASTER"].ToStructure();equi_master["EQUIPMENT"]="TESTEQUIP04";// Equipmentequi_master["EQUICATGRY"]="M";//EquipmentCategoryequi_master["EQUITYPE"]="5000";//ObjectType optionalequi_master["INVENTORY"]="123456";//Inventury No. optionalequi_master["MANFACTURE"]="TEST AG";//Manufacturer optionalRFCStructureequi_text=func.Exports["EQUITEXT"].ToStructure();equi_text["EQUIDESCR"]="TestDescription";//DescriptionRFCStructureequi_location=func.Exports["EQUILOCATION"].ToStructure();equi_location["MAINTPLANT"]="1000";//Plantfunc.Execute();// ReturnMessage from BAPIRFCStructurefuncRet=func.Imports["RETURN"].ToStructure();if(funcRet["Type"].ToString()=="S")Console.WriteLine("Equipment was created succesfully");elseConsole.WriteLine(funcRet["MESSAGE"].ToString());Console.WriteLine("Please Press Enter to continue");Console.ReadLine();