Reading file in pattern from Application server

Hello Experts,
I want to search file from Application server.
I have certain pattern for the file. eg. OEDERS_.DAT or ORDERS_OPEN..
How can I search the file for pattern from the application server?
Ex.
Suppose my file name is ORDER_SENT.DAT, this file should be returned.
Suppose my file name is ORDER+SENT.DAT, this file should be returned with error.
Regards,
RH

The FM  EPS_GET_DIRECTORY_LISTING is not resulting result properly.
I have below files on server.
AMODPROT.PC1
AMODPROT.PC6
CMODACT.PC1
CMODACT.PC6
IMODPROT.PC1
IMODPROT.PC6
N070703.PC2
SAPRUPGM.PC6
TMS_TEST.PC1
TMS_TEST.PC2
TMS_TEST.PC6
UMODPROT.PC6
I use *.PC6 in mask parameter of FM  EPS_GET_DIRECTORY_LISTING , And it returned 0 files, where as there are 6 files.
Did I missed anything in mask parameter?
Regards,
RH

Similar Messages

  • Process for Flat file delta load from Application server to transactional??

    I want to do a flat file extraction in delta loads from application server and that should be loaded into a transactional cubes scheduling a process chain.
    Can any one help with ABAP code and step by step process for this?
    Thank you
    Devi

    Hi Devi,
    As per your explaination, you want to load a list of files from application server using process chain.
    You can do this with below steps.
    1) Create a Event and call event to run Process chain multiple times.
    2) Put all filenames in a file say, source-File
    3) Write a rooting to read filename from Source-File and trigger InfoPackage
    4) At the end of the process chain create new customized program which will delete first line from Source-File so that it will take next file in next run as well as delete currently loaded file. Once this is done trigger event again to start process chain again.
    Regards,
    Ganesh

  • How to upload a file in bdc  from application server

    how to upload a file in bdc  from application server

    Hi
    Check if this is useful and reward.
    PERFORM UNIX_UPLOAD.
    FORM unix_upload.
      DATA : lv_string(600) TYPE c.
      lv_string = p_fname. "p_fname is the filename  in path
    OPEN DATASET lv_string FOR INPUT IN TEXT MODE ENCODING DEFAULT.
      IF sy-subrc <> 0.
        MESSAGE 'File Not Found' TYPE 'I'.
        LEAVE PROGRAM.
      ENDIF.
      DO .
        READ DATASET lv_string INTO gs_gfile.
        IF sy-subrc NE 0 .
          EXIT.
        ENDIF.
        APPEND gs_gfile TO gt_gfile .
        CLEAR  gs_gfile .
      ENDDO.
      CLOSE DATASET lv_string.
      CLEAR lv_string.
      DATA: lc_split TYPE c VALUE cl_abap_char_utilities=>horizontal_tab.
      LOOP AT gt_gfile INTO gs_gfile .
        SPLIT gs_gfile AT lc_split INTO
                                       gs_ipfile-field1                           
                                       gs_ipfile-field2.
      ENDLOOP.
    ENDFORM.                    "unix_upload
    here gs_ipfile is the same structure as your input file to upload
    and
    gs_gfile is the work area of the internal table containing characters as :
    TYPES  : BEGIN OF  ygs_gfile    ,
              data(600)             ,
             END OF    ygs_gfile    .
    *Internal table declaration for input file as text
    gt_gfile   TYPE STANDARD TABLE OF ygs_gfile  INITIAL SIZE 0 ,
    *Work area declaration for input file
           gs_gfile   TYPE ygs_gfile                                   .
    Thanks and Regards
    A Swarna

  • Dynamic selection of file in infopackage from application server

    Hi,
    We have a infopackage in Process chain which runs daily. In the infopackage 'EXTRACTION' tab , input file is from application server. The file we get daily is not unique.
    As an example file name is not like 'UNIQUE.CSV' . It varies daily and carries a date and time stamp like UNIQUE_DATE_TIME.CSV
    I think we can have a routine to handle this. can someone help me with the routine/code?
    Thank you all.

    Hi,
    1. Create Two Floders in AL11 i.e. in Apllication Server. Eg Name it F1 and F2.
    2. First dump the .csv files into Folder F1 using some Programs or Manualy (Name xyz.csv).
    3. Then load the data using InfoPackage (here IN infoPackage, Extraction Tab you need to select Adapter = Load Text File from Application Server and then give the correct path from Folder F1), through PC.
    4. At the end of the load, attach a simple Program to Move the xyz.csv file from Folder F1 to Folder F2.
    5. So next day the file will come to Folder F1 and the it will loaded to Cube/DSO and at the end it will move to Folder F2.
    Else you can use simple one or two lines of UNIX/WINDOWS (depends on your OS) script to move the file from Folder F1 to Folder F2 , once you load is over.
    While moving the file from Folder F1 to Folder F2 you can append the date at the end of the file and then move to Folder F2, it is use full for future reference.
    See Blogs and Article, similar logic...
    https://wiki.sdn.sap.com/wiki/display/profile/Surendra+Reddy
    How to transfer the Data from SAP-System to Non-SAP system without additional Cost/License
    /people/surendrakumarreddy.koduru/blog/2009/03/11/how-to-transfer-the-data-from-sap-system-to-non-sap-system-without-additional-costlicense
    To Check the Files/Reports in Application Server and Trigger Mail Alerts.
    http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/4096bf2d-bcea-2b10-4ab4-e0683830d9b2&overridelayout=true
    1. Create Three Floders in AL11 i.e. in Apllication Server. Eg Name it F1, F2 and F3.
    2. First dump the .csv files into F1. (Name xyz.csv).
    3. Then using UNIX/WINDOWS (depends on your OS) script , first check the file is there are not in F1, if yes then rename the file with date and time or date and transfer the files from F1 to F2 i.e xyz06032010.csv.
    4. Then Create a small ABAP program to check the file in F2, if it is there then Trigger the Event, and using that event you execute teh PC.
    5. Then using UNIX/WINDOWS (depends on your OS) script , transfer the files from F2 to F3 i.e xyz06032010.csv.
    6. Next day morning F1 and F2 are empty and F3 is having the backup files.
    So use this method, I used the similar logic and it is working fine.
    Timinings are importent i.e what time you need to dump the fule in F1 and what time you need to run UNIX/WINDOWS (depends on your OS) script , transfer the files from F1 to F2 and what time UNIX/WINDOWS (depends on your OS) script , transfer the files from F2 to F3.
    Thanks
    Reddy

  • Displaying pdf files in Portal from application server.

    Hi,
    I have a requirement where i will give a link on the portal for Provident Fund related data. When the user clicks on the link, i have to retrieve his pdf file from the folder stored on the application server and display it in portal. Could you please tell me how to do it?
    Also can we use Knowledge Management for it? If yes, how to do it?

    Hi,
    This can be done by
    1. Store the pdfs in the server like userid.pdf. Or you can add the year also the the file name.  The files can be in the same appserver. No need for KM.
    2. Create a Webdynpro application where the WD automatically reads user ids of the person logged in (IUser).
    3. In the Webdynpro code create a LinkToURL element with the user id you got in step one. This will make sure that somebody cannot see others file.
    Regards
    Srini

  • File open error from Application Server

    Hello friends,
    I am able to open a file from the foreground mode.
    However when i run the program in background am unable to open it.
        OPEN DATASET fp_asfile FOR INPUT IN TEXT MODE ENCODING DEFAULT.
    I have alos tried to change the user with the back groung user ID. but it again failed.
    Can any one tell me why.
    Ster

    Hi,
    Ok..go to SM51 in your system...and then check how many application servers are there..
    if there are more than one..do the following..
    In the background mode...the program might be running in a different application server....than the one which you used in the your foreground session..
    check this..
    1)
    In your foreground session...go to system -> status...get the application server..
    2)
    when you define the job in SM36...there is a field in the initial screen.."Exec. Target"...which says in which application server you want to run this job...Give the application server that you got from step 1...Then release the job...now your program should work fine..
    Thanks,
    Naren

  • Validating file/folder path from application server.

    Hi All ,
    I have used the FM '/SAPDMC/LSM_F4_SERVER_FILE' to open F4 help for application server. Now I want to validate the folder or file returned by the FM.
    Can anyone help on this?
    Thanks
    Shilpa

    HI Shilpa,
    Us this  FM
    F4_DXFILENAME_TOPRECURSION
    Hope this will help you.
    Regards,
    Vijay

  • How to upload .CSV file from Application Server

    Hi Experts,
        How to upload .CSV file separated by ',' from Application server to an internal table.
    Invoice No,Cust No,Item Type,Invoice Date,days,Discount Amount,Gross Amount,Sales Amount,Customer Order No.,Group,Pay Terms
    546162,3233,1,9/4/2007,11,26.79,5358.75,5358.75,11264,HRS,11
    546163,2645,1,9/4/2007,11,3.07,305.25,305.25,10781,C,11
    Actually I read some already answered posts. But still I have some doubts.
    Can anybody please send me the code.
    Thanks in Advance.

    Hi Priya,
    Check this code
    Yhe logic used here is as follows,
    Get all the data into an internal table in the simple format ie: a row with one field contains an entire line
    After getting the data, we split each line of the table on every occurrence of the delimiter (comma in your case)
    Here, I have named the fields as field01, field02 etc, you could use your own names according to your requirement
    parameters: p_file(512).
      DATA : BEGIN OF ITAB OCCURS 0,
              COL1(1024) TYPE C,
             END OF ITAB,
             WA_ITAB LIKE LINE OF ITAB.
      DATA: BEGIN OF ITAB_2 OCCURS 0,
        FIELD01(256),
        FIELD02(256),
        FIELD03(256),
        FIELD04(256),
        FIELD05(256),
        FIELD06(256),
        FIELD07(256),
        FIELD08(256),
        FIELD09(256),
        FIELD10(256),
        FIELD11(256),
        FIELD12(256),
        FIELD13(256),
        FIELD14(256),
        FIELD15(256),
        FIELD16(256),
       END OF ITAB_2.
      DATA: WA_2 LIKE LINE OF ITAB_2.
        OPEN DATASET p_FILE FOR INPUT IN TEXT MODE ENCODING NON-UNICODE.
        IF SY-SUBRC = 8.
          WRITE:/ 'File' , p_FILE , 'cannot be opened'.
          LV_LEAVEPGM = 'X'.
          EXIT.
        ENDIF.
        WHILE SY-SUBRC <> 4.
          READ DATASET p_FILE INTO WA_ITAB.
          APPEND WA_ITAB TO ITAB.
        ENDWHILE.
        CLOSE DATASET p_FILE.
      LOOP AT ITAB INTO WA_ITAB.
        SPLIT WA_ITAB-COL1 AT ','    " where comma is ur demiliter
         INTO WA_2-FIELD01 WA_2-FIELD02 WA_2-FIELD03 WA_2-FIELD04
         WA_2-FIELD05 WA_2-FIELD06 WA_2-FIELD07 WA_2-FIELD08 WA_2-FIELD09
         WA_2-FIELD10 WA_2-FIELD11 WA_2-FIELD12 WA_2-FIELD13 WA_2-FIELD14
         WA_2-FIELD15 WA_2-FIELD16.
        APPEND WA_2 TO ITAB_2.
        CLEAR WA_2.
      ENDLOOP.
    Message was edited by:
            Kris Donald

  • Downloading more than 1 file from Application server

    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,
       hope this FM can help.
    PARAMETER: p_file           type pfeflnamel DEFAULT '/usr/sap/tmp'.
    data: begin of it_filedir occurs 10.
            include structure salfldir.
    data: end of it_filedir.
    START-OF-SELECTION.
    Get Current Directory Listing for OUT Dir
    call function 'RZL_READ_DIR_LOCAL'
           exporting
                name     = p_file
           tables
                file_tbl = it_filedir.
    List of files are contained within table it_filedir
      loop at it_filedir.
        write: / it_filedir-NAME.
      endloop.
    rgds
    Umakanth

  • Sending an Email by taking excel sheet from Application Server.

    Hi.
    I Searched in SDN related 'Sending an Email by taking excel sheet from Application Server'.
    But i didnt get. I got sending mails from local pc.
    Can some bdy provide me sample code how to send mail with an attachment. the attached file should get from Application Server
    Regards,
    Renu

    Hi,
    For writing data to app server from internal table:
    https://www.sdn.sap.com/irj/scn/wiki?path=/display/snippets/prog%252bon%252bopen%252bdataset%252binput
    https://www.sdn.sap.com/irj/scn/wiki?path=/display/snippets/prog%252bon%252bopen%252bdataset%252boutput
    Checkout this wiki for sending XL in mail attachment:
    https://www.sdn.sap.com/irj/scn/wiki?path=/display/snippets/multiple%252battachment%252bon%252be_mail
    Thanks,
    Krishna

  • File from application server -Read and process and delete the file .

    Hi All,
             I writing a ZEE program which will read the file from application server(file will be in text delimat format) and moving the data to internal table and uploadind data base.The part which iam facing problem is -
    > I hve read the file from application server like below ,
    OPEN DATASET ld_file FOR INPUT IN TEXT MODE ENCODING DEFAULT.
    IF sy-subrc NE 0.
    EXIT.
    ELSE.
      DO.
        CLEAR: wa_string, wa_uploadtxt.
        READ DATASET ld_file INTO wa_string.
        IF sy-subrc NE 0.
          EXIT.
        ELSE.
          SPLIT wa_string AT con_tab INTO wa_uploadtxt-name1
                                          wa_uploadtxt-name2
                                          wa_uploadtxt-age.
    Spliting part i having problem .i need to seperate each field which is seperate from tab delimite and pass it into respective fields of internal table .
    Second if another file come to the appicaltion server , wether my first file will be there ? or should i need to delete the first file after redaing how should i proceed further ?.
    Regards
    SRIRAM...
    THANKS In ADVANCE

    HI,
    1.
    OPEN DATASET ld_file FOR INPUT IN TEXT MODE ENCODING DEFAULT.
    IF sy-subrc NE 0.
    EXIT.
    ELSE.
    DO.
    CLEAR: wa_string, wa_uploadtxt.
    READ DATASET ld_file INTO wa_string.
    IF sy-subrc NE 0.
    EXIT.
    ELSE.
    SPLIT wa_string AT cl_abap_char_utilities=>horizontal_tab INTO wa_uploadtxt-name1
    wa_uploadtxt-name2
    wa_uploadtxt-age.
    APPEND  wa_uploadtxt TO itab.
    ENDDO.
    CLOSE DATASET ld_file.
    ENDIF.
    2. If the another file get's generated in the application server with same file name then the data in old file get's over written with the new data. You are not required to delete the file.

  • Regarding Reading the file from Application Server

    Hi,
    I am trying to read data from Application Server but due to special characters it is getting dumped out.
    US24,Q,Acero (Carbon),AA,0010,0001,01,Ver Mir para dimension#
    US24,Q,Acero (Carbon),AA,0010,0002,01,Area rectificada sin da#os ra
    US24,Q,Acero (Carbon),AA,0010,0003,01,Ver Mir para dimension#
    US24,Q,Acero (Carbon),CD,0010,0001,01,ITPE Soken para verificacion
    US24,Q,Acero (Carbon),CD,0010,0010,01,No se permite desprendimiento
    US24,Q,Acero (Carbon),CD,0010,0002,01,"Vernier, cinta metrica"#
    In the last line it is going into dump due to special character ".
    Please suggest.
    Thanks
    Priyanka.

    Hi,
    You can check the mode in which you are reading the file
    from application server that is
    Open Dataset in Binary or Text Mode.
    Hope it helps
    Regards
    Mansi

  • Unable to read file from application server

    Hi guys,
    I am reading file(could be any extension) from application server,but some time i am successfuly able to read file and sometime unable to read,why its happening .
    my code is here
    OPEN DATASET E_FILE FOR INPUT IN  BINARY MODE . "
      IF SY-SUBRC = 0.
        DO .
          READ DATASET E_FILE INTO GS_PDF_TAB.
          IF SY-SUBRC = 0.
            APPEND GS_PDF_TAB TO GT_PDF_TAB.
          ELSE.
            EXIT.
          ENDIF.
        ENDDO.
        CLOSE DATASET E_FILE.
      ENDIF.
    Thanks
    Ankur Sharma

    Hi,
    What actually happens?  Do you get a short dump?  Do you get a return code ne 0?  Does it run fine but you get no data in your table?
    We aren't mind-readers and can't help much without more information.
    Try using transaction AL11 to see if you access the files you are trying to open.
    Gareth.

  • Uploading and reading file from application server

    Hi
    My problem is when am uploading a file to application server it is getting stored in
    usr/sap/transyp1/prod/in   directory
    after that i want to read that file from application server to update database
    when  using below code it is showing some other directory in f4 help
    DATA: lv_hostname TYPE msxxlist-name.
    DATA: lv_server TYPE bank_dte_jc_servername.
    PARAMETERS: p_file TYPE rlgrap-filename.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
    CALL FUNCTION 'BANK_API_SYS_GET_CURR_SERVER'
    IMPORTING
    e_server = lv_server.
    lv_hostname = lv_server.
    CALL FUNCTION 'F4_DXFILENAME_4_DYNP'
    EXPORTING
    dynpfield_filename = 'P_FILE'
    dyname = sy-cprog
    dynumb = '1000'
    filetype = 'P'
    location = 'A'
    server = lv_hostname.
    experts could you please help me out
    Thanks & Regards
    Nagesh.Paruchuri

    User Transaction file. You will get all logical file path names.
    used following fucntion module to read file name and use command open dataset to read the file.
    CALL FUNCTION 'FILE_GET_NAME'
           EXPORTING
                CLIENT           = SY-MANDT
                LOGICAL_FILENAME = C_LOGICAL_FILENAME
                OPERATING_SYSTEM = SY-OPSYS
                PARAMETER_1      = P_IN_FILENAME
           IMPORTING
                FILE_NAME        = P_OUT_FILENAME
           EXCEPTIONS
                FILE_NOT_FOUND   = 1
                OTHERS           = 2.
    OPEN DATASET P_OPEN_FILE ENCODING UTF-8 IN TEXT MODE FOR OUTPUT.
      IF SY-SUBRC <> 0.
        MESSAGE E000(38) WITH 'Error in Opening file: ' V_PHY_FILENAME.
      ENDIF.

  • Reading tab delimited file from application server

    Hi All,
    I do know that we need to use Open data set to read a file from application server, but my question is when you use  read DATASET v_file into wa_final -  this wa_final is an work area and also i have mentione an internal table. so do we need to Split the record at tab into the corresponding fields. Append the records into an internal table i_input.????
    Please let me know on this....
    thanks in advance....
    Poonam....

    Hi,
    first see the file contents in application server, how the contents whether the contents seperated by any symbol or not, if the contents seperated by any symbol then you have to split the data before appending to internal table.
    check this code.
    DATA: l_data_string TYPE string.
      filename = p_file.
      OPEN DATASET p_file FOR INPUT IN TEXT MODE ENCODING DEFAULT.
      IF sy-subrc EQ 0.
        DO.
          READ DATASET filename INTO l_data_string.
          IF sy-subrc NE 0.
            EXIT.
          ENDIF.
          CLEAR k_input.
          SPLIT l_data_string AT '#' INTO k_input-agreement k_input-suffix k_input-status
                k_input-first_name k_input-last_name k_input-job_title k_input-tel k_input-fax k_input-email_address k_input-mob_number.
          APPEND k_input TO i_input.
        ENDDO.
      ENDIF.
    Regards,
    Venu

Maybe you are looking for

  • Planned Delivery Cost in MIRO for different freight vendor

    Hi, Kindly share, how to get rid of above issue: 1) PO created with a freight condition (FRA1 with a different vendor assigned to it under item conditions tab) 2) GR done, & all accounting entries were OK, (including freight costs in FR1 or FR3) 3) w

  • /TMWFLOW/CMSCONF error

    Dear All Upon executing transaction /TMWFLOW/CMSCONF, I am encountering the following error: Runtime Errors         IMPORT_ALIGNMENT_MISMATCH                                                  Except.                CX_SY_IMPORT_MISMATCH_ERROR         

  • Loss of quality between iMovie '09 and iDVD

    Hi all, I'd like to have some advises to understand if what I'm doing is the right way to do or if there is a better/different solution. I'm working in a photo shop (not ADOBE Photoshop ... ;-)) and sometimes we are doing some "movies" from photos. I

  • Trouble with photoshop 7

    When trying to put pictures on a disc in photoshop 7 all I get is an error has occured with the following numbers, repult 13, command 81, sense 4, asc9,ascq 0. Is there anyone who can help in theis promblem I am lost and cannot seem to make anything

  • Determining the project architecture issue

    Hi, I have a architecture designing problem. First version: I had all the UI, Business manager and the persistence layer in the client side. So the UI came very heavy weight. Second version: I have the User Interface layer and Service Layer(will have