cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

SAP HCI-DS Add months to the input date value, "add_months" function not working.

Former Member
0 Kudos
1,127

Hi All,

We have a requirement to add 1 month to the input date field. The input is

2010-04-01T00:00:00 and expected output is 2010-05-01T00:00:00.

Connection details: SAP SuccessFactors to HANA DataBase. I have used predefined "add_months" function and I am getting below error:

<JDBC Adapter> does not support function <add_months>. Check your dataflow.

I am attaching images of my approch.

Please suggest any other ways i can get the expected output or anything we need to fix regarding JDBC Adapter.

Regards,

Sravan

error.pngfunction-use.png

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Raised a ticket in SAP.

Former Member
0 Kudos

Hello Sravan,

Add_Months() function should work irrespective of the receiver system. are you passing the date in right dateformat ?

Not sure, why presence of this function is not being supported by the JDBC. These is not mentioned in documentation or any exception mentioned in help page for this function. Better raise a ticket with SAP.

Just to debug the issue. Try passing the date value to target with a simple hard code date as 02.13.2020 or sysdate() or even the input date without adding months. Lets check, how this works.

if this has become a show stopper, Last option might be to split the flow as 2 flows . SF to File ( use "add_month" here) and File to DB.

with regards,

Nazeer

Former Member
0 Kudos

Hello Sravan,

This should work fine, The way, you have mentioned.

Is this function in the last Target transform step? Try adding this in the last but one step. anything before the last transform. check if that works ?

Make sure, you have all the records with date value coming correctly in right date format and cast the date in MM.DD.YYYY format in the previous step (if possible). In case, if you get any record as NULL, that could also make the code fail. In case of NULL or Blank date, Try skipping the Add Months functions.

with regards,

Nazeer

Former Member
0 Kudos

Hi Nazeer,

I have tried the above approaches, still getting same error.

-Sravan

Former Member
0 Kudos

Hello Sravan,

JDBC is your sender or receiver ? Can you please explain your flow ?

with regards,

Nazeer

Former Member
0 Kudos

Hi Nazeer,

Our source is Successfactors and we are using SF ODATA and target is SAP HANA database using JDBC. We have a field start_date coming from source table and we need to add one month to the date and populate it in HANA DB. Initially I tried to with "add_months" function in target querry but got error and I tried with a transformation before target querry and implemented the "add_months" there but still ended up with error. I tried to modify 'start_date' with other available predefined functions and the output will have "add_months" transform but still getting the same error.

Regards,

Sravan