<?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 Passing Fields dynamically to Structure in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/passing-fields-dynamically-to-structure/m-p/2196807#M468972</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Can any one help me out on this scenario.&lt;/P&gt;&lt;P&gt;I have the selected fields(table fields from EKKO) in my internal table say for example "ZIT_EKKOFLD". And my internal table has the value also for the corresponding fields.&lt;/P&gt;&lt;P&gt;Now i am in Loop&lt;/P&gt;&lt;P&gt;Loop at ZIT_EKKOFLD into work area(wa_ekkofld)&lt;/P&gt;&lt;P&gt;I have another structure say for example wa_ekko, now &lt;/P&gt;&lt;P&gt;i need to assign the new value to wa_ekko from wa_ekkofld work area.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i.e., WA_EKKO - (WA_EKKOFLD-FIELDNAME) = WA_EKKOFLD-VALUE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;Can any one tell me how can i do this dynamically ? I know the structure name only thing is i need to pass the field name dynamically inside the loop.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 04 May 2007 11:34:15 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-05-04T11:34:15Z</dc:date>
    <item>
      <title>Passing Fields dynamically to Structure</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/passing-fields-dynamically-to-structure/m-p/2196807#M468972</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Can any one help me out on this scenario.&lt;/P&gt;&lt;P&gt;I have the selected fields(table fields from EKKO) in my internal table say for example "ZIT_EKKOFLD". And my internal table has the value also for the corresponding fields.&lt;/P&gt;&lt;P&gt;Now i am in Loop&lt;/P&gt;&lt;P&gt;Loop at ZIT_EKKOFLD into work area(wa_ekkofld)&lt;/P&gt;&lt;P&gt;I have another structure say for example wa_ekko, now &lt;/P&gt;&lt;P&gt;i need to assign the new value to wa_ekko from wa_ekkofld work area.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i.e., WA_EKKO - (WA_EKKOFLD-FIELDNAME) = WA_EKKOFLD-VALUE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;Can any one tell me how can i do this dynamically ? I know the structure name only thing is i need to pass the field name dynamically inside the loop.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 May 2007 11:34:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/passing-fields-dynamically-to-structure/m-p/2196807#M468972</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-04T11:34:15Z</dc:date>
    </item>
    <item>
      <title>Re: Passing Fields dynamically to Structure</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/passing-fields-dynamically-to-structure/m-p/2196808#M468973</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;Try using &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;wa_ekko = wa_ekkofld.&lt;/P&gt;&lt;P&gt;or move wa_ekkofld to wa_ekko.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Asha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 May 2007 11:42:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/passing-fields-dynamically-to-structure/m-p/2196808#M468973</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-04T11:42:12Z</dc:date>
    </item>
    <item>
      <title>Re: Passing Fields dynamically to Structure</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/passing-fields-dynamically-to-structure/m-p/2196809#M468974</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;The one which you are saying to move the value, but my question is fields for the structure will be dynamic.&lt;/P&gt;&lt;P&gt;ie., wa_ekko-(xxxxxx) this xxxxxx fields will be in my looping table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let me know is this clear to you or not.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 May 2007 12:03:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/passing-fields-dynamically-to-structure/m-p/2196809#M468974</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-04T12:03:48Z</dc:date>
    </item>
    <item>
      <title>Re: Passing Fields dynamically to Structure</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/passing-fields-dynamically-to-structure/m-p/2196810#M468975</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Could you please elaborate about the structure of wa_ekko as to the fields.&lt;/P&gt;&lt;P&gt;Since it is a structure and must be having some fields.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 May 2007 12:07:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/passing-fields-dynamically-to-structure/m-p/2196810#M468975</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-04T12:07:34Z</dc:date>
    </item>
    <item>
      <title>Re: Passing Fields dynamically to Structure</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/passing-fields-dynamically-to-structure/m-p/2196811#M468976</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You should use field-symbols:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
field-symbols: &amp;lt;field&amp;gt; TYPE any.

ASSIGN component xxx OF STRUCTURE wa_ekkoofld TO &amp;lt;field&amp;gt;.
&amp;lt;field&amp;gt; = wa_ekko-value.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;xxx can be the fieldname or the number of the field in the structure.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 May 2007 12:12:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/passing-fields-dynamically-to-structure/m-p/2196811#M468976</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-04T12:12:29Z</dc:date>
    </item>
    <item>
      <title>Re: Passing Fields dynamically to Structure</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/passing-fields-dynamically-to-structure/m-p/2196812#M468977</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;  If the structures WA_EKKO and WA_EKKOFLD have same fields u can use &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Move-corresponding WA_EKKOFLD  to WA_EKKO.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Kasi S&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 May 2007 12:17:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/passing-fields-dynamically-to-structure/m-p/2196812#M468977</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-04T12:17:11Z</dc:date>
    </item>
    <item>
      <title>Re: Passing Fields dynamically to Structure</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/passing-fields-dynamically-to-structure/m-p/2196813#M468978</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am explaning you in detail.&lt;/P&gt;&lt;P&gt;    My Internal table for example : ZIT_FIELDS (Fieldname, Value)&lt;/P&gt;&lt;P&gt;    consider this values in ZIT_FIELDS : &lt;/P&gt;&lt;P&gt;       fieldname     value&lt;/P&gt;&lt;P&gt;       -&lt;/P&gt;&lt;HR originaltext="------------" /&gt;&lt;P&gt;     -&lt;/P&gt;&lt;HR originaltext="--------" /&gt;&lt;P&gt;       BUKRS        9999&lt;/P&gt;&lt;P&gt;       BSART         ZTY&lt;/P&gt;&lt;P&gt;       ERNAM        kumar&lt;/P&gt;&lt;P&gt;       ERDAT         20070404&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  Now i am in loop, say &lt;/P&gt;&lt;P&gt;  loop at zit_fields into work area(wa_fields)&lt;/P&gt;&lt;P&gt;  I have data in another structure say LS_EKKO will have my zit_fields as well, now i need to change the&lt;/P&gt;&lt;P&gt;  respective fields as well as value from zit_fields.&lt;/P&gt;&lt;P&gt;  i.e., LS_EKKO-BUKRS, LS_EKKO-BSART, LS_EKKO-ERNAM....&lt;/P&gt;&lt;P&gt;  since these field names are in my internal table, how can i pass those field  &lt;/P&gt;&lt;P&gt;  names to my structure LS_EKKO dyanamically?&lt;/P&gt;&lt;P&gt; endloop.&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt;  I hope this is clear to you?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 May 2007 12:22:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/passing-fields-dynamically-to-structure/m-p/2196813#M468978</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-04T12:22:25Z</dc:date>
    </item>
    <item>
      <title>Re: Passing Fields dynamically to Structure</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/passing-fields-dynamically-to-structure/m-p/2196814#M468979</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That's what I tried to explain earlier: Use Field-symbols!&lt;/P&gt;&lt;P&gt;Should work like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;field-symbols: &amp;lt;field&amp;gt; TYPE any.
DATA: wa_fields  LIKE ZIT_FIELDS. 
 
SELECT * FROM ZIT_FIELDS INTO wa_fields.

ASSIGN COMPONENT wa_fields-fieldname
OF STRUCTURE wa_ekko TO &amp;lt;field&amp;gt;.
IF sy-subrc = 0.
&amp;lt;field&amp;gt; = wa_fields-value.
ENDIF.

ENDSELECT.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;This will try to assign the value from ZIT into the fieldname from ZIT of structure ls_ekko if this structure contains such fieldname.&lt;/P&gt;&lt;P&gt;Of course, bad values for the destination datatype will cause an conversion dump!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 May 2007 15:05:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/passing-fields-dynamically-to-structure/m-p/2196814#M468979</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-04T15:05:15Z</dc:date>
    </item>
    <item>
      <title>Re: Passing Fields dynamically to Structure</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/passing-fields-dynamically-to-structure/m-p/2196815#M468980</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sivanarul,&lt;/P&gt;&lt;P&gt;                    Refer this code for crating dynamic internal table..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: wa_fldcat TYPE LVC_S_FCAT.&lt;/P&gt;&lt;P&gt;DATA: it_fldcat TYPE LVC_T_FCAT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: it TYPE REF TO DATA.&lt;/P&gt;&lt;P&gt;FIELD-SYMBOLS: &amp;lt;fs_table&amp;gt; TYPE TABLE.&lt;/P&gt;&lt;P&gt;FIELD-SYMBOLS: &amp;lt;fs_temp&amp;gt; TYPE ANY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;START-OF-SELECTION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*BUILDING FIELD CATALOG.&lt;/P&gt;&lt;P&gt;wa_fldcat-fieldname = 'matnr'.&lt;/P&gt;&lt;P&gt;wa_fldcat-tabname    = 'it'.&lt;/P&gt;&lt;P&gt;wa_fldcat-datatype    = 'matnr'.&lt;/P&gt;&lt;P&gt;append wa_fldcat to it_fldcat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*CREATE THE DYNAMIC INTERNAL TABLE&lt;/P&gt;&lt;P&gt;CALL METHOD cl_alv_table_create=&amp;gt;create_dynamic_table&lt;/P&gt;&lt;P&gt;  EXPORTING&lt;/P&gt;&lt;P&gt;    it_fieldcatalog           = it_fldcat&lt;/P&gt;&lt;P&gt;  IMPORTING&lt;/P&gt;&lt;P&gt;    EP_TABLE                  = it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Assign the pointer &amp;lt;fs_table&amp;gt; to the dynamically created internal table "it"&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  ASSIGN it-&amp;gt;* TO &amp;lt;fs_table&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;populate the internal table (through field symbols)&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  select matnr&lt;/P&gt;&lt;P&gt;         INTO TABLE &amp;lt;fs_table&amp;gt;&lt;/P&gt;&lt;P&gt;         from mara&lt;/P&gt;&lt;P&gt;         where mtart = 'ABF'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;write the data&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;loop at &amp;lt;fs_table&amp;gt; ASSIGNING &amp;lt;fs_temp&amp;gt;.&lt;/P&gt;&lt;P&gt;  write:/ &amp;lt;fs_temp&amp;gt;.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward points if helpful.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Hemant&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 04 May 2007 15:12:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/passing-fields-dynamically-to-structure/m-p/2196815#M468980</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-04T15:12:43Z</dc:date>
    </item>
  </channel>
</rss>

