How to upload a Flat file into sap database if the file is in Appl'n Server

Hello Sap Experts , Can you tel me
" How to upload a Flat file into sap database if the file is in Application Server.
what is Path for that ?
Plz Tel Me its Urgent
Thanks for all

Hi,
ABAP code for uploading a TAB delimited file into an internal table. See code below for structures.
*& Report  ZUPLOADTAB                                                  *
*& Example of Uploading tab delimited file                             *
REPORT  zuploadtab                    .
PARAMETERS: p_infile  LIKE rlgrap-filename
                        OBLIGATORY DEFAULT  '/usr/sap/'..
DATA: ld_file LIKE rlgrap-filename.
*Internal tabe to store upload data
TYPES: BEGIN OF t_record,
    name1 like pa0002-VORNA,
    name2 like pa0002-name2,
    age   type i,
    END OF t_record.
DATA: it_record TYPE STANDARD TABLE OF t_record INITIAL SIZE 0,
      wa_record TYPE t_record.
*Text version of data table
TYPES: begin of t_uploadtxt,
  name1(10) type c,
  name2(15) type c,
  age(5)  type c,
end of t_uploadtxt.
DATA: wa_uploadtxt TYPE t_uploadtxt.
*String value to data in initially.
DATA: wa_string(255) type c.
constants: con_tab TYPE x VALUE '09'.
*If you have Unicode check active in program attributes then you will
*need to declare constants as follows:
*class cl_abap_char_utilities definition load.
*constants:
*    con_tab  type c value cl_abap_char_utilities=>HORIZONTAL_TAB.
*START-OF-SELECTION
START-OF-SELECTION.
ld_file = p_infile.
OPEN DATASET ld_file FOR INPUT IN TEXT MODE ENCODING DEFAULT.
IF sy-subrc NE 0.
ELSE.
  DO.
    CLEAR: wa_string, wa_uploadtxt.
    READ DATASET ld_file INTO wa_string.
    IF sy-subrc NE 0.
      EXIT.
    ELSE.
      SPLIT wa_string AT con_tab INTO wa_uploadtxt-name1
                                      wa_uploadtxt-name2
                                      wa_uploadtxt-age.
      MOVE-CORRESPONDING wa_uploadtxt TO wa_upload.
      APPEND wa_upload TO it_record.
    ENDIF.
  ENDDO.
  CLOSE DATASET ld_file.
ENDIF.
*END-OF-SELECTION
END-OF-SELECTION.
*!! Text data is now contained within the internal table IT_RECORD
* Display report data for illustration purposes
  loop at it_record into wa_record.
    write:/     sy-vline,
           (10) wa_record-name1, sy-vline,
           (10) wa_record-name2, sy-vline,
           (10) wa_record-age, sy-vline.
  endloop.

Similar Messages

  • Uploading Excel file into SAP Database table?

    I built a table in the SAP Data Dictionary, and i need to write a program that uploads the Excel table, into the SAP Database table.  Does anybody have a sample program that may help me?  Thanks!

    TYPES:
         BEGIN OF ty_upload,
         matnr like mara-matnr,
         meins like mara-meins,
         mtart like mara-mtart,
         mbrsh like mara-mbrsh,
         END OF ty_upload.
      DATA it_upload TYPE STANDARD TABLE OF ty_upload WITH header line.
      DATA wa_upload TYPE ty_upload.
      DATA: itab TYPE STANDARD TABLE OF alsmex_tabline WITH header line.
      CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
        EXPORTING
          filename    = 'C:\Documents and Settings\venkatapp\Desktop\venkat.xls'
          i_begin_col = 1
          i_begin_row = 1
          i_end_col   = 4
          i_end_row   = 65535
          TABLES
          intern      = itab.
    if not itab[] is initial.
    loop at itab .
    case itab-col.
    when '0001'.
    it_upload-matnr = itab-value.
    when '0002'.
    it_upload-meins = itab-value.
    when '0003'.
    it_upload-mtart = itab-value.
    when '0004'.
    it_upload-mbrsh = itab-value.
    append it_upload.
    clear it_upload.
    clear itab.
    endcase.
    endloop.
    endif.
    loop at it_upload into wa_upload.
    ztable-matnr = wa_upload-matnr.
    ztable-meins = wa_upload-meins.
    ztable-mtart = wa_upload-mtart.
    ztable-mbrsh = wa_upload-mbrsh.
    insert ztable.
    endloop.

  • Ipod touch 4's files are deleted whenever i add a new file into it through itunes (the files i have on my ipod touch aren't in my itunes before hand) and i don't know what to do to keep these files from being erased. PLEASE HELP :(

    my ipod touch 4th generation has files that i didnt back up because i didnt know i was supposed to. the when i tried to add one new file to my EMPTY itunes, all files are deleted, yes because i know i didnt back the files up and the files on my ipod arent in my itunes. so i cancelled adding the new file and all files
    are back again, like i didnt press the sync button when it showed the deletion. what am i supposed to do about this? i dont want my ipod files to be deleted, i just wanna add new files freely without losing any of my old files. please help.

    You want to transfer purchases from the iPod to your iTunes account.
    Connect the device to iTunes but do not sync.
    Select File > Transfer Purchases.
    This will copy the content purchased via iTunes on the iPod to your iTunes account.

  • Using bapi how to upload the data into sap database?

    hi dear all,
                  im facing problem with bapi ? let me edcuate on bapi ..
    i will be  waiting for reply.
    my e-id :[email protected]
    thanks&regards
    shiva.

    Hi
    A BAPI is a method of a SAP Business Object. BAPI enables SAP and third party applications to interact and integrate
    with each other at the Business Object / Process level.
    Check this link to know more about BAPI.
    http://www.sapgenie.com/abap/bapi/example.htm
    http://sappoint.com/abap/
    Batch Data Communication (BDC) is the oldest batch interfacing technique that SAP provided since the early versions of R/3. BDC is not a
    typical integration tool, in the sense that, it can be only be used for uploading data into R/3 and so it is not bi-directional.
    BDC works on the principle of simulating user input for transactional screen, via an ABAP program. Typically the input comes in the form
    of a flat file. The ABAP program reads this file and formats the input data screen by screen into an internal table (BDCDATA). The
    transaction is then started using this internal table as the input and executed in the background.
    In ‘Call Transaction’, the transactions are triggered at the time of processing itself and so the ABAP program must do the error handling.
    It can also be used for real-time interfaces and custom error handling & logging features. .
    To know more about BDC,
    check the link.
    http://sappoint.com/abap/
    Main differences are...
    In case of bdc data transfer takes place from flat file into sap system ie the file existing in sap system to sap sytem
    where is bapi's r remotly enabled function modules which are assigned to some business objects n used to transfer the data between different business partners who are using different systems other than sap.
    not only that...
    when you plan to upgrade your system version then bdc willnot support those upgradations where as bapi's will support.
    http://www.sap-img.com/abap/ale-bapi.htm
    SAP BAPI
    BAPI STEPS
    Hope this helps.
    ashish

  • Uploading the file into sap ( fields are seprerated by ' | '.

    Hi All,
    Plz let me know how to upload the file into sap in which the fields are separated by the symbol ' | '
    sample file format
    Material|Oracle_Item_type
    (89034)|PFG
    001069-000-97|BTF/BTS
    001070-000-97|SRV PTS
    001074-000-00|SRV PTS
    001086-000-97|SRV PTS
    001143-000-97|SRV PTS
    001176-000-97|SRV PTS
    001197-000-97|SRV PTS

    data: gt_txtar TYPE truxs_t_text_data.
    CALL FUNCTION 'SAP_CONVERT_TO_TEX_FORMAT'
              EXPORTING
                i_field_seperator    = ' | '
              TABLES
                i_tab_sap_data       = itab
              CHANGING
                i_tab_converted_data = gt_txtar.
    CONCATENATE '/usr/sap/tmp/file.txt' INTO lv_dwnfile.
    OPEN DATASET lv_dwnfile FOR OUTPUT IN TEXT MODE ENCODING UTF-8 .
    loop at gt_txtar.
    TRANSFER gt_txtar TO lv_dwnfile.
    endloop.
    CLOSE DATASET lv_dwnfile .
    Regards
    Sathar
    Edited by: Sathar RA on Sep 1, 2008 9:47 AM

  • How do I upload XML files into sap table?

    Dear all,
    I found some methods that upload xml into SAP,
    but there doesn’t work under 4.6c.
    Can someone tell me how to upload XML files into
    sap under 4.6c?
    THX!

    hi,
    You can convert XML to abap using transformations. Simple transformations is a proprietary SAP programming language that describes the transformation of ABAP data to XML (serialization) and from XML to ABAP data (deserialization).
    goto SE80->workbench->edit object(or other objects)->in object selection chose more tab and then choose the transformation radio button and write a name and click create new.
    Here you enter your transformation like
    <xsl:transform version="1.0"
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
      xmlns:sap="http://www.sap.com/sapxsl"
    >
    <xsl:strip-space elements="*"/>
    <xsl:template match="/">
      <xsl:copy-of select="."/>
    </xsl:template>
    </xsl:transform>
    You can use this transfomation in your program using call transformation. You can find more info on call transformation in help.
    Hope this helps.
    Regards,
    Richa

  • How to Import file into sap directory.

    Hi all,
    I need to import a .XML file into SAP-BW directory from my local pc.
    By tcod AL11 I can only display all the directories, but I cannot import/upload this file.
    How I Can create my own directory e.g /usr/sap/tmp123
    Help me please.
    thanks.
    Kaustubh.

    Hi Kaustubh,
    Use the FM ARCHIVFILE_CLIENT_TO_SERVER.
    Give Filename + path for both the source and destination and your file will get transferred to the specified directory in AL11.
    But I am not sure about creating your own directory in AL11.
    Reward if helpful.
    Regards
    Hemant Khemani

  • How to Import XML file into SAP B1

    Dear All,
    I have a scenario like,
    I am receiving a XML file from a 3rd party application for the daily Creation,Update of Item Master,BP Master, Marketing Documents. I want to import this file into SAP B1 through its approp objects. I understand DTW has limitation in its file types (Semicolo,Tab,Comma,ODBC). How do i do this ? Please guide me.
    Thanks,
    Thanga Raj K

    Hy folks,
    I´m frim Brasil and I've been studying the tool EFM (Eletronic File Manager) to learn more about it!
    There I saw that we can extract to XML "any" infomation from the database we want, mainly through the GEP.
    However, as I've seen, this Add-On can not import any XML file into SBO, unless for the BFP wich can be imported in conjunction with the BTHF Add-on.
    So I ask: how is it possible to import XML data into SBO database? Is it possible to be done through the EFM? or  it´s really necessary to write a code specifically to do that?
    Besides, I know that de B1iSN fit to this necessity... but when I tried to use it, by the custom "object" for BP, for example, there are some data wich the mapping conteined in this custom "process" that can not be imported... I tried to understand how to map those other fields not imported by the custom but this has been dificult to me as I am a implementation consultant focused in administrative process not on development...
    Could you please help me with this subject!
    Thanks a lot,
    Denis

  • Uploading Data from a Flat file into Oracle Database

    Hi,
    I am a novice to Java . SO, please bear with me. I have a reqiurement where I have a flat file or excel file from which I need to read the data and insert into Oracle Database. The falt file will exist on the client machine. I have been reading and I see this can be done through I/O Streams. Correct me if I am wrong. I am looking for a sample code to get started. Any Java expert has an answer for it, I will appreciate it.
    Thanks

    Try UploadBean. It allows to upload files (from a browser) in Oracle.
    http://www.javazoom.net/jzservlets/uploadbean/uploadbean.html
    You will find JSP and servlet samples.

  • How to call GOS(Generic Object service) attachment ( BMP file ) into SAP

    How to call GOS(Generic Object service) attachment ( BMP file ) into SAP script
    Example: MM02 Service object there attaching the bmp file the same file i need to call script based on the material number
    Please provide the procedure and  coding.
    Thanks in advance
    Raju

    Hi,
    The following link may be useful to u.
    help.sap.com/printdocu/.../BCSRVOBS.pdf

  • T-code to upload mutliple files into SAP directories ?

    Hi,
    Is there any other transaction to upload multiple files into SAP directories ( ALL11) other than CG3Z ? Any other procedures at the operating system level ? Please advise.
    Regards
    Shiva

    I dont think so. But you can :
    -- Ask your developer to create a BDC for this transaction to upload multiple files.
    -- Use LSMW to record this transaction to upload multiple files.
    Regards,
    Jazz

  • How to deploy web application .war file into SAP NetWeaver Engine?

    Hi All,
    I want to deploy web application which is developped using JAVA web technology into SAP netweaver Engine.
    I tried to deploy .war file through SDM but it complained the following error
    - Hide quoted text -
    "Error loading archive
    C;\Document and Settings\cr1adm\Desktop\MyProject.war
      (server side name is: F:\usr\sap\JR1\JC01\SDM\program\temp\MyProject.war)
    com.sap.sdm.util.sduread.IIIFormattedSduFileException: The information about development component found in the manifest is either missing or incomplete!
    Manifest attributes are missing or have badly formatted value:
    attribute keylocation missing
    attribute keyname is missing
    attribute keyvendor is missing
    attribute keycounter is missing
    (F:\usr\sap\JR1\JC01\SDM\program\temp\MyProject.war)"
    Can any one please suggest how to deploy external web application into SAP netweaver engine.
    Is there any procedure to follow to do this.
    your inputs will be highly appreciated...
    Thanks in advance

    Hi,
    I think first you need to wrap it into an EAR file, then you can deploy it.
    As far as I know standalone deployment of WAR is deprecated as of 640.
    similar threads:
    How to deploy .war on NWDI
    Deploying an existing WAR file into the Portal
    Hopefully this tutorial also gives some idea:
    http://help.sap.com/saphelp_nw70ehp1/helpdata/en/70/13353094af154a91cbe982d7dd0118/frameset.htm
    Regards,
    Ervin

  • How to deploy my web application .war file into SAP netweaver Engine

    Hi All,
    I want to deploy web application which is developped using JAVA web technology into SAP netweaver Engine.
    I tried to deploy .war file through SDM but it complained the following error
    "Error loading archive
    C;\Document and Settings\cr1adm\Desktop\MyProject.war
      (server side name is: F:\usr\sap\JR1\JC01\SDM\program\temp\MyProject.war)
    com.sap.sdm.util.sduread.IIIFormattedSduFileException: The information about development component found in the manifest is either missing or incomplete!
    Manifest attributes are missing or have badly formatted value:
    attribute keylocation missing
    attribute keyname is missing
    attribute keyvendor is missing
    attribute keycounter is missing
    (F:\usr\sap\JR1\JC01\SDM\program\temp\MyProject.war)"
    Can any one please suggest how to deploy external web application into SAP netweaver engine.
    Is there any procedure to follow to do this.
    your inputs will be highly appreciated...
    Thanks in advance
    JM

    You may need to convert the .war archive to SDA/SCA file  format before deploying it to SAP Netweaver Engine.
    Check out the below SAP NOTE if it is usefull.
    Note 1223957 - Usage of NetWeaver Packaging Tool.
    Apart from SDM you can also deploy the files through telnet...
    Note 859444 - How to deploy libraries on J2EE Engine 6.40
    1)Connect to telnet as below
    Start --> Run
    telnet hostname/ip address portno
    Ex: telnet xxx.xx.xx.x 5<Instance no>08
    2)Login with administrator id:
    Use the below command to deploy the files.
    deploy <directory path to the SDAs location> version_rule=all on_prerequisite_error=stop on_deploy_error=stop
    Example: deploy E:\usr\sap\trans\EPS\in\VCBASE03_0-10006939.SCA version_rule=all on_prerequisite_error=stop on_deploy_error=stop.
    Also have a look at this note which talks about the error you are getting.
    Note 1171457 - IllFormattedSduManifest/SduFileException during deployment
    Hope it helps.
    Edited by: Khaiser Khan Mohammed on Nov 7, 2010 12:17 PM

  • Uploading File into SAP Transaction using BSP

    Hi Everybody,
    I would like to know how to save the file into SAP Transaction thro BSP. I have one requirement,For example,the captured file from the web should be attached into the Equipment master (Transaction Code IE02).Its possible via SAP GUI.But i would like to know how it can be done from BSP.The same example applicable to sales order also..
    Also i wondering where these files get stored.
    Anybody could help me out of this issue please?...
    Naga Bokkisam

    You can do that using BDS..But you need to find the Business object to store it under Equipment Master or Sales order.
    Here is the example where i stored the document under Warranty process, ie sub set of Equipment master:
    Here BUS2222 is business object for Warranty Process:
      CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
        EXPORTING
          BUFFER                = STR_FILE_CONTENT
        TABLES
          BINARY_TAB            = I_FILE_CONTENT.
      CALL FUNCTION 'BDS_BUSINESSDOCUMENT_CREA_TAB'
        EXPORTING
          CLASSNAME             = 'BUS2222' "classname_select
          CLASSTYPE             = 'BO'" classtype_select
        CLIENT                = SY-MANDT
          OBJECT_KEY            = OBJECT_KEY
        BINARY_FLAG           = 'X'
        TABLES
          SIGNATURE             = I_SIGNATURE
          COMPONENTS            = I_COMPONENTS
        CONTENT               = I_FILE_CONTENT
    EXCEPTIONS
       NOTHING_FOUND         = 1
       PARAMETER_ERROR       = 2
       NOT_ALLOWED           = 3
       ERROR_KPRO            = 4
       INTERNAL_ERROR        = 5
       NOT_AUTHORIZED        = 6
       OTHERS                = 7     .
    Let me know if you need any detail..
    <i>*Reward each useful answer</i>
    Raja T

  • How to load budgeted sales dollars into SAP.

    hello experts
    we are using ecc 5.0
    pl advise how how to load budgeted sales dollars into SAP
    thnks
    vinod

    Hello,
    Budgets are like threshold figures where your actuals cannot exceed your budgets.
    Whereas, planned data is for variance analysis with your actuals.
    You can configure the cost center planning so that the user can upload the data through KP06 or KP26
    This is controlled by planning are in your planning profile. You need to use "Cost ctrs: Cost element/activity inputs" planning area for this purpose.
    Hope you are conversant with Integrated excel upload.
    To do integrated excel upload of cost center plan data.
    IMG ==> Controlling ==> Cost Center Accounting ==> Planning ==> Manual Planning User Defined Layouts - Create your own layout or copy from standard layout and change it.
    IMG ==> Controlling ==> Cost Center Accounting ==> Planning ==> Define User Defined Planner Profiles
    Copy the SAPALL to ZSAPALL. You cannot change SAPALL as it is standard.
    In ZSAPALL planner profile, select proper planning area and enter your layout.
    Tick Integrate Excel.
    Once the popup for KP06 comes, you need enter the data and save it. It would generate the file name.
    With the same file name you need upload the plan data by using KP06.
    In KP06
    Extras ==> Excel Planning ==> Upload
    Select the file as prepared in accordance with format at the time of generating the file name.
    Hope this solves your problem.
    Please let me know if you need futher help.
    Regards,
    Ravi

Maybe you are looking for

  • How can I turn off the iPad theme on safari?

    I was recently on a website in safari on my iPad, I minimised the safari and went back on it a while later, now it's gone onto something called iPad theme? Every time I click off to turn it off, it does nothing Anyone know what to do as it has made t

  • Error while posting .ZIP file

    Hi All, I am working on file to file scenario.. I want to post .zip file from source to target. I am not using any mapping for this... I m using the Integrated configuration for theis scenario.. We are using sFTP advantco adapter for both sender and

  • Safari crashes after clicking on certain links in yahoo pages.

    Mac 10.4.9 I have all the latest updates and permissions repaired. This crash only happens with my user account. This does not happen in another account. Firefox is fine. But I need to test our web pages with Safari. Please help! Date/Time: 2007-04-2

  • Help - Inkwell transfers only the letter A into Remote Desktop.

    Hello, I use Microsoft's remote desktop over a VPN to use my servers at work (terminal services). It works great in every aspect except when I try to write using inkwell. When I start to write with my stylus the yellow paper window opens and accepts

  • * Best option for 4:3 letterbox SD when shooting in 16:9 *

    Can some tell me what workflow or option is the easiest, fastest and looks the best for 4:3 letterbox? No.1 Shoot 16:9 HD Edit 16:9 HD Export 16:9 SD DVD Studio Pro 16:9 letterbox Display mode No. 2 Shoot 16:9 HD Down convert 16:9 SD Edit 16:9 SD Exp