<?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: Database Table in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/database-table/m-p/1007527#M78125</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Friends,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  Thanks for your replies.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  The problem is solved&lt;/P&gt;&lt;P&gt;  The solution is as follows.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    1. Declare an itab with all fields except mandt&lt;/P&gt;&lt;P&gt;    2. Populate this itab with flatfile contents&lt;/P&gt;&lt;P&gt;    3. Declare another itab with dbtable type&lt;/P&gt;&lt;P&gt;    4. Move the corresponding fields of first itab to second itab&lt;/P&gt;&lt;P&gt;    5. Insert the second itab contents to dbtable.&lt;/P&gt;&lt;P&gt;The program is now working!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Once again thanks for your replies friends.&lt;/P&gt;&lt;P&gt;Jayanthi, thanks a lot.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Usha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 04 Jul 2005 11:17:35 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2005-07-04T11:17:35Z</dc:date>
    <item>
      <title>Database Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/database-table/m-p/1007519#M78117</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Friends,&lt;/P&gt;&lt;P&gt;  Try to resolve the below query&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using a Custom Table with a following fields&lt;/P&gt;&lt;P&gt;mandt, empid, empname, salary etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am having a flatfile which contains values for&lt;/P&gt;&lt;P&gt;empid, empname, salary etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I declared an itab as follows&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  data : itab like dbtable occurs 0 with header line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then I used WS_UPLOAD (GUI_UPLOAD) to upload the&lt;/P&gt;&lt;P&gt;contents of flatfile to itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this scenario, the field empid is assigned to MANDT in internal table &amp;amp;&lt;/P&gt;&lt;P&gt;empname is assigned to empid in internal table &amp;amp; so on.&lt;/P&gt;&lt;P&gt;How to resolve the same.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FYI :&lt;/P&gt;&lt;P&gt;I have used the "A" as delivery Class &amp;amp; "APPl0" as DataClass.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also have a query.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  1. What should be my filetype (ASC, DAT, WK1) in the following cases&lt;/P&gt;&lt;P&gt;        a. Continuous flatfile without any delimiters&lt;/P&gt;&lt;P&gt;        b. Tab delimited text file&lt;/P&gt;&lt;P&gt;        c. File with a specific delimiter as comma&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Jul 2005 09:33:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/database-table/m-p/1007519#M78117</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-07-04T09:33:21Z</dc:date>
    </item>
    <item>
      <title>Re: Database Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/database-table/m-p/1007520#M78118</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;Try creating an internal table without the MANDT field,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Eg.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;begin of itab occurs 0,&lt;/P&gt;&lt;P&gt;      empid(5) type i,&lt;/P&gt;&lt;P&gt;      empname(20) type c,&lt;/P&gt;&lt;P&gt;      salary(5) type i,&lt;/P&gt;&lt;P&gt;      end of itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After populating the itab, try appending records to the table.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Jul 2005 09:40:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/database-table/m-p/1007520#M78118</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-07-04T09:40:01Z</dc:date>
    </item>
    <item>
      <title>Re: Database Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/database-table/m-p/1007521#M78119</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 may wish to define the ITAB fields individually rather than by using 'like dbtab'. This will help in case your dbtable has 'float' or 'packed decimal' fields like salary, and your file has the data in char form. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cheers,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Jul 2005 09:42:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/database-table/m-p/1007521#M78119</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-07-04T09:42:23Z</dc:date>
    </item>
    <item>
      <title>Re: Database Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/database-table/m-p/1007522#M78120</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Best way is to declare a type with only required fields like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;begin of XXXX,&lt;/P&gt;&lt;P&gt;  empid type ....&lt;/P&gt;&lt;P&gt;  .&lt;/P&gt;&lt;P&gt;  .&lt;/P&gt;&lt;P&gt;end of XXXXX.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: YYY type standard table of XXXXX.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;File type is ASC&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For download you should use a table with a single column like the one below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;       BEGIN OF download,&lt;/P&gt;&lt;P&gt;            row(1500)    TYPE  c,&lt;/P&gt;&lt;P&gt;       END OF final.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All download values are concatenated and appended to the above table. For continuous text you will just concatenate all values but for tab delimited declare a constant like this: &lt;/P&gt;&lt;P&gt;c_tab(1)         TYPE x           VALUE '09' and use this in SEPARATED BY clause.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Jul 2005 09:43:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/database-table/m-p/1007522#M78120</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-07-04T09:43:52Z</dc:date>
    </item>
    <item>
      <title>Re: Database Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/database-table/m-p/1007523#M78121</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;For Sridevi, you can't specify length for a type i.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As for the request,&lt;/P&gt;&lt;P&gt;you can use a *.CSV file with comma separator then in the ABAP you put the following code : &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
  DATA: line             TYPE string,
        filename         TYPE string,
        t_file TYPE TABLE OF string.
  filename = p_filename.

    CALL FUNCTION 'GUI_UPLOAD'
      EXPORTING
        filename                = filename
        filetype                = 'ASC'
      TABLES
        data_tab                = t_file
      EXCEPTIONS
        file_open_error         = 1
        file_read_error         = 2
        no_batch                = 3
        gui_refuse_filetransfer = 4
        invalid_type            = 5
        no_authority            = 6
        unknown_error           = 7
        bad_data_format         = 8
        header_not_allowed      = 9
        separator_not_allowed   = 10
        header_too_long         = 11
        unknown_dp_error        = 12
        access_denied           = 13
        dp_out_of_memory        = 14
        disk_full               = 15
        dp_timeout              = 16
        OTHERS                  = 17.
*--

  LOOP AT t_table.
    SPLIT t_file AT ';' INTO   t_table-empid
                               t_table-empname  
                               t_table-salary.

    APPEND t_table.
  ENDLOOP

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Erwan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Jul 2005 09:49:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/database-table/m-p/1007523#M78121</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-07-04T09:49:17Z</dc:date>
    </item>
    <item>
      <title>Re: Database Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/database-table/m-p/1007524#M78122</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;Your filetype should be 'ASC' if you are uploading text file.If you want Tab delimited ouput,then Has_field_separator parameter should be 'X'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you declare like that,&lt;/P&gt;&lt;P&gt;types : begin of db,&lt;/P&gt;&lt;P&gt;...delcare other fields except mandt&lt;/P&gt;&lt;P&gt;        end of db.&lt;/P&gt;&lt;P&gt;data itab type standard table of db.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then you will get correct output.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you function module documentation,then you can see the example coding.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Jul 2005 09:56:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/database-table/m-p/1007524#M78122</guid>
      <dc:creator>jayanthi_jayaraman</dc:creator>
      <dc:date>2005-07-04T09:56:18Z</dc:date>
    </item>
    <item>
      <title>Re: Database Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/database-table/m-p/1007525#M78123</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Friends,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   The task does not end with just uploading the contents of&lt;/P&gt;&lt;P&gt;flat file to itab, from itab the contents has to be again posted to the dbtable.&lt;/P&gt;&lt;P&gt;If we assign all fields except mandt, i am getting pblem while&lt;/P&gt;&lt;P&gt;inserting the contents to dbtable. Pls help to resolve the same.&lt;/P&gt;&lt;P&gt;Friends, my query is the mandt field should automatically populated isn't it?!!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;P&gt;Usha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Jul 2005 10:42:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/database-table/m-p/1007525#M78123</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-07-04T10:42:58Z</dc:date>
    </item>
    <item>
      <title>Re: Database Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/database-table/m-p/1007526#M78124</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;It is not like that mandt is automatically populated while uploading.&lt;/P&gt;&lt;P&gt;But if you defined user defined datatype as I mentioned in my previous reply,you will get the contents in an itab without that mandt field.&lt;/P&gt;&lt;P&gt;So declare&lt;/P&gt;&lt;P&gt;data itab type standard table of db.&lt;/P&gt;&lt;P&gt;loop at itab into wa.&lt;/P&gt;&lt;P&gt;move-corresponding wa to wa1.&lt;/P&gt;&lt;P&gt;append wa1 to itab1.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;But you can use the table itab1 to insert into database.Here it will be populated automatically.&lt;/P&gt;&lt;P&gt;Insert db from table itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Jul 2005 10:49:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/database-table/m-p/1007526#M78124</guid>
      <dc:creator>jayanthi_jayaraman</dc:creator>
      <dc:date>2005-07-04T10:49:01Z</dc:date>
    </item>
    <item>
      <title>Re: Database Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/database-table/m-p/1007527#M78125</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Friends,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  Thanks for your replies.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  The problem is solved&lt;/P&gt;&lt;P&gt;  The solution is as follows.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    1. Declare an itab with all fields except mandt&lt;/P&gt;&lt;P&gt;    2. Populate this itab with flatfile contents&lt;/P&gt;&lt;P&gt;    3. Declare another itab with dbtable type&lt;/P&gt;&lt;P&gt;    4. Move the corresponding fields of first itab to second itab&lt;/P&gt;&lt;P&gt;    5. Insert the second itab contents to dbtable.&lt;/P&gt;&lt;P&gt;The program is now working!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Once again thanks for your replies friends.&lt;/P&gt;&lt;P&gt;Jayanthi, thanks a lot.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Usha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Jul 2005 11:17:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/database-table/m-p/1007527#M78125</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-07-04T11:17:35Z</dc:date>
    </item>
  </channel>
</rss>

