Esempio n. 1
0
        public IRfcStructure ToSapObject(string name)
        {
            IRfcStructure s = SapConnections.Get(name).Repository.GetStructureMetadata("BAPIMATMFRPN").CreateStructure();

            s["MANU_MAT"].SetValue(MANU_MAT);
            s["MFR_NO"].SetValue(MFR_NO);
            return(s);
        }
Esempio n. 2
0
 /// <summary>
 /// FUNCTION BAPI_USER_GETLIST
 /// </summary>
 /// <param name="ROWS">No. of users selected</param>
 /// <param name="MAX_ROWS">Maximum Number of Lines of Hits</param>
 /// <param name="WITH_USERNAME">Read User with Name</param>
 /// <param name="RETURN">Return Parameter</param>
 /// <param name="SELECTION_EXP">Search for Users with Free Selections</param>
 /// <param name="SELECTION_RANGE">Search for Users with a Ranges Table</param>
 /// <param name="USERLIST">User List</param>
 public static bool Invoke(ConnectionInformations ci, out string exception, out int ROWS, int MAX_ROWS, string WITH_USERNAME, ref SapTable <BAPIRET2> RETURN, ref SapTable <BAPIUSSEXP> SELECTION_EXP, ref SapTable <BAPIUSSRGE> SELECTION_RANGE, ref SapTable <BAPIUSNAME> USERLIST)
 {
     exception = "";
     ROWS      = default(int);
     try
     {
         SapConnections.Init(ci);
         RfcRepository rfcRep   = SapConnections.Get(ci.Name).Repository;
         IRfcFunction  function = rfcRep.CreateFunction("BAPI_USER_GETLIST");
         function.SetValue("MAX_ROWS", MAX_ROWS);
         function.SetValue("WITH_USERNAME", WITH_USERNAME);
         if (RETURN != null)
         {
             function.SetValue("RETURN", RETURN.ToSapObject(ci.Name));
         }
         if (SELECTION_EXP != null)
         {
             function.SetValue("SELECTION_EXP", SELECTION_EXP.ToSapObject(ci.Name));
         }
         if (SELECTION_RANGE != null)
         {
             function.SetValue("SELECTION_RANGE", SELECTION_RANGE.ToSapObject(ci.Name));
         }
         if (USERLIST != null)
         {
             function.SetValue("USERLIST", USERLIST.ToSapObject(ci.Name));
         }
         function.Invoke(SapConnections.Get(ci.Name));
         ROWS = function.GetInt("ROWS");
         if (RETURN == null)
         {
             RETURN = new SapTable <BAPIRET2>();
         }
         RETURN.FromSapObject(function.GetTable("RETURN"));
         if (SELECTION_EXP == null)
         {
             SELECTION_EXP = new SapTable <BAPIUSSEXP>();
         }
         SELECTION_EXP.FromSapObject(function.GetTable("SELECTION_EXP"));
         if (SELECTION_RANGE == null)
         {
             SELECTION_RANGE = new SapTable <BAPIUSSRGE>();
         }
         SELECTION_RANGE.FromSapObject(function.GetTable("SELECTION_RANGE"));
         if (USERLIST == null)
         {
             USERLIST = new SapTable <BAPIUSNAME>();
         }
         USERLIST.FromSapObject(function.GetTable("USERLIST"));
         return(true);
     }
     catch (Exception ex)
     {
         exception = ex.Message;
         return(false);
     }
 }
Esempio n. 3
0
        public IRfcStructure ToSapObject(string name)
        {
            IRfcStructure s = SapConnections.Get(name).Repository.GetStructureMetadata("BAPIMATRAS").CreateStructure();

            s["SIGN"].SetValue(SIGN);
            s["OPTION"].SetValue(OPTION);
            s["DESCR_LOW"].SetValue(DESCR_LOW);
            s["DESCR_HIGH"].SetValue(DESCR_HIGH);
            return(s);
        }
Esempio n. 4
0
        public IRfcStructure ToSapObject(string name)
        {
            IRfcStructure s = SapConnections.Get(name).Repository.GetStructureMetadata("BAPIUSNAME").CreateStructure();

            s["USERNAME"].SetValue(USERNAME);
            s["FIRSTNAME"].SetValue(FIRSTNAME);
            s["LASTNAME"].SetValue(LASTNAME);
            s["FULLNAME"].SetValue(FULLNAME);
            return(s);
        }
Esempio n. 5
0
        public IRfcStructure ToSapObject(string name)
        {
            IRfcStructure s = SapConnections.Get(name).Repository.GetStructureMetadata("BAPIMATLST").CreateStructure();

            s["MATERIAL"].SetValue(MATERIAL);
            s["MATL_DESC"].SetValue(MATL_DESC);
            s["MATERIAL_EXTERNAL"].SetValue(MATERIAL_EXTERNAL);
            s["MATERIAL_GUID"].SetValue(MATERIAL_GUID);
            s["MATERIAL_VERSION"].SetValue(MATERIAL_VERSION);
            return(s);
        }
Esempio n. 6
0
        public IRfcStructure ToSapObject(string name)
        {
            IRfcStructure s = SapConnections.Get(name).Repository.GetStructureMetadata("BAPIUSSRGE").CreateStructure();

            s["PARAMETER"].SetValue(PARAMETER);
            s["FIELD"].SetValue(FIELD);
            s["SIGN"].SetValue(SIGN);
            s["OPTION"].SetValue(OPTION);
            s["LOW"].SetValue(LOW);
            s["HIGH"].SetValue(HIGH);
            return(s);
        }
Esempio n. 7
0
        public IRfcStructure ToSapObject(string name)
        {
            IRfcStructure s = SapConnections.Get(name).Repository.GetStructureMetadata("BAPIRET2").CreateStructure();

            s["TYPE"].SetValue(TYPE);
            s["ID"].SetValue(ID);
            s["NUMBER"].SetValue(NUMBER);
            s["MESSAGE"].SetValue(MESSAGE);
            s["LOG_NO"].SetValue(LOG_NO);
            s["LOG_MSG_NO"].SetValue(LOG_MSG_NO);
            s["MESSAGE_V1"].SetValue(MESSAGE_V1);
            s["MESSAGE_V2"].SetValue(MESSAGE_V2);
            s["MESSAGE_V3"].SetValue(MESSAGE_V3);
            s["MESSAGE_V4"].SetValue(MESSAGE_V4);
            s["PARAMETER"].SetValue(PARAMETER);
            s["ROW"].SetValue(ROW);
            s["FIELD"].SetValue(FIELD);
            s["SYSTEM"].SetValue(SYSTEM);
            return(s);
        }
Esempio n. 8
0
 /// <summary>
 /// FUNCTION BAPI_MATERIAL_GETLIST
 /// </summary>
 /// <param name="MAXROWS">Maximum number of materials to be selected</param>
 /// <param name="DISTRIBUTIONCHANNELSELECTION">Selection options for distribution channel</param>
 /// <param name="MANUFACTURERPARTNUMB">Manufacturer and manufacturer part number</param>
 /// <param name="MATERIALSHORTDESCSEL">Selection options for material description</param>
 /// <param name="MATNRLIST">List of material numbers with material description</param>
 /// <param name="MATNRSELECTION">Selection options for material number</param>
 /// <param name="PLANTSELECTION">Selection options for plants</param>
 /// <param name="RETURN">Return Parameter</param>
 /// <param name="SALESORGANISATIONSELECTION">Selection options for sales organization</param>
 /// <param name="STORAGELOCATIONSELECT">Selection options for storage locations</param>
 public static bool Invoke(ConnectionInformations ci, out string exception, int MAXROWS, ref SapTable <BAPIMATRADC> DISTRIBUTIONCHANNELSELECTION, ref SapTable <BAPIMATMFRPN> MANUFACTURERPARTNUMB, ref SapTable <BAPIMATRAS> MATERIALSHORTDESCSEL, ref SapTable <BAPIMATLST> MATNRLIST, ref SapTable <BAPIMATRAM> MATNRSELECTION, ref SapTable <BAPIMATRAW> PLANTSELECTION, ref SapTable <BAPIRET2> RETURN, ref SapTable <BAPIMATRASO> SALESORGANISATIONSELECTION, ref SapTable <BAPIMATRAL> STORAGELOCATIONSELECT)
 {
     exception = "";
     try
     {
         SapConnections.Init(ci);
         RfcRepository rfcRep   = SapConnections.Get(ci.Name).Repository;
         IRfcFunction  function = rfcRep.CreateFunction("BAPI_MATERIAL_GETLIST");
         function.SetValue("MAXROWS", MAXROWS);
         if (DISTRIBUTIONCHANNELSELECTION != null)
         {
             function.SetValue("DISTRIBUTIONCHANNELSELECTION", DISTRIBUTIONCHANNELSELECTION.ToSapObject(ci.Name));
         }
         if (MANUFACTURERPARTNUMB != null)
         {
             function.SetValue("MANUFACTURERPARTNUMB", MANUFACTURERPARTNUMB.ToSapObject(ci.Name));
         }
         if (MATERIALSHORTDESCSEL != null)
         {
             function.SetValue("MATERIALSHORTDESCSEL", MATERIALSHORTDESCSEL.ToSapObject(ci.Name));
         }
         if (MATNRLIST != null)
         {
             function.SetValue("MATNRLIST", MATNRLIST.ToSapObject(ci.Name));
         }
         if (MATNRSELECTION != null)
         {
             function.SetValue("MATNRSELECTION", MATNRSELECTION.ToSapObject(ci.Name));
         }
         if (PLANTSELECTION != null)
         {
             function.SetValue("PLANTSELECTION", PLANTSELECTION.ToSapObject(ci.Name));
         }
         if (RETURN != null)
         {
             function.SetValue("RETURN", RETURN.ToSapObject(ci.Name));
         }
         if (SALESORGANISATIONSELECTION != null)
         {
             function.SetValue("SALESORGANISATIONSELECTION", SALESORGANISATIONSELECTION.ToSapObject(ci.Name));
         }
         if (STORAGELOCATIONSELECT != null)
         {
             function.SetValue("STORAGELOCATIONSELECT", STORAGELOCATIONSELECT.ToSapObject(ci.Name));
         }
         function.Invoke(SapConnections.Get(ci.Name));
         if (DISTRIBUTIONCHANNELSELECTION == null)
         {
             DISTRIBUTIONCHANNELSELECTION = new SapTable <BAPIMATRADC>();
         }
         DISTRIBUTIONCHANNELSELECTION.FromSapObject(function.GetTable("DISTRIBUTIONCHANNELSELECTION"));
         if (MANUFACTURERPARTNUMB == null)
         {
             MANUFACTURERPARTNUMB = new SapTable <BAPIMATMFRPN>();
         }
         MANUFACTURERPARTNUMB.FromSapObject(function.GetTable("MANUFACTURERPARTNUMB"));
         if (MATERIALSHORTDESCSEL == null)
         {
             MATERIALSHORTDESCSEL = new SapTable <BAPIMATRAS>();
         }
         MATERIALSHORTDESCSEL.FromSapObject(function.GetTable("MATERIALSHORTDESCSEL"));
         if (MATNRLIST == null)
         {
             MATNRLIST = new SapTable <BAPIMATLST>();
         }
         MATNRLIST.FromSapObject(function.GetTable("MATNRLIST"));
         if (MATNRSELECTION == null)
         {
             MATNRSELECTION = new SapTable <BAPIMATRAM>();
         }
         MATNRSELECTION.FromSapObject(function.GetTable("MATNRSELECTION"));
         if (PLANTSELECTION == null)
         {
             PLANTSELECTION = new SapTable <BAPIMATRAW>();
         }
         PLANTSELECTION.FromSapObject(function.GetTable("PLANTSELECTION"));
         if (RETURN == null)
         {
             RETURN = new SapTable <BAPIRET2>();
         }
         RETURN.FromSapObject(function.GetTable("RETURN"));
         if (SALESORGANISATIONSELECTION == null)
         {
             SALESORGANISATIONSELECTION = new SapTable <BAPIMATRASO>();
         }
         SALESORGANISATIONSELECTION.FromSapObject(function.GetTable("SALESORGANISATIONSELECTION"));
         if (STORAGELOCATIONSELECT == null)
         {
             STORAGELOCATIONSELECT = new SapTable <BAPIMATRAL>();
         }
         STORAGELOCATIONSELECT.FromSapObject(function.GetTable("STORAGELOCATIONSELECT"));
         return(true);
     }
     catch (Exception ex)
     {
         exception = ex.Message;
         return(false);
     }
 }