How to upload CSV file(Flat File) in SAP system.

Hi All,
Please guide me how to upload flat file into SAP system.
Regards
Avinav

Use following syntax -
DATA L_P_FILE TYPE STRING.
     L_P_FILE = P_FILE.
CALL FUNCTION 'GUI_UPLOAD'
  EXPORTING
    FILENAME                      = L_P_FILE   <-------Your PC file name
    FILETYPE                      = u2018ASCu2019
    HAS_FIELD_SEPARATOR           = u2018Xu2019
  TABLES
    DATA_TAB                      = P_I_DATA[]   <-----Your internal table
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
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
Endif

Similar Messages

  • How to  upload data from flat file to datastore object in BI 7.0

    Dear friends,
    Please tell me
    step by step process for upload data from flat file to datastore object in BI 7.0
    <removed by moderator>
    please help me
    Thanks,
    D.prabhu
    Edited by: Siegfried Szameitat on Aug 17, 2011 11:40 AM

    Create transformation on thr data source and keep the DSO as the target and load.
    Ravi Thothadri

  • How to upload heirarchy through flat file in BI 7.0

    i have the documentation for loading heirarchy through flatfile in 3.x but i want documentation for 7.0 can anyone help me out

    Hi folks, As given in the previous links; Is Hierarchy Loading possible in BI 7.0 without using RSA1OLD(3.X approach)? The blogs & articles in SDN only cover 3.X methodology for uploading Hierarchies from flat files or external source systems. Hierarchies are not supported in 7.0 Datasources. Could anyone correct me if I'm wrong. Please refer this [link |/thread/375310 [original link is broken];for reference. I had this wierd feeling that the approach that we follow is correct, but this came to my mind when instead of using 7.0 DS, we are forced to use 3.X methodology; That evokes to reason with! Thanks.

  • How to Upload the excel flat file in LSMW

    Hi all,
    Can any one plz Help me,
    How to Upload a excel file format by suing the lsmw .
    Regadrs.
    [email protected]
    Upender..
    Edited by: Upender Reddy on Sep 12, 2008 8:37 AM

    Hi,
    In 7 th step of LSMW we need to specify the file ie flat file.
    In this step you describe all files to be used in the following steps:
    · Your legacy data on the PC and/or R/3 server
    · The file for the read data
    · The file for the converted data.
    As your legacy data is on the PC: ie your excel file that is tab delimited or comma delimited.
    here give ur file name, description , click data from one src structure, then delimiter is tabulator if so, in file structure click both check boxes if in ur flat file ur first row is column, file type is record end indicator, code page ASCII and conitnue that's it.
    you can go through this link very useful :
    ****************/Tutorials/LSMW/LSMWMainPage.htm.
    thanx.

  • How to upload comm seperated flate file into sap r/3?

    plz send me any simple report program

    Hi,
    Please refer code below:
    data : begin of itab1 occurs 0,
            values(1000) type c,
           end of itab1.
    PARAMETERS : p_file LIKE rlgrap-filename OBLIGATORY.
    DATA : filename TYPE string.
    DATA : w_textout LIKE t100-text.
    DATA: BEGIN OF messtab OCCURS 0.
            INCLUDE STRUCTURE bdcmsgcoll.
    DATA: END OF messtab.
    data : begin of itab occurs 0,
               BLDAT(10) TYPE C,
               BLART(2) TYPE C,
               BUKRS(4) TYPE C,
               BUDAT(10) TYPE C,
               MONAT(2) TYPE C,
               WAERS(5) TYPE C,
               NEWBS(2) TYPE C,
               NEWKO(17) TYPE C,
               WRBTR(13) TYPE C,
               SGTXT(50) TYPE C,
               GSBER(4) TYPE C,
               KOSTL(10) TYPE C,
               AUFNR(10) TYPE C,
               TNEWBS(2) TYPE C,
               TNEWKO(17) TYPE C,
               TWRBTR(13) TYPE C,
           end of itab.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
      CLEAR p_file.
      CALL FUNCTION 'F4_FILENAME'
        IMPORTING
          file_name = p_file.
    start-of-selection.
      filename = p_file.
      CALL FUNCTION 'GUI_UPLOAD'
        EXPORTING
         FILENAME                      = filename
         FILETYPE                      = 'ASC'
         HAS_FIELD_SEPARATOR           = 'X'
    *   HEADER_LENGTH                 = 0
    *   READ_BY_LINE                  = 'X'
    *   DAT_MODE                      = ' '
    *   CODEPAGE                      = ' '
    *   IGNORE_CERR                   = ABAP_TRUE
    *   REPLACEMENT                   = '#'
    *   CHECK_BOM                     = ' '
    *   VIRUS_SCAN_PROFILE            =
    * IMPORTING
    *   FILELENGTH                    =
    *   HEADER                        =
        TABLES
          DATA_TAB                      = itab1
    * 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 ITAB1.
          SPLIT ITAB1 AT ',' INTO ITAB-BLDAT ITAB-BLART ITAB-BUKRS ITAB-BUDAT ITAB-MONAT
                             ITAB-WAERS ITAB-NEWBS ITAB-NEWKO ITAB-WRBTR ITAB-SGTXT ITAB-GSBER ITAB-KOSTL ITAB-AUFNR.
        APPEND ITAB.
      ENDLOOP.
    Thanks,
    Sriram Ponna.

  • How to upload .CSV file from Application Server

    Hi Experts,
        How to upload .CSV file separated by ',' from Application server to an internal table.
    Invoice No,Cust No,Item Type,Invoice Date,days,Discount Amount,Gross Amount,Sales Amount,Customer Order No.,Group,Pay Terms
    546162,3233,1,9/4/2007,11,26.79,5358.75,5358.75,11264,HRS,11
    546163,2645,1,9/4/2007,11,3.07,305.25,305.25,10781,C,11
    Actually I read some already answered posts. But still I have some doubts.
    Can anybody please send me the code.
    Thanks in Advance.

    Hi Priya,
    Check this code
    Yhe logic used here is as follows,
    Get all the data into an internal table in the simple format ie: a row with one field contains an entire line
    After getting the data, we split each line of the table on every occurrence of the delimiter (comma in your case)
    Here, I have named the fields as field01, field02 etc, you could use your own names according to your requirement
    parameters: p_file(512).
      DATA : BEGIN OF ITAB OCCURS 0,
              COL1(1024) TYPE C,
             END OF ITAB,
             WA_ITAB LIKE LINE OF ITAB.
      DATA: BEGIN OF ITAB_2 OCCURS 0,
        FIELD01(256),
        FIELD02(256),
        FIELD03(256),
        FIELD04(256),
        FIELD05(256),
        FIELD06(256),
        FIELD07(256),
        FIELD08(256),
        FIELD09(256),
        FIELD10(256),
        FIELD11(256),
        FIELD12(256),
        FIELD13(256),
        FIELD14(256),
        FIELD15(256),
        FIELD16(256),
       END OF ITAB_2.
      DATA: WA_2 LIKE LINE OF ITAB_2.
        OPEN DATASET p_FILE FOR INPUT IN TEXT MODE ENCODING NON-UNICODE.
        IF SY-SUBRC = 8.
          WRITE:/ 'File' , p_FILE , 'cannot be opened'.
          LV_LEAVEPGM = 'X'.
          EXIT.
        ENDIF.
        WHILE SY-SUBRC <> 4.
          READ DATASET p_FILE INTO WA_ITAB.
          APPEND WA_ITAB TO ITAB.
        ENDWHILE.
        CLOSE DATASET p_FILE.
      LOOP AT ITAB INTO WA_ITAB.
        SPLIT WA_ITAB-COL1 AT ','    " where comma is ur demiliter
         INTO WA_2-FIELD01 WA_2-FIELD02 WA_2-FIELD03 WA_2-FIELD04
         WA_2-FIELD05 WA_2-FIELD06 WA_2-FIELD07 WA_2-FIELD08 WA_2-FIELD09
         WA_2-FIELD10 WA_2-FIELD11 WA_2-FIELD12 WA_2-FIELD13 WA_2-FIELD14
         WA_2-FIELD15 WA_2-FIELD16.
        APPEND WA_2 TO ITAB_2.
        CLEAR WA_2.
      ENDLOOP.
    Message was edited by:
            Kris Donald

  • How to upload  and download a files into AL11 directory in ABAP

    Hi,
                   How to upload  and download a files into AL11 directory in ABAP
    thanks
    Moderator message: please search for available information/documentation.
    Edited by: Thomas Zloch on Mar 21, 2011 9:18 AM

    You should try one of these forums for an answer to your question:
    http://swforum.sun.com/jive/forum.jspa?forumID=116
    http://community.java.net/netbeans
    http://linux.java.net

  • How to upload an excel template file to SAP server

    Dear Experts,
    I am develpoing a program to generate the Excel file with a fixed template and save it to user's local drive, the excel template is stored in SAP server. I use the function module C13Z_FILE_DOWNLOAD_BINARY to do this is. But now my problem is I do not know how to upload the excel template to our SAP server. Do any friends can kindly tell me how to upload the excel template to SAP server?? Thanks.
    Best Regards
    Joe

    Hi Joe,
    Please refer following sample program:
    http://abapcode.blogspot.com/2007/06/sample-program-to-upload-excel-document.html
    Best regards,
    Prashant

  • How to convert IDOC to flat file in XI

    Hello SDNers
    I have a scenario IDOC --> XI  --> Flat file. My question is how to conver IDOC to flat file. At least there are two ways to do that:
    1) Define a flat structure in PI that reflects the IDOC structure, then using content conversion to convert the flat structure to flat file in hte receiver communication channel.
    2) There is a [document |https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/46759682-0401-0010-1791-bd1972bc0b8a] talking about using a generic ABAP mapping to map any IDOC to flat file.
    For the option 1, I don't want that way, because I would need to define a flat structure in PI for each IDOC which is too much effort. (I would have dozens of IDOC scenarios)
    The second one is very attractive. However the document is not complete to follow. Basically it does not explain how the inbound flat structure looks like. I guess the generic ABAP mapping is used to map any IDOC_XML structure to a flat structure, then in the file receiver communication channel to convert the flat structure to flat file format. But the document does not mention how the flat structure looks like. Has somebody tried this scenario? If yes, can you please let me know the steps to do in ESR (IR) and ID? Basically what structure the IDOC_XML should be mapped to using the generic ABAP mapping class?
    Or somebody has other ideas on how to convert IDOC to flat file?
    Thank you so much
    Eric

    > 1) You are saying that for Java mapping and abap mapping, the target data type (messag type) is just a dummy one, the real (XML) message the receiver will recieve is the one (stream) produced by the java or abap mapping. Is that correct?
    Definitely yes!
    >
    > 2) For the abap mapping option, I would define a dummy target data type. Do I need to do any content conversion in the receiver adapter (communication channel)?
    None wat so ever.The output of your Java Mapping will be the Native Idoc Format.
    >
    > 3) I tried with a dummy target data type as mentioned in my second post, can you see any clue in the error message what is wrong?
    Dats one thing I cant help much. Just make sure that the ABAP report is valid and take the help of a ABAP'er to debug what is going wrong. Not much of a ABAP guy, can read ABAP code, but cant write one myself
    Try to test the program standalone to see how it works. Maybe take some Idoc XML file as input and then dump the output to a .txt file and so on.
    Regards
    Bhavesh
    PS : All this is from what I have read of this guide. I have not convert Idoc XML to Native Idoc but have used this guide to convert Native Idoc to Idoc XML .

  • How To Convert IDOC to FLAT File ?

    Dear Expert,
            My requirement is to convert the IDOC to FLAT File using XI. How can i do this. I have gone thru the Guide How to convert IDOC to Flat file using ABAP mapping but it does not talk about what are all the stpes i need to do in IR & ID.
    I am ready to use ABAP mapping since i am an ABAPER.
             Is it recommended to use ABAP mapping since we expect daily 500 IDOCs to be converted to a flat file & transfer this flat file to some FTP location.
             Can anybody tell me the stpes how to do this in XI. The steps i am expecting like how to define the Data Type / Message type / Mapping etc & how to configure the channel ?
             The Flat file i want to convert should look like the way IDOC file gets created in FILE FTP port in SAP.
    Regards,
    Umesh

    I think there is some confusion... Let me explian my problem once again.
    I want to convert the Shipment IDOC as it is the moment the shipment documents gets created in R/3. I dont want to collect many IDOCs & make as single file. For each IDOC it should create a Flat File.
    Secondly if i have to MAP the whole IDOC the graphical mapping is too difficult.
    So instead of that can i use ABAP/XSLT/JAVA whichever is easy. ?
    Since i am ABAPER i can use ABAP mapping.
    The Output file should look like as below.
    EDI_DC40  9000000000011785526620 3012  OILSHI01                                                    OILSH1                                           SAPP01    LS  SAPCLNT900                                                                                A000000018LS  WBIMQSI                                                                                20071031161506                                                                                20071031161506     
    E2OILSH001                    90000000000117855260000010000000250 1011537344 1101                1 300X1 TRKGMKG 0202KG KG X        ZTLF  X XX 000   BLX X        X60002200710310000002007103100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000        E2OILSA                       9000000000011785526000002000001031011537344000001SP          0000201496000000000000000000                                           00                                        00 V                                                                                E2OILSA                       9000000000011785526000003000001031011537344000002SP          0000201496000000000000000000                                           00                                        00 S
    E2OILSV                       900000000001178552600000400000103MH04CG6052        LPBW50D62401033       000020149601KG KGM   35200.00000             17200.00000             18000.00000                               0.000          0.000          0.000          DLLPGB220071031000000 00000000000000000000000000000000000                    0000XX    6000AAAA0.00000                 0.00000                 17200.00000             35200.00000             18000.00000             MH04CG6052 new bulk tender approved rs                                          LPG Bulk Lorry - WR                     Refinery TPP                                                                                BABA TRANSLINES                     kg        kg        0.000             0.00           0.00                                                                                E2OILSC                       9000000000011785526000005000004041  001                                                 18000.000000           18000.000000           35200.000000           0.000000               0.000000                  KG                                                                                E2OILSQ001                    9000000000011785526000006000005050011  MH04CG6052MH04CG60521J          05041089055000                        00000118000.0000000  KG 18000.000000           18000.000000           6000V04 18000.000      KGM18000.000      KGM00000000  V        0.000000                  0.000000               0.000000                  0.000000                           0.000000               0.000000               0.000000               0.000000                          0001                                                                                E2OILS2                       9000000000011785526000007000004040001000001000200020000.000000               0.000000               0.000000               0.000000               0.000000               0.000000               0.000000               0.000000               0.000000               XX0000000000000000000000000000 XX0504108905J5000              PUNE LPG BOTTLING PLANT            START     0001 1END       0001 10.000000               0.000000               0.000000               0.000000               0.000000               0.000000
    Pl. Help me its Urgent.
    Regards,
    Umesh

  • How to load a long flat file field into BW

    Hi all,
    I have a field from flat file with 256 characters to be loaded into BW. As we all know the max length an info object can take is only 60. How can I split the flat file field so that I can load that data into BW and how can I then concatenate them in the BEx.
    Can anyone suggest a way?
    Thanks in advance.
    Vinay

    Hi Vinay,
    we already had this discussion in this forum. In short:
    1. create a number range object
    2. create a table with a number field a key and a text field
    3. while loading the data check your text against the table. If the text already exist, get the number out of the table. If the text doesn't exist, get a new number out of your number range object and post this number + the text into your table.
    4. in your loaded data always work with the number you assigned to the text
    5. create a infoobject for the number-field
    6. create a variable that takes it's value out of the table.
    regards
    Siggi

  • Upload hierarchy from flat file to BPC

    Hello SAP Guru,
    I have download customer / material  hierarchy in flat flie from BI/BW  and now I want to upload hierarchy from flat file to BPC
    Please can any one give me step by step method to load hierarchy from Flat file to SAP - BPC.
    Thanks in advance.
    With regards,
    Anand Kumar

    Hi Saida Reddy,
    why you resurrect a 5 years old thread? Surely he solved in the meanwhile his issue, see please dr Frankenstein.
    Regards
        Roberto

  • Upload data from flat file to OVKK  using BDC

    Hi All,
    I want to upload data from flat file to OVKK tcode using BDC.
    OVKK is a maintaince view with  a table control.
    So please send me code for uploading data to OVKK through BDC.
    Thanks & Regards,
    Siva.B

    Hi,
    Welcome to SDN!!!!!!!!!!
    Can you see this example for Table control.
    http://www.sap-img.com/abap/bdc-example-using-table-control-in-bdc.htm
    Today this is the second post on the same issue and same Tranx.
    1st try through SHDB and check the code.
    Thanks.
    If this helps you reward with points.

  • How to Upload pdf or ppt files from desktop to some learning object

    Hi All
    I have a query, How to Upload pdf or ppt files from desktop to some learning object, do I need to have content server for same?

    Hi,
    This is standard functionality, that you can read more about in the OLM User Manual. You can upload the files to an OLM content server or to any other content server that can be accessed with a URL.
    Regards Anders Northeved

  • How to upload words, exel, PDF file from the pc via itune to the iPad, and where will the uploaded file be saved? In the apps?

    How to upload words, exel, PDF file from the pc via itune to the iPad, and where will the uploaded file be saved? In the apps?

    You will need an app (or apps) on your iPad that is capable of reading the documents, as they will be saved with the app - if you don't have such an app then there is nothing to transfer them to or to read/access them.
    One method of transferring them is toconnect your iPad to your computer's iTunes, select it's app tab, and then scroll to the bottom of it - you should the apps That you've got that are capable of file-sharing (if you've got any).  Selecting/high-lighting one of them should then allow you to add files to it via the box to the right of it.
    An alternative way to get the documents onto your iPad is if the app that you want to transfer them to has a wifi setting, which will then allow you to transfer the documents wirelessly. You can also send the documents to yourself as attachments and then use Mail's 'open in' facility to copy them into your chosen app.
    Edit : more info on file sharing from the manual :
    File Sharing lets you transfer files between iPad and your computer. You can share files created with a compatible app and saved in a supported format.
    Apps that support file sharing appear in the File Sharing Apps list in iTunes. For each app, the Files list shows the documents that are on iPad. See the app’s documentation for how it shares files; not all apps support this feature.
    Connect iPad to your computer.
    In iTunes, select iPad in the Devices list, then click Apps at the top of the screen.
    In the File Sharing section, select an app from the list on the left.
    On the right, select the file you want to transfer, then click “Save to” and choose a destination on your computer.
    Transfer a file from your computer to iPad:
    Connect iPad to your computer.
    In iTunes, select iPad in the Devices list, then click Apps at the top of the screen.
    In the File Sharing section, click Add.
    Select a file, then click Choose (Mac) or OK (PC).
    The file is transferred to your device and can be opened using an app that supports that file type. To transfer more than one file, select each additional file.
    Delete a file from iPad: Select the file in the Files list, then tap Delete.
    Message was edited by: King_Penguin

  • How to upload and download any file from plsql through weblogic server

    hi all,
    how to upload and download any file from plsql through weblogic server? i am using oracle 10g express edition and jboss.
    Thanks and Regards,
    MSORA

    hi bala ,
    for a windown server u can use VNC (virtual network connection) which opens a session on u r desktop later u can drag and drop form there vice versa and for a linux box you can use Win SCP which helps to open a session with interface to u r desktop in both cases you can upload and down load files very easiy just as we drag and drop items in a simple pc .. we use the same technique...
    bye
    vamshi

Maybe you are looking for