Creating a List

This code example illustrates using CreateList for an XML request with the TC Name/Table Name and data selection and sequencing. The system returns an XML response with a handle that is associated with the created list:

<?xml version="1.0"?>
<jdeRequest type="list" user="JDE" pwd="JDE" environment="PRODHP01"
role='*ALL' session="" sessionidle="">
 <ACTION TYPE="CreateList">
  <TC_NAME VALUE=""/>
  <TC_VERSION VALUE=""/>
  <FORMAT VALUE="UT"/>
    <RUNTIME_OPTIONS>
    <DATA_SELECTION>
     <CLAUSE TYPE="WHERE">
       <COLUMN NAME="" TABLE="" INSTANCE="" ALIAS=""/>
       <OPERATOR TYPE="EQ"/>
       <OPERAND>
        <COLUMN NAME="" TABLE="" INSTANCE="" ALIAS=""/>
        <LITERAL VALUE=""/>
        <LIST>
          <LITERAL VALUE=""/>
        </LIST>
        <RANGE>
          <LITERAL_FROM VALUE=""/>
          <LITERAL_TO VALUE=""/>
        </RANGE>
       </OPERAND>
     </CLAUSE>
<CLAUSE TYPE="OR">
       <COLUMN NAME="" TABLE="" INSTANCE="" ALIAS=""/>
       <OPERATOR TYPE="EQ"/>
       <OPERAND>
        <COLUMN NAME="" TABLE="" INSTANCE="" ALIAS=""/>
        <LITERAL VALUE=""/>
        <LIST>
          <LITERAL VALUE=""/>
        </LIST>
        <RANGE>
          <LITERAL_FROM VALUE=""/>
          <LITERAL_TO VALUE=""/>
        </RANGE>
       </OPERAND>
     </CLAUSE>
    </DATA_SELECTION>
    <DATA_SEQUENCING>
     <DATA SORT="ASCENDING">
       <COLUMN NAME="Product Code" TABLE="F0004" INSTANCE="" ALIAS=""/>
     </DATA>
    </DATA_SEQUENCING>
  </RUNTIME_OPTIONS>
 </ACTION>
</jdeRequest>

Either TC_NAME and TC_VERSION or TABLE_NAME and TABLE_TYPE must be defined in the request. TABLE_TYPE can be one of these:

  • OWTABLE

  • OWVIEW

  • FOREIGN_TABLE

FORMAT VALUE is an optional attribute of the FORMAT element that enables full mode or concise mode formatting in the response message. UT is the only FORMAT value that is supported. If you do not set the VALUE="UT" attribute on the FORMAT element, the response message uses concise formatting, which is illustrated in this sample response:

<F0005>
   <SY>00</SY>
   <RT>03</RT>
   <KY>   DIR</KY>
   <DL01>Direct Manufacturing</DL01>
   <DL02> </DL02>
   <SPHD> </SPHD>
   <UDCO> </UDCO>
   <HRDC> </HRDC>
   <USER>DEMO</USER>
   <PID>P00051</PID>
   <UPMJ>2055/05/12</UPMJ>
   <JOBN>V3477JG51</JOBN>
   <UPMT>175301</UPMT>
</F0005>

If you do not use the <FORMAT VALUE> element or you do not set the attribute to UT in the request, the response message uses full formatting, which is illustrated in this sample response:

<FORMAT NAME='F0005'>
    <COLUMN ALIAS='SY'>00</COLUMN>
    <COLUMN ALIAS='RT'>03</COLUMN>
    <COLUMN ALIAS='KY'>       DIR</COLUMN>
    <COLUMN ALIAS='DL01'>Direct Manufacturing</COLUMN>
    <COLUMN ALIAS='DL02'>        </COLUMN>
    <COLUMN ALIAS='SPHD'> </COLUMN>
    <COLUMN ALIAS='UDCO'> </COLUMN>
    <COLUMN ALIAS='HRDC'> </COLUMN>
    <COLUMN ALIAS='USER'>DEMO</COLUMN>
    <COLUMN ALIAS='PID'>P00051</COLUMN>
    <COLUMN ALIAS='UPMJ'>2055/05/12</COLUMN>
    <COLUMN ALIAS='JOBN'>V3477JG51</COLUMN>
    <COLUMN ALIAS='UPMT'>175301</COLUMN>
</FORMAT>

The CLAUSE can be WHERE, OR, or AND to simulate an SQL statement.

You can specify the COLUMN NAME with any meaningful name to help recognize the real column name in the table, which should be defined in ALIAS. The values of TABLE, INSTANCE, and ALIAS should be the same as those in the XML response that is returned by a GetTemplate request. For example, if Column X is in the data selection, it should be <COLUMN NAME=My column TABLE=F9999 INSTANCE=0 ALIAS=X/> because information is returned by a GetTemplate request and is similar to this example:

<COLUMN NAME="X" ALIAS="X" TYPE="String" LENGTH="32" TABLE="F9999" INSTANCE="0">

The OPERATOR uses values of EQ, NE, LT, GT, LE, GE, IN, NI, BW (between) or NB.

The OPERAND node can contain one of the these supported element types:

  • Column

  • Literal

  • List

  • Range

This XML node, which is a template fragment that should be used with only one of the supported elements, shows the supported elements in the OPERAND node:

<CLAUSE TYPE="WHERE">
 <COLUMN NAME="UserDefinedCodes" TABLE="F0005" INSTANCE="" ALIAS="RT"/>
 <OPERATOR TYPE="EQ"/>
 <OPERAND>
    <COLUMN NAME="" TABLE="" INSTANCE="" ALIAS="null"/>
    <LITERAL VALUE="P4"/>
    <RANGE>
    </RANGE>
 </OPERAND>
</CLAUSE>

These sample XML nodes show the operator type and the operand using the different supported elements.

If the operand is a COLUMN, populate the COLUMN element. For example:

<CLAUSE TYPE="WHERE">
 <COLUMN NAME="DRSY" TABLE="F0005" INSTANCE="0" ALIAS="SY"/>
 <OPERATOR TYPE="EQ"/>
 <OPERAND>
    <COLUMN NAME="DRRT" TABLE="F0005" INSTANCE="0" ALIAS="RT"/>
 </OPERAND>
</CLAUSE>

If the operand is a LITERAL, populate the LITERAL element. For example:

<CLAUSE TYPE="WHERE">
 <COLUMN NAME="DRSY" TABLE="F0005" INSTANCE="0" ALIAS="SY"/>
 <OPERATOR TYPE="EQ"/>
 <OPERAND>
    <LITERAL VALUE="08"/>
 </OPERAND>
</CLAUSE>

If the operand is a LIST, populate the element LIST. LIST should be used with IN or NI. For example:

<CLAUSE TYPE="WHERE">
 <COLUMN NAME="DRSY" TABLE="F0005" INSTANCE="0" ALIAS="SY"/>
 <OPERATOR TYPE="IN"/>
 <OPERAND>
    <LIST>
        <LITERAL VALUE="08"/>
        <LITERAL VALUE="09"/>
    </LIST>
 </OPERAND>
</CLAUSE>

If the operand is a RANGE, populate the element RANGE. RANGE should be used with BW or NB. For example:

<CLAUSE TYPE="WHERE">
 <COLUMN NAME="DRSY" TABLE="F0005" INSTANCE="0" ALIAS="SY"/>
 <OPERATOR TYPE="BW"/>
 <OPERAND>
    <RANGE>
        <LITERAL_FROM VALUE="08"/>
        <LITERAL_TO VALUE="10"/>
    </RANGE>
 </OPERAND>
</CLAUSE>

The XML response for a CreateList request is similar to this:

<?xml version="1.0"?>
<jdeResponse type="list" session="5665.931961929.454">
<returnCode code="0">XMLRequest OK</returnCode>
 <ACTION TYPE="CreateList">
           <TABLE_NAME VALUE="F0005">
    <HANDLE>"1r4670001"</HANDLE>
    <SIZE>773</SIZE>
 </ACTION>
</jdeResponse>

The value of HANDLE can be published and referenced in a GetGroup or DeleteList request.