2 Replies Latest reply: Oct 3, 2017 8:59 AM by Sam Yurchuk RSS

    SAP CONNECTOR - EVALUATING TODAY'S DATE IN WHERE CLAUSE

    Sam Yurchuk

      I am trying to create a simple incremental load from SAP CDHDR table.  For the initial load using UDATE = 10/01/2017 worked fine.  I’ve tried several different ideas for the incremental load (see below).  What is the best way to get SAP date field(UDATE in this case) = Today’s date in a where clause for an incremental load?  THANKS!!!


      Let vToday = Date(Today(), 'MM/DD/YYYY');

       

       

      LIB CONNECT TO 'SAP'

       

      [DAILY_HEADER]:

      LOAD OBJECTCLAS,

      OBJECTID,

      CHANGENR,

      USERNAME,

      UDATE,

      TCODE,

      CHANGE_IND;

       

      SELECT OBJECTCLAS,

      OBJECTID,

      CHANGENR,

      USERNAME,

      UDATE,

      TCODE,

      CHANGE_IND

         

       

      FROM CDHDR

       

      WHERE OBJECTCLAS = 'VERKBELEG' AND UDATE  = '$(vToday)';


      or

      [DAILY_HEADER]:

      LOAD OBJECTCLAS,

      OBJECTID,

      CHANGENR,

      USERNAME,

      UDATE,

      TCODE,

      CHANGE_IND;

       

      SELECT OBJECTCLAS,

      OBJECTID,

      CHANGENR,

      USERNAME,

      UDATE,

      TCODE,

      CHANGE_IND

         

       

      FROM CDHDR

       

      WHERE OBJECTCLAS = 'VERKBELEG' AND UDATE  = sy-datum;