<?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: Import parametes and insert into database table suggestions in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/import-parametes-and-insert-into-database-table-suggestions/m-p/5778898#M1307990</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Marcin Pciak &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thank you a lot. your explanation is so clear and good to understand&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 01 Jul 2009 08:32:57 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-07-01T08:32:57Z</dc:date>
    <item>
      <title>Import parametes and insert into database table suggestions</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/import-parametes-and-insert-into-database-table-suggestions/m-p/5778895#M1307987</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;experts need suggestions&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;created a table with 3 fields.&lt;/P&gt;&lt;P&gt;zstable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;field dataelement type length&lt;/P&gt;&lt;P&gt;kunnr  kunnr      char  10       key field &lt;/P&gt;&lt;P&gt;name   dname      char   30      key field&lt;/P&gt;&lt;P&gt;aedat aedat        dats  8 &lt;/P&gt;&lt;P&gt;aenam  aenam       char  12&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now i am creating a function modlue with two input parameters&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1)kunnr&lt;/P&gt;&lt;P&gt;2)name&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i want to update this two fields into table zstable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. so suggest me the best way to do this.&lt;/P&gt;&lt;P&gt;Delcarations in import options which one of the below is best and why?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;name type char30&lt;/P&gt;&lt;P&gt;kunnr type kunnr&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or&lt;/P&gt;&lt;P&gt;name like zstable-name&lt;/P&gt;&lt;P&gt;kunnr like zstable-kunnr&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or&lt;/P&gt;&lt;P&gt; kunnr type zstable-kunnr&lt;/P&gt;&lt;P&gt;name type zstable-name.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. inserting into table &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the data that we recieve from the import parameters need to be inserted into the zstable.&lt;/P&gt;&lt;P&gt;please suggest me the appropriate statement  waht i need to code for this.&lt;/P&gt;&lt;P&gt; insert kunnr name into zstable.&lt;/P&gt;&lt;P&gt;can i ignore the third field as it is not the key field?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. before inserting do i need to check whether kunnr and uname is initial ie import parametrs?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4. suppose if i delcared two input parameters  in function module zfuntion say vbeln and posnr.&lt;/P&gt;&lt;P&gt;  and source code &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;insert vbeln and posnr into zstable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now i am calling from the program&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;zreport.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;call function 'ZFUNCTION'.&lt;/P&gt;&lt;P&gt;EXPORT &lt;/P&gt;&lt;P&gt;NAME =&lt;/P&gt;&lt;P&gt;KUNNR =&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Will the above statement updates the blank records into the table zstable?.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Jul 2009 06:50:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/import-parametes-and-insert-into-database-table-suggestions/m-p/5778895#M1307987</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-07-01T06:50:46Z</dc:date>
    </item>
    <item>
      <title>Re: Import parametes and insert into database table suggestions</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/import-parametes-and-insert-into-database-table-suggestions/m-p/5778896#M1307988</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 have to create one more structure similar to your z-table and that you have to use in your FM as table type.&lt;/P&gt;&lt;P&gt;Through that table type you can pass data into your z-table as per the queries used by you in Fm.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regds,&lt;/P&gt;&lt;P&gt;Anil&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Jul 2009 07:20:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/import-parametes-and-insert-into-database-table-suggestions/m-p/5778896#M1307988</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-07-01T07:20:39Z</dc:date>
    </item>
    <item>
      <title>Re: Import parametes and insert into database table suggestions</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/import-parametes-and-insert-into-database-table-suggestions/m-p/5778897#M1307989</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;1) I think the best is either refer directly to &lt;EM&gt;data element&lt;/EM&gt; or to table field. This is beacuse once any change is made to this data element it will automatically reflect in your parameters. For table fields it is a bit less safier but still correct. Golden rule - always try to refer to DDIC components like data elements.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;name type dname&lt;/P&gt;&lt;P&gt;kunnr type kunnr&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) You need to provide all key fields. I recommend to use MODIFY as it would hanlde both INSERT (if yet no such record exists ) and UPDATE (if already exists). &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
data: wa_zstable type zstable. "declare work area

wa_zstable-kunnr = kunnr.  "pass parameters here
wa_zstable-name = name. 
modify zstable from wa_zstable.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3) good practise, for this use&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
if kunnr is initial and   
   name is initial.
  "modify ...
endif.

"or if parameters are set as OPTIONAL, then use
if kunnr is supplied and 
   name is supplied.
   ...
endif.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4) No, the statment you want to use&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
insert vbeln and posnr into zstable.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;is only used for FIELD GROUPS, not DB table. Please refer [INSERT|http://help.sap.com/abapdocu/en/ABAPINSERT_DBTAB_SHORTREF.htm] for correct syntax.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can alternatively use somthing like&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
UPDATE zstable SET vbeln = ...
                                        posnr = ...
                                 WHERE ...
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;This will update fields VBELN and PONR for all records fullfilling WHERE condition. These however musn't be key fields, only non-key fields can be udpated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Marcin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Jul 2009 07:39:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/import-parametes-and-insert-into-database-table-suggestions/m-p/5778897#M1307989</guid>
      <dc:creator>MarcinPciak</dc:creator>
      <dc:date>2009-07-01T07:39:24Z</dc:date>
    </item>
    <item>
      <title>Re: Import parametes and insert into database table suggestions</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/import-parametes-and-insert-into-database-table-suggestions/m-p/5778898#M1307990</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Marcin Pciak &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thank you a lot. your explanation is so clear and good to understand&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Jul 2009 08:32:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/import-parametes-and-insert-into-database-table-suggestions/m-p/5778898#M1307990</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-07-01T08:32:57Z</dc:date>
    </item>
  </channel>
</rss>

