3 Replies Latest reply: Oct 4, 2017 2:32 PM by Felip Drechsler RSS

    Using value from previously loaded table to filter subsequent query

    Sam Yurchuk

      Hello.  I am trying to use  OBJECTID, and   CHANGENR as filters for the next query.  In debug mode, both vCHANGENR  and vOBJID are returning nulls.  My script is below.  I can't figure out why I am getting nulls.

       

       

       

      CDHDR:

      LOAD

          OBJECTCLAS,

          OBJECTID,

          CHANGENR,

          USERNAME,

          UDATE,

          TCODE,

          CHANGE_IND

      FROM [lib://QVD_Store/CDHDR.qvd]

      (qvd)

      WHERE WildMatch(OBJECTID,'00003*');

       

       

      LOAD

      CONCAT(Chr(39)&OBJECTID&Chr(39),',') as OBJID

      RESIDENT CDHDR;

       

       

       

      LET vOBJID = OBJID;

      LET vCHANGENR = CHANGENRID;

       

       

       

      CDPOS:

      LIB CONNECT TO 'SAP';

       

       

      INNER JOIN LOAD

      OBJECTCLAS,

      OBJECTID,

      CHANGENR,

      TABNAME,

      TABKEY,

      FNAME,

      CHNGIND,

      VALUE_NEW,

      VALUE_OLD;

       

       

      SELECT 

      OBJECTCLAS,

      OBJECTID,

      CHANGENR,

      TABNAME,

      TABKEY,

      FNAME,

      CHNGIND,

      VALUE_NEW,

      VALUE_OLD

       

      FROM CDPOS

       

       

      WHERE OBJECTCLAS = 'VERKBELEG' AND TABNAME = 'VBEP' AND FNAME = 'EDATU' AND OBJECTID IN('$(vOBJID)');