<?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 Function in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-function/m-p/991520#M74318</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;What is your SAP release ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Svetlin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 16 Sep 2005 14:54:03 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2005-09-16T14:54:03Z</dc:date>
    <item>
      <title>Dynamic Function</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-function/m-p/991516#M74314</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hii,&lt;/P&gt;&lt;P&gt;i have fm in which i have the code like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;my ztab contains 4 columns field1 field2 field3 field4.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;call function 'ZUPDATE'.
  importing
    tabname = 'ZTAB'
    value   = '2,3,4,5' .&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now in &amp;lt;b&amp;gt;zupdate&amp;lt;/b&amp;gt; function i have written code like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data wa like ztab.

split value at ','  
into wa-field1 wa-field2 wa-field3 wa-field4 .

modify (tabname) from wa .&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but  want to make this zupdate function as dynaminc so that it can be run for any z-table&lt;/P&gt;&lt;P&gt;i have tried using field symbols but not able to succeed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the parameter i shud pass to zupdat fm will be any table name and its corressponding values saparated by ','.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;abhishek suppal&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Sep 2005 11:36:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-function/m-p/991516#M74314</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-09-16T11:36:35Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Function</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-function/m-p/991517#M74315</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;you can try so:&lt;/P&gt;&lt;P&gt;DATA: WA        TYPE REF TO DATA.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: T_VALUES(100) OCCURS 0 WITH HEADER LINE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FIELD-SYMBOLS: &amp;lt;WA&amp;gt;        TYPE ANY,&lt;/P&gt;&lt;P&gt;               &amp;lt;VALUE&amp;gt;     TYPE ANY.&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;Work area:&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CREATE DATA WA TYPE (TABNAME).&lt;/P&gt;&lt;P&gt;ASSIGN WA-&amp;gt;* TO &amp;lt;WA&amp;gt;.   &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REFRESH T_VALUE.&lt;/P&gt;&lt;P&gt;SPLIT VALUE AT ',' INTO TABLE T_VALUE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT T_VALUE.&lt;/P&gt;&lt;P&gt;  ASSIGN COMPONENT SY-TABIX OF STRUCTURE &amp;lt;WA&amp;gt; TO &amp;lt;VALUE&amp;gt;.&lt;/P&gt;&lt;P&gt;  MOVE T_VALUE TO &amp;lt;VALUE&amp;gt;.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CHECK SY-SUBRC = 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MODIFY (TABNAME) FROM &amp;lt;WA&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Max&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Sep 2005 11:54:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-function/m-p/991517#M74315</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-09-16T11:54:41Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Function</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-function/m-p/991518#M74316</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is it working ??&lt;/P&gt;&lt;P&gt;It is surprising that your function 'ZUPDATE' has the visiblity on the table declared in your first function ??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would have expected some kind of Field-Symbol in order to address that particular table. Something like :&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA : w_extern_tab(30) TYPE c VALUE '(ZFIRST_FUNCTION)ZTAB'
ASSIGN (w_extern_tab) TO &amp;lt;F&amp;gt;.
MODIIFY &amp;lt;F&amp;gt; FROM wa.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;well, sort of.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Apart from this, I think you should use ASSIGN COMPONENT OF STRUCTURE ... to do this&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Sep 2005 11:57:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-function/m-p/991518#M74316</guid>
      <dc:creator>guillaume-hrc</dc:creator>
      <dc:date>2005-09-16T11:57:19Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Function</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-function/m-p/991519#M74317</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am not sure that it is a good idea to pass the values in a string. I would expect problems with packed formats or conversion exists. &lt;/P&gt;&lt;P&gt;Christian&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Sep 2005 14:00:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-function/m-p/991519#M74317</guid>
      <dc:creator>ChristianFi</dc:creator>
      <dc:date>2005-09-16T14:00:32Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Function</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-function/m-p/991520#M74318</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;What is your SAP release ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Svetlin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Sep 2005 14:54:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-function/m-p/991520#M74318</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-09-16T14:54:03Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Function</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-function/m-p/991521#M74319</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi, though max's code can compile successfully. &lt;/P&gt;&lt;P&gt;I think there are some problems in it.&lt;/P&gt;&lt;P&gt;First,  'ZUPDATE' maybe a customize table or a internal table. &lt;/P&gt;&lt;P&gt;For CREATE DATA WA TYPE (TABNAME).&lt;/P&gt;&lt;P&gt;if TABNAME is a DDIC type, it is ok, if a internal table name, it will be fail. because CREATE DATA need a 'Absolute Type Names', not a internal name. So if ZUPDATE is a internal table, you can do like following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
data: cl_typ  type ref to CL_ABAP_TYPEDESCR.
cl_typ = CL_ABAP_TYPEDESCR=&amp;gt;DESCRIBE_BY_DATA( ZTAB ).
CALL FUNCTION 'ZUPDATE'
  EXPORTING
    TABNAME       = cl_typ-&amp;gt;ABSOLUTE_NAME
     .........
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Second, the problem is still have. even CREATE DATA can create a correct type table, but it is initial. And can its update be transfered out of the function? ZTAB is a table out of the FM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In my opinion, if you want to achieve it in a clear and easy way, just reference how ALV function do.&lt;/P&gt;&lt;P&gt;transfer ANY table into FM, and using Field Symbol.&lt;/P&gt;&lt;P&gt;Just a table name is not enough.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope it will be helpful&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Sep 2005 15:44:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/dynamic-function/m-p/991521#M74319</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-09-16T15:44:26Z</dc:date>
    </item>
  </channel>
</rss>

