Writing File into Application Server

Hello,
In one scenario i ve to upload a text file into the Application Server.
I know to upload the file through tcode CG3Z, but i have to upload the file through the code.
How to do that?
Please reply.
Regards,
Rahul

Hi Rahul,
Save the excel file as Tab delimited, and use the FM: GUI_UPLOAD.
DATA: i_file like rlgrap-filename value '/usr/sap/tmp/file.txt'.
DATA: begin of it_datatab occurs 0,
row(500) type c,
end of it_datatab.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = i_file
filetype = 'ASC'
has_field_separator = 'X'
TABLES
data_tab = it_datatab "ITBL_IN_RECORD[]
EXCEPTIONS
file_open_error = 1
OTHERS = 2.
Hope this helps you.
Regards,
Chandra Sekhar

Similar Messages

  • How to Post a file(Flat File ) into Application server of the XI(AL11)?

    How to Post a file(Flat File ) into Application server of the XI(AL11)?
    Best Regards,
    Jose

    Hi,
    1) goto SXDA_TOOLS Transaction code
    2) Provide the Following details
    Object Type : DXPROJECT
    Program Type: BAPI
    Program/Method: CREATE
    3) Click on Copy Button
    4) Select the Source as Presentation Server
         a) Select  the File where you saved in your Local machine
    5) Select the Target as Application server
         a) Check the check box Remote Server
         b) Select the File type as Physical
         c) In File name give /usr/sap/SSD/DVEBMGS00/work\Your file name (This the Server path                                                                               
    Where the file is going to save)
    6) Click on Continue
    Go to AL11 and check whether the File has been create in the following path  /usr/sap/SSD/DVEBMGS00/work
    Provide this path in the Communication channel path when you select the Transport Protocol as NFS and you place the file in AL11 directory.
    Regards
    Seshagiri

  • Write PDF file into application server.

    Hi Gurus,
    I have created a smartform and converted into PDF using function module as given below. Now I want to write this generated PDF file into application server. I am not generating any spool request too. How can I proceed from here?  Pls advice..
    CALL FUNCTION 'CONVERT_OTF_2_PDF'
        IMPORTING
          bin_filesize                 = lv_bin_filesize
        TABLES
          otf                              = ls_job_output_info-otfdata
          doctab_archive         = lt_docs
          lines                           = lt_lines
        EXCEPTIONS
          err_conv_not_possible  = 1
          err_otf_mc_noendmarker = 2
          OTHERS                 = 3.
    Thanks..
    Saj

    transfer all the data from ur itabs to one final itab declared as follow
    DATA: BEGIN OF final_itab OCCURS 0,
                     document  TYPE string,
               END OF final_itab.
    then finally,
    OPEN DATASET 'yourfile.pdf' FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
      len = strlen( final_itab-DOCUMENT ).
      TRANSFER final_itab-DOCUMENT  TO 'yourfile.pdf'  LENGTH len.
    CLOSE DATASET 'yourfile.pdf'.
    This ends the coding mate.
    Enjoy it n have a good day.
    Cheers

  • Special characters downloading file into application server

    Dear Friends,
    i have to download records into excel sheet through back ground job, while downloading records into applications server.
    all records are downloading properly up to here fine but some special characters also downloading. i had downloaded same records in debugging mode from the same internal table here no special characters.
    i found that the structure(standard ( /SCWM/S_LIME_ALL_MON )) which is being used in that some fields are defined as RAW data type this may be the problem.but i tried to convert them using some function modules no result getting dump only.
    i am using data sets to download data into application server here gui_download will not work because it is back ground job.
    can any one please help me in this. its urgent...
    please please help me in this it has been pending since DEC-01-11.
    extra characters like (  #v#M?LQia#####
    #v#M?LQia#####
    #v#)
    my code
      open DATASET LV_FLNAM for OUTPUT in LEGACY BINARY MODE .
      IF sy-subrc EQ C_ZERO.
        LOOP AT LT_TAB INTO WA_TAB.
          transfer WA_TAB to LV_FLNAM.
        ENDLOOP.
        CLOSE DATASET LV_FLNAM.
      ENDIF.
    Edited by: sairam.kusuma on Dec 16, 2011 6:26 AM
    Edited by: sairam.kusuma on Dec 16, 2011 6:38 AM
    Edited by: sairam.kusuma on Dec 16, 2011 6:39 AM

    TYPES:BEGIN OF ty_stru,
          LGTYP  TYPE /SCWM/LGTYP,
          LGPLA  TYPE /SCWM/LGPLA,
          MATNR  TYPE /SCWM/DE_MATNR,
          MAKTX  TYPE /SCWM/DE_UI_MAKTX,
          QUAN(13)  TYPE C,"/SCWM/DE_UI_QUAN,
          UNIT  TYPE /SCWM/DE_BASE_UOM,
          CAT  TYPE /SCWM/DE_CAT,
          CAT_TXT  TYPE /SCWM/DE_CAT_TXT,
          CHARG  TYPE /SCWM/DE_CHARG,
          OWNER  TYPE /LIME/OWNER,
          ENTITLED  TYPE /SCWM/DE_ENTITLED,
          UI_WDATT  TYPE /SCWM/DE_UI_WDATT,
          UI_WDATU  TYPE /SCWM/DE_UI_WDATU,
          SKZSI  TYPE /SCWM/LQUA_SKZSI,
          QUANA(13)  TYPE C,"/SCWM/DE_UI_QUAN_PACKED,
          ALTME  TYPE /SCWM/DE_AUNIT,
          ITMNO  TYPE /SCDL/DL_ITEMNO,
          WEIGHT(15)  TYPE C,"/SCWM/DE_NWEIGHT,
          UNIT_W  TYPE /SCWM/DE_WGT_UOM,
          VOLUM(15)  TYPE C,"/SCWM/DE_NVOLUME,
          UNIT_V  TYPE /SCWM/DE_VOL_UOM,
          CAPA(15)  TYPE C,"/SCWM/DE_CAPAUSE,
          SN_STOCK  TYPE /SCWM/DE_SER_STOCK,
          END OF ty_stru.
    DATA: LV_LGNUM TYPE /SCWM/LGNUM VALUE 'R10',
          LV_FLNAM TYPE rlgrap-filename VALUE '/tmp/RAMA.xls'.
    CONSTANTS: C_ZERO TYPE I VALUE '0'.
    DATA: LT_TAB TYPE STANDARD TABLE OF /SCWM/S_LIME_ALL_MON,
          WA_TAB TYPE /SCWM/S_LIME_ALL_MON,
          i_stru TYPE STANDARD TABLE OF ty_stru,"
          wa_stru TYPE ty_stru.
    REFRESH LT_TAB.
    CLEAR: WA_TAB.
    *this is modified function module from /SCWM/S_LIME_ALL_MON
    CALL FUNCTION 'ZEWM_F_PHYSICAL_INVENTORY_STOC'
      EXPORTING
        IV_LGNUM             = LV_LGNUM
      IV_VARIANT           =
      IV_MODE              = '1'
      IT_DATA_PARENT       =
      IMPORTING
        ET_DATA              = LT_TAB
      EV_RETURNCODE        =
      EV_VARIANT           =
    CHANGING
      CT_TAB_RANGE         =
    i have to download what are the fields defined as structure.
    1)when ever i am using the internal table(LT_TAB) to download getting specials characters(####) with all records for the fields QUAN, QUANA, WEGHT,VOLUM and CAPA.
    open DATASET LV_FLNAM for OUTPUT in LEGACY BINARY MODE .
    IF sy-subrc EQ C_ZERO.
      CLEAR: WA_stru,
             wa_tab.
      LOOP AT LT_TAB INTO WA_TAB.
        transfer WA_TAB to LV_FLNAM.
        CLEAR: WA_TAB.
      ENDLOOP.
      CLOSE DATASET LV_FLNAM.
    ENDIF.
    2)if i take another internal table with converting them as char file is downloading with out special characters but it is downloading single line only but not the hole data.
    if i have the below code getting only single line records not total records without special characters.
    open DATASET LV_FLNAM for OUTPUT in LEGACY BINARY MODE .
    IF sy-subrc EQ C_ZERO.
      CLEAR: WA_stru,
             wa_tab.
      LOOP AT LT_TAB INTO WA_TAB.
         wa_stru-LGTYP = wa_tab-LGTYP.
         wa_stru-LGPLA = wa_tab-LGPLA.
         wa_stru-MATNR = wa_tab-MATNR.
         wa_stru-MAKTX = wa_tab-MAKTX.
         wa_stru-QUAN = wa_tab-QUAN.
         wa_stru-UNIT = wa_tab-UNIT.
         wa_stru-CAT = wa_tab-CAT.
         wa_stru-CAT_TXT = wa_tab-CAT_TXT.
         wa_stru-CHARG = wa_tab-CHARG.
         wa_stru-OWNER = wa_tab-OWNER.
         wa_stru-ENTITLED = wa_tab-ENTITLED.
         wa_stru-UI_WDATT = wa_tab-UI_WDATT.
         wa_stru-UI_WDATU = wa_tab-UI_WDATU.     
         wa_stru-SKZSI = wa_tab-SKZSI.
         wa_stru-QUANA = wa_tab-QUANA.
         wa_stru-ALTME = wa_tab-ALTME.
         wa_stru-ITMNO = wa_tab-ITMNO.
         wa_stru-WEIGHT = wa_tab-WEIGHT.
         wa_stru-UNIT_W = wa_tab-UNIT_W.
         wa_stru-VOLUM = wa_tab-VOLUM.
         wa_stru-UNIT_V = wa_tab-UNIT_V.
         wa_stru-CAPA = wa_tab-CAPA.
         wa_stru-SN_STOCK = wa_tab-SN_STOCK.
        transfer WA_stru to LV_FLNAM.
        CLEAR: WA_stru.
      ENDLOOP.
      CLOSE DATASET LV_FLNAM.
    ENDIF.

  • Function Module for putting Flat File into Application Server

    Hi Pals,
         what is the   Function module for putting my flatfile into application server..
    because i dont have  authorizations to  put my flatfile  into application server directly..
    I know one function mudule is there for that ...so,  can you suggest me.. what is the function module... for that..
    thanks.. and points will be assigned..
    chitti

    Hi,
    well normally you use the method GUI_UPLOAD of class CL_GUI_FRONTEND_SERVICES to upload a file from your client pc. Then you use the abap statements open dataset, transfer and close dataset to put the file to the app-server.
    kind regards
    Siggi

  • Saving PDF file into application server

    Dear all,
    My requirement is retrieving a PDF file from application server and modifying the document and saving it back to the application server through BSP application.
    I've retrieved the data from the application server and displayed it in the frame of BSP layout and modified the same (adding signature). We got stuck in saving back the signed document into the application server.
    Can anyone guide me in saving back the modified document or how to get the modified file content through BSP.
    Regards
    Srini

    Hi Friend,
    Hope these  links will help you ,
    File Upload in BSP Applications and store in Application server
    Re: How to Upload .TXT, BITMAP, .PDF files into a Data base Table.
    Re: sapscript - pdf
    With Regards,
    SHARMILA BRINDHA.M

  • Move pdf file into application server

    Hi ABAP Gurus,
    i want your valuable help in solving my problem.
       i tried to create PDF file in application server and its creating as
    PDF file in Application server..but i am unable to see the content in text ,
    instead it is displaying in binary content...but when i tried to create
    in presentation server i am able to see it as text in PDF file....
    Can u please let me know whats wrong in my work and how to create a PDF file
    in Application server with text content
    with regards,
    Gowri.

    Hi Gowri,
    Check this example....
    report ztest.
    data: begin of itab occurs 0,
    field(256),
    end of itab.
    data: dsn(100) value '/usr/sap/xfr/FIS/testpdf',
    length like sy-tabix,
    lengthn like sy-tabix.
    call function 'GUI_UPLOAD'
    exporting
    filename = 'c:\temp\test.pdf'
    filetype = 'BIN'
    importing
    filelength = length
    tables
    data_tab = itab.
    open dataset dsn for output in binary mode.
    loop at itab.
    transfer itab-field to dsn.
    endloop.
    close dataset dsn.
    clear itab.
    refresh itab.
    *- To crosscheck if it went well
    open dataset dsn for input in binary mode.
    do.
    read dataset dsn into itab-field.
    if sy-subrc = 0.
    append itab.
    else.
    exit.
    endif.
    enddo.
    call function 'GUI_DOWNLOAD'
    exporting
    filename = 'c:\temp\testn.pdf'
    filetype = 'BIN'
    bin_filesize = length
    importing
    filelength = lengthn
    tables
    data_tab = itab.
    Or
    Use the TCode
    CG3Z or CG3Y
    for downloading to Application Server.
    Thanks,
    Reward If helpful.

  • Error when deploying war file into application server

    I wrote a web service in java using RAD and managed to check it using a web service client with no errors.
    However, after creating a war file and tried to deploy this into the Sun application server, the following can be seen at the application server console:
    Deploying application in domain failed; Error while running ejbc -- Fatal Error from EJB Compiler -- jaxrpc compilation exception ; requested operation cannot be completed Error while running ejbc -- Fatal Error from EJB Compiler -- jaxrpc compilation exception
    In the server.log file, the following appears:
    loyment|_ThreadID=13;|DPL5035:Error while running ejbc
    com.sun.enterprise.deployment.backend.IASDeploymentException: Fatal Error from EJB Compiler -- j axrpc compilation exception
    at com.sun.enterprise.webservice.codegen.JaxRpcRICodegen.accept(JaxRpcRICodegen.java:206 )
    at com.sun.enterprise.deployment.WebBundleDescriptor.visit(WebBundleDescriptor.java:1101 )
    at com.sun.enterprise.deployment.Application.visit(Application.java:1346)
    at com.sun.enterprise.webservice.codegen.JaxRpcRICodegen.run(JaxRpcRICodegen.java:103)
    at com.sun.ejb.codegen.IASEJBC.doCompile(IASEJBC.java:785)
    at com.sun.ejb.codegen.IASEJBC.ejbc(IASEJBC.java:563)
    at com.sun.enterprise.deployment.backend.EJBCompiler.preDeployModule(EJBCompiler.java:42 7)
    at com.sun.enterprise.deployment.backend.EJBCompiler.compile(EJBCompiler.java:213)
    at com.sun.enterprise.deployment.backend.ModuleDeployer.runEJBC(ModuleDeployer.java:967)
    at com.sun.enterprise.deployment.backend.WebModuleDeployer.deploy(WebModuleDeployer.java :193)
    at com.sun.enterprise.deployment.backend.ModuleDeployer.doRequestFinish(ModuleDeployer.j ava:140)
    at com.sun.enterprise.deployment.phasing.J2EECPhase.runPhase(J2EECPhase.java:146)
    at com.sun.enterprise.deployment.phasing.DeploymentPhase.executePhase(DeploymentPhase.ja va:71)
    at com.sun.enterprise.deployment.phasing.PEDeploymentService.executePhases(PEDeploymentS ervice.java:633)
    at com.sun.enterprise.deployment.phasing.PEDeploymentService.deploy(PEDeploymentService. java:188)
    at com.sun.enterprise.deployment.phasing.PEDeploymentService.deploy(PEDeploymentService. java:520)
    at com.sun.enterprise.management.deploy.DeployThread.deploy(DeployThread.java:143)
    at com.sun.enterprise.management.deploy.DeployThread.run(DeployThread.java:172)
    |#]
    [#|2007-11-14T11:21:10.083+0930|INFO|sun-appserver-ee8.1_02|javax.enterprise.system.tools.deploy ment|_ThreadID=13;|Total Deployment Time: 14145 msec, Total EJB Compiler Module Time: 0 msec, Po rtion spent EJB Compiling: 0%|#]
    [#|2007-11-14T11:21:10.116+0930|SEVERE|sun-appserver-ee8.1_02|javax.enterprise.system.tools.depl oyment|_ThreadID=13;|Exception occured in J2EEC Phase
    com.sun.enterprise.deployment.backend.IASDeploymentException: Error while running ejbc -- Fatal Error from EJB Compiler -- jaxrpc compilation exception
    at com.sun.enterprise.webservice.codegen.JaxRpcRICodegen.accept(JaxRpcRICodegen.java:206 )
    at com.sun.enterprise.deployment.WebBundleDescriptor.visit(WebBundleDescriptor.java:1101 )
    at com.sun.enterprise.deployment.Application.visit(Application.java:1346)
    at com.sun.enterprise.webservice.codegen.JaxRpcRICodegen.run(JaxRpcRICodegen.java:103)
    at com.sun.ejb.codegen.IASEJBC.doCompile(IASEJBC.java:785)
    at com.sun.ejb.codegen.IASEJBC.ejbc(IASEJBC.java:563)
    at com.sun.enterprise.deployment.backend.EJBCompiler.preDeployModule(EJBCompiler.java:42 7)
    at com.sun.enterprise.deployment.backend.EJBCompiler.compile(EJBCompiler.java:213)
    at com.sun.enterprise.deployment.backend.ModuleDeployer.runEJBC(ModuleDeployer.java:967)
    at com.sun.enterprise.deployment.backend.WebModuleDeployer.deploy(WebModuleDeployer.java :193)
    at com.sun.enterprise.deployment.backend.ModuleDeployer.doRequestFinish(ModuleDeployer.j ava:140)
    at com.sun.enterprise.deployment.phasing.J2EECPhase.runPhase(J2EECPhase.java:146)
    at com.sun.enterprise.deployment.phasing.DeploymentPhase.executePhase(DeploymentPhase.ja va:71)
    at com.sun.enterprise.deployment.phasing.PEDeploymentService.executePhases(PEDeploymentS ervice.java:633)
    at com.sun.enterprise.deployment.phasing.PEDeploymentService.deploy(PEDeploymentService. java:188)
    at com.sun.enterprise.deployment.phasing.PEDeploymentService.deploy(PEDeploymentService. java:520)
    at com.sun.enterprise.management.deploy.DeployThread.deploy(DeployThread.java:143)
    at com.sun.enterprise.management.deploy.DeployThread.run(DeployThread.java:172)
    |#]

    I got a similar error deploying to Weblogic with JBuilder 6 and it proved to be
    the Manifest.mf file inside war, which is very sensitive to CLASSPATH entry. Finally
    I used the file generated by JBuilder and it worked ...
    Stefan
    Frank Sun <[email protected]> wrote:
    Hi, this is Frank.
    I have a war file and want to deploy it. but somehow I got java.lang.StringIndexOutOfBoundsException:
    String index out of range: -1
    error
    Would anyone please help me?
    This war file is able to be deplyed using Tomcat 4.0.3.
    Please help.

  • Regarding writing file in application server with ISO8859 characters

    Hello Experts,
      I have a requirement that i need to write my file which read from the data base in ISO8859 characters in the application server.
    Is there any FM or any particular code conver normal data base data to ISO8859 characters ?
    Please give me some advise.
    Thanks,
    Suresh

    Hello Suresh,
    You DONOT have to do any conversion. You need to use the CODE PAGE addition with your OPEN DATASET stmt.
    Can you specify as to which Character Set you need to download? (e.g., Cyrillic, Greek, Polish etc)
    You can have a look into the SAP Note 73606 for details.
    BR,
    Suhas
    Edited by: Suhas Saha on Dec 19, 2008 7:27 AM

  • PDF file into application server

    Hi all,
    How to upload a PDF file into an application server.
    Urgent pls help.
    rgds
    Sarvana

    hi use this...,
    REPORT ZMN_PDF_UPLOAD.
    data: begin of itab occurs 0,
    field(256),
    end of itab.
    data: dsn(100) value '\usr\sap\DEV\DVEBMGS00\work\testpdf',
    length like sy-tabix,
    lengthn like sy-tabix.
    call function 'GUI_UPLOAD'
    exporting
    filename = 'c:\temp\test.pdf'
    filetype = 'BIN'
    importing
    filelength = length
    tables
    data_tab = itab.
    open dataset dsn for output in binary mode.
    loop at itab.
    transfer itab-field to dsn.
    endloop.
    close dataset dsn.
    clear itab.
    refresh itab.
    *To crosscheck if it went well
    open dataset dsn for input in binary mode.
    do.
    read dataset dsn into itab-field.
    if sy-subrc = 0.
    append itab.
    else.
    exit.
    endif.
    enddo.
    call function 'GUI_DOWNLOAD'
    exporting
    filename = 'c:\temp\testn.pdf'
    filetype = 'BIN'
    bin_filesize = length
    importing
    filelength = lengthn
    tables
    data_tab = itab.
    *Or
    *Use the TCode
    *CG3Z or CG3Y
    *for downloading to Application Server.
    regards,
    venkat.

  • About download the file into application server

    Hi,
    I have created the HR report for employee details like wbselement,manager details,
    department,desg,etc. and this output will be downloaded to application server.
    For this,am using open dataset and close dataset.
    what's my problem is ,  when i am trying to download the details in Appln server, it exceeds the maximum line size and some of fields are truncated. how to avoid this?
    Thankx,
    Sivasamy

    Hi,
    While you download the Sata into an application server, you can see upto 254 cahrecters only, you can not see more than then, but if you download the smae into an internal tabel then it will download all the data ...
    Regards
    Sudheer

  • BDC :  Uploading a file into Application Server(Data Set)

    Hi Peers,
    I have a requirement where in I have to upload all the data from an Internal table to an Dataset.For this I m using:
       OPEN DATASET p_ofile FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
        LOOP AT t_excel.
          TRANSFER t_excel TO p_ofile.
        ENDLOOP.
        CLOSE DATASET p_ofile.
    p_ofile is an .XLS file , t_excel is an Internal Table.
    When the data is update in the p_ofile the Format of the data is not proper everything is on the first column of .xls file.
    Could you please guide me in this regard.
    Thanks,
    Criag

    Hi Daniel
    You need to take other internal table with 2000 charecter length, then concatinate all the field to this Internla table with a Charecter return, so it will be displayed in teh excel sheet
    Here is the sample program
        LOOP AT it_headings_gro_plc.   " Your INternal table
    * Add tabs as the field separator, so that the file will be
    * downloaded to the excel format
          CONCATENATE
               it_headings_gro_plc-prod      " Product code
               it_headings_gro_plc-type      " Pre-format Type
               it_headings_gro_plc-group     " Pre-format Group Code
               it_headings_gro_plc-code      " Pre-format Code
               it_headings_gro_plc-party     " Party Name
               it_headings_gro_plc-acct      " Debit Acct No
               it_headings_gro_plc-name      " Chinese Name
               it_headings_gro_plc-addr1                        " Address 1
               it_headings_gro_plc-addr2                        " Address 2
               it_headings_gro_plc-addr3                        " Address 3
               it_headings_gro_plc-method    " Delivery method
               it_headings_gro_plc-trans     " Transaction cod e
               it_headings_gro_plc-banka     " Benficiary bank name
               it_headings_gro_plc-bankn     " Benficiary Count number
            INTO it_report_out_tab SEPARATED BY g_separator.   " G-Separator is the separator for the line feed,
    " Beforre this one   g_separator = cl_abap_char_utilities=>horizontal_tab.
          APPEND it_report_out_tab.    "New  2000 charecter Internal table
        ENDLOOP.

  • Downloading file to application server

    Hi,
    I have requirement of downlaoding some (.doc,.xls,.txt,.ppt) files into application server from sap r/3,the file will be picked by some other 3rd party application.
    I was able to achieve it using OPEN DATA SET and TRANSFER,but the data gets encrytped and the actual file is not copied to application server.(example if its .doc file the same file data should be copied to app server and not the encrypted file data like 5%%#.......6234726&&%212).
    The encrypted file again displays like exact file as its uploaded when downloaded from app server.
    But the file in app server is encrypted,my requirement is to copy the exact file to app server.
    This encryption is happening when is OPEN DATA SET and TRANSFER,even the FM ARCHIVFILE_CLIENT_TO_SERVER is also using  OPEN DATA SET and TRANSFER only.
    Please suggest me any other way to move file to app server other than OPEN DATA SET and TRANSFER.
    Thanks,
    Phani.

    Hi,
    If you are downloading the file from application server, you have to use OPEN DATASET CLOSE DATASET.
    I think you are making some mistake in your code.
    Refer to my code below and let me know if you have any doubt.
    *&      Form  APL_DOWNLOAD
          DOWNLOADING FILE TO APPLICATION SERVER.
    FORM apl_download .
      IF NOT i_output[] IS INITIAL.
    IF NOT p_pathdl is initial.
        IF v_flag <> c_chk.                          "IF search help was not called.
          CLEAR:     v_filename,
                        v_path.
    Building File Name.
          CONCATENATE c_mf018
                      v_date
                      v_time
                      c_extn
                 INTO v_filename.
    Conactenating File Name and File Path for Dataset parameter.
          CONCATENATE p_pathdl
                      c_slash
                      v_filename
                 INTO v_path.
        ELSE.                                        "IF search help was called.
          v_path = p_pathdl.
        ENDIF.
    Local Data Declaration.
        DATA v_string  TYPE string.
    Creating a file of given name at given path on apllication server.
        OPEN DATASET v_path FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
        IF sy-subrc = 0.
    Building header and transfering it to the file.
          CONCATENATE text-004 c_sep text-005 c_sep text-006 c_sep
                      text-007 c_sep text-008 c_sep text-009 c_sep
                      text-010 c_sep text-011 c_sep text-012 c_sep
                      text-013 c_sep text-014 c_sep text-015 c_sep
                 INTO v_string.
          TRANSFER v_string TO v_path.
          CLEAR v_string.
    Reading data from internal table & transfering to file.
          LOOP AT i_output INTO w_output.
            CONCATENATE w_output-lifnr      c_sep w_output-banksrec   c_sep
                        w_output-bankkrec   c_sep w_output-banknrec   c_sep
                        w_output-waers      c_sep w_output-bankssnd   c_sep
                        w_output-bankksnd   c_sep w_output-chainno    c_sep
                        w_output-chainbankt c_sep w_output-chainbanks c_sep
                        w_output-chainbankk c_sep w_output-chainbankn
                  INTO v_string.
            TRANSFER v_string TO v_path.
            CLEAR: v_string,
                   w_output.
          ENDLOOP.
        ELSE.
          MESSAGE i000 WITH text-040.
          EXIT.
        ENDIF.
        MESSAGE i000 WITH text-038 v_path.
      ELSE.
        MESSAGE i000 WITH text-048.
      ENDIF.
      ELSE.
        MESSAGE i000 WITH text-041.
      ENDIF.
    ENDFORM.                    " APL_DOWNLOAD

  • Placing the text file in application server

    Hi all,
    I am uploading the text file into application server.
    the line length is 1028 characters.But in application server i am not able to see whole line.it is showing only some data and reamaining data is not coming.
    Please let em know how can we increase the line length in application server.
    Regards,
    Shoban

    SE38 is the ABAP Editor transaction.
    Use function module ‘GUI_UPLOAD’ to create an upload the data. 
    *Use function module ‘GUI_UPLOAD’ to create an upload the data.
    Example Code >>>
    REPORT  zuploadtab                    .
    PARAMETERS: p_infile  LIKE rlgrap-filename
                            OBLIGATORY DEFAULT  '/usr/sap/'..
    *DATA: ld_file LIKE rlgrap-filename.
    DATA: gd_file type string.
    *Internal tabe to store upload data
    TYPES: BEGIN OF t_record,
        name1 LIKE pa0002-vorna,
        name2 LIKE pa0002-name2,
        age   TYPE i,
        END OF t_record.
    DATA: it_record TYPE STANDARD TABLE OF t_record INITIAL SIZE 0,
          wa_record TYPE t_record.
    *Internal table to upload data into
    DATA: BEGIN OF it_datatab OCCURS 0,
      row(500) TYPE c,
    END OF it_datatab.
    *Text version of data table
    TYPES: BEGIN OF t_uploadtxt,
      name1(10) TYPE c,
      name2(15) TYPE c,
      age(5)  TYPE c,
    END OF t_uploadtxt.
    DATA: wa_uploadtxt TYPE t_uploadtxt.
    *String value to data in initially.
    DATA: wa_string(255) TYPE c.
    CONSTANTS: con_tab TYPE x VALUE '09'.
    *If you have Unicode check active in program attributes then you will
    *need to declare constants as follows:
    *class cl_abap_char_utilities definition load.
    *constants:
       con_tab  type c value cl_abap_char_utilities=>HORIZONTAL_TAB.
    *AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_INFILE.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_infile.
      CALL FUNCTION 'WS_FILENAME_GET'
           EXPORTING
                def_filename     = p_infile
                mask             = ',*.txt.'
                mode             = 'O'
                title            = 'Upload File'(078)
           IMPORTING
                filename         = p_infile
           EXCEPTIONS
                inv_winsys       = 1
                no_batch         = 2
                selection_cancel = 3
                selection_error  = 4
                OTHERS           = 5.
    *START-OF-SELECTION
    START-OF-SELECTION.
      gd_file = p_infile.
      CALL FUNCTION 'GUI_UPLOAD'
        EXPORTING
          filename                = gd_file
          has_field_separator     = 'X'  "file is TAB delimited
        TABLES
          data_tab                = it_record
        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 NE 0.
          write: 'Error ', sy-subrc, 'returned from GUI_UPLOAD FM'.
          skip.
        endif.
    Alternative method, where by you split fields at each TAB after you
    have returned the data. No point unless you dont have access to
    GUI_UPLOAD but just included for information
    CALL FUNCTION 'GUI_UPLOAD'
          EXPORTING
               filename        = gd_file
               filetype        = 'ASC'
          TABLES
               data_tab        = it_datatab  "ITBL_IN_RECORD[]
          EXCEPTIONS
               file_open_error = 1
               OTHERS          = 2.
    IF sy-subrc NE 0.
    ELSE.
       LOOP AT it_datatab.
         CLEAR: wa_string, wa_uploadtxt.
         wa_string = it_datatab.
         SPLIT wa_string AT con_tab INTO wa_uploadtxt-name1
                                         wa_uploadtxt-name2
                                         wa_uploadtxt-age.
         MOVE-CORRESPONDING wa_uploadtxt TO wa_record.
         APPEND wa_record TO it_record.
       ENDLOOP.
    ENDIF.
    *END-OF-SELECTION
    END-OF-SELECTION.
    *!! Text data is now contained within the internal table IT_RECORD
    Display report data for illustration purposes
    LOOP AT it_record INTO wa_record.
      WRITE:/     sy-vline,
             (10) wa_record-name1, sy-vline,
             (10) wa_record-name2, sy-vline,
             (10) wa_record-age, sy-vline.
    ENDLOOP.
    Edited by: Nikhil Jathar on Jan 9, 2008 7:38 AM

  • File from Application server into BW

    Hi All,
    I have a urgent requirement and I do not know much of ABAP
    The requirement is
    selecting existing file from application server Dynamically in BW server. This will be done by writing an ABAP code at the InfoPackage level in the External Data Tab but I am in need some ABAP code for the same
    Also let me know which table stores AL11 files
    I know USER_DIR stores directories but I required the table for the files within the directories.
    Any help is appreciated

    Hi DPN,
    If we have a condition like depending on System Date we have to get a file some thing like that then we can do that by using the ABAP Routine. But in your Scenario there are no specific conditions to select a file.
    If we have some variable which stores the value which we give and gets the specified file... That Would be Great.
    But in Routine we can not use Variables..(As Far As I Know)
    So better Select manually every time...
    Hope This Helps.
    Regards,
    rik.

Maybe you are looking for

  • Can't Move files to iDisk on MacMini

    I'm trying to clear my mac mini hard disk by moving my movies to iDisk, and they seem to go up, but at the very end it says finishing up, but never finishes up. I can't get anything onto my iDisk. I'm copying big files and then pasting them to direct

  • EP 7 Portal stylesheet with WD ABAP

    We run a WD WD ABAP application and want to use the EP 7 stylesheet with the iView: - we use the WD iView - Stylesheet -> ur - Supply Portal Stylesheet -> yes a) What values are possible for stylesheet. "ur" does not mean anything to me. We have trie

  • Controlling brightness and contrast in DVD Player

    Is it possible to control the brightness and contrast in DVD player?

  • IOS 4.1 & Alpine Car Audio

    Hello, I have an Alpine CDE-113BT and yesterday I upgraded the iPhone to the 4.1, since I done it the car-audio doesn't recognize the iPhone and shows me this message 'Error 01'. Alpine refered to Apple to solve this issue. Thanks You

  • Font Capture: InDesign.exe - Entry Point Not Found

    I have had problems loading the CS5 suite with a network user using a mandatory profile. I have finally get InDesign working for the most part by renaming file extensions on certain plug-ins. However when I try to load the program there is still an e