示例#1
0
        private void button2_Click(object sender, EventArgs e)
        {
            rfc_Connector cfg = null;

            cfg = new rfc_Connector();

            IRfcFunction getDataSAP = GlobalData.rfcRepository.CreateFunction("ZFRFC001");
            //getDataSAP.SetValue("P_KUNNR", "ALL");

            IRfcTable IT_DATA = getDataSAP.GetTable("LTLTZTB001");

            IT_DATA.Clear();
            IT_DATA.Append();
            IT_DATA.SetValue("MANDT", "400");
            IT_DATA.SetValue("MATNR", matnr.Text);
            IT_DATA.SetValue("MAKTX", maktx.Text);

            //IT_DATA.Append();
            //IT_DATA.SetValue("MANDT", "400");
            //IT_DATA.SetValue("MATNR", "MATERIAL02");
            //IT_DATA.SetValue("MAKTX", "COBA MATERIAL TEST");

            try
            {
                getDataSAP.Invoke(GlobalData.rfcDestination);
                RfcSessionManager.EndContext(GlobalData.rfcDestination);

                var           exObject    = getDataSAP.GetObject("OUTPUT");
                IRfcStructure exStructure = getDataSAP.GetStructure("LS_ZTB001");
            }
            catch (Exception ex)
            {
                message  = "SAP ZFDLKNA1 ";
                message += ex.Message;

                //RfcSessionManager.EndContext(GlobalData.rfcDestination);
                //Thread.Sleep(1000);
            }

            readdata();
        }
示例#2
0
        private void button2_Click(object sender, EventArgs e)
        {
            rfc_Connector cfg = null;

            cfg = new rfc_Connector();

            IRfcFunction getDataSAP = GlobalData.rfcRepository.CreateFunction("ZPM_NOTIF_02_REWORK");

            getDataSAP.SetValue("QMNUM", textBox1.Text);

            try
            {
                getDataSAP.Invoke(GlobalData.rfcDestination);
                RfcSessionManager.EndContext(GlobalData.rfcDestination);

                var exObject = getDataSAP.GetObject("MESSAGE");
                MessageBox.Show(exObject.ToString());
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }