<?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: dynamic field symbol declaration in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-field-symbol-declaration/m-p/11888445#M1961308</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Do it all dynamic as Naveen said (and you'll also need to use additionally other field symbols and statements like ASSIGN COMPONENT 'DIM_INPERIOD_ID' OF STRUCTURE &amp;lt;im_data&amp;gt; TO &amp;lt;dim_inperiod_id&amp;gt;), but if you have only one other HR form, then maybe it will be more readable to define a separate field symbol:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FIELD-SYMBOLS: &amp;lt;im_data_xxx&amp;gt;&amp;nbsp; TYPE /1pyxxfo/zhr_payslip_xxx.&lt;/P&gt;&lt;P&gt;FIELD-SYMBOLS: &amp;lt;im_data_yyy&amp;gt;&amp;nbsp; TYPE /1pyxxfo/zhr_payslip_yyy.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if XXX =‘1’.&lt;/P&gt;&lt;P&gt;ASSIGN ch_data-&amp;gt;* TO &amp;lt;im_data_xxx&amp;gt; CASTING..&lt;/P&gt;&lt;P&gt;" only work with &amp;lt;im_data_xxx&amp;gt;&lt;/P&gt;&lt;P&gt;Else.&lt;/P&gt;&lt;P&gt;ASSIGN ch_data-&amp;gt;* TO &amp;lt;im_data_yyy&amp;gt; CASTING..&lt;/P&gt;&lt;P&gt;" only work with &amp;lt;im_data_yyy&amp;gt;&lt;/P&gt;&lt;P&gt;Endif.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 14 Sep 2016 17:48:28 GMT</pubDate>
    <dc:creator>Sandra_Rossi</dc:creator>
    <dc:date>2016-09-14T17:48:28Z</dc:date>
    <item>
      <title>dynamic field symbol declaration</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-field-symbol-declaration/m-p/11888443#M1961306</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Currently there is a badi that contains instructions to manipulate data from an HRFORM named zhr_payslip_xxx.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code is as follows:&lt;/P&gt;&lt;P&gt;FIELD-SYMBOLS: &amp;lt;im_data&amp;gt;&amp;nbsp; TYPE /1pyxxfo/zhr_payslip_xxx.&lt;/P&gt;&lt;P&gt;&amp;nbsp; DATA: l_lines&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TYPE i,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ls_deductions_y4&amp;nbsp;&amp;nbsp;&amp;nbsp; LIKE LINE OF &amp;lt;im_data&amp;gt;-star_deductions_y4,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ls_payments_z9&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LIKE LINE OF &amp;lt;im_data&amp;gt;-star_payments_z9,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; wc_notices&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LIKE LINE OF &amp;lt;im_data&amp;gt;-star_notices,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; wc_inperiod&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LIKE LINE OF &amp;lt;im_data&amp;gt;-dim_forperiod,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; l_begdate&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TYPE d,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; l_enddate&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TYPE d.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;* Assign the infostar!&lt;/P&gt;&lt;P&gt;&amp;nbsp; ASSIGN ch_data-&amp;gt;* TO &amp;lt;im_data&amp;gt; CASTING.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*Reject if no data!&lt;/P&gt;&lt;P&gt;&amp;nbsp; DESCRIBE TABLE &amp;lt;im_data&amp;gt;-dim_inperiod_id LINES l_lines.&lt;/P&gt;&lt;P&gt;&amp;nbsp; IF l_lines = 0.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; RAISE reject.&lt;/P&gt;&lt;P&gt;&amp;nbsp; ELSE.&lt;/P&gt;&lt;P&gt;* Save current period info&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; READ TABLE &amp;lt;im_data&amp;gt;-dim_forperiod INDEX 1 INTO wc_inperiod.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; l_begdate = wc_inperiod-key-begin_date.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; l_enddate = wc_inperiod-key-end_date.&lt;/P&gt;&lt;P&gt;&amp;nbsp; ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to re use the same code but with a different HRFORM named zhr_payslip_yyy.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Are any of you aware on how can it be possible to declare/assign a different type to &amp;lt;im_data&amp;gt;?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Something like a &lt;/P&gt;&lt;P&gt;if XXX =‘1’.&lt;/P&gt;&lt;P&gt;FIELD-SYMBOLS: &amp;lt;im_data&amp;gt;&amp;nbsp; TYPE /1pyxxfo/zhr_payslip_xxx.&lt;/P&gt;&lt;P&gt;Else&lt;/P&gt;&lt;P&gt;FIELD-SYMBOLS: &amp;lt;im_data&amp;gt;&amp;nbsp; TYPE /1pyxxfo/zhr_payslip_yyy.&lt;/P&gt;&lt;P&gt;Endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could anybody please point me on the correct direction on how to achieve this ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Sep 2016 16:19:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-field-symbol-declaration/m-p/11888443#M1961306</guid>
      <dc:creator>marcelo_dudzin2</dc:creator>
      <dc:date>2016-09-14T16:19:33Z</dc:date>
    </item>
    <item>
      <title>Re: dynamic field symbol declaration</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-field-symbol-declaration/m-p/11888444#M1961307</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use type ANY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #333333; font-size: 12px;"&gt;FIELD-SYMBOLS: &amp;lt;im_data&amp;gt;&amp;nbsp; TYPE ANY.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Naveen &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Sep 2016 17:27:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-field-symbol-declaration/m-p/11888444#M1961307</guid>
      <dc:creator>naveen_inuganti2</dc:creator>
      <dc:date>2016-09-14T17:27:55Z</dc:date>
    </item>
    <item>
      <title>Re: dynamic field symbol declaration</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-field-symbol-declaration/m-p/11888445#M1961308</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Do it all dynamic as Naveen said (and you'll also need to use additionally other field symbols and statements like ASSIGN COMPONENT 'DIM_INPERIOD_ID' OF STRUCTURE &amp;lt;im_data&amp;gt; TO &amp;lt;dim_inperiod_id&amp;gt;), but if you have only one other HR form, then maybe it will be more readable to define a separate field symbol:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FIELD-SYMBOLS: &amp;lt;im_data_xxx&amp;gt;&amp;nbsp; TYPE /1pyxxfo/zhr_payslip_xxx.&lt;/P&gt;&lt;P&gt;FIELD-SYMBOLS: &amp;lt;im_data_yyy&amp;gt;&amp;nbsp; TYPE /1pyxxfo/zhr_payslip_yyy.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if XXX =‘1’.&lt;/P&gt;&lt;P&gt;ASSIGN ch_data-&amp;gt;* TO &amp;lt;im_data_xxx&amp;gt; CASTING..&lt;/P&gt;&lt;P&gt;" only work with &amp;lt;im_data_xxx&amp;gt;&lt;/P&gt;&lt;P&gt;Else.&lt;/P&gt;&lt;P&gt;ASSIGN ch_data-&amp;gt;* TO &amp;lt;im_data_yyy&amp;gt; CASTING..&lt;/P&gt;&lt;P&gt;" only work with &amp;lt;im_data_yyy&amp;gt;&lt;/P&gt;&lt;P&gt;Endif.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Sep 2016 17:48:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-field-symbol-declaration/m-p/11888445#M1961308</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2016-09-14T17:48:28Z</dc:date>
    </item>
    <item>
      <title>Re: dynamic field symbol declaration</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-field-symbol-declaration/m-p/11888446#M1961309</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you both.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have done already something similar to&amp;nbsp; Sandra's code, but I am not entirely happy about it.&lt;/P&gt;&lt;P&gt;I want to use the same Field-symbol name but different type.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I will see if&amp;nbsp; I can learn to do it with the assign component code...&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Sep 2016 09:28:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-field-symbol-declaration/m-p/11888446#M1961309</guid>
      <dc:creator>marcelo_dudzin2</dc:creator>
      <dc:date>2016-09-15T09:28:19Z</dc:date>
    </item>
  </channel>
</rss>

