<?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: Convert structure to string and viceversa in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/convert-structure-to-string-and-viceversa/m-p/12050829#M1968695</link>
    <description>&lt;P&gt;Just to comment that using external performs is bad practice (as is using PERFORMs since they're considered obsolete now).&lt;/P&gt;</description>
    <pubDate>Tue, 03 Dec 2019 12:08:29 GMT</pubDate>
    <dc:creator>matt</dc:creator>
    <dc:date>2019-12-03T12:08:29Z</dc:date>
    <item>
      <title>Convert structure to string and viceversa</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/convert-structure-to-string-and-viceversa/m-p/12050825#M1968691</link>
      <description>&lt;P&gt;Hello, I need to convert a structure with some amount fields to a char like field, and then do the opposite.&lt;/P&gt;
  &lt;P&gt;I can convert the structure to a cfield with this:&lt;/P&gt; 
  &lt;PRE&gt;&lt;CODE&gt;DATA: lv_content  TYPE asafbtabcontent,
      lo_record TYPE REF TO data.


GET REFERENCE OF ls_my_str INTO lo_record.

PERFORM record_to_cfield IN PROGRAM saplas_afb USING lo_record  CHANGING lv_content.&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;But, how to do the opposite?&lt;/P&gt;
  &lt;P&gt;Abap 731.&lt;/P&gt;
  &lt;P&gt;Trying something like this, but values are wrong.&lt;/P&gt; 
  &lt;PRE&gt;&lt;CODE&gt;  FIELD-SYMBOLS:
    &amp;lt;ls_my_str&amp;gt; TYPE zz_my_str.

 ASSIGN lv_content TO &amp;lt;ls_my_str&amp;gt; CASTING. "HANDLE lo_TYPEDESCR.
  IF sy-subrc EQ 0.
      ls_my_str = &amp;lt;ls_my_str&amp;gt;.
  ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;I seem to remember that there was a FM or METHOD * CONTAINER * to do this conversions, but don't remember the name.&lt;/P&gt;
  &lt;P&gt;Any clue?&lt;/P&gt;
  &lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 03 Dec 2019 09:40:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/convert-structure-to-string-and-viceversa/m-p/12050825#M1968691</guid>
      <dc:creator>oliver_am</dc:creator>
      <dc:date>2019-12-03T09:40:19Z</dc:date>
    </item>
    <item>
      <title>Re: Convert structure to string and viceversa</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/convert-structure-to-string-and-viceversa/m-p/12050826#M1968692</link>
      <description>&lt;P&gt;Is this class what you are looking for? &lt;BR /&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;CL_ABAP_CONTAINER_UTILITIES&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 03 Dec 2019 09:50:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/convert-structure-to-string-and-viceversa/m-p/12050826#M1968692</guid>
      <dc:creator>Tomas_Buryanek</dc:creator>
      <dc:date>2019-12-03T09:50:12Z</dc:date>
    </item>
    <item>
      <title>Re: Convert structure to string and viceversa</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/convert-structure-to-string-and-viceversa/m-p/12050827#M1968693</link>
      <description>&lt;P&gt;Hello &lt;A href="https://answers.sap.com/users/69381/oliveram.html"&gt;Oliver AM&lt;/A&gt;,&lt;/P&gt;&lt;P&gt;It should be CL_ABAP_CONTAINER_UTILITIES. To know more about on how to use it, please follow the below Blog.&lt;/P&gt;&lt;P&gt;&lt;A href="https://blogs.sap.com/2013/09/27/conversion-using-method-clabapcontainerutilitiesfillcontainerc/" target="_blank"&gt;BLOG&lt;/A&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Regards!&lt;/P&gt;</description>
      <pubDate>Tue, 03 Dec 2019 10:02:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/convert-structure-to-string-and-viceversa/m-p/12050827#M1968693</guid>
      <dc:creator>former_member1716</dc:creator>
      <dc:date>2019-12-03T10:02:45Z</dc:date>
    </item>
    <item>
      <title>Re: Convert structure to string and viceversa</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/convert-structure-to-string-and-viceversa/m-p/12050828#M1968694</link>
      <description>&lt;P&gt;Thanks ! this is what I was looking for&lt;/P&gt;</description>
      <pubDate>Tue, 03 Dec 2019 10:16:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/convert-structure-to-string-and-viceversa/m-p/12050828#M1968694</guid>
      <dc:creator>oliver_am</dc:creator>
      <dc:date>2019-12-03T10:16:14Z</dc:date>
    </item>
    <item>
      <title>Re: Convert structure to string and viceversa</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/convert-structure-to-string-and-viceversa/m-p/12050829#M1968695</link>
      <description>&lt;P&gt;Just to comment that using external performs is bad practice (as is using PERFORMs since they're considered obsolete now).&lt;/P&gt;</description>
      <pubDate>Tue, 03 Dec 2019 12:08:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/convert-structure-to-string-and-viceversa/m-p/12050829#M1968695</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2019-12-03T12:08:29Z</dc:date>
    </item>
    <item>
      <title>Re: Convert structure to string and viceversa</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/convert-structure-to-string-and-viceversa/m-p/12050830#M1968696</link>
      <description>&lt;P&gt;I have a problem with the class CL_ABAP_CONTAINER_UTILITIES.&lt;/P&gt;&lt;P&gt;I've created a report to save the data from a table into a txt file.&lt;BR /&gt;If I read the downloaded file in the same system I can read and convert the data to the structure type correctly.&lt;/P&gt;&lt;P&gt;But I'm trying to read this file in other system, and in this other system the method READ_CONTAINER_C is not working fine. Returns wrong data and strange characters.&lt;/P&gt;&lt;P&gt;Do you know what can be the problem?&lt;BR /&gt;Version of first system; 731 and second system; 75D S4/HANA.&lt;/P&gt;&lt;P&gt;Code of the method READ_CONTAINER_C in both systems is the same.&lt;BR /&gt;Any clue?&lt;/P&gt;</description>
      <pubDate>Tue, 03 Dec 2019 17:38:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/convert-structure-to-string-and-viceversa/m-p/12050830#M1968696</guid>
      <dc:creator>oliver_am</dc:creator>
      <dc:date>2019-12-03T17:38:42Z</dc:date>
    </item>
    <item>
      <title>Re: Convert structure to string and viceversa</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/convert-structure-to-string-and-viceversa/m-p/12050831#M1968697</link>
      <description>&lt;P&gt;Thanks Matthew, It's was only a try. &lt;BR /&gt;I'll try to use OO in the future and not use PERFORMs any more.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Dec 2019 17:39:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/convert-structure-to-string-and-viceversa/m-p/12050831#M1968697</guid>
      <dc:creator>oliver_am</dc:creator>
      <dc:date>2019-12-03T17:39:58Z</dc:date>
    </item>
    <item>
      <title>Re: Convert structure to string and viceversa</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/convert-structure-to-string-and-viceversa/m-p/12050832#M1968698</link>
      <description>&lt;P&gt;CL_ABAP_CONTAINER_UTILITIES is only a temporary solution when you convert a system from Non-Unicode to Unicode. In non-unicode programs, structures with packed fields could be transferred to character fields. It's considered incorrect practice since Unicode (it's not really connected to Unicode, it's just that it was a good occasion to clean ABAP code). If you want to transfer data in a standardized way, please use JSON or XML (it could be done via data clusters too, with the classes CL_ABAP_EXPIMP* (which support internal formats of several kernel versions), but I don't like it because it's a SAP proprietary method).&lt;/P&gt;</description>
      <pubDate>Tue, 03 Dec 2019 20:14:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/convert-structure-to-string-and-viceversa/m-p/12050832#M1968698</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2019-12-03T20:14:11Z</dc:date>
    </item>
  </channel>
</rss>

