100% found this document useful (1 vote)
247 views25 pages

QM Idi

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
100% found this document useful (1 vote)
247 views25 pages

QM Idi

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 25
Developer Notes SAP QM-IDI Interface For INTERNAL USE ONLY by QSI Corporation © Copyright Quality Systems International Table of Contents Table of Contents. Introduction... Pre-requisites Development. 1.1 Get connected to SAP QM IDI... 1.2 Required Software. 124 12.2 123 124 125 1.3 Building QMIDI_VB.exe 00 1.3.1 Compiling the SAP Proxy Classes Deployment... 14 Pre-requisite installs. 15 Testing SAP connectivity . 1.5.1 Required Credentials 1.6 Database Install... 1.6.1 Supported Database Brands, 1.6.2 Required Database Objects 1.7 Running QMIDI_VB for the first time 18 Using QMIDI_VB. 41.8.1 Setting up the SAP Connection setting in WINLIMS_INI 1.8.2 Troubleshooting, LogLevel and log files. 1.8.3 Running QMIDI_VB in automode, .. 1.8.4 _Disconnecting the interface between Download and Uploads Data Flow of the Interface... 1,9 SAP QMIDI background.....ssss 1.10 The Role of QMIDI_VB.exe.. 1.11 The role of the WINLIMS "Mirror Tables”. ‘SAP QMIDI Interface ~ Developer Notes 1.11.1 Field Mapping between WinLIMS and QMIDI Mirror Tables 1.11.2 SAP Structures and Mirror tables used in the interfa 1.12 The role of INBOX SAMPLE Module. wisn 1.13 Database triggers and procedures logic 1.13.1. Download to WinLIMS .. 1.13.2 Upload to SAP.. Index..... ‘SAP QMIDI Interface ~ Developer Notes Introduction This document serves as a home for programmer/developer notes, such as programming, database, technical, and installation tips, etc. for the SAP QMIDI Interface (the “interface") that was deployed initially at Taminco (Fka Air Products and Chemicals). ‘The interface was derived from the interface deployed at StadtWerke- Flensburg, which in turn was derived from the Certified SAP interface. Note that the SWEL interface had a number of issues that made it compatible only on Oracle, and also it did not have the capability to upload Usage Decisions and it did not allow the upload of Qualitative results (text). These features, as well as a few other features (not Taminco specific but features that would be useful for any site) have been added to the "Taminco build of QMIDI_VB". This document will be amended frequently until a stable release. ‘SAP QMIDI Interface ~ Developer Notes Pre-requisites ‘The following items are to deploy the interface, referred to as the “interface” or as "QMIDI_VB” Development computer: - Hardware: any computer capable of running the software below - Visual Studio .NET 2002 (.NET Framework 1.0) - SAP .NET Connector or SAP.Connector.DLL - SAP GUI 4.6 installed and connectivity established << VITAL = QM-IDI_VB Solution - WinLIMS 2005 solution Note: the development environment has not been fully documented and tested, as we used precompiled exes for the install, but the above were required to open and view the source code. Deployed computer (server or desktop) - Windows 2003 or higher server or Windows 2000 or Windows XP desktop - _.NET Framework 1.0 or higher - SAP GUI - SAP .NET Connector - Java 2 Runtime Environment, v2.11.15.0 or higher ‘SAP QMIDI Interface ~ Developer Notes Development 1.1 Get connected to SAP QM IDI The development machine (with QMIDI_VB solution using Visual Studio .NET 2002) must be connected to the customer's SAP system. There are 2 main ways to do this: 1. your office PC will have a VPN connection to their network and be able to run the SAP GUT locally. 2. Commander 2 customer computer with a connection, install al necessary software and make it a development machine and control that computer remotely (e.g. GoToMeeting). 1 chose option 2 simply because I found it a lot easier to take a customer computer that had a proven SAP Gui install, and install VS.NET and the other pieces of software below. I then used GoToMeeting to control the PC from my desk. I recommend 2, however Strunk and Dobbertin in QSI DE recommend option 1. 1.2 Required Software This software is required for the development PC to connect up to SAP, run the proxy class generator and ultimately run the program and execute RFCs in SAP. ‘The software below should be installed in the order below. 1.2.1 SAP GUI The customer must have this installed at his location, and a login must be performed in person as a test. Doing this test also allows you to glean and verify important connection details which you'll need later. You can get the Application Host, System Number, etc. from the SAP Gui Login screen (scroll to the right) and once logged in addition information from the Status screen, 1.2.2 Visual Studio .NET 2002 (.NET 1.0) If this is not something the customer has in-house, use QSI MSDN CDs to ‘temporarily install VS.NET 2002 at the customer site if you plan to remotely ‘SAP QMIDI Interface ~ Developer Notes control a PC at customer site, or be on-site and use a customer computer. Considering that we do very little development in VS.NET 2002, we have enough MSDN licenses to temporarily install this for this purpose, Note: do not install VS.NET 2003 or 2005, you must use VS.NET 2002. 1.2.3. SAP .NET Connector ‘The SAP .Net Connector is installed via the file: SAP.NET_Connector.msi. This file is supplied by SAP but we retained a copy and can provide it with the interface. Run the install and select all defaults. Note: If you do not have Visual Studio NET 2002 you will get an error stating “Visual Studio IDE 7.0 required” and you will NOT be able to install the connector. Go back and install VS.NET. 1.2.4 Java 2 Runtime The SAP .Net Connector is installed via the file: j2re-1_4 1 01-windows-i586- i.exe, oF later file, This file is supplied by Sun Microsystems and QSI can provide a copy along with the interface. Run the install and select all defaults. 1.2.5 Solution for the SAP interface: QMIDI_VB ‘The QMIDI Solution should be placed somewhere on the PC, usually: User\My Documents\Visual Studio Projects\SAP Interface for WinLIMS The file “gmidi_winlims.sin” can be found in the root folder. Click “qmidi_winlims.sin” to open the Solution. Under most circumstances you should not need to modify this solution to deploy to a customer site; however this section will review the different projects within the solution for informational purposes. 1.2.5.1 References to winlims2005 core DLLs ‘The Qmidi_vb solution references the DLLs built from winlimis2005 solution so to compile gmidi_vb you must have these DLLs referenced within your project. These files have been copied into the BIN folder of the gmidi_vb so the there ‘SAP QMIDI Interface ~ Developer Notes should be no problems with references. If there are simply re-reference them to the corresponding DLLs in BIN. DLLs include as of this writing: clsostcrypt dll, clsgstForm.dll, DBWrapper-dll, ErrorsAndLogs.dll, Evaluator-dll, Interop-Access.dil, Interop.DAO.dl1, erop.0ffico.dll, Interop.Outlock.dll, Interop.VBIDE.dll, erop.Word.dil, Int1settings.dll 1.2.5.2 Projects within QMIDI_VB solution qmidi_vb This is the User Interface (very limited) and displays the SAP Mirror table's data and call the SAP RFC that downloads Inspection Lots and Characteristics and uploads the Sample Usage Decision and characteristic’s Qualitative and Quantitative results. SAPProxyDII2 This is the SAP Proxy Class that was generated by running the SAP Proxy Class Wizard within VS.NET while connected to the customer's system. During installation, this project is rebuilt and will be replaced with the classes reflective of the customers’ installation (this is discussed in more detail). This project is a C# class and does not need to be directly modified for any reason (that I know of). The wizard builds the SAP RFC and structures for you. 1.3 Building QMIDI_VB.exe To build the solution for the customer you need to have satisfied all the pre- requisite software in the previous section, With QMIDI_VB open, do a test build of the solution to make sure you have you references correct. If you do not get any errors you may proceed to the next step. 1.3.1 Compiling the SAP Proxy Classes AAs was previously mentioned, this is a crucial step and since it took me a good deal of time to realize this, I want to make sure no one else falls into this trap and learns from my costly mistakes. To repeat: at this point you are using a development machine that is directly connected to the customers’ SAP system. To compile the Proxy Classes: ‘SAP QMIDI Interface ~ Developer Notes 1. Remove the SAPProxyClass2 project from the solution, and locate the folder SAPProxyClass2 and delete this from disk. (This proxy class was compiled at Taminco thus it may not work for your install here). 2. Click New Project, then choose C# Project, then select "SAP Connector Class” (the SAP Connector Class is a product of the SAP Connector that you installed previously). (Screen shots below taken from “Anleitung-Download-RFC-Bausteine.doc”). I » Bolten: vag: fie] Vas basco a] ‘Siveatcenonae (Gi Veud CH Projelte: i) e Sete. ewateteron | mont tamer tops Bitter einen P re [sR ‘Nase: fowls ——“—SOSCS~<‘<‘<; 3}XTHhCStS gutwot: —_ [CToRRVRCEW Aer >] avec sro een CCTM CHORAL [Keres [ecm | = To retain the references within the current QMIDI_VB project, use SAPProxtClass2 for the name (atherwise you will need to re-link all your references in the project later). Ignore the name “QMIDI_CS” above. Click OK. On the next screen click option “SAP Server” and then click Next. ‘SAP QMIDI Interface ~ Developer Notes ‘Welcome tothe SAP Net Connector Wizard The ward cress C p09 that loys you toes Lad chance a verage SAP serves. Sehet bert gene om © WSDL He tom SAPIFR © SAP eevee © Sted WSDL fe co |_ tot» Next, enter the correct credentials into the fields below. These settings will not apply at your site 2 a Leta ancsrmannie — LT os a Host [194.64 35.67 * aa Beasiyraes to nizecaze) 1 Cieteaometvoneus maths 1 sample per inspection lot. When a 1:1 ration of Inspection Lots to Samples is present, the ORDER row is optional. Characteristics are equivalent to a SAMPLEPARAM row. There are abundant details about QM IDI online. SAP Online Help: http://help.sap.com/saphelp 45b/helpdata/en/26/b43c06506511d182c20000e8 29fbfe/frameset.htm 1.10 The Role of QMIDI_VB.exe QMIDI_VB.exe is a .Net program thet directly connects to SAP QMIDI via an SAP .NET Connector. It is a middleman program that it is designed to download and upload data from SAP to WinLIMS mirror tables, and back to SAP: SAP has “structures” that are in-memory tables which qmidi_vb reads data from. The tables with “WL_” prefixes are WinLIMS “mirror tables” that are exact copies of the SAP like named SAP structures, For customer deployments, we do not change the mirror tables and we do change the QMIDI_VB program. However when we customize the interface for customers, the triggers on the “mirror tables” are changed programmatically, not the interface (to allow for data mapping between WL_QAIVC and SAMPLE and SAMPLE and WL* for example). ‘SAP QMIDI Interface ~ Developer Notes For the download phase: QMIDI_VB simply runs unattended on a PC waiting for information to be moved from the SAP QMIDI structures above (usually oarve and oaimy). Once that happens, QMIDI detects this and copies that data into the WL_ mirror tables (usually wi. oarve and wi._oazmv). The triggers on the mirror tables are mapped to the appropriate columns in the WinLIMS data model according to customer needs. For the upload phase, QMIDI waits for rows to appear in the WL_mirror tables, (usually wi._gase and iiL_oarme) and moves these rows to SAP QMIDI (usually arse and gxima) and QMIDI takes care of the changes in the SAP Core. 1.11 The role of the WINLIMS “Mirror Tables” ‘The mirror tables as mentioned in the previous section are simply read and written to by the QMIDI_VB interface as it detects new rows in QMIDI structures used in the download and new rows in the WL_tables used in the upload process. The reason why the mirror tables are identical is so that we won't need to ever change the qmidi_vb program and it can remain "SAP Certified”. Instead, standard triggers are altered so that the data from mirror tables is mapped to and from appropriate WinLIMS tables and columns. 1.11.1 Field Mapping between WinLIMS and QMIDI Mirror Tables For the download, SAMPLE level mappings are: WL_QATVC.CRARG WL_QAIVC. PRUEFLOS WL_QAIVC.HERKUNFT + WL_OAIVC.MATNR: WL_QAIVC.. WERK WL_QAIVC. ERSTELLER WL_gartve WL_oar) WL_oatve.. SAMPLE .LOT SAMPLE . SAMPLE_1D SAMPLE . SAMPLE_TYPE SAMPLE . SUBMITTER SAMPLE |REG_BY SAMPLE . REG_ON SAMPLE . REMARKS SAMPLE . DATEL The same mappings apply for the upload however; some linkages are present as follows: For the upload, results level mappings are different for Qualitative vs. Quantitative results. For numeric results, Satzart=Q71 and values are set as: ‘SAMPLEPARAM. SRESULT => Wh_QATMR. MITTELWERT Hard coded value “071” => WL_QATMR. SATZART ‘SAP QMIDI Interface ~ Developer Notes Hard coded value “A” WL_OAIMR.MBEWERTG When the result is string (for Taminco a pick list value of OK/NOK), Satzart=Q72 and values are set as follows: SAMPLEPARAM.SRESULT (either OK/NOK) WLOAIMR. CODE1 Hard coded value “972” WL_QAIMR. SATZART Hard coded value “A” => WL_QAIMR. MBEWERTG For the upload the SAMPLE-level “Usage Decision” occurs when the SAMPLE_STATUS="A’ and: Hard coded value “989” SAMPLE. SAMPLE_ID Hard coded value “A” Hard coded value “02” Hard coded value “1000” WL_QAIVE. SATZART WL_OAIVE. PROBFLOS WL_QAIVE..coDE WL_QAIVE . AUSMMENGE WL_QAIVE.. AUSWMGHRK 1.11.2 SAP Structures and Mirror tables used in the interface: 1.11.2.1 SAP to WinLIMS (the download) + structure oarvc --> WLLOAIVe Record Type Q40 Table T_QAIVCTAR Using QIRF_SEND_REQUIRMENTS_G2T_DAT2 © Structure QAIMVY --> WLLQAIMY Record Type 042 Table T_QATMVTAS + Structure QATCA --> WLLOAICA Record Type 045 Table T_QAICATAB 1.11.2.2 WinLIMS to SAP side (the upload) © structure QarsE <-- WL_QAISE Table T_QATSETAB Using QIRF_GE7_ALL_DATA_VALUES2 © structure QATSR WL_QATSR (Table T_QAISRTAB) © structure oAIMR <-— WL_QAIMR (Record Types Q71, 072 Table T_QATMRTAR) ‘SAP QMIDI Interface ~ Developer Notes * Structure QATVE <-- WLLOAIVE (Record Type 089 Table T_ QAIVETAB) 1.11.23 Error Handling (download and upload) © Structure QTERR --> WLLQTERR (Table T_QTERRTAB) 1.12 The role of INBOX_SAMPLE Module ‘The standard WinLIMS INBOX_SAMPLE module could not be used at Taminco because they run v5.00h in production and there is no support for INBOX_SAMPLE until v5.21 or v6.00. 1.13 Database triggers and procedures logic 1.13.1 Download to WinLIMS ‘These procedures and triggers are used in the download from SAP QMIDI to WinLIMS: tr_WL_QAIVC (trigger fires on INSERT) on table WL_QAIVC Tasks: ‘+ INSERTs data from WL_QAIVC into INBOX sample according to the mappings identified above. INBOX_SAMPLE then takes over the complicated logic of ORDERS, SAMPLE, SAMPMETH and SAMPLEPARAM inserts. ‘See INBOX_SAMPLE documentation for more details on this topic. © UPDATEs WL_QAIVC.STATUS='B' ‘SAP QMIDI Interface ~ Developer Notes 1.13.2 Upload to SAP ‘These procedures and triggers are used in the upload from WinLIMS to SAP QMIDI: ‘TR_SAMPLE_AU (trigger fires AFTER UPDATE OF SAMPLE_STATUS) on table SAMPLE Tasks: * Calls procedure: SP_INSERT_WL_QAIMR, which performs the following logic: When SAMPLE_STATUS = ‘VA’ loop through all WL_QAIMV rows where WL_QAIMV.PRUEFLOS (the Inspection Lot) is equal to SAMPLE,SAMPLE_ID for the current row (that fired the trigger) and where WL_QAIMV.ERFASSART='G" Each row will have a characteristic value which will be plugged into the next select statement as the condition PA_NAME= For each row above, which represents a characteristic/SAMPLEPARAM row, perform this select: ‘SELECT SRESULT FROM SAMPLEPARAM WHERE. SAMPLE_ID=currentSampleID AND PA_NAME= For each SAMPLEPARAM row we insert a row into WL_QAIMR, using this command: INSERT INTO dbo. WL_QAIMR( ‘SATZART, RUECKMELNR, MITTELWERT, VARIANZ,ANZWERTG, KZBEWEEXT, MBEWERTG STATUS) VALUES (Q71’, @sRueckmelnr, @sSResult, ‘0.00, '1', 'X', @sMBEWERTG, 'N’) Or (if it’s a string qualitative result) INSERT INTO dbo.WL_QAIMR( SATZART, RUECKMELNR, KZABSCHL, MBEWERTG, GRUPPE1, CODE1, ANZWERTG, STATUS) VALUES ('Q72' , @sRueckmelnr, ‘A’, @sMBEWERTG, ‘OK/NOK', @sSResult,'I','N') Note: if result is off spec (contains a 1 in the STATUS) then @sMBEWERTG = *R’, otherwise "A" (this closes the characteristic in SAP as approve or rejected) ‘SAP QMIDI Interface ~ Developer Notes Finally, since the SAMPLE_STATUS is "VA" we update the Usage Decision in LIMS as “A” INSERT INTO dbo.WL_QAIVE( SATZART, PRUEFLOS, AUSWMENGE, AUSWMGWRK, CODE, CODEGRUPPE, TRANSFER_ON, TRANSFER BY, STATUS) VALUES ('Q89', @sSample_Id, '03', 1000’, ‘A’, '03', getdate(), ‘SAP 'N’) Note that we do not handle SAMPLE_STATUS =VRj yet, but could easily handle it by updating CODE="R". [end] ‘SAP QMIDI Interface ~ Developer Notes Index A Vv 1 ‘SAP QMIDI Interface ~ Developer Notes

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy