cancel
Showing results for 
Search instead for 
Did you mean: 

User Defined Function in SAP HCI

0 Kudos

Hi,

We are using SAP HCI to for integrating on-premise SAP ECC and on-cloud SAP C4C systems. There is a requirement to map source field TDLINE to a target field CustomerText. TDLINE has 0...unbounded cardinality where as target field has 0...1 cardinality. Now, we need to concatenate all the values of TDLINE queue and map it to the target CustomerText field.

This requirement is straightforward in PI by creating a UDF. However, in HCI there is no provision to create a UDF in mapping. Is there a way we create some kind of custom function to achieve the mapping functionality we need?

Regards,

Netrey

Accepted Solutions (1)

Accepted Solutions (1)

former_member194786
Active Contributor
0 Kudos

Hi Netrey,

You can use groovy scripts in HCI. Please refer to Sujit's blog on how to use it:

Thanks,

Sanjeev.

Former Member
0 Kudos

No UDF support yet. But using Groovy script or Java script it can be achieved.

reg, avinash

Answers (3)

Answers (3)

sinaei
Contributor
0 Kudos

Hi Netrey,

Could you please let me know how you solve your problem?

I would be appreciate if you can help me.

Regards

Sin

0 Kudos

Hi Sin,

Latest release supports creating custom functions within message mapping. You can use JavaScript or Groovy Script to write your code.

Regards,

Netrey

sinaei
Contributor
0 Kudos

Hi Netrey,

Yes, we can create a custom function, I have some problems to writing the codes,

can you give me any suggestion or help?

I would be appreciate

Thanks

Sin

Sriprasadsbhat
Active Contributor
0 Kudos

Hello Sin,

here you go with sample code.

More info available in SAP Hana Cloud integration Help Page.

Regards,

Sriprasad S Bhat

sinaei
Contributor
0 Kudos

Thanks for your sharing!

Regards

Sin

0 Kudos

Thanks guys for your responses.

We took a different approach. We downloaded the standard content for PI which we canmodify in the PI system, create UDF or whatever we used to do in PI comfortably and then import this mapping into HCI iFlow. It works perfectly.

Regards,

Netrey

vipinkumar_kanchan
Participant
0 Kudos

Hi Netrey,

Did the UDF from PI work in HCI? did you need to do any modifications to it after importing it into HCI for it to work? Can you please confirm..

Regards,

Vipin

0 Kudos

Hi Vipin,

UDF from PI works perfectly in HCI. You cannot do any modification to UDF in HCI. If you have to make any changes then do the changes in PI and import the mapping again.

I hope that answers your question.

Regards,

Netrey

vipinkumar_kanchan
Participant
0 Kudos

Hi Netrey,

Thanks for the confirmation.

We imported the UDF into HCI but we are not getting the full functionality of the UDF in HCI. Our requirement is exactly opposite to yours, we have a text which needs to be split before mapping into TDLINE (since TDLINE can only carry 70 characters). The UDF creates a second context based on the length of the text and splits the value into the contexts, but in HCI we get only the first context and the first 70 characters of the text.

Regards,

Vipin

0 Kudos

Hi Vipin,

That seems to be the mapping issue. Did you test the mapping in PI and did it work as expected? If it did work then it will work in HCI also.

Regards,

Netrey

vipinkumar_kanchan
Participant
0 Kudos

Works as expected in PI mapping editor test tab.

Does not work in the HCI interface. 

sinaei
Contributor
0 Kudos

Hi Vipin,

Did you find any soloution for your scenario?

I have the same issue,

I would be appreciate if you can help me about it,

Regards

Sin

vipinkumar_kanchan
Participant
0 Kudos

Hi sin,

We were able to design the interface without the requirement for the UDF. The text was controlled on the 3rd party side itself.

Regards,

Vipin Kanchan

sinaei
Contributor
0 Kudos

Hi Vipin,

Thanks a lot,

Aslo we have solved it,

Regards

Sin

Vlado
Advisor
Advisor
0 Kudos

Moved to correct space