示例#1
0
        public ResponseWE05 extractReport(string messageVariant, string folderPath)
        {
            // 2 - inbound idocs only
            // 51 - Application not posted (Hardstop workflow)
            executeWE05(2.ToString(), 51.ToString(), messageVariant);
            string screenShotPath;
            string fileName;

            screenShotPath = folderPath + @"\" + DateAndTime.Now.ToFileNameFormat() + " WE05.jpg";
            fileName       = DateAndTime.Now.ToFileNameFormat() + " WE05.xlsx";

            if (sapLib.isPopUp())
            {
                sapLib.printScreenOfCurrentSession(screenShotPath);
                sapLib.pressEnter();
                return(ResponseWE05.noItems);
            }

            if (isTableExists())
            {
                sapLib.openExport();
                sapLib.exportExcel(folderPath, fileName);
                sapLib.printScreenOfCurrentSession(screenShotPath);
                return(ResponseWE05.successTable);
            }
            else
            {
                screenShotPath = folderPath + @"\" + DateAndTime.Now.ToFileNameFormat() + " single item only found WE05.jpg";
                try {
                    sapLib.printScreenOfCurrentSession(screenShotPath);
                } catch (Exception) {
                    System.Threading.Thread.Sleep(3000);
                    sapLib.printScreenOfCurrentSession(screenShotPath);
                }

                return(ResponseWE05.successSingleValue);
            }
        }