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

Anyone having a list of HCI-DS scripts functions ?

Former Member
0 Likes
2,062

Hi folks,

Is there anyone having a full list of HCI-DS scripts functions available. We are investigating the HCI-DS scripts further than what we do and would like to develop these ones in order to call functions and may be even use Flat Files creation on the HCI server.

We easily handle calling Global variables, Time tags for Jobs run etc... but sure we can develop something more ingenious


I am asking this as both HCI-DS help and SAP support docs are not listing full detailed functions available in terms of scripts.

Thanks in advance for your expertise,

Regards,

Julien

Accepted Solutions (1)

Accepted Solutions (1)

Alecsandra
Product and Topic Expert
Product and Topic Expert

Hi Julien,

Here is one example where flat file is moved to a different folder after being processed by HCI.

I will check if some colleagues of mine care share some more examples.

Regards

Alecsandra

Former Member
0 Likes

Thanks Alecsandra, this might be useful indeed.

I was more thinking of a script reading a FF onto the HCI server and making the input data in Global variables.

You know customers sometimes do not want to either hardcode filters in their DF or having a long list of GV set up especially when we filter on LOCID imagine a big company making filters on warehouses #.

We could have a FF stored onto the HCI server with the warehouses # in it and then a script calling this FF and adapt the GV accordingly.

Hope it makes sense on an email

Thanks again for your help.

Julien

Shamscharma
Participant
0 Likes

Julien

I am working on a script that I got from SAP Help.

I am not able to understand couple of things because example is not clear:

1. In following line what does Task_Name mean?

if (get_data('<task_name>') = " or $G_RESET = 'Y')

  $G_STARTDATE = to_date('1900-01-01 00:00:00', 'yyyy-mm-dd hh24:mi:ss');

Above statement is used to get the Start Date from a saved Global Variable as in step 2 (in Post Script).

2. print('Saving enddate for next startdate: [$G_ENDDATE]');

save_data('<task_name>',to_char($G_EDATE,'yyyy-mm-dd hh24:mi:ss'));

I am able to get the values in the variable but in the following run $G_EDATE value is not available even when its successfully saved.

Other question I have is that why SAP is using a date using to_CHAR function. It did not work that way for me. It worked when I moved to DATETIME variable.

When my problem now is to be able to read the save variable in item 1.

I am really looking for some help to resolve this.

Thanks

RS

Former Member
0 Likes

Hi RS,

Can you please specify what you are trying to achieve from the script, your example is not really clear to me.

In regards of the Task_Name, it must be the name of your task where you have the script. You are trying to input a script into a Dataflow which is part of a task ... this is the one.

The to_char is used for converting a date or numeric data to a string. If it worked for you with DATETIME it all depends on your input format date.

Let me know,

Julien

Shamscharma
Participant
0 Likes

It looks like I am having problems with Get_Data and Save_Data functions. using global variables.

Answers (1)

Answers (1)

yeushengteo
Product and Topic Expert
Product and Topic Expert
0 Likes

Hello

You can check the list here HELP CENTER for SAP HANA Cloud Integration.

Regards.

YS

Shamscharma
Participant
0 Likes

Have you ever tried Save_Data function?

Thanks for your help.

RS

Former Member
0 Likes

Save_Data() is used in combination with Get_Data() to save a value to be used across executions of a task. E.g. you can save the $G_LAST_EXTRACT_DATE from one execution in the post load script and read it back in the next execution of the task to implement a delta load logic.

Thanks,

Ben.

---

Product Manager SAP HANA Cloud Integration for data services (HCI-DS) and HANA smart data integration (SDI)

Shamscharma
Participant
0 Likes

Thanks Ben!

I am aware of the functionality but here is the problem.

I do have an Enddate from the Preload script in a global variable.

It retains the value.

Net I use save_data as recommended by SAP using another global variable.

save_data($G_TODATE, to_char($G_ENDDATE,'yyyy-mm-dd hh24:mi:ss'));

But i am not getting any value in in $G_TODATE.

When I dont have a value here I cant read it using get_data.

But when I dont use save_date I can display the value.

I hope I was clear enough.

Thanks

Former Member
0 Likes

Your save_data() should look like this:

save_data('TASK_XYX_EndDate',to_char($G_ENDDATE,'yyyy-mm-dd hh24:mi:ss'));

This will save the end date as a permanent variable with the name TASK_XYZ_EndDate (you can choose any name, recommendation is to use the task name to avoid that you overwrite the value from different tasks).

In order to pick up the value in the next run you use:

$G_TODATE = get_data('TASK_XYX_EndDate');

Thanks,

Ben.

Shamscharma
Participant
0 Likes

Ben, highly appreciable. Should TASK_XYX_EndDate not be a variable?

TASK_XYX_EndDate would be a global variable isn't it?

Something like $TASK_XYX_EndDate othewise it throws an error.

How can we display saved and get values?

This statement is used in Postload script.

After I hear back from you I will give it another shot.

thanks again

RS

Shamscharma
Participant
0 Likes

Also if you could specify types also.

Do we need to define 'TASK_XYX_EndDate somewhere before using it?

Shamscharma
Participant
0 Likes

System does not accept TASK_XYX_EndDate without a $ value.

Former Member
0 Likes

No $ sign needed, no declaration needed either.

Try this very simple example:

Pre-load script:

save_data('ANY TEXT','100');

Post-load script:

Print(get_data('ANY TEXT'));

In the pre-load script we create an entry with the name ANY TEXT and store the value 100.

In the post load script we get the value for ANY TEXT and print it in the monitor log.

There are no global variables used at all in this example. Only global variables need the $ sign and declaration before you can use them.

Shamscharma
Participant
0 Likes

Ben,

Thanks so much for your help. The issue is resolved. Your last example was the one that helped me troubleshoot my logic. Once  i was able to print the value it was easier.

Highly appreciable!

RS

Shamscharma
Participant
0 Likes

Hi Ben,

I have not heard back from you since your last help.

Thanks again!

You know I am trying to create a delta process using HCI Data Services.

I need to copy one HCP table to another HCP table (With data), how can I create a data flow when source is also HCP and target is also HCP?

I am sure you know.

Looking forward,

RS

Former Member
0 Likes

Can you post this as a new question ? It's a bit off-topic here, and not related to IBP. You can post HCP questions here:

Shamscharma
Participant
0 Likes

Ben

Good to hear from you.

My more important questions is as follows:

How to create a flow to copy one HCP table to another with Data?

Thanks

RS