cancel
Showing results for 
Search instead for 
Did you mean: 

get a part of the string

Former Member
0 Kudos

Hi SAP gurus

i have a string where i need to eliminate 'A.B.N' from the following string please advice

as i am new to xslt i am not sure how

xsl:value-of select="concat('A.B.N. ',$vABNNameValue)"/

this is the part of the xsl i am trying to change the above statement in .

:for-each select="/ORDERS02/IDOC/E1EDKA1" >

<xsl:if test="PARVW = 'LF' ">

<Name3>

<xsl:variable name= "vABNNameValue">

<xsl:value-of select="''" />

<xsl:for-each select="E1EDKA3" >

< xsl:if test="QUALP = 'ABN' ">

<xsl:if test="STDPN != ''">

<xsl:value-of select= "STDPN"/>

</xsl:if>

</xsl:if>

</xsl:for-each>

</xsl:variable>

<xsl:choose>

<xsl:when test= "$vABNNameValue != ''">

< !xsl:value-of select="concat('A.B.N. ',$vABNNameValue)"/-!>

<xsl:value-of select="concat(' A.B.N. ',$vABNNameValue)"/>

<!<xsl:value-of select="$vABNvalue"/>>

</xsl:when >

<xsl:otherwise >

<!-- OVSD Call 324728 End -- >

< xsl:variable name="Name3Test">

<xsl:call-template name="Template_GetE1EDKA1Name3">

<xsl:with-param name= "TestValue">LF</xsl:with-param >

< /xsl:call-template>

< /xsl:variable>

< xsl:if test="$Name3Test != ''" >

<xsl:value-of select="$Name3Test"/ >

</xsl:if >

<!-- OVSD Call 324728 Begin -- >

< /xsl:otherwise>

< /xsl:choose>

< /Name3>

< /xsl:if>

< /xsl:for-eac

please advice its so urgent i have a production issue

i know there is a function substring

thanks

Accepted Solutions (1)

Accepted Solutions (1)

ranjit_deshmukh
Active Participant
0 Kudos

Hi,

this implies that there is an error in your mapping.

pls check it in the Interface mapping by hitting the test tab

enter some valid data in to source and then test it.

But before you test it make sure that you are filling in all those values in the fields which are used with the string funcions if any.

One more thing make sure that ur using as

>><b><xsl:value-of select='$vABNNameValue' /></b>

Ranjit.

Former Member
0 Kudos

Hi Renjith

Thanks for ur advice ,

i have tested and am getting the result executed successfully when i supply the values inthe mapping test inthe directory

but the java mapping error still exists

please advice

thanks

Answers (4)

Answers (4)

Former Member
0 Kudos

Have a look at this

http://www.w3schools.com/xpath/xpath_functions.asp#string

i guess this might be useful to you :

<b>replace(string,pattern,replace) </b>

Returns a string that is created by replacing the given pattern with the replace argument

Example: replace("Bella Italia", "l", "")

Result: 'Bea Itaia'

in your case

<b>replace("someA.B.Nssss","A.B.N","")</b>

I think it would work. try this....

PS: award points if answer helps you.

thanks,

Pooja

ranjit_deshmukh
Active Participant
0 Kudos

ok I got it

simply use:

xsl:value-of select=$vABNNameValue

in spite of:

>>xsl:value-of select="concat('A.B.N. ',$vABNNameValue)"/

Ranjit.

Former Member
0 Kudos

hi

Renjit

I did the same as u mentioned

but now there is an error in the java Application</SAP:Category>

<SAP:Code area="MAPPING">STREAM_TRANSFORMATION_EX</SAP:Code>

<SAP:P1>com/xxx/xi/utils/schema/SchemaUtilOrders</SAP:P1>

<SAP:P2>ValidationParsingException: ERRORS : cvc-complex~</SAP:P2>

<SAP:P3 />

<SAP:P4 />

<SAP:AdditionalText />

<SAP:ApplicationFaultMessage namespace="" />

<SAP:Stack>Java mapping of application triggered an exception</SAP:Stack>

thanks

Former Member
0 Kudos

If you know the positions of your 'A.B.N' string in your field value, then you can use substring and contact functions to get the desired result.

e.g

<xsl:element name="FIELD">

<xsl:value-of select="substring(FIELD,start,end)"/>

</xsl:element>

thanks,

Pooja

ranjit_deshmukh
Active Participant
0 Kudos

Can u pls clarify a little more as to wht u exactly are up to?

do u want to eliminate 'A.B.N.' from

>>>xsl:value-of select="concat('A.B.N. ',$vABNNameValue)"/

or what?

Ranjit