<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic assign x type data to xstring type issue in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/assign-x-type-data-to-xstring-type-issue/m-p/3632443#M874907</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;how assign x type to xstring.&lt;/P&gt;&lt;P&gt;and get actual length.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: len type i,&lt;/P&gt;&lt;P&gt;        x1(300) type x,&lt;/P&gt;&lt;P&gt;        xs type xstring.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;case 1:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;xs = '2222'. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;len = xstrlen( xs ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;we will get len value is 2 which result that i want to get.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;case 2.&lt;/P&gt;&lt;P&gt;x1 = '2222'.&lt;/P&gt;&lt;P&gt;len = xstrlen( x1 ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;we will get len value is 300.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;xs = x1.&lt;/P&gt;&lt;P&gt;len = xstrlen( xs ).&lt;/P&gt;&lt;P&gt;we will get len value is 300.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i know in var x1 will fill with '00' from left to right. but i want to know actual length not definition lenth.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thank you very much advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 09 Apr 2008 03:21:44 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-04-09T03:21:44Z</dc:date>
    <item>
      <title>assign x type data to xstring type issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/assign-x-type-data-to-xstring-type-issue/m-p/3632443#M874907</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;how assign x type to xstring.&lt;/P&gt;&lt;P&gt;and get actual length.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: len type i,&lt;/P&gt;&lt;P&gt;        x1(300) type x,&lt;/P&gt;&lt;P&gt;        xs type xstring.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;case 1:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;xs = '2222'. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;len = xstrlen( xs ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;we will get len value is 2 which result that i want to get.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;case 2.&lt;/P&gt;&lt;P&gt;x1 = '2222'.&lt;/P&gt;&lt;P&gt;len = xstrlen( x1 ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;we will get len value is 300.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;xs = x1.&lt;/P&gt;&lt;P&gt;len = xstrlen( xs ).&lt;/P&gt;&lt;P&gt;we will get len value is 300.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i know in var x1 will fill with '00' from left to right. but i want to know actual length not definition lenth.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thank you very much advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Apr 2008 03:21:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/assign-x-type-data-to-xstring-type-issue/m-p/3632443#M874907</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-09T03:21:44Z</dc:date>
    </item>
    <item>
      <title>Re: assign x type data to xstring type issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/assign-x-type-data-to-xstring-type-issue/m-p/3632444#M874908</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Use describe statement i.e, &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
data : len type i. 

DESCRIBE FIELD x1 length len.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Apr 2008 03:35:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/assign-x-type-data-to-xstring-type-issue/m-p/3632444#M874908</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-09T03:35:39Z</dc:date>
    </item>
    <item>
      <title>Re: assign x type data to xstring type issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/assign-x-type-data-to-xstring-type-issue/m-p/3632445#M874909</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;xstrlen will return the actual lenghth only in case of hexstrings.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For x type variables with fixed length xstrlen will return the defined lenghth always.&lt;/P&gt;&lt;P&gt;Try using strlen instead of xstrlen for such cases to get correct occupied lenght. In 4.6 it works. I do not know what release you are on.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Apr 2008 03:44:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/assign-x-type-data-to-xstring-type-issue/m-p/3632445#M874909</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-09T03:44:22Z</dc:date>
    </item>
    <item>
      <title>Re: assign x type data to xstring type issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/assign-x-type-data-to-xstring-type-issue/m-p/3632446#M874910</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thank you!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;release is 6.4! &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;replace string type to xstring type and get length is definition length yet.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Apr 2008 04:17:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/assign-x-type-data-to-xstring-type-issue/m-p/3632446#M874910</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-09T04:17:26Z</dc:date>
    </item>
    <item>
      <title>Re: assign x type data to xstring type issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/assign-x-type-data-to-xstring-type-issue/m-p/3632447#M874911</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi xiaobing xue,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is no Function Module in SAP that actually removes the Zero's after the numbers ('222200000000'). CONVERSION_EXIT FM's are there to remove Leading Zero's and add Leading Zero's. So I think you need to manually proceed and calculate the length. Try the following code and you'll get the desired output.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: len TYPE i,&lt;/P&gt;&lt;P&gt;      x1(300) TYPE x,&lt;/P&gt;&lt;P&gt;      xs TYPE xstring,&lt;/P&gt;&lt;P&gt;      xs1 TYPE xstring.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: ch1 TYPE char255,&lt;/P&gt;&lt;P&gt;      ch2 TYPE char255.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: l1 TYPE i,&lt;/P&gt;&lt;P&gt;      l2 TYPE i.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;xs = '2222'.&lt;/P&gt;&lt;P&gt;len = XSTRLEN( xs ).&lt;/P&gt;&lt;P&gt;WRITE:/ 'First Length Calculation', len.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLEAR: len.&lt;/P&gt;&lt;P&gt;x1 = '2222'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;len = XSTRLEN( x1 ).&lt;/P&gt;&lt;P&gt;DO len TIMES.&lt;/P&gt;&lt;P&gt;  IF x1+l2(1) IS NOT INITIAL.&lt;/P&gt;&lt;P&gt;    MOVE x1+l2(1) TO ch2.&lt;/P&gt;&lt;P&gt;    CONCATENATE ch1 ch2 INTO ch1.&lt;/P&gt;&lt;P&gt;    l2 = l2 + 1.&lt;/P&gt;&lt;P&gt;  ELSE.&lt;/P&gt;&lt;P&gt;    EXIT.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;ENDDO.&lt;/P&gt;&lt;P&gt;MOVE ch1 TO xs1.&lt;/P&gt;&lt;P&gt;len = XSTRLEN( xs1 ).&lt;/P&gt;&lt;P&gt;WRITE:/ 'Second Length Calculation', len.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLEAR: len, ch1, ch2, l2.&lt;/P&gt;&lt;P&gt;xs = x1.&lt;/P&gt;&lt;P&gt;len = XSTRLEN( xs ).&lt;/P&gt;&lt;P&gt;DO len TIMES.&lt;/P&gt;&lt;P&gt;  IF xs+l2(1) NE '00'.&lt;/P&gt;&lt;P&gt;    MOVE xs+l2(1) TO ch2.&lt;/P&gt;&lt;P&gt;    CONCATENATE ch1 ch2 INTO ch1.&lt;/P&gt;&lt;P&gt;    l2 = l2 + 1.&lt;/P&gt;&lt;P&gt;  ELSE.&lt;/P&gt;&lt;P&gt;    EXIT.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;ENDDO.&lt;/P&gt;&lt;P&gt;MOVE ch1 TO xs1.&lt;/P&gt;&lt;P&gt;len = XSTRLEN( xs1 ).&lt;/P&gt;&lt;P&gt;WRITE:/ 'Third Length Calculation', len.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that this solves your problem. Reward accordingly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks and Regards,&lt;/P&gt;&lt;P&gt;Maddineni Bharath.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Apr 2008 04:51:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/assign-x-type-data-to-xstring-type-issue/m-p/3632447#M874911</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-09T04:51:37Z</dc:date>
    </item>
    <item>
      <title>Re: assign x type data to xstring type issue</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/assign-x-type-data-to-xstring-type-issue/m-p/3632448#M874912</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thank you &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CLEAR: len, ch1, ch2, l2.&lt;/P&gt;&lt;P&gt;xs = x1.&lt;/P&gt;&lt;P&gt;len = XSTRLEN( xs ).&lt;/P&gt;&lt;P&gt;DO len TIMES.&lt;/P&gt;&lt;P&gt;  IF xs+l2(1) NE '00'.&lt;/P&gt;&lt;P&gt;    MOVE xs+l2(1) TO ch2.&lt;/P&gt;&lt;P&gt;    CONCATENATE ch1 ch2 INTO ch1.&lt;/P&gt;&lt;P&gt;    l2 = l2 + 1.&lt;/P&gt;&lt;P&gt;  ELSE.&lt;/P&gt;&lt;P&gt;    EXIT.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;ENDDO.&lt;/P&gt;&lt;P&gt;MOVE ch1 TO xs1.&lt;/P&gt;&lt;P&gt;len = XSTRLEN( xs1 ).&lt;/P&gt;&lt;P&gt;WRITE:/ 'Third Length Calculation', len.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;is i want!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thank you !&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Apr 2008 04:58:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/assign-x-type-data-to-xstring-type-issue/m-p/3632448#M874912</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-04-09T04:58:53Z</dc:date>
    </item>
  </channel>
</rss>

