How to upload excel file in Webdynpro application using ABAP

Hi Experts,
Am developing a webdynpro application in which it will take an excel file as input and display the contents in the form of a table in output. I am able to upload tab delimited text file and populate the table using the below code but not able to do the same with .xls file. Pls let me know if I need to use a different function module for upload excel file.
get single attribute
  wd_context->get_attribute(
    EXPORTING
      name =  `DATASOURCE`
    IMPORTING
      value = l_xstring ).
  CALL FUNCTION 'HR_KR_XSTRING_TO_STRING'
    EXPORTING
      in_xstring = l_xstring
    IMPORTING
      out_string = l_string.
  SPLIT l_string  AT cl_abap_char_utilities=>newline INTO TABLE i_data.
Bind With table Element.
  LOOP AT i_data INTO l_string.
    SPLIT l_string AT cl_abap_char_utilities=>horizontal_tab INTO TABLE fields.
    READ TABLE fields INTO lv_field INDEX 1.
    fs_table-name = lv_field.
    READ TABLE fields INTO lv_field INDEX 2.
    fs_table-age = lv_field.
    APPEND fs_table TO t_table1.
  ENDLOOP.
lo_nd_data = wd_context->get_child_node( 'DATA_TAB' ).
lo_nd_data->bind_table( T_TABLE1 ).
Thanks,
Subathra

Dear Exports
Can anyone guide me how to uplode the .xlsx or ..xls formatted excel file using abap webdynpro without converting it to .txt file. Because my client requirement is only to upload the excel file. because to convert the .xlsx flie to .txt file it will be time taking and cost expanssive. Another requirement is suppose today i have create a application for uploading a file which has 8 columns and 10 rows. suppose tomorrow the client will make some changes in that flat file means the client will add 2 extra columns and 10 more columns in that fil. and will upload that file. Then the new file will be display on the browser or old file. but my requirement is to display the new file in browser.
Can anyone kindly help to solve my problem. I am completely fresher in this field and I need to do it as soon as possible. Please help to solve the problem. 
Regards
Rashmita

Similar Messages

  • How to upload muliple files in webdynpro abap?

    dear team
    any one could you tell me how to upload multiple files in webdynpro  abap with detailed steps?
    and where & what code i have to write?
    kindly give me the solution for this problem
    regards
    sathya

    Please use the forum search!
    Thomas has made an excellent guide about exactly what you require:
    http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/109b9b52-bc00-2c10-8786-e4c5e96d7e04
    Cheers, Lukas

  • How to upload Excel file in BI using function module in abap program

    How to upload Excel file in BI using function module in abap program?

    Hi Anuj,
    To upload the file , you can try a standard program "RSEPSFTP" .
    while you execute the program , a selection screen appears in which the inputs should be give as
    RFC destination - The target server name
    FTP command- PUT
    local file - your file name
    local directory - path of your local file
    remote file - your target file name
    remote directory - where it has to be stored
    Hope this is useful for you
    Thanks & regards
    Anju

  • Help Required:How Upload Excel file Into Oracle Table Using PLSQL Procedure

    Please Help , Urgent Help Needed.
    Requirement is to Upload Excel file Into Oracle Table Using PLSQL Procedure/Package.
    Case's are :
    1. Excel File is On Users/ Client PC.
    2. Application is on Remote Server(Oracle Forms D2k).
    3. User Is Using Application Using Terminal Server LogIn.
    4. So If User Will Use to GET_FILE_NAME() function of D2K to Get Excel File , D2k Will Try to pick File from That Remote Server(Bcs User Logind from Terminal Server Option).
    5. Cannot Use Util_File Package Or Oracle Directory to Place That File on Server.
    6. we are Using Oracle 8.7
    So Need Some PL/SQL Package or Fuction/ Procedure to Upload Excel file on User's Pc to Oracle Table.
    Please Guide me wd some Code. or with Some Pl/SQL Package, or With SOme Hint. Or any Link ....
    Jus help to Sort This Issue ........
    you can also write me on :
    [email protected], [email protected]

    TEXT_IO is a PL/SQL package available only in Forms (you'll want to post in the Forms forum for more information). It is not available in a stored procedure in the database (where the equivalent package is UTL_FILE).
    If the Terminal Server machine and the database machine do not have access to the file system on the client machine, no application running on either machine will have access to the file. Barring exceptional setups (like the FTP server on the client machine), your applications are not going to have more access to the client machine than the operating system does.
    If you map the client drives from the Terminal Server box, there is the potential for your Forms application to access those files. If you want the files to be accessible to a stored procedure in the database, you'll need to move the files somewhere the database can access them.
    Justin

  • How to upload a file in BPEL Console Using JSP in JDeveloper, please help..

    Please I am new to Jdeveloper and to BPEL Process of OASuite,I want to know , how to upload a file in BPEL process using JSP in Jdeveloper IDE.
    The main aim is first we need to upload a file in JSP , it has to go to BPEL Process & it has to read the file & write the respective file in return to JSP through BPEL Process. Please I am in Urgent need of the Query , please help me ASAP.
    Send to me response Please.....................................

    Hi,
    I thin that you asked the same question before and I premember that I ointed you to the ADF BC developer guide and the SRDemo if your application uses JSF. For plain JSP - if you Google for: JSP and file upload then you find plenty of sources for JSP and Struts.
    The remaining part is how to stiff the file into a BPEL service on the middle tier. For this I recommended to ask your question on the BPEL forum
    BPEL
    Note that the BPEL integration would be easier if it was done on the middle tier and not onthe client
    Frank

  • How to upload a file in BPEL Console Using JSP in JDeveloper, pleae........

    I am very new to this JDeveloper & BPEl Process , please could some one help in ersolving my problem that is , how to upload a file in BPEL Console Using JSP in JDeveloper.

    Hi,
    ADF Faces provides you with the file upload component
    http://download-uk.oracle.com/docs/html/B25947_01/web_complex006.htm#CEGCEDHF
    http://download-uk.oracle.com/docs/html/B25947_01/appendixa007.htm#CHDEDCFA
    This gives you a handle to the file content. However, uploading files through a service is different and I suggest to consult teh BPEL forum for this BPEL
    Frank

  • How to build ear files for ADF application using Ant task

    How to build ear files for ADF applications using Ant. The ojdeploy ant task can not find application-level deployment profiles. I am trying to automated build and release for ADF application.
    Any help is highly appreciated.
    Thanks
    Shiva

    Hi Timo
    Thanks for your reply.
    I have successfully created ear file using ojdeploy on jenkins. however when am trying to auto deploy using WLDeploy ant task am getting the following
    error :
    weblogic.application.ModuleException: :oracle.mds.config.MDSConfigurationException:MDS-01335: namespace "/oracle/webcenter/quicklinks/scopedMD" mapped to metadata-store-usage "WebCenterFileMetadataStore" but its definition was not found in MDS configuration
    Please advise how to handle this.
    As am a newbie to ADF, could you please advise if it is possible for the ADF application deployments can be automated for different environments using jenkins due to this MDS dependencies.
    Appreciate your help.
    Thanks
    Shiva

  • How to upload multiple files in Webdynpro using File upload Screen Element

    Hi Experts,
          Can anybody tell me how to upload multiple files/pdfs in webdynpro using file upload screen element, and also please tell me what is the maximum storage limit of RAWSTRING data type,Advance Thanks.
    Regards,
    Sandesh

    Hi Sandesh,
    this is simply not supported, not in WebDynpro nor in standard HTML.
    A workaround is to upload a ZIP with all files and on server side unpack the ZIP and operate on the single files.
    I hope it will  help u..
    ----------------------OR-------------------------
    As you know using File upload UI element we can upload only one file at a time. There may be a scenario where user may want to upload any no of files at a time which is not determined at design time. This can be acheived using the ACF UpDownload UI element which requires a security whiltelist to be created
    http://scn.sap.com/docs/DOC-2270
    ----------------------OR-------------------------
    You can use Table UI element.
    Regards,
    Deepak Singh

  • How do upload a file to the application server into a directory?

    hi to all,
    i want to upload file into the database..i need upload the file into the application server and save it to a directory..is there any way?where i can read about this?any information?
    ashwiny

    Hello,
    First, we need to determine the terms we are using, in order to avoid confusion. We (including the documentation) are using "upload" to describe storing the file on the server, and "download" to pull it from the server into local machine.
    You can use the "File Browse" item to upload any file you need from your local machine and into a database table. The default APEX configuration (in the dads.conf file) stored the uploaded file in a table called wwv_flow_file_objects$. In your application, you can access this table using a view called APEX_APPLICATION_FILES.
    After you uploaded a file, any user can access it, using the download procedure described in the reference I gave you. The download procedure gives you an option to store the download file anywhere you need, using the "Open/Save" dialog box.
    I believe this is covering everything you need. If you still having problems, please consider posting the relevant application pages on apex.oracle.com. It will be easier to understand and help you.
    Regards,
    Arie.

  • Uploading excel file in Web Dynpro for ABAP

    Hello Gurus,
                       I need to upload a excel file in my Web Dynpro (ABAP) program. Can anyone please tell me how do i do this. Kindly help.
    Regards,
    Aditya.

    Hi Aditya,
    Please search the forum...
    Please check this link
    Uploading Data from Excel File To Dynpro
    Excel Upload via Web dynpro ABAP
    Upload and Reading Excel File in Web Dynpro
    Best regards,
    raam

  • How to upload excel file in application server??

    Hi,
    How to upload an excel file into internal table in background mode from application server?
    Thanks

    Hi vipin,
    check this it may help you...
    hope below links helps you
    Export the report list to Excel Sheet
    http://www.sapdevelopment.co.uk/file/file_updown.htm
    or below is a sample programme which helps you upload and download
    REPORT ytest5 LINE-SIZE 80
                    LINE-COUNT 65
                    NO STANDARD PAGE HEADING.
    TABLES: dd02l, dd03l.
    * selection screen
    SELECTION-SCREEN BEGIN OF BLOCK b00 WITH FRAME TITLE text-b00.
    SELECTION-SCREEN BEGIN OF BLOCK b01 WITH FRAME TITLE text-b01.
    PARAMETERS: tabname     LIKE dd02l-tabname OBLIGATORY.
    SELECTION-SCREEN END OF BLOCK b01.
    SELECTION-SCREEN BEGIN OF BLOCK b03 WITH FRAME TITLE text-b03.
    PARAMETERS: path(30)    TYPE c DEFAULT 'C:SAPWorkdir'.
    SELECTION-SCREEN END OF BLOCK b03.
    SELECTION-SCREEN BEGIN OF BLOCK b04 WITH FRAME TITLE text-b04.
    PARAMETERS: p_exp RADIOBUTTON GROUP radi,
                p_imp RADIOBUTTON GROUP radi,
                p_clear     AS CHECKBOX.
    SELECTION-SCREEN END OF BLOCK b04.
    SELECTION-SCREEN END OF BLOCK b00.
    * data
    DATA: q_return     LIKE syst-subrc,
          err_flag(1)  TYPE c,
          answer(1)    TYPE c,
          w_text1(62)  TYPE c,
          w_text2(40)  TYPE c,
          winfile(128) TYPE c,
          w_system(40) TYPE c,
          winsys(7)    TYPE c,
          zname(8)     TYPE c,
          w_line(80)   TYPE c.
    * internal tables
    DATA : BEGIN OF textpool_tab OCCURS 0.
            INCLUDE STRUCTURE textpool.
    DATA : END OF textpool_tab.
    * table for subroutine pool
    DATA : itab(80) OCCURS 0.
    * events
    INITIALIZATION.
      PERFORM check_system.
    AT SELECTION-SCREEN ON tabname.
      PERFORM check_table_exists.
    START-OF-SELECTION.
      PERFORM init_report_texts.
      PERFORM request_confirmation.
    END-OF-SELECTION.
      IF answer = 'J'.
        PERFORM execute_program_function.
      ENDIF.
    TOP-OF-PAGE.
      PERFORM process_top_of_page.
    * forms
    *       FORM CHECK_TABLE_EXISTS                                      *
    FORM check_table_exists.
      SELECT SINGLE * FROM dd02l
      INTO CORRESPONDING FIELDS OF dd02l
      WHERE tabname = tabname.
      CHECK syst-subrc NE 0.
      MESSAGE e402(mo) WITH tabname.
    ENDFORM.
    *       FORM INIT_REPORT_TEXTS                                        *
    FORM init_report_texts.
      READ TEXTPOOL syst-repid
      INTO textpool_tab LANGUAGE syst-langu.
      LOOP AT textpool_tab
      WHERE id EQ 'R' OR id EQ 'T'.
        REPLACE '&1............................'
        WITH tabname INTO textpool_tab-entry.
        MODIFY textpool_tab.
      ENDLOOP.
    ENDFORM.
    *       FORM REQUEST_CONFIRMATION                                     *
    FORM request_confirmation.
    * import selected, confirm action
      IF p_imp = 'X'.
    *   build message text for popup
        CONCATENATE 'Data for table'
                     tabname
                     'will be imported' INTO w_text1 SEPARATED BY space.
    *   check if delete existing selected, and change message text
        IF p_clear = ' '.
          w_text2 = 'and appended to the end of existing data'.
        ELSE.
          w_text2 = 'Existing Data will be deleted'.
        ENDIF.
        CALL FUNCTION 'POPUP_TO_CONFIRM_STEP'
             EXPORTING
                  defaultoption  = 'N'
                  textline1      = w_text1
                  textline2      = w_text2
                  titel          = 'Confirm Import of Data'
                  cancel_display = ' '
             IMPORTING
                  answer         = answer
             EXCEPTIONS
                  OTHERS         = 1.
      ELSE.
    *   export selected, set answer to yes so export can continue
        answer = 'J'.
      ENDIF.
    ENDFORM.
    *       FORM EXECUTE_PROGRAM_FUNCTION                                 *
    FORM execute_program_function.
      PERFORM build_file_name.
      CLEAR: q_return,err_flag.
      IF p_imp = 'X'.
        PERFORM check_file_exists.
        CHECK err_flag = ' '.
        PERFORM func_import.
      ELSE.
        PERFORM func_export.
      ENDIF.
    ENDFORM.
    *       FORM BUILD_FILE_NAME                                          *
    FORM build_file_name.
      MOVE path TO winfile.
      WRITE '' TO winfile+30.
      WRITE tabname TO winfile+31.
      WRITE '.TAB' TO winfile+61(4).
      CONDENSE winfile NO-GAPS.
    ENDFORM.
    *       FORM CHECK_FILE_EXISTS                                        *
    FORM check_file_exists.
      CALL FUNCTION 'WS_QUERY'
           EXPORTING
                filename = winfile
                query    = 'FE'
           IMPORTING
                return   = q_return
           EXCEPTIONS
                OTHERS   = 1.
      IF syst-subrc NE 0 OR q_return NE 1.
        err_flag = 'X'.
      ENDIF.
    ENDFORM.
    *     FORM func_export                                              *
    FORM func_export.
      CLEAR itab. REFRESH itab.
      APPEND 'PROGRAM SUBPOOL.' TO itab.
      APPEND 'FORM DOWNLOAD.' TO itab.
      APPEND 'DATA: BEGIN OF IT_TAB OCCURS 0.' TO itab.
      CONCATENATE 'INCLUDE STRUCTURE'
                  tabname
                  '.' INTO w_line SEPARATED BY space.
      APPEND w_line TO itab.
      APPEND 'DATA: END OF IT_TAB.' TO itab.
      CONCATENATE 'SELECT * FROM'
                  tabname
                  'INTO TABLE IT_TAB.' INTO w_line  SEPARATED BY space.
      APPEND w_line TO itab.
      APPEND 'CALL FUNCTION ''WS_DOWNLOAD''' TO itab.
      APPEND 'EXPORTING' TO itab.
      CONCATENATE 'filename = ' ''''
                  winfile '''' INTO w_line SEPARATED BY space.
      APPEND w_line TO itab.
      APPEND 'filetype = ''DAT''' TO itab.
      APPEND 'TABLES' TO itab.
      APPEND 'DATA_TAB = IT_TAB.' TO itab.
      APPEND 'DESCRIBE TABLE IT_TAB LINES sy-index.' TO itab.
      APPEND 'FORMAT COLOR COL_NORMAL INTENSIFIED OFF.' TO itab.
      APPEND 'WRITE: /1 syst-vline,' TO itab.
      APPEND '''EXPORT'',' TO itab.
      APPEND '15 ''data line(s) have been exported'',' TO itab.
      APPEND '68 syst-index,' TO itab.
      APPEND '80 syst-vline.' TO itab.
      APPEND 'ULINE.' TO itab.
      APPEND 'ENDFORM.' TO itab.
      GENERATE SUBROUTINE POOL itab NAME zname.
      PERFORM download IN PROGRAM (zname).
    ENDFORM.
    *       FORM func_import                                              *
    FORM func_import.
      CLEAR itab. REFRESH itab.
      APPEND 'PROGRAM SUBPOOL.' TO itab.
      APPEND 'FORM UPLOAD.' TO itab.
      APPEND 'DATA: BEGIN OF IT_TAB OCCURS 0.' TO itab.
      CONCATENATE 'INCLUDE STRUCTURE'
                  tabname
                  '.' INTO w_line SEPARATED BY space.
      APPEND w_line TO itab.
      APPEND 'DATA: END OF IT_TAB.' TO itab.
      APPEND 'DATA: BEGIN OF IT_TAB2 OCCURS 0.' TO itab.
      CONCATENATE 'INCLUDE STRUCTURE'
                  tabname
                  '.' INTO w_line SEPARATED BY space.
      APPEND w_line TO itab.
      APPEND 'DATA: END OF IT_TAB2.' TO itab.
      APPEND 'CALL FUNCTION ''WS_UPLOAD''' TO itab.
      APPEND 'EXPORTING' TO itab.
      CONCATENATE 'filename = ' ''''
                  winfile '''' INTO w_line SEPARATED BY space.
      APPEND w_line TO itab.
      APPEND 'filetype = ''DAT''' TO itab.
      APPEND 'TABLES' TO itab.
      APPEND 'DATA_TAB = IT_TAB.' TO itab.
      IF p_clear = 'X'.
        CONCATENATE 'SELECT * FROM'
                    tabname
                    'INTO TABLE IT_TAB2.' INTO w_line SEPARATED BY space.
        APPEND w_line TO itab.
        APPEND 'LOOP AT IT_TAB2.' TO itab.
        CONCATENATE 'DELETE'
                    tabname
                    'FROM IT_TAB2.' INTO w_line SEPARATED BY space.
        APPEND w_line TO itab.
        APPEND 'ENDLOOP.' TO itab.
        APPEND 'COMMIT WORK.' TO itab.
      ENDIF.
      APPEND 'LOOP AT IT_TAB.' TO itab.
      CONCATENATE 'MODIFY'
                  tabname
                  'FROM IT_TAB.' INTO w_line SEPARATED BY space.
      APPEND w_line TO itab.
      APPEND 'ENDLOOP.' TO itab.
      APPEND 'DESCRIBE TABLE IT_TAB LINES sy-index.' TO itab.
      APPEND 'FORMAT COLOR COL_NORMAL INTENSIFIED OFF.' TO itab.
      APPEND 'WRITE: /1 syst-vline,' TO itab.
      APPEND '''IMPORT'',' TO itab.
      APPEND '15 ''data line(s) have been imported'',' TO itab.
      APPEND '68 syst-index,' TO itab.
      APPEND '80 syst-vline.' TO itab.
      APPEND 'ULINE.' TO itab.
      APPEND 'ENDFORM.' TO itab.
      GENERATE SUBROUTINE POOL itab NAME zname.
      PERFORM upload IN PROGRAM (zname).
    ENDFORM.
    *       Form  CHECK_SYSTEM
    *            Check users workstation is running
    *            WINDOWS 95, or WINDOWS NT.
    *            OS/2 uses 8.3 file names which are no good for
    *            this application as filenames created are 30 char
    *            same as table name.
    *            You could change the logic to only use the first 8 chars
    *            of the table name for the filename, but you could possibly
    *            get problems if users had exported already with a table
    *            with the same first 8 chars.
    *            As an alternate method you could request the user to input
    *            the full path including filename and remove the logic to
    *            build the path using the table name.
    FORM check_system.
      CALL FUNCTION 'WS_QUERY'
           EXPORTING
                query  = 'WS'
           IMPORTING
                return = winsys.
      IF winsys NE 'WN32_95'.
        WRITE: 'Windows NT or Windows 95/98 is required'.
        EXIT.
      ENDIF.
    ENDFORM.                               " CHECK_SYSTEM
    *       FORM PROCESS_TOP_OF_PAGE                                      *
    FORM process_top_of_page.
      FORMAT COLOR COL_HEADING INTENSIFIED ON.
      ULINE.
      CONCATENATE syst-sysid
                  syst-saprl
                  syst-host INTO w_system SEPARATED BY space.
      WRITE : AT /1(syst-linsz) w_system CENTERED.
      WRITE : AT 1 syst-vline, syst-uname.
      syst-linsz = syst-linsz - 11.
      WRITE : AT syst-linsz syst-repid(008).
      syst-linsz = syst-linsz + 11.
      WRITE : AT syst-linsz syst-vline.
      LOOP AT textpool_tab WHERE id EQ 'R'.
        WRITE : AT /1(syst-linsz) textpool_tab-entry CENTERED.
      ENDLOOP.
      WRITE : AT 1 syst-vline, syst-datum.
      syst-linsz = syst-linsz - 11.
      WRITE : AT syst-linsz syst-tcode(004).
      syst-linsz = syst-linsz + 11.
      WRITE : AT syst-linsz syst-vline.
      LOOP AT textpool_tab WHERE id EQ 'T'.
        WRITE : AT /1(syst-linsz) textpool_tab-entry CENTERED.
      ENDLOOP.
      WRITE : AT 1 syst-vline, syst-uzeit.
      syst-linsz = syst-linsz - 11.
      WRITE : AT syst-linsz 'Page', syst-pagno.
      syst-linsz = syst-linsz + 11.
      WRITE : AT syst-linsz syst-vline.
      ULINE.
      FORMAT COLOR COL_HEADING INTENSIFIED OFF.
      LOOP AT textpool_tab WHERE id EQ 'H'.
        WRITE : AT /1(syst-linsz) textpool_tab-entry.
      ENDLOOP.
      ULINE.
    ENDFORM.
    if it helps you reward with points.
    regards,
    venu
    regards,
    venu.

  • How to read an excel file in webdynpro application

    Hello Experts,
    Can someone please tell me how to read an excel file in a webdynpro application?
    There is a tutorial for how to write contect into an excel, but i want to read the excel.
    Can someone help please !!
    Thanks and Kind regards,
    G.Singh.

    Hello Experts,
    I have done all the given above.
    I want to read a excel file from KM. My code is as below
    ResourceContext resourceContext = buildResourceContext();
    IResourceFactory resourceFactory = ResourceFactory.getInstance();
    RID pathRID = RID.getRID("/documents/ExcelReport.xls");     
    IResource resource =     resourceFactory.getResource(pathRID, resourceContext);
    Workbook wb = Workbook.getWorkbook(resource.getURI().getPath());
    Sheet sh = wb.getSheet(0);
    int columns = sh.getColumns();
    int rows = sh.getRows();
    wdComponentAPI.getMessageManager().reportSuccess(" Rows: " + rows);
    wdComponentAPI.getMessageManager().reportSuccess(" Columns: " + columns);
    This does not give me the excel file form the KM
    Can you please just what i can do at this point?
    Kind Regards,
    G Singh.

  • How to Upload Excel file to Application Server

    Hi Friends,
    ALSM_EXCEL_TO_INTERNAL_TABLE this F.M is to upload the excel format into internal table , The problem here is after uploading the excel file the format has been changed according to the F.M ... so Im not able to compare the value with my final internal table because the structure is different ... even if I could match with the values Im not able to  upload it to my application server ... is there any F.M which doesn't change the excel format and upload it to the internal table ? ... Or is there any other way of doing it other than using at new , case endcase. ? ...
    Thanks in advance ...
    Cheers

    Hi friend,
    Simply use GUI_UPLOAD function to get data from excel, txt etc.., into internal table in program.
    Try this program.. It performs downloading and uploading functions in both excel and .txt format.
    *& Report  ZAWI_DEMODOWNLOAD                                           *
    REPORT  zawi_demodownload                       .
    *Types
    TYPES: BEGIN OF g_r_mara,
           matnr LIKE mara-matnr,
           ersda LIKE mara-ersda,
           laeda LIKE mara-laeda,
           mtart LIKE mara-mtart,
           mbrsh LIKE mara-mbrsh,
           END OF g_r_mara.
    TYPES: BEGIN OF g_r_mara1,
           matnr TYPE string,
           ersda TYPE string,
           laeda TYPE string,
           mtart TYPE string,
           mbrsh TYPE string,
           END OF g_r_mara1.
    *Data
    DATA: g_t_mara TYPE TABLE OF g_r_mara,
          g_t_mara1 TYPE TABLE OF g_r_mara,
          g_t_mara2 TYPE TABLE OF g_r_mara1,
          filename TYPE string,
          f1 TYPE string,
          f2 TYPE string,
          x TYPE string,
          x1 TYPE string,
          x2 TYPE string,
          x3 TYPE strng,
          c TYPE string,
          g_r_wa TYPE g_r_mara,
          g_r_wa1 TYPE g_r_mara1,
          g_r_wa2 TYPE g_r_mara1,
         g_t_mara2 TYPE TABLE OF g_r_mara1,
          str TYPE string.
    *Tables
    TABLES: mara.
    *Selection Screen
    SELECT-OPTIONS: s_matnr FOR mara-matnr.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 10(20) text-001 FOR FIELD p1.
    PARAMETERS:p1 RADIOBUTTON GROUP g1.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 10(20) text-002 FOR FIELD p2.
    PARAMETERS p2 RADIOBUTTON GROUP g1.
    SELECTION-SCREEN END OF LINE.
    *Input validation.
    DATA: s_high TYPE mara-matnr,
          s_low TYPE mara-matnr.
    AT SELECTION-SCREEN ON s_matnr.
      IF NOT s_matnr-high IS INITIAL.
        s_high = s_matnr-high.
        SELECT SINGLE * FROM mara WHERE matnr = s_high.
        IF sy-subrc <> 0.
         IF NOT s_matnr-low IS INITIAL.
          s_low = s_matnr-low.
          SELECT SINGLE * FROM mara WHERE matnr = s_low.
          IF sy-subrc <> 0.
            MESSAGE e012(zawi_demo).
          ELSE.
            MESSAGE e011(zawi_demo).
          ENDIF.
        ENDIF.
      ENDIF.
    AT SELECTION-SCREEN.
      SELECT SINGLE * FROM mara WHERE matnr IN s_matnr.
      IF sy-subrc <> 0.
        IF s_matnr-low IS INITIAL.
          str = s_matnr-high.
        ELSE.
          str = s_matnr-low.
        ENDIF.
        MESSAGE e010(zawi_demo) WITH str..
      ENDIF.
    START-OF-SELECTION.
    *Data retrival
      SELECT matnr ersda laeda mtart mbrsh
        INTO  CORRESPONDING FIELDS OF TABLE g_t_mara
        FROM mara
        WHERE matnr IN s_matnr.
      IF p1 = 'X'.
        filename = 'C:\Testing.xls'.
       Downloading data from internal table to excel or txt
        f1 = filename.
        CALL FUNCTION 'GUI_DOWNLOAD'
          EXPORTING
            filename              = filename
            filetype              = 'ASC'
         append                = 'X'
            write_field_separator = 'X'
         col_select = 'X'
          TABLES
            data_tab              = g_t_mara.
      ELSE.
        filename = 'C:\Testing.txt'.
        f2 = filename.
        LOOP AT g_t_mara INTO g_r_wa.
          CONCATENATE g_r_wa-matnr ';'  INTO g_r_wa1-matnr.
          CONCATENATE g_r_wa-ersda ';'  INTO g_r_wa1-ersda.
          CONCATENATE g_r_wa-laeda ';'  INTO g_r_wa1-laeda.
          CONCATENATE g_r_wa-mtart ';'  INTO g_r_wa1-mtart.
          CONCATENATE g_r_wa-mbrsh ';'  INTO g_r_wa1-mbrsh.
          APPEND g_r_wa1 TO g_t_mara2.
        ENDLOOP.
        CALL FUNCTION 'GUI_DOWNLOAD'
          EXPORTING
            filename              = filename
            filetype              = 'ASC'
         append                = 'X'
         write_field_separator = 'X'
         col_select = 'X'
          TABLES
            data_tab              = g_t_mara2.
      ENDIF.
       Uploading data from excel to internal table 1
      IF filename = f1.
        CALL FUNCTION 'GUI_UPLOAD'
          EXPORTING
            filename            = filename
            filetype            = 'ASC'
            has_field_separator = 'X'
          TABLES
            data_tab            = g_t_mara1.
        WRITE: / 'Uploaded data' COLOR = 1.
        WRITE:/.
        CLEAR g_r_wa.
        LOOP AT g_t_mara1 INTO g_r_wa.
          WRITE:/ g_r_wa-matnr, g_r_wa-ersda, g_r_wa-laeda, g_r_wa-mtart, g_r_wa-mbrsh.
        ENDLOOP.
      ELSE.
        IF filename = f2.
                           IF sy-subrc <> 0.
                           ENDIF.
          CALL FUNCTION 'GUI_UPLOAD'
            EXPORTING
              filename            = filename
              filetype            = 'ASC'
              has_field_separator = 'X'
              replacement         = ''
            TABLES
              data_tab            = g_t_mara2.
          WRITE: / 'Uploaded data' COLOR = 1.
          WRITE:/.
          CLEAR g_r_wa1.
          LOOP AT g_t_mara2 INTO g_r_wa1.
            g_r_wa2-matnr = g_r_wa1-matnr.
            TRANSLATE g_r_wa2-matnr USING '; ' .
            WRITE:/ g_r_wa2-matnr, g_r_wa2-ersda, g_r_wa2-laeda, g_r_wa2-mtart, g_r_wa2-mbrsh.
            CLEAR g_r_wa2.
          ENDLOOP.
        ENDIF.
      ENDIF.
                                                                                    OR
    Use T-codes:
    CG3Y - Download file               - Download file from Application server
    CG3Z - Upload file                    - Upload file to Application server

  • How to upload company logo in webdynpro application

    Hi,
          I  need to upload the company logo in the View of a Webdynpro application.
    Can someone give me the steps for the same to be done?
    Thanks,
    Kundan

    Hi kundan,
    Store the images in the MIME Directory.
    -> Declare a simple type data type in the Java Dictionary.
    ->Give values and description in the enumeration type.
    -> Declare a value attribute of Simple type in View Controller.
    -> Add a image UI Element and bind it with two attributes(Ctx1 and Ctx2).
    Use the code below to get the name of image and further set it :
    String vehicleType = wdThis.wdGetContext().currentContextElement().getCtx1();
    wdThis.wdGetContext().currentContextElement().setCtx2(vehicleType+ ".jpg");
    Go through the [link|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/d0e599cc-2862-2b10-54a9-dcf1376b52d7]
    Regards,
    srikanth

  • How to Upload a File in Bpel Process using JSP

    I am trying to upload file in bpel process using front end as a Jsp.
    i create the jsp page and i am able to pass the value from jsp to bpel process.
    In bpel process i don't know how to pass or assign the specified file name into file adapter for reading the files.
    Please help me...
    Saravanan

    You don't assign the url of the file to it.
    To either get the data from the file into the bpel process you could use the url-parameter together with the ora:readFile function....or you could let your web-application upload the file to some location on the server...and on this location you could use the file-adapter together with the polling, to start your bpel process.

Maybe you are looking for

  • In the bookmarks toolbar, I want ONLY the icons, not words -- how do I do it?

    Once upon a time, there was a way to dump the description of the items in the bookmarks toolbar and leave ONLY the icons, but, when the mouse scrolls over them, the descriptors pup on. It is that way on my laptop, but, after a wipe are re-install of

  • K7D Master L & Promise FastTrak SX4000 boot hang

    I am having major trouble getting a Promise FastTrak SX4000 RAID controller to work with a K7D Master-L (MSI-6501-030). I would appreciate any and all input, especially from those of you who have similar or identical hardware (same motherboard/chipse

  • Upgrading from 10.2.8 to 10.4

    Hey, I'm trying to figure out if it is possible to upgrade my B&W PowerMac G3, 350MHZ, 384MB RAM, and 120HD to OSX 10.4. Also i would do 10.3, but there aren't that many big differences between 10.2 and 10.3. I know it is possible to have 10.3 on thi

  • IPad mini + cellphone capability

    Is there an app to use the device as a phone? It has to be. This device is perfect. A cellphone and a retina display would make this device "The only thing we need in the pocket".

  • Dynamic actions in infotypes

    Hi all, I am calling one infotype(i.e 22) three times in my infogroup but when i write a subroutine on this infotype, it doesn't get called more than once. I want my infotype to be called three times. Yogesh