<?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: Generic Insert in DBTAB in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/generic-insert-in-dbtab/m-p/1460047#M217226</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your help,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but my problem is not the display of data this is working correctly, my problem is how to fill the values of the Workarea &amp;lt;ROW&amp;gt; by specifying simply the position of the Field, because &amp;lt;row&amp;gt;-fieldname is not working because i do not know the name during designtime, only on runtime.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;best regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kai&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 25 Jul 2006 09:27:09 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-07-25T09:27:09Z</dc:date>
    <item>
      <title>Generic Insert in DBTAB</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/generic-insert-in-dbtab/m-p/1460042#M217221</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Gurus, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i have a difficult question, and i currently do not know how find a solution. I would like to add a entry in a database table, but i only know the name through runtime. So my insert should generic. I am able to create the Structure type of the table, but how do i assign the values to the components,&lt;/P&gt;&lt;P&gt;here is the source code i tried.&lt;/P&gt;&lt;P&gt;FIELD-SYMBOLS: &amp;lt;ITAB&amp;gt; TYPE TABLE.&lt;/P&gt;&lt;P&gt;FIELD-SYMBOLS: &amp;lt;FIELD&amp;gt; TYPE ANY.&lt;/P&gt;&lt;P&gt;FIELD-SYMBOLS: &amp;lt;ROW&amp;gt; TYPE ANY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: table_fields like dbfield occurs 0 with header line.&lt;/P&gt;&lt;P&gt;data: TABNAME LIKE DD02L-TABNAME Value 'ZKW1'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: itab type ref to data.&lt;/P&gt;&lt;P&gt;data: lrow type ref to data.&lt;/P&gt;&lt;P&gt;create data: itab type standard table of (tabname).&lt;/P&gt;&lt;P&gt;create data: lrow type (tabname).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;assign: itab-&amp;gt;* to &amp;lt;itab&amp;gt;.&lt;/P&gt;&lt;P&gt;assign: lrow to &amp;lt;row&amp;gt;.&lt;/P&gt;&lt;P&gt;call function 'DB_GET_TABLE_FIELDS'&lt;/P&gt;&lt;P&gt;exporting&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;FIELD_INFO = 'A'&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;tabname = tabname&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;IMPORTING&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;SUBRC =&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;tables&lt;/P&gt;&lt;P&gt;dbfields = table_fields&lt;/P&gt;&lt;P&gt;exceptions&lt;/P&gt;&lt;P&gt;others = 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sort table_fields by keyflag descending keypos column.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;do.&lt;/P&gt;&lt;P&gt;read table table_fields index sy-index.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;this will always fail, because the Structure is initial.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;ASSIGN COMPONENT SY-INDEX OF STRUCTURE &amp;lt;row&amp;gt; TO&lt;/P&gt;&lt;P&gt;&amp;lt;FIELD&amp;gt;.&lt;/P&gt;&lt;P&gt;if sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;  exit.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&amp;lt;FIELD&amp;gt; = 'TEST'.&lt;/P&gt;&lt;P&gt;enddo.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;insert (tabname) from &amp;lt;row&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this is just a test, later i have the values of the table fields in an internal table with position of the field in the structure (Position = 1, Value = '123423'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;best regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kai&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Jul 2006 09:03:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/generic-insert-in-dbtab/m-p/1460042#M217221</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-25T09:03:46Z</dc:date>
    </item>
    <item>
      <title>Re: Generic Insert in DBTAB</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/generic-insert-in-dbtab/m-p/1460043#M217222</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;Why dont u try native SQL&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Jul 2006 09:12:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/generic-insert-in-dbtab/m-p/1460043#M217222</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-25T09:12:22Z</dc:date>
    </item>
    <item>
      <title>Re: Generic Insert in DBTAB</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/generic-insert-in-dbtab/m-p/1460044#M217223</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi Kai,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; try this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;REPORT ABC.

TABLES : DD03L.

PARAMETERS : DTAB LIKE DD03L-TABNAME.



SELECT SINGLE TABNAME FROM (DTAB) INTO DD03L-TABNAME WHERE TABNAME =
'MARA'.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where dtab is the parameter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Jul 2006 09:17:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/generic-insert-in-dbtab/m-p/1460044#M217223</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-25T09:17:00Z</dc:date>
    </item>
    <item>
      <title>Re: Generic Insert in DBTAB</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/generic-insert-in-dbtab/m-p/1460045#M217224</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi kai,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Probably this code may help a little.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. To display data of internal table, using field-symbols&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. just copy paste&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Report abc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="---------------------------------------" /&gt;&lt;P&gt;data : itab like t001 occurs 0 with header line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="---------------------------------------" /&gt;&lt;P&gt;field-symbols : &amp;lt;ft&amp;gt; type table.&lt;/P&gt;&lt;P&gt;FIELD-SYMBOLS: &amp;lt;dynline&amp;gt; TYPE ANY.&lt;/P&gt;&lt;P&gt;FIELD-SYMBOLS: &amp;lt;fld&amp;gt; TYPE ANY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select * from t001 into table itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*----&lt;/P&gt;&lt;HR originaltext="---------------------------------------" /&gt;&lt;P&gt;assign itab[] to &amp;lt;FT&amp;gt;.&lt;/P&gt;&lt;P&gt;LOOP AT &amp;lt;ft&amp;gt; ASSIGNING &amp;lt;DYNLINE&amp;gt;.&lt;/P&gt;&lt;P&gt;  sy-subrc = 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  write &lt;span class="lia-unicode-emoji" title=":confused_face:"&gt;😕&lt;/span&gt; '----&lt;/P&gt;&lt;HR originaltext="---------------------------------" /&gt;&lt;P&gt;'.&lt;/P&gt;&lt;P&gt;  WHILE SY-SUBRC = 0.&lt;/P&gt;&lt;P&gt;    ASSIGN COMPONENT SY-INDEX OF STRUCTURE &amp;lt;DYNLINE&amp;gt; TO &amp;lt;FLD&amp;gt;.&lt;/P&gt;&lt;P&gt;    WRITE : &amp;lt;FLD&amp;gt;.&lt;/P&gt;&lt;P&gt;  ENDWHILE.&lt;/P&gt;&lt;P&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;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;amit m.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Jul 2006 09:20:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/generic-insert-in-dbtab/m-p/1460045#M217224</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-25T09:20:27Z</dc:date>
    </item>
    <item>
      <title>Re: Generic Insert in DBTAB</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/generic-insert-in-dbtab/m-p/1460046#M217225</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you mean by defining the Fields and Values separately?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you explain that in more detail?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Jul 2006 09:20:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/generic-insert-in-dbtab/m-p/1460046#M217225</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-25T09:20:50Z</dc:date>
    </item>
    <item>
      <title>Re: Generic Insert in DBTAB</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/generic-insert-in-dbtab/m-p/1460047#M217226</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your help,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but my problem is not the display of data this is working correctly, my problem is how to fill the values of the Workarea &amp;lt;ROW&amp;gt; by specifying simply the position of the Field, because &amp;lt;row&amp;gt;-fieldname is not working because i do not know the name during designtime, only on runtime.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;best regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kai&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Jul 2006 09:27:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/generic-insert-in-dbtab/m-p/1460047#M217226</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-25T09:27:09Z</dc:date>
    </item>
    <item>
      <title>Re: Generic Insert in DBTAB</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/generic-insert-in-dbtab/m-p/1460048#M217227</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi guys,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thaanks for your help,&lt;/P&gt;&lt;P&gt;but i fixed it on my own. For those who are interested here is a sample.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA LID LIKE DD02L-TABNAME  VALUE '/CAMELOT/DOCS'.&lt;/P&gt;&lt;P&gt;DATA L_T_PARAMS TYPE /CAMELOT/DCPF_T_PARAMS.&lt;/P&gt;&lt;P&gt;DATA: L_S_PARAMS TYPE /CAMELOT/DCPF_S_PARAM.&lt;/P&gt;&lt;P&gt;DATA: TABLE_FIELDS LIKE DBFIELD OCCURS 0 WITH HEADER LINE.&lt;/P&gt;&lt;P&gt;DATA L_DATA TYPE REF TO DATA.&lt;/P&gt;&lt;P&gt;DATA L_S_FIELDS TYPE DBFIELD.&lt;/P&gt;&lt;P&gt;DATA L_COLUMN TYPE I.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FIELD-SYMBOLS: &amp;lt;FIELD&amp;gt; TYPE ANY,&lt;/P&gt;&lt;P&gt;               &amp;lt;FIELD2&amp;gt; TYPE ANY..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;L_S_PARAMS-NAME = 1.&lt;/P&gt;&lt;P&gt;L_S_PARAMS-VALUE = 12345.&lt;/P&gt;&lt;P&gt;APPEND L_S_PARAMS TO L_T_PARAMS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;L_S_PARAMS-NAME = 2.&lt;/P&gt;&lt;P&gt;L_S_PARAMS-VALUE = 'Meins'.&lt;/P&gt;&lt;P&gt;APPEND L_S_PARAMS TO L_T_PARAMS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*Create empty Data&lt;/P&gt;&lt;P&gt;CREATE DATA L_DATA TYPE (LID).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Dereference Structure to fieldsymbol&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;ASSIGN L_DATA-&amp;gt;* TO &amp;lt;FIELD&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Get Field Definition&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;CALL FUNCTION 'DB_GET_TABLE_FIELDS'&lt;/P&gt;&lt;P&gt;  EXPORTING&lt;/P&gt;&lt;P&gt;    TABNAME  = LID&lt;/P&gt;&lt;P&gt;  TABLES&lt;/P&gt;&lt;P&gt;    DBFIELDS = TABLE_FIELDS&lt;/P&gt;&lt;P&gt;  EXCEPTIONS&lt;/P&gt;&lt;P&gt;    OTHERS   = 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SORT TABLE_FIELDS BY KEYFLAG DESCENDING KEYPOS COLUMN.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&lt;/P&gt;&lt;P&gt;LOOP AT TABLE_FIELDS INTO L_S_FIELDS.&lt;/P&gt;&lt;P&gt;  L_COLUMN = L_S_FIELDS-COLUMN.&lt;/P&gt;&lt;P&gt;  CLEAR L_S_PARAMS.&lt;/P&gt;&lt;P&gt;  ASSIGN COMPONENT L_COLUMN OF STRUCTURE &amp;lt;FIELD&amp;gt; TO &amp;lt;FIELD2&amp;gt;.&lt;/P&gt;&lt;P&gt;  READ TABLE L_T_PARAMS INTO L_S_PARAMS WITH KEY NAME = L_COLUMN.&lt;/P&gt;&lt;P&gt;  IF SY-SUBRC = 0.&lt;/P&gt;&lt;P&gt;    MOVE L_S_PARAMS-VALUE TO &amp;lt;FIELD2&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;INSERT (LID) FROM &amp;lt;FIELD&amp;gt;.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Jul 2006 22:56:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/generic-insert-in-dbtab/m-p/1460048#M217227</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-25T22:56:59Z</dc:date>
    </item>
    <item>
      <title>Re: Generic Insert in DBTAB</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/generic-insert-in-dbtab/m-p/13998000#M2038366</link>
      <description>&lt;P&gt;This is if you already know what the table is going to be. If you do not know the table&amp;nbsp;&lt;SPAN&gt;/CAMELOT/DCPF_T_PARAMS, then you would use a generic type and then it would not let you use append.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jan 2025 13:14:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/generic-insert-in-dbtab/m-p/13998000#M2038366</guid>
      <dc:creator>kanchramas33</dc:creator>
      <dc:date>2025-01-27T13:14:29Z</dc:date>
    </item>
  </channel>
</rss>

