<?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 Re: Offset Problem in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/offset-problem/m-p/12724509#M2020019</link>
    <description>&lt;P&gt;&lt;SPAN class="mention-scrubbed"&gt;omar.saber&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;You can use the following code to print 2 digits of a hex number in ABAP:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA(lv_2bytes) = ls_struc1-data+lv_first_byte_of_row(2).
DATA(lv_hex) = CONV string( lv_2bytes ).
DATA(lv_hex_2digits) = COND #( WHEN strlen( lv_hex ) EQ 1 THEN '0' &amp;amp;&amp;amp; lv_hex ELSE lv_hex ).
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;This code will convert the value of &lt;CODE&gt;lv_2bytes&lt;/CODE&gt; to a string and then check if the length of the string is equal to 1. If it is, it will add a ‘0’ in front of the string. Otherwise, it will return the original string.&lt;/P&gt;&lt;P&gt;I hope this helps! Let me know if you have any other questions.&lt;/P&gt;</description>
    <pubDate>Tue, 09 May 2023 10:20:02 GMT</pubDate>
    <dc:creator>Yogananda</dc:creator>
    <dc:date>2023-05-09T10:20:02Z</dc:date>
    <item>
      <title>Offset Problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/offset-problem/m-p/12724508#M2020018</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
  &lt;P&gt;I am a beginner in ABAP and I want for guideness &lt;/P&gt;
  &lt;P&gt;I have an error say that teh total of the offset (68) and the length (2) was greater than the current length of the string (69) however.&lt;/P&gt;
  &lt;P&gt;so I am using this line of code DATA(lv_2bytes) = ls_struc1-data+lv_first_byte_of_row(2).&lt;/P&gt;
  &lt;P&gt;when I replace the (2) with (1) it works but I want to print 2 digits of the hex number so any suggestion please?&lt;/P&gt;
  &lt;P&gt;thank you in advance.&lt;/P&gt;</description>
      <pubDate>Tue, 09 May 2023 10:06:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/offset-problem/m-p/12724508#M2020018</guid>
      <dc:creator>omar_saber</dc:creator>
      <dc:date>2023-05-09T10:06:03Z</dc:date>
    </item>
    <item>
      <title>Re: Offset Problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/offset-problem/m-p/12724509#M2020019</link>
      <description>&lt;P&gt;&lt;SPAN class="mention-scrubbed"&gt;omar.saber&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;You can use the following code to print 2 digits of a hex number in ABAP:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA(lv_2bytes) = ls_struc1-data+lv_first_byte_of_row(2).
DATA(lv_hex) = CONV string( lv_2bytes ).
DATA(lv_hex_2digits) = COND #( WHEN strlen( lv_hex ) EQ 1 THEN '0' &amp;amp;&amp;amp; lv_hex ELSE lv_hex ).
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;This code will convert the value of &lt;CODE&gt;lv_2bytes&lt;/CODE&gt; to a string and then check if the length of the string is equal to 1. If it is, it will add a ‘0’ in front of the string. Otherwise, it will return the original string.&lt;/P&gt;&lt;P&gt;I hope this helps! Let me know if you have any other questions.&lt;/P&gt;</description>
      <pubDate>Tue, 09 May 2023 10:20:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/offset-problem/m-p/12724509#M2020019</guid>
      <dc:creator>Yogananda</dc:creator>
      <dc:date>2023-05-09T10:20:02Z</dc:date>
    </item>
  </channel>
</rss>

