<?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: Catch a dynamic structure in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/catch-a-dynamic-structure/m-p/5697681#M1294396</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Uwe,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I didn't know the class, but having looked at it, the programm's i found which call these methods, all know up front which structure they will receive. It could be a sollution for me to, but i would rather not determine it before calling the method. (e.g. field-symbol is assigned in certain structure before calling the method...)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Underneath the code which does not work yet....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    DATA lx_upload_data TYPE string. &lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Loop at the uploaded data and call the object specific data handling&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  LOOP AT upload_data INTO lx_upload_data.&lt;/P&gt;&lt;P&gt;    TRY.&lt;/P&gt;&lt;P&gt;      CALL METHOD extract_data_record&lt;/P&gt;&lt;P&gt;        EXPORTING&lt;/P&gt;&lt;P&gt;          ip_data = lx_upload_data&lt;/P&gt;&lt;P&gt;        IMPORTING&lt;/P&gt;&lt;P&gt;          es_extracted_data = &amp;lt;maybe a fieldsymbol here?&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    ENDTRY.&lt;/P&gt;&lt;P&gt;  ENDLOOP. &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;  METHOD extract_data_record.&lt;/P&gt;&lt;P&gt;  FIELD-SYMBOLS &amp;lt;fs_data&amp;gt; TYPE REF TO data.&lt;/P&gt;&lt;P&gt;  FIELD-SYMBOLS &amp;lt;fs_field&amp;gt; TYPE ANY.&lt;/P&gt;&lt;P&gt;  DATA dref TYPE REF TO data.&lt;/P&gt;&lt;P&gt;  DATA lr_fielddescr TYPE REF TO cl_abap_typedescr.&lt;/P&gt;&lt;P&gt;  DATA len_content   TYPE i.&lt;/P&gt;&lt;P&gt;  DATA len_field     TYPE i.&lt;/P&gt;&lt;P&gt;  DATA len_src       TYPE i.&lt;/P&gt;&lt;P&gt;  DATA len_wa        TYPE i.&lt;/P&gt;&lt;P&gt;  DATA offset        TYPE i.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  TRY.&lt;/P&gt;&lt;P&gt;      CREATE DATA dref TYPE (me-&amp;gt;upload_struct_name).&lt;/P&gt;&lt;P&gt;    CATCH cx_sy_create_data_error.&lt;/P&gt;&lt;P&gt;  ENDTRY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ASSIGN dref-&amp;gt;* TO &amp;lt;fs_data&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  offset = 0.&lt;/P&gt;&lt;P&gt;  len_src = 0.&lt;/P&gt;&lt;P&gt;  len_src = STRLEN( ip_data ).&lt;/P&gt;&lt;P&gt;  DO.&lt;/P&gt;&lt;P&gt;    ASSIGN COMPONENT sy-index OF STRUCTURE &amp;lt;fs_data&amp;gt; TO &amp;lt;fs_field&amp;gt;.&lt;/P&gt;&lt;P&gt;    CHECK sy-subrc = 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   DESCRIBE FIELD &amp;lt;fs_field&amp;gt; LENGTH len_field IN CHARACTER MODE.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    lr_fielddescr = cl_abap_datadescr=&amp;gt;describe_by_data( &amp;lt;fs_field&amp;gt; ).&lt;/P&gt;&lt;P&gt;    len_field = lr_fielddescr-&amp;gt;length.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   len_field = STRLEN( &amp;lt;fs_field&amp;gt; ).&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    IF len_src &amp;gt; offset.&lt;/P&gt;&lt;P&gt;      &amp;lt;fs_field&amp;gt; = ip_data+offset(len_field).&lt;/P&gt;&lt;P&gt;      offset = offset + len_field.&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;  es_extracted_data = &amp;lt;fs_data&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDMETHOD. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Maybe some more suggestions?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;Martijn de Jong.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 28 May 2009 14:04:16 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-05-28T14:04:16Z</dc:date>
    <item>
      <title>Catch a dynamic structure</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/catch-a-dynamic-structure/m-p/5697678#M1294393</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does anyone know how i can catch an exporting parameter from a method, which has type ANY?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sample code:&lt;/P&gt;&lt;P&gt;CALL METHOD catch_any&lt;/P&gt;&lt;P&gt;  IMPORTING&lt;/P&gt;&lt;P&gt;    ip_string = lv_string&lt;/P&gt;&lt;P&gt;  EXPORTING&lt;/P&gt;&lt;P&gt;    es_any = ??????.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this method the string is converted to a dynamically built up structure. So up front when calling the method i do not know the type of the structure yet. I could use an additional step in which i first set the structure to a dynamic table, return this as a "type ref to data" and set this to a dynamic local structure, but i don't want that. There must be a simple and clean sollution which i'm missing.....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyone?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;Martijn de Jong.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 May 2009 12:13:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/catch-a-dynamic-structure/m-p/5697678#M1294393</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-28T12:13:15Z</dc:date>
    </item>
    <item>
      <title>Re: Catch a dynamic structure</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/catch-a-dynamic-structure/m-p/5697679#M1294394</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just to give me additional info, and for not having to code anything myself, could you give me an example of how this string is filled (just one example should do) and what the coding inside the method catch_any is looks like.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have an idea of what you are trying to do, but I do need some additional info.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 May 2009 13:00:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/catch-a-dynamic-structure/m-p/5697679#M1294394</guid>
      <dc:creator>Sm1tje</dc:creator>
      <dc:date>2009-05-28T13:00:18Z</dc:date>
    </item>
    <item>
      <title>Re: Catch a dynamic structure</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/catch-a-dynamic-structure/m-p/5697680#M1294395</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Martijn &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Are you aware of class &lt;STRONG&gt;CL_ABAP_CONTAINER_UTILITIES&lt;/STRONG&gt; (&amp;gt;= 6.20 available)?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think its static methods do exactly what you want to achieve: moving data back and forth between an unstructured C-container and a structure.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;  Uwe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 May 2009 13:29:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/catch-a-dynamic-structure/m-p/5697680#M1294395</guid>
      <dc:creator>uwe_schieferstein</dc:creator>
      <dc:date>2009-05-28T13:29:59Z</dc:date>
    </item>
    <item>
      <title>Re: Catch a dynamic structure</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/catch-a-dynamic-structure/m-p/5697681#M1294396</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Uwe,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I didn't know the class, but having looked at it, the programm's i found which call these methods, all know up front which structure they will receive. It could be a sollution for me to, but i would rather not determine it before calling the method. (e.g. field-symbol is assigned in certain structure before calling the method...)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Underneath the code which does not work yet....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    DATA lx_upload_data TYPE string. &lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Loop at the uploaded data and call the object specific data handling&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  LOOP AT upload_data INTO lx_upload_data.&lt;/P&gt;&lt;P&gt;    TRY.&lt;/P&gt;&lt;P&gt;      CALL METHOD extract_data_record&lt;/P&gt;&lt;P&gt;        EXPORTING&lt;/P&gt;&lt;P&gt;          ip_data = lx_upload_data&lt;/P&gt;&lt;P&gt;        IMPORTING&lt;/P&gt;&lt;P&gt;          es_extracted_data = &amp;lt;maybe a fieldsymbol here?&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    ENDTRY.&lt;/P&gt;&lt;P&gt;  ENDLOOP. &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;  METHOD extract_data_record.&lt;/P&gt;&lt;P&gt;  FIELD-SYMBOLS &amp;lt;fs_data&amp;gt; TYPE REF TO data.&lt;/P&gt;&lt;P&gt;  FIELD-SYMBOLS &amp;lt;fs_field&amp;gt; TYPE ANY.&lt;/P&gt;&lt;P&gt;  DATA dref TYPE REF TO data.&lt;/P&gt;&lt;P&gt;  DATA lr_fielddescr TYPE REF TO cl_abap_typedescr.&lt;/P&gt;&lt;P&gt;  DATA len_content   TYPE i.&lt;/P&gt;&lt;P&gt;  DATA len_field     TYPE i.&lt;/P&gt;&lt;P&gt;  DATA len_src       TYPE i.&lt;/P&gt;&lt;P&gt;  DATA len_wa        TYPE i.&lt;/P&gt;&lt;P&gt;  DATA offset        TYPE i.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  TRY.&lt;/P&gt;&lt;P&gt;      CREATE DATA dref TYPE (me-&amp;gt;upload_struct_name).&lt;/P&gt;&lt;P&gt;    CATCH cx_sy_create_data_error.&lt;/P&gt;&lt;P&gt;  ENDTRY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ASSIGN dref-&amp;gt;* TO &amp;lt;fs_data&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  offset = 0.&lt;/P&gt;&lt;P&gt;  len_src = 0.&lt;/P&gt;&lt;P&gt;  len_src = STRLEN( ip_data ).&lt;/P&gt;&lt;P&gt;  DO.&lt;/P&gt;&lt;P&gt;    ASSIGN COMPONENT sy-index OF STRUCTURE &amp;lt;fs_data&amp;gt; TO &amp;lt;fs_field&amp;gt;.&lt;/P&gt;&lt;P&gt;    CHECK sy-subrc = 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   DESCRIBE FIELD &amp;lt;fs_field&amp;gt; LENGTH len_field IN CHARACTER MODE.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    lr_fielddescr = cl_abap_datadescr=&amp;gt;describe_by_data( &amp;lt;fs_field&amp;gt; ).&lt;/P&gt;&lt;P&gt;    len_field = lr_fielddescr-&amp;gt;length.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;   len_field = STRLEN( &amp;lt;fs_field&amp;gt; ).&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    IF len_src &amp;gt; offset.&lt;/P&gt;&lt;P&gt;      &amp;lt;fs_field&amp;gt; = ip_data+offset(len_field).&lt;/P&gt;&lt;P&gt;      offset = offset + len_field.&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;  es_extracted_data = &amp;lt;fs_data&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDMETHOD. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Maybe some more suggestions?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;Martijn de Jong.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 May 2009 14:04:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/catch-a-dynamic-structure/m-p/5697681#M1294396</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-28T14:04:16Z</dc:date>
    </item>
    <item>
      <title>Re: Catch a dynamic structure</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/catch-a-dynamic-structure/m-p/5697682#M1294397</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Martijn &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your program is doing exactly what I suggested:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
...
TRY.
CREATE DATA dref TYPE (me-&amp;gt;upload_struct_name).
CATCH cx_sy_create_data_error.
ENDTRY.

ASSIGN dref-&amp;gt;* TO &amp;lt;fs_data&amp;gt;.
...

" And now you call method:
  CALL METHOD cl_abap_container_utilities=&amp;gt;read_container_c
    EXPORTING
      im_container           = ip_data
    IMPORTING
      ex_value               = &amp;lt;fs_data&amp;gt;
    EXCEPTIONS
      illegal_parameter_type = 1
      OTHERS                 = 2.
  IF sy-subrc &amp;lt;&amp;gt; 0.
*   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Why do you want to re-invent the wheel if SAP has done the job for you?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;  Uwe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 May 2009 14:10:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/catch-a-dynamic-structure/m-p/5697682#M1294397</guid>
      <dc:creator>uwe_schieferstein</dc:creator>
      <dc:date>2009-05-28T14:10:13Z</dc:date>
    </item>
    <item>
      <title>Re: Catch a dynamic structure</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/catch-a-dynamic-structure/m-p/5697683#M1294398</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your calling program will also know the strcture, at least at runtime. Create a field-symbol and assign the reference of dynamic structure to this field-symbol.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Like:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
*----------------------------------------------------------------------*
CLASS lcl_test DEFINITION.

  PUBLIC SECTION.

    DATA: t_mara TYPE standard TABLE OF mara.

    METHODS:
      constructor,

      get
        IMPORTING
          if_matnr TYPE matnr
        EXPORTING
          ea_mara  TYPE any.

ENDCLASS.                    "lcl_test DEFINITION

START-OF-SELECTION.
  DATA: lo_test TYPE REF TO lcl_test,
        lr_data TYPE REF TO data.

  FIELD-SYMBOLS: &amp;lt;fa_any&amp;gt; TYPE ANY,
                 &amp;lt;f_field&amp;gt; TYPE ANY.

* At this point I know that I will receive back the structure type MARA
  DATA: la_mara TYPE mara.

  ASSIGN la_mara TO &amp;lt;fa_any&amp;gt;.

  CREATE OBJECT lo_test.

  lo_test-&amp;gt;get(
    EXPORTING
      if_matnr = '000000000077000000'
    IMPORTING
      ea_mara  = &amp;lt;fa_any&amp;gt; ).

  WRITE: 'Done'.

*----------------------------------------------------------------------*
CLASS lcl_test IMPLEMENTATION.

  METHOD constructor.

    SELECT * INTO TABLE t_mara
           FROM mara
           UP TO 10 ROWS.

  ENDMETHOD.                    "constructor

  METHOD get.

    FIELD-SYMBOLS: &amp;lt;lfs_mara&amp;gt; LIKE LINE OF me-&amp;gt;t_mara.

    READ TABLE me-&amp;gt;t_mara ASSIGNING &amp;lt;lfs_mara&amp;gt; WITH KEY matnr = if_matnr.

    ea_mara = &amp;lt;lfs_mara&amp;gt;.

  ENDMETHOD.                    "get

ENDCLASS.                    "lcl_test IMPLEMENTATION
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Naimesh Patel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 May 2009 14:24:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/catch-a-dynamic-structure/m-p/5697683#M1294398</guid>
      <dc:creator>naimesh_patel</dc:creator>
      <dc:date>2009-05-28T14:24:04Z</dc:date>
    </item>
    <item>
      <title>Re: Catch a dynamic structure</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/catch-a-dynamic-structure/m-p/5697684#M1294399</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Uwe,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your reply. Indeed no need to invent the wheele twice... Still my question remains if there is a way to catch that dynamic structure from the method in which this method (read_container_c) is called, without knowing the upload structure in this calling method?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As in your example code i know the upload structure, but in the actual code, this method is called from another class and method whcih doesn't know the structure.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope i made myself clear enough?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;Martijn de Jong.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Jun 2009 07:44:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/catch-a-dynamic-structure/m-p/5697684#M1294399</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-06-03T07:44:11Z</dc:date>
    </item>
    <item>
      <title>Re: Catch a dynamic structure</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/catch-a-dynamic-structure/m-p/5697685#M1294400</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Martijn&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My assumption is that the contents of ME-&amp;gt;UPLOAD_STRUCT_NAME changes at runtime and belongs to a DDIC structure (or TYPE-POOLS definition).&lt;/P&gt;&lt;P&gt;If this is correct then the program is fully dynamic:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
...
TRY.
CREATE DATA dref TYPE (me-&amp;gt;upload_struct_name).  " changes during runtime
CATCH cx_sy_create_data_error.
ENDTRY.
 
ASSIGN dref-&amp;gt;* TO &amp;lt;fs_data&amp;gt;.
...
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;  Uwe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Jun 2009 11:40:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/catch-a-dynamic-structure/m-p/5697685#M1294400</guid>
      <dc:creator>uwe_schieferstein</dc:creator>
      <dc:date>2009-06-03T11:40:04Z</dc:date>
    </item>
    <item>
      <title>Re: Catch a dynamic structure</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/catch-a-dynamic-structure/m-p/5697686#M1294401</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Uwe,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It does, but:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Class A:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;method A1.&lt;/P&gt;&lt;P&gt;  call method B1&lt;/P&gt;&lt;P&gt;    exporting ip_data = ls_data&lt;/P&gt;&lt;P&gt;    importing es_new = ls_/fs_???.&lt;/P&gt;&lt;P&gt;endmethod.    "A1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Class B:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;method B1.&lt;/P&gt;&lt;P&gt;  TRY.&lt;/P&gt;&lt;P&gt;  CREATE DATA dref TYPE (me-&amp;gt;upload_struct_name). &lt;/P&gt;&lt;P&gt;  CATCH cx_sy_create_data_error.&lt;/P&gt;&lt;P&gt;  ENDTRY.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;  ASSIGN dref-&amp;gt;* TO &amp;lt;fs_data&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CALL METHOD cl_abap_container_utilities=&amp;gt;read_container_c&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      im_container           = ip_data&lt;/P&gt;&lt;P&gt;    IMPORTING&lt;/P&gt;&lt;P&gt;      ex_value               = &amp;lt;fs_data&amp;gt;&lt;/P&gt;&lt;P&gt;    EXCEPTIONS&lt;/P&gt;&lt;P&gt;      illegal_parameter_type = 1&lt;/P&gt;&lt;P&gt;      OTHERS                 = 2.&lt;/P&gt;&lt;P&gt;  IF sy-subrc  0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  es_new = &amp;lt;fs_data&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endmethod.   "B1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;es_new now contains a dynamically determined structure, but in what kind of local variable do i catch it in method A1?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Jun 2009 11:56:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/catch-a-dynamic-structure/m-p/5697686#M1294401</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-06-03T11:56:38Z</dc:date>
    </item>
  </channel>
</rss>

