Ejemplo n.º 1
0
        public bool GetMaterialInfoForSAP(string strMaterialNo, ref Task.TaskDetails_Model taskDetailsModel, ref string strErrMsg)
        {
            var    sap_comm     = SAP_Common.SAP_Common.CreateInstance();
            string functionName = "ZLS_GET_MAT_WMS";
            Dictionary <string, string> lstParameters = null;
            Dictionary <string, Dictionary <string, object> > lstStructures = null;


            string        tableindex                            = "I_MATNR";
            List <string> ParameterNamesForOut                  = null;
            Dictionary <string, string> ParametersOutput        = null;
            List <string> StructureNamesForOut                  = null;
            Dictionary <string, IRfcStructure> StructureOutputs = null;
            List <string> tableNamesForOut                      = new List <string>()
            {
                "T_MATNR", "RETURN"
            };
            Dictionary <string, IRfcTable> rtbsOutput = null;

            IRfcTable rtbInput = CreateIrfcTableForMaterialInfo(sap_comm, strMaterialNo, functionName, tableindex);

            bool bSucc = sap_comm.getSapFunctionToTable(functionName, lstParameters, lstStructures, rtbInput, tableindex, ParameterNamesForOut, out ParametersOutput, StructureNamesForOut,
                                                        out StructureOutputs, tableNamesForOut, out rtbsOutput, ref strErrMsg);

            if (bSucc == false)
            {
                return(bSucc);
            }

            taskDetailsModel = CreateDetailsMaterial(rtbsOutput["T_MATNR"]);

            return(bSucc);
        }
Ejemplo n.º 2
0
        private Task.TaskDetails_Model CreateDetailsMaterial(IRfcTable rtb)
        {
            Task.TaskDetails_Model taskDetailsModel = new Task.TaskDetails_Model();

            taskDetailsModel.MaterialNo   = rtb[0].GetString("MATNR");
            taskDetailsModel.MaterialDesc = rtb[0].GetString("MAKTX");
            taskDetailsModel.Unit         = rtb[0].GetString("MEINS");
            taskDetailsModel.IsROHS       = rtb[0].GetString("NORMT") == "ROHS" ? 2 : 1;
            return(taskDetailsModel);
        }