<?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 Deep structure having field name with '-' in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/deep-structure-having-field-name-with/m-p/12764022#M2022660</link>
    <description>&lt;P&gt;Hi Guys, &lt;/P&gt;
  &lt;P&gt;I have a requirement to created deep structure (JSON to external system) like below :&lt;/P&gt;
  &lt;P&gt;Body: { "name" : "user id", &lt;/P&gt;
  &lt;P&gt;"email" : "email address", &lt;/P&gt;
  &lt;P&gt;"description" : "user display name", &lt;/P&gt;
  &lt;P&gt;"remote-name" : "id in the remote system", &lt;/P&gt;
  &lt;P&gt;"screen-reader" : "true/false", &lt;/P&gt;
  &lt;P&gt;"roles" : [ "role1", "role2", ...] } &lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;SAP does not allow to '-' in the field name, I was able to create dynamic internal table with field names having '-' using cl_alv_table_create=&amp;gt;create_dynamic_table but not sure how create a deep structure to add "roles". &lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;Please guide. &lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;Thanks!&lt;/P&gt;</description>
    <pubDate>Mon, 26 Jun 2023 15:38:53 GMT</pubDate>
    <dc:creator>johnmjd</dc:creator>
    <dc:date>2023-06-26T15:38:53Z</dc:date>
    <item>
      <title>Deep structure having field name with '-'</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/deep-structure-having-field-name-with/m-p/12764022#M2022660</link>
      <description>&lt;P&gt;Hi Guys, &lt;/P&gt;
  &lt;P&gt;I have a requirement to created deep structure (JSON to external system) like below :&lt;/P&gt;
  &lt;P&gt;Body: { "name" : "user id", &lt;/P&gt;
  &lt;P&gt;"email" : "email address", &lt;/P&gt;
  &lt;P&gt;"description" : "user display name", &lt;/P&gt;
  &lt;P&gt;"remote-name" : "id in the remote system", &lt;/P&gt;
  &lt;P&gt;"screen-reader" : "true/false", &lt;/P&gt;
  &lt;P&gt;"roles" : [ "role1", "role2", ...] } &lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;SAP does not allow to '-' in the field name, I was able to create dynamic internal table with field names having '-' using cl_alv_table_create=&amp;gt;create_dynamic_table but not sure how create a deep structure to add "roles". &lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;Please guide. &lt;/P&gt;
  &lt;P&gt;&lt;/P&gt;
  &lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 26 Jun 2023 15:38:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/deep-structure-having-field-name-with/m-p/12764022#M2022660</guid>
      <dc:creator>johnmjd</dc:creator>
      <dc:date>2023-06-26T15:38:53Z</dc:date>
    </item>
    <item>
      <title>Re: Deep structure having field name with '-'</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/deep-structure-having-field-name-with/m-p/12764023#M2022661</link>
      <description>&lt;P&gt;It's bad practice to use cl_alv_table_create=&amp;gt;create_dynamic_table as explained here: &lt;A href="https://blogs.sap.com/2019/11/16/alternative-to-cl_alv_table_createcreate_dynamic_table/"&gt;Alternative to CL_ALV_TABLE_CREATE=&amp;gt;CREATE_DYNAMIC_TABLE | SAP Blogs&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;For information, dynamic variable creation should use RTTS, creating variables with "-" is supported only if CREATE is called with P_STRICT = abap_false.&lt;/P&gt;&lt;P&gt;Better use /UI2/CL_JSON. There's built-in dynamic creation (not sure how to handle both dynamic creation and names containing "-").&lt;/P&gt;</description>
      <pubDate>Mon, 26 Jun 2023 17:06:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/deep-structure-having-field-name-with/m-p/12764023#M2022661</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2023-06-26T17:06:51Z</dc:date>
    </item>
    <item>
      <title>Re: Deep structure having field name with '-'</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/deep-structure-having-field-name-with/m-p/12764024#M2022662</link>
      <description>&lt;P&gt;Thanks Sandra for your inputs.&lt;/P&gt;&lt;P&gt;I will able to create dynamic_table using RTTS with field name '-' and then added a similar code below to create a deep structure.&lt;/P&gt;&lt;P&gt;&lt;EM&gt;2.1 Creating the Deep strcuture field&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;  DATA:  lo_tab TYPE REF TO cl_abap_tabledescr.&lt;/P&gt;&lt;P&gt;&lt;EM&gt;*&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;  lo_tab ?= cl_abap_typedescr=&amp;gt;describe_by_name( 'LVC_T_SCOL' ).&lt;/P&gt;&lt;P&gt;  la_comp-name = 'COLOR_TAB'.&lt;/P&gt;&lt;P&gt;  la_comp-type = lo_tab.&lt;/P&gt;&lt;P&gt;  APPEND la_comp TO lt_tot_comp.&lt;/P&gt;&lt;P&gt;  CLEAR: la_comp.&lt;/P&gt;</description>
      <pubDate>Mon, 26 Jun 2023 20:00:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/deep-structure-having-field-name-with/m-p/12764024#M2022662</guid>
      <dc:creator>johnmjd</dc:creator>
      <dc:date>2023-06-26T20:00:52Z</dc:date>
    </item>
    <item>
      <title>Re: Deep structure having field name with '-'</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/deep-structure-having-field-name-with/m-p/12764025#M2022663</link>
      <description>&lt;P&gt;Just to complete my previous comment, these are the lines which I was referring to, in my blog post: &lt;A href="https://github.com/sandraros/ZCL_ALV_TABLE_CREATE_RTTC/blob/4fe1113b091fe3b2b29114a3bb59bdbdb57765ef/src/zcl_alv_table_create_rttc.clas.abap#L392-L394"&gt;https://github.com/sandraros/ZCL_ALV_TABLE_CREATE_RTTC/blob/4fe1113b091fe3b2b29114a3bb59bdbdb57765ef/src/zcl_alv_table_create_rttc.clas.abap#L392-L394&lt;/A&gt;:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;        lp_struc_descr = cl_abap_structdescr=&amp;gt;create(
                          p_components = lt_comp
                          p_strict     = ' ' ).&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;As you can see, it's p_strict = ' ' so the class is ready for supporting names with a dash/hyphen.&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jun 2023 10:02:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/deep-structure-having-field-name-with/m-p/12764025#M2022663</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2023-06-27T10:02:25Z</dc:date>
    </item>
  </channel>
</rss>

