Uploading data using 'GUI_UPLOAD' ....

Hi Experts,
i ve a problem i.e here am uploading a flat file but am not getting proper output,
could anyone see this peace of code.
DATA: BEGIN OF ITAB OCCURS 1,
      BRANCH(1) TYPE C,
      XRE_TTY(18) TYPE C,
      ORIG_CURR(3) TYPE C,
      COB(3) TYPE C,
      TTY_TYPE(1) TYPE C,
      END OF ITAB.
DATA: WA_ITAB LIKE ITAB.
CALL FUNCTION 'GUI_UPLOAD'
  EXPORTING
    FILENAME                      = 'C:\ACCUPLOAD\input'
   FILETYPE                      = 'DAT'
   HAS_FIELD_SEPARATOR           = '|'
  HEADER_LENGTH                 = 0
  READ_BY_LINE                  = 'X'
  DAT_MODE                      = ' '
IMPORTING
  FILELENGTH                    =
  HEADER                        =
  TABLES
    DATA_TAB                      = ITAB
EXCEPTIONS          .
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
LOOP AT ITAB .
WRITE:/20 ITAB-BRANCH,
                 ITAB-XRE_TTY,
                 ITAB-ORIG_CURR,
                 ITAB-COB,
                 ITAB-TTY_TYPE.
ENDLOOP.
my input file is (here seperator is (pipe) | ).
S|S-FFF-P-96-0193-96|AED|FFF|P
S|S-FNM-P-96-0194-96|USD|FNM|P
S|S-EEB-P-92-0365-92|PKR|EEB|P
S|S-EEB-P-92-0365-93|PKR|EEB|P
S|S-EEB-P-92-0365-94|PKR|EEB|P
S|S-GGA-P-92-0006-96|PKR|GGA|P
but am getting output is only single char. like.
S
S
S
S
S
S
WHAT is the wrong here plz..
Thanks in advance..
sudharsan.

GIVE SPACE IN THE HAS FIELD SEPERATOR......
I HAVE TRIED THIS AND I GOT THE OUTPUT
DATA: BEGIN OF ITAB OCCURS 1,
BRANCH(1) TYPE C,
XRE_TTY(18) TYPE C,
ORIG_CURR(3) TYPE C,
COB(3) TYPE C,
TTY_TYPE(1) TYPE C,
END OF ITAB.
DATA: WA_ITAB LIKE ITAB.
DATA: V_FILENAME TYPE STRING.
V_FILENAME = 'C:\ACCUPLOAD\input.TXT'.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = V_FILENAME
FILETYPE = 'ASC'
HAS_FIELD_SEPARATOR = ' '
HEADER_LENGTH = 0
READ_BY_LINE = 'X'
DAT_MODE = 'X'
IMPORTING
FILELENGTH =
HEADER =
TABLES
DATA_TAB = ITAB.
EXCEPTIONS .
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
LOOP AT ITAB .
WRITE:/20 ITAB-BRANCH,
ITAB-XRE_TTY,
ITAB-ORIG_CURR,
ITAB-COB,
ITAB-TTY_TYPE.
REWARD POINTS IF HELPFUL .......

Similar Messages

  • Upload data using 'GUI_UPLOAD'

    Hi all,
          l like to upload data from local file.
    My question is how to upload data from .xls file using function 'GUI_UPLOAD', and then transfert that data into local internal table.
    Bob

    hI,
    To Upload the excel file FM 'ALSM_EXCEL_TO_INTERNAL_TABLE'
    BElow is the sample code.
    report ztest.
    types: begin of ttab ,
          fld1(30) type c,
          fld2(30) type c,
          fld3(30) type c,
          fld4(30) type c,
          fld5(30) type c,
          end of ttab.
    data: itab type table of ttab with header line.
    selection-screen skip 1.
    parameters: p_file type localfile default
                'C:\test.txt'.
    selection-screen skip 1.
    at selection-screen on value-request for p_file.
      call function 'KD_GET_FILENAME_ON_F4'
           exporting
                static    = 'X'
           changing
                file_name = p_file.
    start-of-selection.
      clear itab. refresh itab.
      perform upload_data.
      loop at itab.
        write:/ itab-fld1, itab-fld2, itab-fld3, itab-fld4, itab-fld5.
      endloop.
    Upload_Data
    form upload_data.
      data: file type  rlgrap-filename.
      data: xcel type table of alsmex_tabline with header line.
      file = p_file.
      call function 'ALSM_EXCEL_TO_INTERNAL_TABLE'
           exporting
                filename                = file
                i_begin_col             = '1'
                i_begin_row             = '1'
                i_end_col               = '200'
                i_end_row               = '10000'
           tables
                intern                  = xcel
           exceptions
                inconsistent_parameters = 1
                upload_ole              = 2
                others                  = 3.
      loop at xcel.
        case xcel-col.
          when '0001'.
            itab-fld1 = xcel-value.
          when '0002'.
            itab-fld2 = xcel-value.
          when '0003'.
            itab-fld3 = xcel-value.
          when '0004'.
            itab-fld4 = xcel-value.
          when '0005'.
            itab-fld5 = xcel-value.
        endcase.
        at end of row.
          append itab.
          clear itab.
        endat.
      endloop.
    endform.
    Reward Points if it is Useful.
    Thanks,
    Manjunath MS

  • Can anyone list problems/errors when uploading data using BDC's and BAPI's?

    Can anyone list the problems/errors when uploading data using BDC's and BAPI's?

    Hi,
    If you are actually creating a BDC to load data pls be more specific.
    Data format incorrect. Tab delimited/ etc
    Dates in wrong formats
    Currency incorrect formats
    Missing screens
    Wrong transaction code
    File not found,
    Missing Mandatory fields,
    Screen resoultion.
    You should always use refresh for your Bdcdata table.
    Loop at internal table.
    refresh Bdcdata.
    regards,
    sowjanya.

  • How to upload data using SXDA Transaction

    HI,
    Can any one explain step by step procedure to upload data using SXDA transaction.
    I have already uploaded to txt file in Application server.
    I have created a project and  entered into the sub-project wizard and selected the object type as BKPF and then pressed continue, then i enter into task tab....
    There i see convert data , Check file,File split,load data,
    In convert data i have selected the program name as RFBIBL00.
    In check file i have selected the file type as Physical file and selected the file name from F4 button.
    I am fasing the probelm in load data ....
    Can any one please explain how to proceed further..

    Hi Yogesh,
    Use this function module
    ALSM_EXCEL_TO_INTERNAL_TABLE to upload the excel sheet data into internal table.
    Then from the internal table data use KE13 transaction to upload data.
    Regards
    Arun

  • How to upload data using utl_file when you dont know the exact file name

    Hi
    i want to upload data from a flat file to a table.
    i dont know the exact file name. i want to make a search for filename. like i want to make a search on file (say test*) which will give me all the files with test.
    i want to upload data using these files.
    how can i do this by using UTL_FILE.
    Regards
    Manish

    Thank you very much.
    Thing is previously we are using sqlloader and shell script for loading the data.
    now i am creating a procedure (if possible without parameters).
    Is there any other way i can do that.
    can i make a wild card search using utl_file.
    Thanks n Regards
    Manish

  • UPload data useing BDC for cost element allocation

    Hi ALL,
      i have to upload data useing BDC , have to upload data for cost centre accloction table ,What is the T.code and how to do it, i have knows LSMW,
    very useful for me
    Advance  Thanks
    Narra

    Using BDC means...use theTCODE: SHDB   + ABAPer help, it requires program need to create for this....you can have options in BDC is...u can test the data validity before you upload the data
    VVR

  • Upload data using BDC

    Hi Expert,
    How to upload data using BDC. I have uploaded using LSMW....now want to know how to upload data using BDC

    HI
    Ask your Abapper.
    First you have to record in SHDB. then you have to generate the program and write the code in SE38
    For more details please make a search
    regards
    Prashanth

  • For transaction code MD61, I want to upload data using BAPI

    Hi,
    for transaction code MD61, I want to upload data using BAPI.
    Which BAPi I ll call ?
    Can anyone suggest me how to do it with any simple example program ?

    Refer the thread for details about coding-
    BAPI_REQUIREMENTS_CREATE
    Reards,
    Amit

  • Which method is easiest for uploading data using LSMW?

    which method is easiest for uploading data using LSMW (Direct method or batch input method) bcs I am facing lot of problem using batch input method while recording.Even  I cannot use direct method using standard program.can anyone tell me some other easiest way for uploading MM01.?

    I personally used the direct input way 6 years ago and it was a little bit of a struggle cause I was very new to SAP at the time.  But it worked out to be ok in the end.  You just have to keep messing with it till the errors are clear and then you can upload for real.  The test mode is a nice touch, you can get rid of all of the errors before actually uploading the data.
    Regards,
    Rich Heilman

  • Getting error while uploading data  using the EXCEL( GUI_upload)

    Dear Freinds,
    I am uploading data from my excel sheet to my Custom table . I am using the below code
    call function 'GUI_UPLOAD'
    exporting
    filename = l_fn
    filetype = 'BIN' "'ASC'
    has_field_separator = 'X'
    tables
    data_tab = p_i_ins_db
    exceptions
    others = 17.
    i can see in my internal P_i_ins_db ...all the data is coming in encrypted format.
    The flat given to me is the .CSV file .
    Could any one please let me know how i can upload the data which is there in .csv file.
    regards
    syamala

    Hi Syamala,
    Before using the GUI_UPLOAD to upload the data from the excel file to the internal table,you can try usng the Function Module 'SAP_CONVERT_TO_TEX_FORMAT' or 'SAP_CONVERT_TO_CSV_FORMAT' as it helps n formatting the data.
    In case you have any further clarifications,do let me know.
    Regards,
    Puneet Jhari.

  • Problem in Uploading Data using a Tab Separated File?

    Hi All,
    I am trying to upload a file which tab separated containing customer and bank details and my file structure somewhat in the following manner.
    10     21169     abcde     xyz     kdHDHLk     gdh     ghgah  (Customer Details)
    20     21169     DE     20050000     01122334  (bank details for customer 21169)
    20     21169     DE     23022200     1122334455
    (bank details for customer 21169)
    20     21169     DE     23984899     223344556    (bank details).
    But when I am trying to intial upload the details to an internal table using GUI_upload FM and display to check if it is loading correctly or not it is not giving me any o/p.
    I am copying the code which I am trying to execute. Please tell me what way I need to modify the code so that it executes correctly.
    parameters: p_file type rlgrap-filename.
    data: begin of wa_file,
          text(256) type c,
          end of wa_file.
    data: it_file like table of wa_file.
    types: begin of ty_kna1,
           kunnr type kunnr,
           name1 type name1,
           sortl type sortl,
           stras type stras,
           ort01 type ort01,
           land1 type land1,
           spras type spras,
           end of ty_kna1.
    data: it_kna1 type standard table of ty_kna1,
          wa_kna1 type ty_kna1.
    types: begin of ty_knbk,
           kunnr type kunnr,
           banks type knbk-banks,
           bankl type knbk-bankl,
           bankn type knbk-bankn,
           end of ty_knbk.
    data: it_knbk type standard table of ty_knbk,
          wa_knbk type ty_knbk.
    data: v_id(2).
    At Selection-Screen on Value-Request for p_file.
    CALL FUNCTION 'F4_FILENAME'
    EXPORTING
       PROGRAM_NAME        = SYST-CPROG
       DYNPRO_NUMBER       = SYST-DYNNR
    *   FIELD_NAME          = ' '
    IMPORTING
       FILE_NAME           = p_file
    Start-of-Selection.
    data: p_file1 type string.
          p_file1 = p_file.
    CALL FUNCTION 'GUI_UPLOAD'
      EXPORTING
        FILENAME                      = p_file1
       FILETYPE                      = 'ASC'
       HAS_FIELD_SEPARATOR           = 'X'
    *   HEADER_LENGTH                 = 0
    *   READ_BY_LINE                  = 'X'
    *   DAT_MODE                      = ' '
    * IMPORTING
    *   FILELENGTH                    =
    *   HEADER                        =
      TABLES
        DATA_TAB                      = it_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
    IF SY-SUBRC <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    constants: c_tab type X value '09'.
    loop at it_file into wa_file.
    if wa_file+0(2) = '10'.
    split wa_file at 'c_tab'
              into v_id
                   wa_kna1-kunnr
                   wa_kna1-name1
                   wa_kna1-sortl
                   wa_kna1-stras
                   wa_kna1-ort01
                   wa_kna1-land1
                   wa_kna1-spras.
    append wa_kna1 to it_kna1.
    elseif wa_file+0(2) = '20'.
    split wa_file at 'c_tab'
           into v_id
                wa_knbk-kunnr
                wa_knbk-banks
                 wa_knbk-bankl
                 wa_knbk-bankn.
    append wa_knbk to it_knbk.
    endif.
    endloop.
    write:/ 'Customer Master General Data'.
    uline.
    loop at it_kna1 into wa_kna1.
    write:/ wa_kna1-kunnr,
             wa_kna1-name1,
                   wa_kna1-sortl,
                   wa_kna1-stras,
                   wa_kna1-ort01,
                   wa_kna1-land1,
                   wa_kna1-spras.
    endloop.
    clear wa_kna1.
    skip 2.
    write:/ 'Customer Master Bank Data'.
    uline.
    loop at it_knbk into wa_knbk.
    write:/ wa_knbk-kunnr,
             wa_knbk-banks,
             wa_knbk-bankl,
             wa_knbk-bankn.
    endloop.
    clear wa_knbk.
    Regards,
    MD

    Declare Class cl_abap_char_utilities
    Use File type as 'DBF'
    Has_field_seperator = w_tab in FM GUI_UPLOAD
    DATA: w_tab TYPE c VALUE cl_abap_char_utilities=>horizontal_tab.
        CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
        BIN_FILESIZE                    =
          filename                        = w_file
       filetype                        = 'DBF'
        append                          = ' '
       write_field_separator           = w_tab
        TABLES
          data_tab                        = it_extractchar
       fieldnames                      = it_header
    EXCEPTIONS
       file_write_error                = 1
       no_batch                        = 2
       gui_refuse_filetransfer         = 3
       OTHERS                          = 22

  • Difference between uploading data using BDC,CATT

    Dear experts,
    what is the difference between uploading the data using BDC and CATT tool?
    is it only the coding or something else.
    and can you explain the situations where we prefer to upload the data using CATT tool.
    thanks in advance.

    Check this thread -
    Differences between  BDC , LSMW, BAPI,CATT
    Regards,
    Amit

  • In RFC how to uploading data using bdc

    Hi, Experts
    In RFC how to use bdc program for uploading data
    any example plz.
    my requrement for tcode ME21.
    thank you in advance.
    with best regards
        sai

    Thank u  reply
    my requirement is in function moudle 
    ( Program will be called from non-sap system with the data in the form of table as per the structure given above. Then the program will do the some validation for the data.  If data validated correct, BDC will be run for creating DO
    condition is )
    ex:
    if T_itab –KNTTP = ‘K’,
    Run BDC for transaction ME21.
    ( in that you should not use upload and ws_upload )
    in put paramer is taking value for structure (non- sap ) run the bdc update in sap system.
    plz any sample program
    regards
    sai

  • UPLOADING DATA USING BAPI_DOCUMENT_CREATE2

    Hi Friends,
    I am uploading data for CV01N using FM "BAPI_DOCUMENT_CREATE2",
    it is updating the data successfully,
    but for my requirement i need to change the value of
    RC29P-POSTP     Bom Item Category in the DOCUMENT STRUCTURE , it is default taking as "D", my requirement with "T" also.
    I am not finding the correct field in the Function module to mapp this POSTP (Bom Item Category ).
    Can any one suggest, as its urgent.
    Otherwise can any one suggest FM to create DOCUMENT STRUCTURE ( CV11 ) with above requirement.
    Regards,
    Sivaram.
    Message was edited by:
            Sivaram Prasad Gadde
    Message was edited by:
            Sivaram Prasad Gadde

    Hi Frank,
    Did you manage to figure out what the problem was?
    Thank you.
    Regards,
    Bruno

  • Flat  file to upload data using BDC for transaction MM01

    Hi
    I am trying to update data using bdc code has been attached below using a txt file.
    It is updating the first set of data into the table mara ,but  for the rest it is not
    All the data from txt file has being loaded to internal table , but the problem is it does not gets updated from internal table to the database .
    Only the first set of data has been loaded ,<u><b> rest of the data is not loaded</b></u>
    <u><b>content of txt file</b></u>
    zsc     zsc     kg     
    zsv     zsv     kg     
    zsb     zsb     kg
    <u><b>Actual code</b></u>
    report ZMAT_UPLOAD
           no standard page heading line-size 255.
    types declaration..........................................................................
    types : begin of t_mat,
       matnr(20),
       desc(50),
       uom(5),
    end of t_mat.
    internal table and workarea declaration.......................................
    data : i_mat type table of t_mat.
    data : wa_mat type t_mat.
    include bdcrecx1.
    start-of-selection.
    moving the flat file content to internal table................................
    CALL FUNCTION 'UPLOAD'
         EXPORTING
             FILETYPE   = 'DAT'
         TABLES
             data_tab   = i_mat.
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    perform open_group.
    loop at i_mat into wa_mat.
    perform bdc_dynpro      using 'SAPLMGMM' '0060'.
    perform bdc_field       using 'BDC_CURSOR'
                                       'RMMG1-MATNR'.
    perform bdc_field       using 'BDC_OKCODE'
                                        '=AUSW'.
    perform bdc_field       using 'RMMG1-MATNR'
                                        wa_mat-matnr.
    perform bdc_field       using 'RMMG1-MBRSH'
                                        'P'.
    perform bdc_field       using 'RMMG1-MTART'
                                        'ZOH'.
    perform bdc_dynpro   using 'SAPLMGMM' '0070'.
    perform bdc_field       using 'BDC_CURSOR'
                                        'MSICHTAUSW-DYTXT(01)'.
    perform bdc_field       using 'BDC_OKCODE'
                                        '=ENTR'.
    perform bdc_field       using 'MSICHTAUSW-KZSEL(01)'
                                        'X'.
    perform bdc_dynpro   using 'SAPLMGMM' '4004'.
    perform bdc_field       using 'BDC_OKCODE'
                                        '=BU'.
    perform bdc_field       using 'MAKT-MAKTX'
                                        wa_mat-desc.
    perform bdc_field       using 'BDC_CURSOR'
                                        'MARA-MEINS'.
    perform bdc_field       using 'MARA-MEINS'
                                        wa_mat-uom.
    perform bdc_field       using 'MARA-MTPOS_MARA'
                                        'NORM'.
    perform bdc_transaction using 'MM01'.
    endloop.
    Perform close_group.

    Hi Sumant,
    just concentrate on bold one
    report ZMAT_UPLOAD
    no standard page heading line-size 255.
    types declaration..........................................................................
    <b>
    data : begin of t_mat occurs 0,
    matnr(20),
    desc(50),
    uom(5),
    end of t_mat.</b>
    internal table and workarea declaration.......................................
    <b>*data : i_mat type table of t_mat.
    *data : wa_mat type t_mat.</b>
    include bdcrecx1.
    start-of-selection.
    moving the flat file content to internal table................................
    CALL FUNCTION 'UPLOAD'
    EXPORTING
    FILETYPE = 'DAT'
    TABLES
    <b>data_tab = i_mat.---> t_mat.</b>
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    perform open_group.
    <b>loop at i_mat into wa_mat.------>loop at t_mat.</b>
    perform bdc_dynpro using 'SAPLMGMM' '0060'.
    perform bdc_field using 'BDC_CURSOR'
    'RMMG1-MATNR'.
    perform bdc_field using 'BDC_OKCODE'
    '=AUSW'.
    perform bdc_field using 'RMMG1-MATNR'
    <b>wa_mat-matnr.---->t_mat-matnr(change in this for ur wa to t_mat.</b>
    perform bdc_field using 'RMMG1-MBRSH'
    'P'.
    perform bdc_field using 'RMMG1-MTART'
    'ZOH'.
    perform bdc_dynpro using 'SAPLMGMM' '0070'.
    perform bdc_field using 'BDC_CURSOR'
    'MSICHTAUSW-DYTXT(01)'.
    perform bdc_field using 'BDC_OKCODE'
    '=ENTR'.
    perform bdc_field using 'MSICHTAUSW-KZSEL(01)'
    'X'.
    perform bdc_dynpro using 'SAPLMGMM' '4004'.
    perform bdc_field using 'BDC_OKCODE'
    '=BU'.
    perform bdc_field using 'MAKT-MAKTX'
    wa_mat-desc.
    perform bdc_field using 'BDC_CURSOR'
    'MARA-MEINS'.
    perform bdc_field using 'MARA-MEINS'
    wa_mat-uom.
    perform bdc_field using 'MARA-MTPOS_MARA'
    'NORM'.
    perform bdc_transaction using 'MM01'.
    endloop.
    Perform close_group.
    Reward points for helpful answers.
    Thanks
    Naveen khan
    Message was edited by:
            Pattan Naveen
    Message was edited by:
            Pattan Naveen

Maybe you are looking for

  • How can I get rid of the fine, black, vertical "glitch lines" that print from my InDesign doc?

    In the three orange ellipses in this photo, you can see some of the vertical lines that have been driving me crazy. Any idea what causes them? I've tried separating adjacent lines onto different layers, merging layers, and everything I could think of

  • Query related to Delta changes in ABAP Dictionary

    Dear All, Can anyone of you please provide me the necessary documents or can suggest the delta changes from 4.6C to ECC 6.0 for Data Dictionary. Thanks and regards, Atanu

  • 9.0.3 / BC4J / JSP /  Error: IMW-00008 ??

    Hello! During migrating from JDEV/BC4J 9.0.2 to 9.0.3.10.33 i get the following Exception (under 9.0.2 it works fine): I 'm executing "Commit" after updating the row in DataHandlerComponent.jsp. At this point, the exception is thrown. DataHandlerComp

  • Internet in Virtual box

    I am having windows xp as a guest in my virtual box. I am connected to internet in arch through bluetooth  by ppp method. using pon airtel command. So how can i access the internet in my vbox.

  • Conky and top reporting differently

    Here are some screen caps of conky and terminal running top command. The part I am interested in is the processes, one says 85 while the other says 105? I question this because when I had gnome-system-monitor installed it would always show gnome-keyr