How to upload a multistructured file in BDC program using gui_upload?

I want to upload a multistructured file in BDC program...in which some structures are repeating for multiple records..how to do this..
BP_GEN_DATA     FR0100270154                         FR12345678902
BP_PAYMENT     FR     0123456789     01234567890          
BP_UNLOAD     MARSEILLE     X     FR                    
BP_UNLOAD     PARIS          FR                         
Here BP_GEN_DATA is root structure and BP_UNLOAD is lower level structure which is repeating

Resolved

Similar Messages

  • To upload an excel file from front end using GUI_UPLOAD

    Hi All,
    Please give me the code to upload data from front end to internal table only using GUI_UPLOAD.
    Thanks,
    Kumar

    Check this program , reward points if helpful
    *& Report  ZEXCEL_UPLOAD                                               *
    report  ZEXCEL_UPLOAD    message-id ZMSG.
    tables :T001.
    data : begin of ITAB occurs 0,
          BUKRS like T001-BUKRS,
          BUTXT like T001-BUTXT,
          ORT01 like T001-ORT01,
          LAND1 like T001-LAND1,
          WAERS like T001-WAERS,
          end of ITAB.
    data : WA_T001_EXCEL like ITAB.
    data : IT_T001_EXCEL like standard table of WA_T001_EXCEL.
    data IT_TEXT like ITAB occurs 0 with header line.
    data : IT_RETURN  like standard table of ALSMEX_TABLINE,
           WA_RETURN like ALSMEX_TABLINE,
            WA_RETURNS like ALSMEX_TABLINE.
    data : V_FILE type STRING,V_MASK(10) type C.
    selection-screen  begin of block B1 with frame title TEXT-001.
    parameters P_FILE like RLGRAP-FILENAME .
    selection-screen end of block B1.
    selection-screen  begin of block B2 with frame title TEXT-002.
    parameter : R_TXT  radiobutton group G1 default 'X' user-command C1,
                R_EXCEL radiobutton group G1.
    selection-screen end of block B2.
    at selection-screen on value-request for P_FILE.
      if R_TXT = 'X'.
        V_MASK = '*TXT'.
      elseif R_EXCEL = 'X'.
        V_MASK = '*XLS'.
      endif.
      call function 'KD_GET_FILENAME_ON_F4'
        exporting
          PROGRAM_NAME  = SYST-REPID
          DYNPRO_NUMBER = SYST-DYNNR
          MASK          = V_MASK
        changing
          FILE_NAME     = P_FILE.
    at selection-screen.
      translate P_FILE to upper case.
      if R_TXT = 'X'.
        search P_FILE for '*TXT'.
        if SY-SUBRC <> 0.
          message E011.
        endif.
      endif.
      if R_EXCEL = 'X'.
        search P_FILE for '*XLS'.
        if SY-SUBRC <> 0.
          message E012.
        endif.
      endif.
    start-of-selection.
      V_FILE = P_FILE.
      if R_TXT = 'X'.
        call function 'GUI_UPLOAD'
          exporting
            FILENAME            = V_FILE
            FILETYPE            = 'ASC'
            HAS_FIELD_SEPARATOR = 'X'
          tables
            DATA_TAB            = IT_TEXT.
        if SY-SUBRC eq 0.
          message I013 with V_FILE.
          loop at IT_TEXT .
        write :/ IT_TEXT-BUKRS color 4, IT_TEXT-BUTXT color 3,IT_TEXT-ORT01
        color 5,
        IT_TEXT-LAND1 color 2,IT_TEXT-WAERS color 1.
          endloop.
        endif.
      elseif R_EXCEL = 'X'.
        call function 'ALSM_EXCEL_TO_INTERNAL_TABLE'
          exporting
            FILENAME    = P_FILE
            I_BEGIN_COL = 1
            I_BEGIN_ROW = 1
            I_END_COL   = 4
            I_END_ROW   = 2
          tables
            INTERN      = IT_RETURN.
        if SY-SUBRC eq 0.
          message I014 with P_FILE.
          sort IT_RETURN by ROW COL.
          loop at IT_RETURN into WA_RETURNS.
            WA_RETURN = WA_RETURNS.
            case WA_RETURN-COL.
              when 1.
                WA_T001_EXCEL-BUKRS = WA_RETURN-VALUE.
              when 2.
                WA_T001_EXCEL-BUTXT = WA_RETURN-VALUE.
              when 3.
                WA_T001_EXCEL-ORT01 = WA_RETURN-VALUE.
              when 4.
                WA_T001_EXCEL-LAND1 = WA_RETURN-VALUE.
            endcase.
            at end of ROW.
              append WA_T001_EXCEL to IT_T001_EXCEL.
              clear : WA_RETURN, WA_T001_EXCEL.
            endat.
          endloop.
        endif.
        loop at IT_T001_EXCEL into WA_T001_EXCEL.
          write :/ WA_T001_EXCEL-BUKRS color 1, WA_T001_EXCEL-BUTXT color 2,
                   WA_T001_EXCEL-ORT01 color 3,WA_T001_EXCEL-LAND1 color 4.
        endloop.
      endif.

  • How to Upload a PDF file into BLOB column in a table using Forms 9i

    Can anyone tell me how to upload a PDF file from client system using File dialog window and store its content in BLOB column in a table. The file to be uploaded will be in client side.

    Hi,
    please, search a bit on the forum before do a question:
    Just searching by "upload blob pdf" ...
    How to batch upload PDF files into database BLOB
    Regards,
    Jose.

  • To upload a PDF file in BLOB column using Oracle Forms 9i

    Can anyone tell me how to upload a PDF file from client system using File dialog window and store its content in BLOB column in a table. The file to be uploaded will be in client side.

    Take a look at the following :
    Re: Storing a PDF in a BLOB
    Re: Retrive Image from DB into Image_item
    although the threads above are reffered to images and word doc... the procedure/steps are the same....
    Greetings...
    Sim

  • How to upload normal excell file to ztable

    Hi All there,
    Can anybody tell me how to upload normal excell file to ztable directly.
    pl provide detail coding
    Regards
    Sagar

    Hi Sagar,
       first upload the excel data into your internal table using a FM than upload the data to your ZTABLE using BDC.
    parameters:
      p_file type rlgrap-filename          " File name
      data:
        lw_file  type string.              " File Path
    data:
      t_bdcdata type
       standard table
             of bdcdata,
      fs_bdcdata type bdcdata.             " Work area for bdcdata
    * Messages of call transaction
    data:
      t_messtab type
       standard table
             of bdcmsgcoll,
      fs_messtab type bdcmsgcoll.          " Work area for messtab
    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.
      lw_file = p_file.
      call function 'GUI_UPLOAD'
        exporting
          filename                    = lw_file
          filetype                    = 'ASC'
          has_field_separator         = 'X'
          dat_mode                    = 'X'
        tables
          data_tab                    = t_final_data
        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.                               " IF SY-SUBRC <> 0
      if t_final_data is initial.
        message 'File not found'(003) type 'E'.
      endif.                               " IF T_FINAL_DATA IS INITIAL
    end-of-selection.
      perform upload_0585_data_using_bdc.  " populate the bdcdata table using tcode SHDB
      call transaction 'PA30' using t_bdcdata
                               mode 'A'
                           messages into t_messtab.
    form upload_0585_data_using_bdc.
      loop at t_final_data into fs_final_data.
    perform bdc_field       using 'Q0585-ACNTR(07)'
                                   w_curr.
    perform bdc_field       using 'Q0585-ACOPC'
                                   lw_flag.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=UPD'.
    perform bdc_dynpro      using 'MP058500' '2000'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/EBCK'.
    perform bdc_dynpro      using 'SAPMP50A' '1000'.
    endloop.
    *        Start new screen                                              *
    form bdc_dynpro using program dynpro.
      clear fs_bdcdata.
      fs_bdcdata-program  = program.
      fs_bdcdata-dynpro   = dynpro.
      fs_bdcdata-dynbegin = 'X'.
      append fs_bdcdata to t_bdcdata.
    endform.                               " Form bdc_dynpro using program...
    *        Insert field                                                  *
    form bdc_field using fnam fval.
        clear fs_bdcdata.
        fs_bdcdata-fnam = fnam.
        fs_bdcdata-fval = fval.
        append fs_bdcdata to t_bdcdata.
    endform.                               " Form bdc_field using fnam fval
    With luck,
    Pritam.

  • How to upload a text file from a shared folder and provide an o/p

    how to upload a text file from a shared folder and provide an o/p  containing the details in each order in the text file

    Hi,
    Use <b>GUI_UPLOAD</b> to upload a text file from a shared folder.
    Use <b>GUI_DOWNLOAD</b> to download data in a file on the presentation server or use <b>OPEN DATASET, TRANSFER</b> and <b>CLOSE DATASET</b> statements to download data to the application server.
    Now, I hope the code for data fetching, if required, is already present in the report.
    Reward points if the answer is helpful.
    Regards,
    Mukul

  • How to upload an excel file using ABAP.

    Hi,
    Can anyone please help me in understanding how to upload an excel file using ABAP.
    Thanks!!

    http://diocio.wordpress.com/2007/02/12/sap-upload-excel-document-into-internal-table/
    check the link
    TYPES: Begin of t_record,
    name1 like itab-value,
    name2 like itab-value,
    age   like itab-value,
    End of t_record.
    DATA: it_record type standard table of t_record initial size 0,
    wa_record type t_record.
    DATA: gd_currentrow type i.
    *Selection Screen Declaration
    PARAMETER p_infile like rlgrap-filename.
    *START OF SELECTION
    call function ‘ALSM_EXCEL_TO_INTERNAL_TABLE’
    exporting
    filename                = p_infile
    i_begin_col             = ‘1&#8242;
    i_begin_row             = ‘2&#8242;  “Do not require headings
    i_end_col               = ‘14&#8242;
    i_end_row               = ‘31&#8242;
    tables
    intern                  = itab
    exceptions
    inconsistent_parameters = 1
    upload_ole              = 2
    others                  = 3.
    if sy-subrc <> 0.
    message e010(zz) with text-001. “Problem uploading Excel Spreadsheet
    endif.
    Sort table by rows and colums
    sort itab by row col.
    Get first row retrieved
    read table itab index 1.
    Set first row retrieved to current row
    gd_currentrow = itab-row.
    loop at itab.
      Reset values for next row
    if itab-row ne gd_currentrow.
    append wa_record to it_record.
    clear wa_record.
    gd_currentrow = itab-row.
    endif.
    case itab-col.
    when ‘0001&#8242;.                              “First name
    wa_record-name1 = itab-value.
    when ‘0002&#8242;.                              “Surname
    wa_record-name2 = itab-value.
    when ‘0003&#8242;.                              “Age
    wa_record-age   = itab-value.
    endcase.
    endloop.
    append wa_record to it_record.
    *!! Excel 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.

  • How to upload the pdf file to the next view?....urgent

    Hi Experts,
    I need to upload the pdf file( a interactive form ) using the fileupload element in the A_view and the pdf file can be displayed in the b_view.
    But I don't know how to complete the function?
    Action:
    0.  Create a adobe form (c_form)in the R/3 using sfp with a inputfield.
    1.  Create a adobe interactive form (A_interactive_form)in the view(display_view) of the WDA for abap.
    2.  Create a context attribute(upload) in the display_view.
    3.  Bind the c_form to the A_interactive_form, so that the data can be transfered to the c_form.
    4.  Bind the "pdfSourth" property to context attribute "upload" in the A_interactive_form.
    4.  Type code in the WDA for abap for setting data("old") to the context.
    5.  Active the WDA and run the WDA.
    6.  In the IE, the interactive form is displayed with the value "old" in the field. Save the pdf form as "test.pdf" and close the IE.
    7.  Open the test.pdf, and type the inputfield "new" in the form, and save the test.pdf.
    8.  Create a context node(Pdfsourth) in the component controller, and create a attribute("upload") that type is xstring in the Pdfsourth.
    9.  Create a view(C_view), mapping the context node(Pdfsourth) in the component controller.
    10. Create a fileupload element in the C_view, and the "data" property is binded the "upload" attribute in the context node(Pdfsourth).
    11. Create a button(Display_form) and create the action with the outplug for upload the pdf file(test.pdf).
    12. Change the window and set the C_view as default view, and set the Navigation link from the C_view to B_view.
    13. Type code in the wddoinit method in the display_view for transfering the test.pdf file.
    method WDDOINIT .
    DATA lo_componentcontroller TYPE REF TO ig_componentcontroller .
    DATA upload                 TYPE        xstring.
    lo_componentcontroller =   wd_this->get_componentcontroller_ctr( ).
      lo_componentcontroller->getupload(
        IMPORTING
          upload = upload                         " xstring
      DATA lo_nd_pdfsourch TYPE REF TO if_wd_context_node.
      DATA lo_el_pdfsourch TYPE REF TO if_wd_context_element.
      DATA ls_pdfsourch TYPE wd_this->element_pdfsourch.
    navigate from <CONTEXT> to <PDFSOURCH> via lead selection
      lo_nd_pdfsourch = wd_context->get_child_node( name = wd_this->wdctx_pdfsourch ).
    get element via lead selection
      lo_el_pdfsourch = lo_nd_pdfsourch->get_element(  ).
    get single attribute
      lo_el_pdfsourch->set_attribute(
        EXPORTING
          name =  `UPLOAD`
          value = upload ).
    endmethod.
    15. Active the WDA and run the WDA.
    In the fileupload of the C_view, I select the test.pdf from my local machine. and click the button(Display_form), the display_view is displayed with the A_interactive_form.
    But in the A_interactive_form, the value "old" is in the field in the form rather than "new".
    I hope to display the test.pdf in the A_interactive_form. I don't know how to change my code or configuration?
    Do you give some example or some hint for this problem ?
    Thanks & Regards,
    Tao

    Now, The problem has been solved.Thanks a lot.

  • How can i upload a image file to server by using jsp or servlet.

    Hi,
    I m gurumoorthy. how can i upload a image file to server by using jsp or servlet without using third party API. pls anyone send me atleast outline of the source code.
    Pls send me anyone.
    Regards,
    Gurumoorthy.

    I'm not an applet programmer so I can't give you much advice there.
    If you want to stream the file from the server before it's entirely uploaded, then I don't believe you can treat it like a normal file. If you're just wanting to throw it up there and then listen to it, then you can treat it like a normal file.
    But again, I'm not entirely certain. You might be able to stream the start of the file from the server while you're still uploading the end of it, but it probably depends on what method you're using to do the transfer.

  • Urgent : How to upload a tif file without using upload element

    could someone please tell me how to upload a tif file(any file) without using upload element. Function Module GUI_UPLOAD does not work. Please suggest. Appreciate your suggestions.

    Hello Suri,
    there's currently no way to achieve this.
    Best regards,
    Thomas

  • How to upload Unicode encoding files from web?

    Hi everyone,
    I do not manage to upload Unicode encoding CSV files from web. Currently I use class CL_HTMLB_MANAGER to upload file from web. It works fine with ANSI encoding files, but file content is not uploaded correctly with Unicode encoding files. Especially I get innumerable characters u201C#u201D throughout the string that contains the file content (For example instead of u201CSAP CATALOG CSV 2.0u201D I get u201CÿþS#A#P# #C#A#T#A#L#O#G# #C#S#V# #2#.#0#u201D).
    I did not find in forums a solution to my issue that is why I am now asking for your help.
    How can I upload Unicode encoding files from web? Do you know another way to upload file from web that is Unicode compatible?
    Remark: I tried to upload Unicode encoding files from SAP GUI using function module GUI_UPLOAD and upload is successful.
    Here is the code that I currently used.
    DATA:     lr_event_ex     TYPE REF TO if_htmlb_data,
               fileupload      TYPE REF TO cl_htmlb_fileupload,
               lr_upload_model TYPE REF TO /ccm/cl_bsp_upload_model,
               lr_error        TYPE REF TO /ccm/cx_file_upload.
    lr_event_ex =  cl_htmlb_manager=>get_event_ex( runtime->server->request ).
    IF lr_event_ex->event_name = 'fileUpload' AND lr_event_ex->event_type = 'upload'.
      fileupload ?= lr_event_ex.
      FREE lr_event_ex.
    * get the model
      lr_upload_model ?= me->get_model( model_id = 'mupl' ).
      IF NOT fileupload->file_name IS INITIAL.
    *   upload data
        TRY.
            CALL METHOD lr_upload_model->upload_data
              EXPORTING
                iv_file_name = fileupload->file_name
              CHANGING
                cv_xcontent  = fileupload->file_content.
          CATCH /ccm/cx_file_upload INTO lr_error.
        ENDTRY.
        FREE fileupload.
      ENDIF.
    ENDIF.
    Thank you in advance for helping me.
    Best regards,
    Vanessa

    Hi There,
    Please check the details for the same.
    Link: http://helpx.adobe.com/creative-cloud/help/sync-files.html#Sync or upload files
    Troubleshoot sync:     
    Error: "Unable to sync files"
    Creative Cloud File Sync | Known issues
    Thanks,
    Atul Saini

  • How to Upload a PDF file into BLOB column in a table using Forms 6i

    Can anyone tell me how to upload a PDF file from client and store its content in BLOB column in a table. The file will be genered using reports and win be stored in db.The file to be uploaded will be in client side.
    Thank´s.

    If you are using version 9 or 10 use webutil.... Look in webutil.pll.
    Use either one these two fuctions...
    FUNCTION Client_To_DB( clientFile       in VARCHAR2,
                             tableName        in VARCHAR2,
                             columnName       in VARCHAR2,
                             whereClause      in VARCHAR2,
                             asynchronous     in BOOLEAN default FALSE,
                             callbackTrigger  in VARCHAR2 default NULL) return BOOLEAN;
      FUNCTION Client_To_DB_With_Progress
                         (   clientFile       in VARCHAR2,
                             tableName        in VARCHAR2,
                             columnName       in VARCHAR2,
                             whereClause      in VARCHAR2,
                             progressTitle    in VARCHAR2,
                             progressSubTitle in VARCHAR2,
                             asynchronous     in BOOLEAN default FALSE,
                             callbackTrigger  in VARCHAR2 default NULL) return BOOLEAN;

  • How to upload a PDF file in iCloud

    Hi everybody,
    I would like to know how to upload a PDF file in iCloud. I want to share some PDF files with my iPhone, MacBook and iMac.
    Thank you a lot!

    Yes, but the problem is will iBooks remember where I left off in that pdf file? Unlikely since it was deleted.  Also, what is handy about the kindle app is once you delete it an icon appears in the app to show that this file is in the cloud. I guess for reading pdfs the kindle app is better.  I am not saying that the kindle app would be that great for other things but at least with syncing and such it's much better.  Well, iCloud is meant for other things.  It's fine because I'll just use it for those other things and stick to the kindle app for reading pdfs.  Well I use endnote for reading technical pdfs, I'm just talking about novels and such on the kindle app. 

  • How to upload a BLOB file from CMP Entity Beans

    Hi,
    I want to upload a .xls file as a BLOB using CMP. And also to get back the BLOB from the database through CMP. I am using oracle 8i DataBase and weblogic 8.1 server with weblogic workshop as IDE.
    I don't have any idea to save a file as BLOB.
    Could any one please help me to solve this as it is very urgent.
    regards
    KumudaRajarshi

    I would just put the .xls file into a byte array in a
    class that implements the serializable
    interface. This class then becomes a column in your
    database table(as a blob) represented by an
    attribute in your entity bean. On sun appserver7
    serializable is mapped to a blob column in the
    database by default. You don't have to deal with a
    blob at all in the code, just your
    serializable type. You may have to use a type 2
    driver to get it to work with files
    over 4 or 5k.
    See the appserver7 EJBdevguide, page 92 for details.could you descrbe the detail how to use the class to become the column as blob?
    is that any sample code can be provided?
    it's very urgent, please help..
    thanks

  • How to upload a XML file to Servlet

    Hi,
    I am new to Java, I have to upload an XML file to java/j2ee server. The web server running on the server is "Tomcat 4.1". My new requirement is I have to upload an "Input.XML" file, can you please tell me how to upload an XML file. If any samples appriciated very soon.
    Thanks & Regards,

    Hi!
    On the client side, the client's browser must support form-based upload. Most modern browsers do, but there's no guarantee. For example,
    <FORM ENCTYPE='multipart/form-data'
    method='POST' action='/myservlet'>
    <INPUT TYPE='file' NAME='mptest'>
    <INPUT TYPE='submit' VALUE='upload'>
    </FORM>
    The input type &quot;file&quot; brings up a button for a file select box on the browser together with a text field that takes the file name once selected. The servlet can use the GET method parameters to decide what to do with the upload while the POST body of the request contains the file data to parse.
    When the user clicks the "Upload" button, the client browser locates the local file and sends it using HTTP POST, encoded using the MIME-type multipart/form-data. When it reaches your servlet, your servlet must process the POST data in order to extract the encoded file. You can learn all about this format in RFC 1867.
    Unfortunately, there is no method in the Servlet API to do this. Fortunately, there are a number of libraries available that do. Some of these assume that you will be writing the file to disk; others return the data as an InputStream.
    You can see more things about Servlet on this website [http://pedrofao.blogspot.com|http://pedrofao.blogspot.com].

Maybe you are looking for

  • MIDI Banks and Apple Loops Trustworthy Downloads?

    I am currently attempting to locate and download MIDI banks and Apple Loops that I can use in the future, but I'm looking for a trustworthy site (a one stop shop if you will) to do this.  If we only have Garageband installed, and not Pro Logic or any

  • Can't install OracleXE on Windows 7

    Please, help me. I'm trying to install OracleXe on my workstation with Windows 7 32bit. Few minutes is OK, then computer begins to fail, there are black, white, with very big windows species of my desktop for along time. After all I can see message a

  • My iphone5 does not charge how can I fix it?

    My brother and I have the same phone both batteries ran out, when we got to charging it mine charged but his doesn't. We cleaned the small opening, where the charger goes in, and removed all the dust. The screen shows the little battery with a chargi

  • Has anyone heard of putting fibre optic camera into iphone4 to check for damage

    HHas anyone ever heard of using fibre optic camera to look inside iphone 4 for damage without taking the phone apart

  • Today's Date within Date Range

    I have a BeginDate and EndDate in a database.  I want to be able to list those records if todays date is within the date range of BeginDate and EndDate.  I am unsure of the coding on this.  Has anyone done this and can give me some help? Thanks.