DME Queries in Lawson

, ,

Lawson provides the ability to query Lawson tables via URL.  These transactions are called “DME” queries, and can be quite useful in IPA processes, or in scripting bulk data calls.

To query data using a DME call, the URL is https://<server name>/servlet/Router/Data/Erp?.  To select specific fields, use the “FIELD” key word.  To filter the results, use the “SELECT” key word.  You will need to have knowledge of the data tables and columns to build these queries.  The dbdef command in LID can be quite useful for this.

GEN

To query GEN data, the syntax would be https://<servername>/servlet/Router/Data/Erp?PROD=GEN

For example, this URL would return the PRODUCTLINE and FILENAME fields for the FILEDEF record with prefix “API”:

https://lawson.company.com/servlet/Router/Data/ERP?PROD=GEN&FILE=FILEDEF&SELECT=PREFIX=API&FIELD=PRODUCTLINE,FILENAME

LOGAN

To query LOGAN data, the syntax would be https://<servername>/servlet/Router/Data/Erp?PROD=LOGAN

For example, this URL would return the VERSION data in the LOGAN data area

https://lawson.company.com/servlet/Router/Data/ERP?PROD=LOGAN&FILE=VERSION

Data Area

To query your desired data area, the syntax would be https://<servername>/servlet/Router/Data/Erp?PROD=<data area>

For example, this URL would return the CUCODE “USD” from the CUCODES table in the TEST data area.

https://lawson.company.com/servlet/Router/Data/ERP?PROD=TEST&FILE=SELECT=CURRENCY-CODE=USD&FIELD=CURRENCY-CODE,DESCRIPTION

Output

The default output type is XML, but you can also output in CSV format.  To do that, in the URL, append the command “&out=csv”.