2025 Feb 21 11:46 AM - edited 2025 Feb 21 12:45 PM
Hi,
Just screaming loud - migrating working code to the Cloud and facing again a problem - function is not supported.
This time it's sap:external-function in XSLT.
We have some transformations which were XSLT but with some custom hooks via classes. Now we need to rewrite it to sXML code to parse the file and implement the logic which we could just reach with trully simple code as this:
<xsl:param name="CASE" sap:type="ZIF_ABAP_CASE"/>
<xsl:template match="@name">
<xsl:attribute name="name">
<xsl:value-of select="f:fromAbap($CASE,string(.))"/>
</xsl:attribute>
</xsl:template>
<sap:external-function name="f:fromAbap" method="FROM_ABAP" kind="instance" >
<sap:argument param="VALUE" type="csequence"/>
<sap:result param="RESULT" type="string"/>
</sap:external-function>
Of course this is just one of examples, but that's still not clear why.. I'd wish this functionality to be available back in the cloud too
Is there anybody from ABAP Cloud team who can explain why it was revoked
Thanks!
Request clarification before answering.
OK seems like sap:call-external is still allowed. Small adjustment of the code helped to keep transformation almost same, but still required modification
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The cloud environment restricts such direct ABAP calls for security and architectural reasons
Use ABAP Class-Based XSLT Transformation
If you must use XSLT, you can pass additional parameters to the transformation via ABAP.
Another alternative approach
Preprocess Data in ABAP before XSLT
Modify your code to process data before calling XSLT, so you don’t need sap:external-function.
ABAP Code:
DATA:
lt_xml_input TYPE string,
lt_xml_output TYPE string,
lo_transform TYPE REF TO cl_transformation.
DATA(lo_case) = NEW zif_abap_case( ). " your custok class instance
DATA(lv_transformed_value) = lo_case->from_abap( 'OriginalValue' ).
lt_xml_input = `<root name="` && lv_transformed_value && `"></root>`.
" Apply XSLT transformation
CREATE OBJECT lo_transform TYPE ('ZMY_TRANSFORMATION').
lo_transform->call_transformation(
EXPORTING input = lt_xml_input
IMPORTING output = lt_xml_output
).
Processes data before XSLT execution and this works in the Cloud
Hope this helps. Cheers!!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 11 | |
| 6 | |
| 6 | |
| 4 | |
| 3 | |
| 3 | |
| 3 | |
| 3 | |
| 3 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.