Showing posts from 2016

Browse Control for ISO SDK App–Part 1

BackgroundIn a conventional M3 Program, data in some fields can be searched by pressing the F4 key or Browse function. Using MAK (M3 Adaptation Kit – the framework to develop M3 programs), it is just mater of overriding  PxPMT() to enable this Browse feature. However, in SDK development, we don’t have that option. Neither a function to override nor control to re-use.  Instead, using WPF & C# we have to create it from the scratch. I did this for my current SDK project and going to share with SDK development community. There is an article in Potato IT blog (  This was a good starting point for me. However, since I have MAK background, I wanted to implement similar way, that PxPMT() method does (below is an excerpt of  M3 Browse )if(IN62){if(DSP.hasFocus("W1TOOL")){this.PXFILE.moveLeft("CSYTAB00");this.PXMBR.clear();this.PXOPT='1';this.PXKVA1.moveLeft(LDAZD.CONO,3);…

Read Profile Settings from ISO SDK App

BackgroundAccessing  Web Services, external data sources from a SDK app is common like other technologies do. To store these access points, parameters etc. can be done in various ways. In a .net application common scenario is store then in the .config file or setting file. Why we want to do like this is, avoid hassles of deployment. When ISO SDK application is considered, we can achieve same thing by using .manifest file.ProblemI need to get database connection string from the M3 profile.Solution Using Profile Editor, add a setting to store database connection string. For this example, I’m going to use setting name as “DbConnection”.
Use the following code to extract above information.
txtDBConStr.Text= ApplicationServices.SystemProfile.GetProperty("M3", "SDKApp", "DbConnection");

MEC: How to Set Message Counter for EDI Message

When you sending/creating EDI messages it is necessary to include unique message interchange number. This is to ensure each message that we are sending is unique. In EANCOM/EDIFACTElement 0020 of UNB segment:
UNB+UNOA:4+xxxxxxx:14+xxxxxx+20160905:0831+00000000000057+    +ORDERS++1'In X12Element ISA13 of ISA segment:
ISA*00* *00* *ZZ*167520391 *ZZ*39319445 *991201*1248*U*00200*000000001*0*P*>This number need to be persistent. The middleware we are using for EDI transformation should cater this requirement. I used MS-BizTalk  Server for two EDI projects, which cater the same. (just by a configuration)M3 e-Collaborator (MEC) does the same thing in a different way. In the MEC database (e.g. MEC_Storage_TST) has a table (UTIL_Message_Counters) for this purpose. Table structure is like this:Note 1: To be able to use this class you must first create this table (use the SQL script MeC_Utilities_db_script.sql). You don’t have to enter a record or write code to save/get data. Instead, you …

Compare 2 Word Documents

Microsoft Word came with a handy feature to compare 2 Word documents. But I’ve got to know this very recently. BackgroundWhen I’m getting multiple revisions of the same MS-Word document, how can I make sure that I have seen the changes effectively?SolutionIn MS Word, go to “Review” and select “Compare”
Select files to compare
Output looks like this
Double click on red colored line, then you can see the changes. (deletion, insertion etc.)

MEC: Call Web Service in a cleaner way

BackgroundIn the MEC mapper, calling a web service is a general scenario. There are few ways to do it. One method is build the SOAP request Payload in a string and submit via POST method. (as below code snippet) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 obj =new; con =( obj.openConnection(); con.setRequestMethod("POST"); con.setRequestProperty("Content-Type","text/xml"); con.setRequestProperty("Accept","text/xml"); String itemStr ="<soap:Envelope xmlns:xsi=\"\" xmlns:xsd=\"\" xmlns:soap=\"\">"+"<soap:Body>"+"<GetItem xmlns=\"\">"+"<itemNumber>KelumG</itemNumber>"+"</Ge…

MEC: Change out file name dynamically

Background Manipulating the out file name generated by the middle ware is a common scenario. By default file names are generated with a GUID (13a7a838-a706-4273-b190-9d58a79bf04e). It is more practical if the file name is human readable. SolutionIn the Mapper add User function to change the file name. (Note: this function should the last function in the map)
Add similar code to the function. This code set file name to the manifest information of the map.
1 2 3 4 5 6String date =new java.text.SimpleDateFormat("yyMMdd").format(new java.util.GregorianCalendar().getTime()); String time =new java.text.SimpleDateFormat("HHmmss").format(new java.util.GregorianCalendar().getTime()); String fileName ="EDI_832_OUT_"+ date+time; setManifestInfo("map:FileName", fileName); Then, configure the relevant Send (in partner agreement) object to take the given file name.
And you are done. !!!

Development with MEC older version

Presently I’m working with a MEC older version (Ver 9.1). This version is not part of an Eclipse plugin. It’s a standalone application that use for MEC mapper development. Very tedious to work with. MEC Mapper different than the Eclipse version. But Flat file definition tool, it’s manager & the partner agreement tool looks the same. Mapping manger looks like this. Load button to retrieve all the existing mappings. New button to create a new one Generate & Publish buttons to compile the map & deploy to the server Import & export button: Once you create a map, you cannot change it. Instead, import existing version and export with a new changes and new version numberMapper looks like this. Mapping flow is organized in “tree-view” like structure.You can generate the map from this screen. But to publish you have to close this and go back to Mapping manger & publish.Two options to save (to DB & to File)Validate map option also available on this screen.

ISO SDK : Unkown Error

Problem I’ve got following error when I try to testing after configuring ISO SDK.

Solution When you configure “SERVER” path in the registry entry  (HKEY_CURRENT_USER\Software\Lawson\MangoDev)  make sure correct path of LSO server path is set.
How to get correct LSO PATH?Go to the log viewer of the LSO by clicking
Then select following entry & copy LSO server path
What I got wrong? I’ve set LSO client installation path (that can be access through Web browser) to the “Server” registry entry.

How MEC Message Flow Work

Like any other middle-ware application MEC has unique architectural components. Below diagram depicts them.Inbound message will be consumed by the MEC and goes through detection rules defined in the partner agreement. Detection is either channel or XML detection. If inbound message is a flat file, channel detection will be used.
For XML detection, inbound message must have meta data to configure the detection.

Note below payload has RequestHeader as meta data.
<!-- Items goes here-->

detection configuration is:
Detection information  & rules are saved in MEC storage. MEC will evaluate all saved detections (in a order) until its find the correct one. Once the detection has passed, process the message based on the defined processing steps. (in the given order)


M3 Integrations (MEC)

I was able to refresh my knowledge of   M3 integration with MEC (M3 E-collaborator).  MEC is a middle-ware specifically design for M3 integration development. Over the past few years it has been evolved.
MEC has following components: Flat-File definition tool -  Using this tool you can create XML schema file. Also it can generate sample Flat File & XML file for the schema. Flat-File Repository manger - Is the repository for the local and server definitions. Mapper - Use to transform data to a output file or update M3 directly for the given input schema and the defined logic. It has certain functions to perform this level of transformation.  (Later, with my next posts I'm hopping to reveal them). If you are familiar with Ms-BizTalk server, it's orchestration and MEC mapper is  similar in behavior. Partner Admin tool - Use to configure agreement for the integration such as, DetectionProcessesError handlingand other admin tasks (e.g. communication, web-service definitions, Ev…