cancel
Showing results for 
Search instead for 
Did you mean: 

DS 4.2 get ECC CDHDR deltas in ABAP data flow using last run log table

brad_schroeter2
Explorer
0 Kudos

I have a DS 4.2 batch job where I'm trying to get ECC CDHDR deltas inside an ABAP data flow.  My SQL Server log table has an ECC CDHDR last_run_date_time (e.g. '6/6/2014 10:10:00') where I select it at the start of the DS 4.2 batch job run and then update it to the last run date/time at the end of the DS 4.2 batch job run.

The problem is that CDHDR has the date (UDATE) and time (UTIME) in separate fields and inside an ABAP data flow there are limited DS functions.  For example, outside of the ABAP data flow I could use the DS function concat_date_time for UDATE and UTIME so that I could have a where clause of 'concat

_date_time(UDATE, UTIME) > last_run_date_time and concat_date_time(UDATE, UTIME) <= current_run_date_time'.  However, inside the ABAP data flow the DS function concat_date_time is not available.  Is there some way to concatenate UDATE + UTIME inside an ABAP data flow?

Any help is appreciated.

Thanks,

Brad

Accepted Solutions (1)

Accepted Solutions (1)

brad_schroeter2
Explorer
0 Kudos

FYI...a co-worker helped me resolve my issue.  I set both $CDHDR_Last_Run_Date_Time and $Run_Date_Time to varchar(14) and in the format of 'YYYYMMDDHHMISS'.

Then here's my ABAP data flow where clause:

CDHDR.OBJECTCLAS in ('DEBI', 'KRED', 'MATERIAL')

and ((CDHDR.UDATE || CDHDR.UTIME) > $CDHDR_Last_Run_Date_Time_Char)

and ((CDHDR.UDATE || CDHDR.UTIME) <= $Run_Date_Time_Char)

Here's selected contents of the generated ABAP file (*.aba):

PARAMETER $PARAM1(14) TYPE C.

PARAMETER $PARAM2(14) TYPE C.

...

DATA ALTMP1(512) TYPE C.

DATA ALTMP2(512) TYPE C.

...

concatenate CDHDR-UDATE CDHDR-UTIME into ALTMP1.

concatenate CDHDR-UDATE CDHDR-UTIME into ALTMP2.

IF ( ( ALTMP2 <= $PARAM2 )

AND ( ALTMP1 > $PARAM1 ) ).

Since in the generated ABAP file all of the fields are varchar with concatenated date and time, I can easily pull the CDHDR deltas.

-Brad

Answers (1)

Answers (1)

Former Member
0 Kudos

Hello

Assign the date + time value to a variable in a script before the dataflow, and then use the variable (or a parameter mapped to the variable) within the where clause of your ABAP dataflow.

Michael

brad_schroeter2
Explorer
0 Kudos

Michael,

Thanks for the reply.  I'm already assigning the last_run_date_time to a variable in a script prior to the ABAP data flow.  My issue is that inside the ABAP data flow the CDHDR UDATE and UTIME are in separate fields and I don't know of a way to combine them into one field for comparison within the where clause of the ABAP data flow.

-Brad

Former Member
0 Kudos

Sorry, wrong way round!

Can't you split the date + time and compare it that way?  The where clause would get more complex, but will work.  Could you just add the date and time together?  I'm not sure what datatypes you're dealing with though.  Typical dates are integers and times are fractions.  Even if they are strings, concatenation might work (if the format is yymmdd etc.).

Michael

brad_schroeter2
Explorer
0 Kudos

Michael,

I'm trying to concatenate date and time and here's my ABAP data flow where clause:

CDHDR.OBJECTCLAS in ('DEBI', 'KRED', 'MATERIAL')

and ((CDHDR.UDATE || ' ' || CDHDR.UTIME) > $CDHDR_Last_Run_Date_Time)

and ((CDHDR.UDATE || ' ' || CDHDR.UTIME) <= $Run_Date_Time)

Here are DS print statements showing my global variable values:

$Run_Date_Time is 2014.06.09 14:14:35

$CDHDR_Last_Run_Date_Time is 1900.01.01 00:00:01

The issue is I just created a CDHDR record with a UDATE of '06/09/2014' and UTIME of '10:48:27' and it's not being pulled in the ABAP data flow.  Here's selected contents of the generated ABAP file (*.aba):

...

PARAMETER $PARAM1 TYPE D.

PARAMETER $PARAM2 TYPE D.

...

concatenate CDHDR-UDATE ' ' into ALTMP1.

concatenate ALTMP1 CDHDR-UTIME into ALTMP2.

concatenate CDHDR-UDATE ' ' into ALTMP3.

concatenate ALTMP3 CDHDR-UTIME into ALTMP4.

IF ( ( ALTMP4 <= $PARAM2 )

AND ( ALTMP2 > $PARAM1 ) ).

...

So $PARAM1 corresponds to $CDHDR_Last_Run_Date_Time ('1900.01.01 00:00:01') and $PARAM2 corresponds to $Run_Date_Time ('2014.06.09 14:14:35').  But from my understanding ABAP data type D is for date only (YYYYMMDD) and doesn't include time, so is my time somehow being defaulted to '00:00:00' when it gets to DS?  I ask this as a CDHDR record I created on 6/6 wasn't pulled during my 6/6 testing but this 6/6 CDHDR record was pulled today.

I can get  last_run_date_time and current_run_date_time into separate date and time fields but I'm not sure how to build the where clause using separate date and time fields.  Do you have any recommendations or is there a better way for me to pull CDHDR deltas in an ABAP data flow using something different than a last run log table?

Thanks,

Brad