<?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: Convert data field to string in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/convert-data-field-to-string/m-p/12583473#M2009447</link>
    <description>&lt;P&gt;It's probably possible, but I don't get what is your exact question, so difficult to answer.&lt;/P&gt;</description>
    <pubDate>Fri, 06 May 2022 09:21:19 GMT</pubDate>
    <dc:creator>Sandra_Rossi</dc:creator>
    <dc:date>2022-05-06T09:21:19Z</dc:date>
    <item>
      <title>Convert data field to string</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/convert-data-field-to-string/m-p/12583471#M2009445</link>
      <description>&lt;P&gt;Hello guys,&lt;/P&gt;
  &lt;P&gt;is it possible to convert any type of data field to a string? My problem is the following: I use dynamic sub routine where I for example do some data select but also need the name of the database table as a string. So in first case I would use ZTABLE as data field which I can use as SELECT table and in the second case I need 'ZTABLE' as string field (only the name, not the content) which I need to move to some other variable. Is there any function or hint how I can achieve this? Thought about field symbols but I'm not sure if its possible.&lt;/P&gt;
  &lt;P&gt;Regards Michael&lt;/P&gt;</description>
      <pubDate>Fri, 06 May 2022 08:44:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/convert-data-field-to-string/m-p/12583471#M2009445</guid>
      <dc:creator>Missschaaa</dc:creator>
      <dc:date>2022-05-06T08:44:08Z</dc:date>
    </item>
    <item>
      <title>Re: Convert data field to string</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/convert-data-field-to-string/m-p/12583472#M2009446</link>
      <description>&lt;P&gt;You mean : &lt;/P&gt;&lt;P&gt;data(table_name) = conv tablename( 'T001W' ). &lt;/P&gt;&lt;P&gt;select * from (table_name) ....&lt;/P&gt;&lt;P&gt;assign (table_name) to field-symbol(&amp;lt;my_table&amp;gt;).&lt;/P&gt;&lt;P&gt;and why you need to do this ? &lt;/P&gt;</description>
      <pubDate>Fri, 06 May 2022 09:08:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/convert-data-field-to-string/m-p/12583472#M2009446</guid>
      <dc:creator>FredericGirod</dc:creator>
      <dc:date>2022-05-06T09:08:10Z</dc:date>
    </item>
    <item>
      <title>Re: Convert data field to string</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/convert-data-field-to-string/m-p/12583473#M2009447</link>
      <description>&lt;P&gt;It's probably possible, but I don't get what is your exact question, so difficult to answer.&lt;/P&gt;</description>
      <pubDate>Fri, 06 May 2022 09:21:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/convert-data-field-to-string/m-p/12583473#M2009447</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2022-05-06T09:21:19Z</dc:date>
    </item>
    <item>
      <title>Re: Convert data field to string</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/convert-data-field-to-string/m-p/12583474#M2009448</link>
      <description>&lt;P&gt;maybe is to catch the result of the SELECT, but it is more simple to create dynamic internal table&lt;/P&gt;</description>
      <pubDate>Fri, 06 May 2022 09:25:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/convert-data-field-to-string/m-p/12583474#M2009448</guid>
      <dc:creator>FredericGirod</dc:creator>
      <dc:date>2022-05-06T09:25:46Z</dc:date>
    </item>
    <item>
      <title>Re: Convert data field to string</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/convert-data-field-to-string/m-p/12583475#M2009449</link>
      <description>&lt;P&gt;No vice versa. I use the variable itself in this case T001W as data object and need in some variable myvariable which should have 'T001W' as value. I do not want to just say myvariable = 'T001W' because it should be dynamic for more than one variable. I coded a macro which should dynamic read data from different custom tables and I just want to get coding as low as possible. In the macro I need both, the table as table name and the table as string in some data field.&lt;/P&gt;</description>
      <pubDate>Fri, 06 May 2022 09:36:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/convert-data-field-to-string/m-p/12583475#M2009449</guid>
      <dc:creator>Missschaaa</dc:creator>
      <dc:date>2022-05-06T09:36:34Z</dc:date>
    </item>
    <item>
      <title>Re: Convert data field to string</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/convert-data-field-to-string/m-p/12583476#M2009450</link>
      <description>&lt;P&gt;Why don't you show your code?&lt;/P&gt;&lt;P&gt;If it's a macro, there's no issue to pass only T001W, which your macro can use as both &amp;amp;1 and '&amp;amp;1'.&lt;/P&gt;&lt;P&gt;But you may also use the macro with 'T001W' and do SELECT ... FROM (&amp;amp;1).&lt;/P&gt;&lt;P&gt;I wouldn't use a macro anyway, only experts can debug, nowadays you can avoid the macros completely.&lt;/P&gt;</description>
      <pubDate>Fri, 06 May 2022 09:45:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/convert-data-field-to-string/m-p/12583476#M2009450</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2022-05-06T09:45:02Z</dc:date>
    </item>
    <item>
      <title>Re: Convert data field to string</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/convert-data-field-to-string/m-p/12583477#M2009451</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;  DEFINE mac_get_conttxt.&lt;BR /&gt;    CLEAR: ls_condtab,&lt;BR /&gt;           lt_condtab.&lt;BR /&gt;&lt;BR /&gt;    ls_condtab-field = 'SPRAS'.&lt;BR /&gt;    ls_condtab-opera = 'EQ'.&lt;BR /&gt;    ls_condtab-low   = sy-langu.&lt;BR /&gt;    APPEND ls_condtab TO lt_condtab.&lt;BR /&gt;    ls_condtab-field = &amp;amp;4.&lt;BR /&gt;    ls_condtab-opera = 'EQ'.&lt;BR /&gt;    ls_condtab-low   = is_not_detail-&amp;amp;5.&lt;BR /&gt;    APPEND ls_condtab TO lt_condtab.&lt;BR /&gt;    CALL FUNCTION 'RH_DYNAMIC_WHERE_BUILD'&lt;BR /&gt;      EXPORTING&lt;BR /&gt;        dbtable         = space&lt;BR /&gt;      TABLES&lt;BR /&gt;        condtab         = lt_condtab&lt;BR /&gt;        where_clause    = lt_where_clause&lt;BR /&gt;      EXCEPTIONS&lt;BR /&gt;        empty_condtab   = 01&lt;BR /&gt;        no_db_field     = 02&lt;BR /&gt;        unknown_db      = 03&lt;BR /&gt;        wrong_condition = 04.&lt;BR /&gt;&lt;BR /&gt;    CLEAR ls_desc.&lt;BR /&gt;    SELECT SINGLE rollname FROM dd03l INTO ls_desc-rollname&lt;BR /&gt;      WHERE tabname   EQ &amp;amp;3&lt;BR /&gt;        AND fieldname EQ &amp;amp;4.&lt;BR /&gt;&lt;BR /&gt;    SELECT SINGLE &amp;amp;1 &amp;amp;2 FROM (&amp;amp;3) INTO (ls_desc-id, ls_desc-text)&lt;BR /&gt;      WHERE (lt_where_clause).&lt;BR /&gt;&lt;BR /&gt;    IF   ls_desc-id   IS NOT INITIAL&lt;BR /&gt;     AND ls_desc-text IS NOT INITIAL.&lt;BR /&gt;      APPEND ls_desc TO lt_desc.&lt;BR /&gt;    ENDIF.&lt;BR /&gt;  END-OF-DEFINITION.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;macro looks like this. &amp;amp;1 and &amp;amp;2 is for example fieldname as fieldname itself, &amp;amp;4 is fieldname as string. I do not want to put it both in the macro (fieldname and 'FIELDNAME'), just one time and convert it for the the other statement.&lt;/P&gt;</description>
      <pubDate>Fri, 06 May 2022 09:46:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/convert-data-field-to-string/m-p/12583477#M2009451</guid>
      <dc:creator>Missschaaa</dc:creator>
      <dc:date>2022-05-06T09:46:41Z</dc:date>
    </item>
    <item>
      <title>Re: Convert data field to string</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/convert-data-field-to-string/m-p/12583478#M2009452</link>
      <description>&lt;P&gt;I read several time your question, and I still doesn't understand, you already did it:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt; SELECT SINGLE &amp;amp;1 &amp;amp;2 FROM (&amp;amp;3) INTO (ls_desc-id, ls_desc-text)&amp;lt;br&amp;gt;      WHERE (lt_where_clause).&lt;/CODE&gt;&lt;/PRE&gt;
&lt;PRE&gt;&lt;CODE&gt;    SELECT SINGLE rollname FROM dd03l INTO ls_desc-rollname&amp;lt;br&amp;gt;      WHERE tabname   EQ &amp;amp;3&amp;lt;br&amp;gt;        AND fieldname EQ &amp;amp;4.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;and, you should really forget MACRO, this is old old school&lt;/P&gt;</description>
      <pubDate>Fri, 06 May 2022 11:39:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/convert-data-field-to-string/m-p/12583478#M2009452</guid>
      <dc:creator>FredericGirod</dc:creator>
      <dc:date>2022-05-06T11:39:58Z</dc:date>
    </item>
    <item>
      <title>Re: Convert data field to string</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/convert-data-field-to-string/m-p/12583479#M2009453</link>
      <description>&lt;P&gt;Yes, your hint for database table was good, I already fixed it, but I still have the problem for fieldnames of database tables (&amp;amp;4 vs &amp;amp;2).&lt;/P&gt;&lt;P&gt;I know macro is not very popular here, but I like it. Yes, debugging is crap, but its an easy way to put some repeating routines more cleaned up in coding. Of course I could also use some form routines or methods, but in my mind its not that flexible as macro, I canot put simple fieldnames withoud structure name in it like in macro for example.&lt;/P&gt;</description>
      <pubDate>Fri, 06 May 2022 12:00:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/convert-data-field-to-string/m-p/12583479#M2009453</guid>
      <dc:creator>Missschaaa</dc:creator>
      <dc:date>2022-05-06T12:00:11Z</dc:date>
    </item>
    <item>
      <title>Re: Convert data field to string</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/convert-data-field-to-string/m-p/12583480#M2009454</link>
      <description>&lt;P&gt;maybe have a look to the demo program available through ABAPDOCU trans : demo_dynamic_sql&lt;/P&gt;&lt;P&gt;(and also through SE38)&lt;/P&gt;&lt;P&gt;You could do whatever you made in macro, in method. the demo program show using method&lt;/P&gt;</description>
      <pubDate>Fri, 06 May 2022 12:09:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/convert-data-field-to-string/m-p/12583480#M2009454</guid>
      <dc:creator>FredericGirod</dc:creator>
      <dc:date>2022-05-06T12:09:42Z</dc:date>
    </item>
    <item>
      <title>Re: Convert data field to string</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/convert-data-field-to-string/m-p/12583481#M2009455</link>
      <description>&lt;P&gt;We could add a second reason why macros should be avoided because it may be very difficult to troubleshoot syntax errors... &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Conclusion: don't use macros because it's very difficult to debug and to troubleshoot syntax errors.&lt;/P&gt;</description>
      <pubDate>Fri, 06 May 2022 14:44:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/convert-data-field-to-string/m-p/12583481#M2009455</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2022-05-06T14:44:09Z</dc:date>
    </item>
  </channel>
</rss>

