I am facing problem to get text file from application sever

Hi This is lokesh.
Actually my requirement is to craete sales orders by getting file from other server.for that i have used shell script to connect that server.Ok i am connecting to that different server(not sap server) successfully.
But my problem is getting text file from application SERVER.
That different server people will send the file name as 'DDHHMMSS' (Days,Hours,Minutes,Seconds).
Just suppose if they will send today means that file name will come as 20103025. and with in half an hour if they again send that file file means that file name as '20110025'.
like that file name is always varies.So how can i read that type of text files from the application server.
and one more thing that is there chance to read morethan one text file from application server.
Pls guide me if u know the solution.PLs this requirement is urgent.
Regards,
Lokeshgoud

Hi..,
<b>Just execute this program ... this is for the files received in JUST 3 MINS...</b>
change it according to your requirement !!
data time type sy-uzeit value '100000'. <i>"<<----start time</i>
data file(8) type c value '20'.
do 180 times. <i>" <<----- for 3 minutes</i>
add sy-index to time.
concatenate file time into file.
write / file.
OPEN DATASET FILE FOR INPUT IN TEXT MODE ENCODING DEFAULT.
IF SY-SUBRC EQ 0.
PERFORM READ_DATASET.
ENDIF.
file = '20'.
time = '100000'.
ENDDO.
<b>form read_dataset.
read the file here with the file name <b>FILE</b>.
endform.</b>
regards,
sai ramesh

Similar Messages

  • Download text file from application server to client server.

    Hi all,
    I am facing a format issue while downloading text file from application server to the client machine.
    The issue is that, say I have 6 to 10 lines in my text file in application server. but when i store it on the hard drive,
    it shoes all the data in a single line. Where as i need to download data in same format as in application server.
    Awaiting for your responses.
    Regards,
    Jose

    Hi,
    If we want to upload file data from the application server to the internal table, there is no function module or class static method which we can use, we must wirte the code by ourselves.
    1. For the file data which has no seperator between field columns.
    PARAMETERS p_file  TYPE dxfile-filename.
    START-OF-SELECTION.
    OPEN DATASET p_file IN TEXT MODE ENCODING DEFAULT FOR INPUT.
      DO.
        READ DATASET p_file INTO gds_data.
        IF sy-subrc <> 0.
          EXIT.
        ENDIF.
        APPEND gds_data TO gdt_data.
      ENDDO.
    CLOSE DATASET p_file.2. For the file data which has tab separator between field columns.
    DATA: gds_field_split type gts_data.
    FIELD-SYMBOLS: <fs_field> TYPE gts_data.
    PARAMETERS p_file  TYPE dxfile-filename.
    START-OF-SELECTION.
    OPEN DATASET prf_file IN TEXT MODE ENCODING DEFAULT FOR INPUT.
      DO.
        READ DATASET p_file INTO gds_field.
        SPLIT gds_field  AT cl_abap_char_utilities=>horizontal_tab
             INTO TABLE gdt_field_split.
       LOOP AT gdt_field_split  into gds_field_split.
           gdf_index = gdf_index + 1.
           ASSIGN COMPONENT gdf_index OF STRUCTURE
                 gds_data to <fs_field>.
          IF sy-subrc = 0.
              <fs_field> = gds_field_split.
          ENDIF.
       ENDLOOP.
        APPEND gds_data TO gdt_data.
      ENDDO.
    CLOSE DATASET p_file.
    Thanks & regards,
    ShreeMohan

  • Problem while dowloading the file from Application Server

    Dear Experts,
                 I am facing the Problem while downloading the file from Application server.
    We done the automatic function while saving the invoice, this will create an idoc, and this idoc is written in the Application Server.
    I am running the Transaction AL11 and select the record, and from menu --> List, i am downloading into TXT format.
    But for some segments, the length is long, and so the last 3 to 4 fields values are not appearing in the File. Even though i am unable to view the values in the file before downloading. But i can view in IDOC.
    Please help me to solve this issue.
    Thanks & Regards,
    Srini

    but our user will use the Txn. AL11 and they will download from there
    Educate the user On a serious note, tell him this is not how data from app server should be downloaded. You can ask him to talk to the basis team to provide him access to the app server folder where the file is being stored.
    I can set the Variant and put this in background, But always the file name will be change, Like we use Time stamp in the File name.
    You can't automate this process by scheduling in BG mode. This is because the in BG mode you can't dwld the file to presentation server.
    Hope i'm clear.
    BR,
    Suhas

  • Sending EMail "Text-File" from Application Server!

    Hi Experts,
    how can I sending a Text-File from Application Server via Email?
    Is there existing a Function Modul?
    With Kind regards
    Ersin
    Moderator message: sending emails = FAQ, please search before posting.
    Edited by: Thomas Zloch on Nov 25, 2010 4:23 PM

    STF (Search the forum)!  This type of question has been asked...and answered....many times.

  • Problem in creating text file from report file

    Hello Everybody...
    I have problem in creating text file.
    I had set System Parameter as below
    DESTYPE : File
    MODE : Character
    DESNAME : gayu.txt
    And ruler setting
    Units : Character Cells
    Character Cell Size : Horiziontal = 7
    Vertiacle =12
    GridSpacing : 1
    no of snap points per grid spacing : 1
    but when i run report it will give error
    "REP_1219 M_2 or R_2 has no size -- length or width zero"
    so is there any solution of that
    or another way to convert report into text file?....

    Hi Folks,
    Please don't go after that Error as its a very deceptive one. Please don't go for altering your design Or changing the size of items in your layout.
    Similar errors I have come across in reports. I think its due to file transfer type. You might have transferred the file in Binary and your File Mode I am seeing it as CHAR.
    This normally happens while making the Report Format as "Text". Either you change that format which I think is possible in your case as your basic requirement is making a report output of CHAR type.
    Please check for this error in Metalink and proceed accordingly. I could fix similar errors when I changed Format type to PDF(from text).
    Regards
    Shibu

  • Downloading file from Application Sever

    Hi Gurus,
    I have a requirement in which I have to execute my program once in every 15 minutes which will check if there are any files present in application server. Is so I have to retreive the files to SAP from Application server.
    Now I have couple of issues in doing so.
    1. How to find the number of files present in that directory?
    2. How to retreive more than 1 file at a time from the directory.
    Its bit urgent.
    Cheers,
    Naveen
    NOTE: Points will be awarded to every useful answer.

    Hi,
    You can use FM EPS_GET_DIRECTORY_LISTING to get all the files from application server in given directory.Then looping that table you can get data from file using open data set
    IF pa_adir+lw_len(1) NE c_fhash  .
          CONCATENATE pa_adir c_fhash  INTO pa_adir.
        ENDIF.                             " IF pa_adir+lw_len(1) NE c_fhash
        CLEAR w_dir.
        w_dir = pa_adir.
        lw_dirname = pa_adir.
        REFRESH:
          t_files_app.
    Getting all files in that directory with filter
        CALL FUNCTION 'EPS_GET_DIRECTORY_LISTING'
          EXPORTING
            dir_name               = lw_dirname
            file_mask              = w_filter
          TABLES
            dir_list               = t_files_app
          EXCEPTIONS
            invalid_eps_subdir     = 1
            sapgparam_failed       = 2
            build_directory_failed = 3
            no_authorization       = 4
            read_directory_failed  = 5
            too_many_read_errors   = 6
            empty_directory_list   = 7
            OTHERS                 = 8.
    Here lw_dirname is directory name
    and w_filter is filter for file types like *.txt
    and you will get all files in t-files_app
    Reward points if help ful

  • How to download a file from Application Sever to Client Workstation?

    Hi All,
    I know how to move a file from client workstation to Application server.
    How to download that uploaded file from Application file (AL11)  directory to local desktop?
    Regards,
    Arun.M.D

    Hi Arun,
    Goto AL11 - > click on the directory path and select your file  -open the file - > click on menu item List - >save/send -> file
    -> select the type of file.
    Or you can write a small abap code using DATASETS. If you require I will post the code.
    Hope it helps you.
    Regards,
    Rajani.

  • Problems loading a text-file from a shared NT network order

    Hi @ all,
    I try to upload a text file in MII that is destinated in a shared order in the NT file network.
    I used text_loader with URL FILE://SERVERNAME/SHARE/input.txt and I get the error message "connection refused" even if I use credentials with an authorised user.
    Do you have any idea why it does not work?
    Thanks in advance!
    Sebastian

    Hi,
    For this you need to use FTP Input Action. Put all the files(you want to upload to MII) are in shared network into your FTP server.
    Then use the FTP related actions in transaction. This is the best way.
    Also see the similar [Thread|Re: Saving a file to an external system from MII server] and [Help|http://help.sap.com/saphelp_mii121/helpdata/en/44/710ca09ea03abee10000000a155369/content.htm]
    Hope this helps you.
    -Suresh

  • FM to get the file from application server to presenatation server automati

    Hi!
    In my upload program I am egtting the error log file onmy application server directly. Is there a function module or a way that in my abap code I can mention to bring the file or transfer the file to the presentation server . As my program is been run in the back ground so I cannot directly get the file on the presenattion server, so I need to bring it back on teh presentation server back to see teh eror log.
    I would like my program to do the transfer in background itself so that I can see the error log on a daily basis from my local file .
    Thanks
    when 'X'.                      "X is application server
    *         TRANSLATE p_err USING '\/'." correct slash for unix
          open dataset p_err2 for output in text mode encoding default.
          if sy-subrc = 0.
            loop at t_err into s_nts.
              transfer s_nts to p_err2.
              if sy-subrc ne 0.
                message i010(ad) with p_err2 'Download Failed'.
              endif.
            endloop.
            close dataset p_err2.
          else.
                message i010(ad) with p_err 'dataset could not be found'.
            sy-subrc = -1.             "Maintain error condition
          endif.
    *        endif.
          when ' '.                      "Blank is presenation server
            translate p_err using '/\'."correct slash Dos file
            call function 'DOWNLOAD'
              EXPORTING
                filename = p_err
                filetype = 'ASC'   "FTYPE set to DAT in DATA seg
              TABLES
                data_tab = t_err.
            if sy-subrc ne 0.
              message i010(ad) with 'File ' p_err 'cannot be located.'.
              sy-subrc = -1.             "Maintain error condition
              exit.
            endif.
        endcase.
      ENDIF.
    Thanks

    SO , after reading all , I assume that there is no way in which when I run the background job and get a errro file on application server can be retrievd on my presenattion serevr during the background job run. I was thinking that theer might be a functionn module which will convert the application server file into presenttion server file during the program run in background and store it in the location provided.
    I was trying to use FM  CALL FUNCTION 'C13Z_APPL_TO_FRONT_END' and  CALL FUNCTION 'ARCHIVFILE_SERVER_TO_SERVER' but using teh first one asks for source file and destination file name during teh program run and as it runs in background it cannot be provided again and again and teh second one dosent seem to work.
    Thanks

  • Downloading a text file from application server

    Hi Freinds,
    I am genarating a text file in our application server (Folder /usr/sap/dbi/) I need to download this text file in my destop pc or some other windows server.
    What do I have to do? What is the procedure, Pls help.
    If someone have sample code, pls send.
    We are running SAP ECC5.0 on an iSeries (AS/400) Database DB2/400.
    Regards
    Thanura

    Hi,
    try this:
    REPORT ZGRO_TEST.
    DATA: DATEI_A(30) TYPE C VALUE '/tmp/matnr.txt'.
    DATA: DATEI_PC TYPE STRING VALUE 'C:\MATNR.TXT'.
    DATA: ITAB        TYPE TABLE OF MARA WITH HEADER LINE.
    START-OF-SELECTION.
      PERFORM DATEI_EINLESEN.
      PERFORM DATEI_DOWNLOAD.
    FORM DATEI_EINLESEN.
      OPEN DATASET DATEI_A FOR INPUT IN TEXT MODE.
      IF SY-SUBRC NE 0. STOP. ENDIF.
      DO.
        READ DATASET DATEI_A INTO ITAB.
        IF SY-SUBRC <> 0. EXIT. ENDIF.
        APPEND ITAB.
      ENDDO.
      CLOSE DATASET DATEI_A.
      IF SY-SUBRC NE 0. STOP. ENDIF.
    ENDFORM.                    "DATEI_EINLESEN
    FORM DATEI_DOWNLOAD.
    Datei downloaden
      CALL METHOD CL_GUI_FRONTEND_SERVICES=>GUI_DOWNLOAD
        EXPORTING
          FILENAME                = DATEI_PC
          FILETYPE                = 'ASC'
        CHANGING
          DATA_TAB                = ITAB[]
        EXCEPTIONS
          FILE_WRITE_ERROR        = 1
          NO_BATCH                = 2
          GUI_REFUSE_FILETRANSFER = 3
          INVALID_TYPE            = 4
          NO_AUTHORITY            = 5
          UNKNOWN_ERROR           = 6
          HEADER_NOT_ALLOWED      = 7
          SEPARATOR_NOT_ALLOWED   = 8
          FILESIZE_NOT_ALLOWED    = 9
          HEADER_TOO_LONG         = 10
          DP_ERROR_CREATE         = 11
          DP_ERROR_SEND           = 12
          DP_ERROR_WRITE          = 13
          UNKNOWN_DP_ERROR        = 14
          ACCESS_DENIED           = 15
          DP_OUT_OF_MEMORY        = 16
          DISK_FULL               = 17
          DP_TIMEOUT              = 18
          FILE_NOT_FOUND          = 19
          DATAPROVIDER_EXCEPTION  = 20
          CONTROL_FLUSH_ERROR     = 21
          NOT_SUPPORTED_BY_GUI    = 22
          ERROR_NO_GUI            = 23
          OTHERS                  = 24.
      IF SY-SUBRC NE 0. STOP. ENDIF.
    ENDFORM.                    "DATEI_DOWNLOAD
    Regards, Dieter

  • How to get text file from app server and process it.

    Hello experts,
    I created a test data based form my recording. Now, I do not know where can I find it.
    Also, I want to create a program that lets users input the file name in the input parameter
    (selection screen) and it would automatically process/split that file. Again, thank you guys
    and take care!

    hi viray,
    im sorry i thought it was reading from presentation server....:-)
    >>I want to create a program that lets users input the file name in the input parameter
    (selection screen)
    at selection-screen on value-request for p_file.
    perform file_help using p_file.
    form file_help  using  p_p_file.
    call function 'RZL_READ_DIR_LOCAL'
    exporting
    name = p_dir
    tables
    file_tbl = t_filetab
    EXCEPTIONS
    ARGUMENT_ERROR = 1
    NOT_FOUND = 2
    OTHERS = 3
    if sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    endif.
    endform.                    " file_help
    Splitting File and path.
    use the FM <b>SO_SPLIT_FILE_AND_PATH</b>
    hope this helps,
    do reward if it helps,
    priya.
    Message was edited by: Priya

  • Problem in uploading file from Application Server

    Hi everyone,
    i got a problem in uplaoding a file from application server.i am having two folder (one folder name is current and another one is processed)in application server. In current folder i am having N no of files.I want to upload all the files names into one internal table and i want to process one by one file.After processing each file the file should be moved to processed folder and the files should not exist in current folder.All these process must be done everyday.Please rectify my problem asap.

    Ramesh,
    Take authorization from basis guy.
    Use the below code to get the list of files from require directory
    *& Report  ZDIRFILES                                                   *
    REPORT  ZDIRFILES    .
    PARAMETER: p_fdir            type pfeflnamel DEFAULT '/usr/sap/tmp'.
    data: begin of it_filedir occurs 10.
            include structure salfldir.
    data: end of it_filedir.
    *START-OF-SELECTION
    START-OF-SELECTION.
    Get Current Directory Listing for OUT Dir
      call function 'RZL_READ_DIR_LOCAL'
           exporting
                name     = p_fdir
           tables
                file_tbl = it_filedir.
    Now in internal table "it_filedir"  will have all your files.
    For moving and deleting
    report zrich_0001.
    Parameters: d1 type localfile default '/usr/sap/TST/SYS/fld1/Data1.txt',
                d2 type localfile default '/usr/sap/TST/SYS/fld2/Data1.txt'.
    data: begin of itab occurs 0,
          rec(20) type c,
          end of itab.
    data: wa(20) type c.
    start-of-selection.
      open dataset d1 for input in text mode.
      if sy-subrc = 0.
        do.
          read dataset d1 into wa.
          if sy-subrc <> 0.
            exit.
          endif.
          itab-rec = wa.
          append itab.
        enddo.
      endif.
      close dataset d1.
      open dataset d2 for output in text mode.
      loop at itab.
        transfer itab to d2.
      endloop.
      close dataset d2.
      delete dataset d1.
    Check below FM if required
    To move the file to archive directoryuse FMs 'PFL_COPY_OS_FILE'
    To Delete 'EPS_DELETE_FILE'.
    Don't forgot to reward if useful

  • Problem in getting parameter value from selection screen in web dynpro abap

    Hi,
    I am facing problem in getting parameter value from selection screen.
    Please find my code below:
    DATA LT_PAR_ITEM TYPE IF_WD_SELECT_OPTIONS=>TT_SELECTION_SCREEN_ITEM.
    FIELD-SYMBOLS:<FS_PAR_ITEM> LIKE LINE OF LT_PAR_ITEM,
                                 <FS_OBJ_USAGE>    TYPE REF TO data.
      WD_THIS->M_HANDLER->GET_PARAMETER_FIELDS( IMPORTING ET_FIELDS = LT_PAR_ITEM ).
      LOOP AT LT_PAR_ITEM ASSIGNING <FS_PAR_ITEM>.
        CASE <FS_PAR_ITEM>-M_ID.
          WHEN `OBJ_USAGE`.
             ASSIGN <FS_PAR_ITEM>-M_VALUE->* TO <FS_OBJ_USAGE>.      
    [ Here, sy-subrc is 4,  <FS_OBJ_USAGE> is not assigning.]
        ENDCASE.
      ENDLOOP. 
    So, can any one solve this problem.
    Thanks in advance,
    Radhika

    Hi Radhika,
    Try using GET_RANGE_TABLE_OF_SEL_FIELD...
    Please Refer below code..
       DATA: NODE_FLIGHTS TYPE REF TO IF_WD_CONTEXT_NODE.
      DATA: RT_CARRID TYPE REF TO DATA.
      DATA: ISFLIGHT TYPE TABLE OF SFLIGHT.
      DATA: WSFLIGHT TYPE SFLIGHT.
      FIELD-SYMBOLS: <FS_CARRID> TYPE TABLE.
    Retrieve the data from the select option
      RT_CARRID = WD_THIS->M_HANDLER->GET_RANGE_TABLE_OF_SEL_FIELD( I_ID = 'S_CARR_ID' ).
    Assign it to a field symbol
      ASSIGN RT_CARRID->* TO <FS_CARRID>.
      CLEAR ISFLIGHT. REFRESH ISFLIGHT.
      SELECT * INTO CORRESPONDING FIELDS OF TABLE ISFLIGHT FROM SFLIGHT
                           WHERE CARRID IN <FS_CARRID>.
      NODE_FLIGHTS = WD_CONTEXT->GET_CHILD_NODE( NAME = `FLIGHTS` ).
      NODE_FLIGHTS->BIND_ELEMENTS( ISFLIGHT ).
    Thanks,
    Regards,
    Kiran

  • How to get files from application server

    Hi
    I got a requirement like i have some n number of file in application server at specified path now i want to get that files from application server to presentation server.
    Please help me out.
    Thanks in advance.
    Regards
    Krishna

    HI.
    Use this Unix script. Give IP and other details as ur requirment.
    Setup variables. #
    Input Directory > #
    Output Directory > #
    Source System > #
    Target System > #
    Files FTPed > lxxxxx* #
    set -x
    DATE="`date +%y%m%d%H%M%S`"
    FTP destination details.
    ftp_host=""
    ftp_user=" "
    ftp_pass="a"
    ftp_remote_dir=" "
    File path and names
    host_dir=""
    ftp_local_file="lxxxx"
    ftp_local_file_dir=" "
    ftp_arch_dir=" "
    ftp_output=" "
    FTP
    if -f $ftp_local_file_dir ; then
    ftp -i -n -d -v $ftp_host<<EOINPUT >$ftp_output
    user $ftp_user $ftp_pass
    cd $ftp_remote_dir
    lcd $host_dir
    mget $ftp_local_file
    bye
    EOINPUT
    mv $ftp_local_file_dir $ftp_arch_dir$ftp_remote_file_name
    else
    echo "ERROR: Local $ftp_local_file_dir does not exist.">>$ftp_output;
    fi
    exit;
    Edited by: Jay on Feb 14, 2008 5:36 PM

  • Facing Problem in getting WSRP folder inside Portal_Home/j2ee folder.

    Hi friends,
    Currently i am facing problem in getting "WSRP" folder inside Portal_Home/j2ee folder.Let me explain in detail.While installing oracle portal i tried to upgrade from 10.1.2 to 10.1.4.Where mura.bat was executed fine.I got the message that it was successfully executed.Generally after upgrading to 10.1.4 it will show new folder " WSRP" inside Portal_Home/j2ee folder. But this time everything was fine but it is not showing that WSRP folder where remaining folders such as Home,OC4J_Portal,OC4J_Wireless was there.Is there any problem in installation.But when i create provider it is showing WSRP option in drop down list.In my previous installation everything was fine.It was showing WSRP folder.But this time it was not showing .What may be the reason for this??
    Thanks in advance.,
    Bala S Murugan.,

    Hi,
    What NWDS are you using.
    This may occur due to version problem.
    You may trying to deploy the application that it build in  NW04s(IDE) and trying to run in NW04 portal.
    Can you give me your verisons
    Raghu

Maybe you are looking for

  • ICloud Not Syncing After IOS 8 Upgrade

    Is anyone else having trouble where nothing updates within iCloud. I make a calendar alteration or edit a numbers or pages file and it never uploads to iCloud. Or if you edit something on the iCloud website it never syncs down to my IOS devices.

  • I am having all these problems after webroot did a clean up of files; I was able to find the files; all are firefox files, how do I reinstall these files?

    I am having all these problems; yahoo is not the same, cannot do anything on facebook; I found the files that were "cleaned" and they were all firefox files, there are many more in que to be "cleaned" by webroot; how do I reinstall these files? How d

  • Bluetooth Keyboard  - Some key don't work

    Hi friends, I have a 2011 (intel based) 27'' iMac with the bluetooth keyboard. I have two non working keys (control and 1). There's a way to repair it? My iMac doesn't have warranty and I would like to repair it. What can I do?? Note: I remove the ke

  • IPhoto won't import jpeg photos from camera

    I've been using the same method to import photos from my camera to iPhoto '09 with no problem ever since we got this computer. All of the sudden, the photos will not import and the error message says the file format is unreadable. All photos have the

  • Will my 4-pin Firewire cable work?

    I've jsut bought a new iMac and want to transfer data from my old one. The old Mac is 24" Late 2006 model and has two different Firewire ports - I think one is 9 pin and the other 6 pin. The new iMac has the the smaller 6 pin port. I've just been to