Replace unix file and abap prog triggers

Hi All,
I had an ABAP program which is scheduled to reads a file at a unix directory.
But instead my program should get triggered when there is a Change to the existing file or a new file comes in in the unix directory.Is there any way to trigger?
Please provide your valuable suggestions , points will be granted for sure.
Thanks
Suman

Suman,
One approach would be to just regularly scan for your config file being modified
(just stat() and check st_mtime in unix) with date and timestamp... How often you want to check is up to you, but I wouldn't think more than once per minute would be necessary, unless you have some need to make changes instantly or something...
Another approach would be to use dnotify/inotify to have the kernel notify you when
the file changes...
Hope this helps
Cheers
Senthil

Similar Messages

  • Reading Data from Unix file and write into an Internal table

    Dear all,
                     I am having an requirement of reading data from unix file and write the same into an internal table..how to do that ...experts please help me in this regard.

    Hi,
    do like this
    PARAMETERS: p_unix LIKE rlgrap-filename OBLIGATORY.
    DATA: v_buffer(2047) TYPE c.
    DATA: BEGIN OF i_buffer OCCURS 0,
            line(2047) TYPE c,
    END OF i_buffer.
    * Open the unix file..
    OPEN DATASET p_unix FOR INPUT IN TEXT MODE.
    <b>IF sy-subrc NE 0.
    *** Error Message "Unable to open file.
    ELSE.</b>
       DO.
         CLEAR: v_buffer.
         READ DATASET p_unix INTO v_buffer.
         IF sy-subrc NE 0.
            EXIT.
         ENDIF.
         MOVE v_buffer TO i_buffer.
         APPEND i_buffer.
      ENDDO.
    ENDIF.
    CLOSE DATASET p_unix.
    <b>Reward points if it helps,</b>
    Satish

  • Write incorrect record to Unix file and not load to PSA

    Hi,
    Is there anyway to write an incorrect record to a file from the transfer rules, such as if the record is not found after a search through one of the master data table, it should not load to the PSA but write to a UNIX file? What would be the ABAP code?
    Thanks,
    Will

    Hi Will,
    Transfer rules are processed after data are loaded to PSA. So you can only avoid that records are updated to info providers and write them to a file on your application server.
    If you really want to manipulate records in PSA you need to load required data to PSA within a process chain and to add a report that deletes the records from PSA and writes them to a file.
    The steps are
    1. Transfer rules
         1.create a start routine
         2.load required masterdata to an internal table
         3.loop at datapak
         4.delete records according to conditions
         5.append records to an internal table
         6.load file from internal table
    2. PSA
         1..Create a report
         2. Load PSA request into an intenal table
         3.load required masterdata to an internal table
         4. loop at ‘internal’ PSA
         5 .delete records according to conditions
         6.append records to an internal table
         7.load file from internal table
    Hope this helps
    Joe

  • How to replace event file AND replace edits in timeline

    Is it possible to replace a video/file in an event, and in turn replace what it was used for in the timeline? For example, if I used some footage from an event and I cut i up 3 times in a project and added transitions and effects, is it possible to replace the file in the event with a new file (same length) and have the same cuts/transitions/effects applied to the new file in the timeline?
    I hope my question is clear. I've been trying to do this in the original media folder but with no luck.
    Thanks!

    Karsten Schlüter wrote:
    Jetemadi wrote:
    … , is it possible to replace the file in the event with a new file (same length) and have the same cuts/transitions/effects applied to the new file in the timeline?…
    hit cmd-c in the Project to copy the clip('s settings)
    select the new clip in the Event
    drag on old clip, select one of the replace-options
    select replaced clip, cmd-alt-v, apply effects/colors/…
    I would NEVER dare to 'fumble' with the internal file-structure of a data-base (=FCPX)
    Yeah I've learned that the hard way. I'll probably never do that again. Anyways, I didn't think about copying the clips settings. That definently works. I guess what I was looking for (or dreaming of) was some kind of automatic way. In After Effects and I believe premiere, you can right-click on a file in the "Event" folder and it will replace it the project as well automatically. I don't think anything like this exists for FCP however. I'm pretty sure the only way would to wait for apple to add something like this, or create some kind of script/plugin/automater. Any ideas?

  • What is difference between UNIX file and DOS file for SAX parser?

    i have the following XML file:
    <?xml version='1.0' encoding='utf-8'?>
    <root>
    <strTask><![CDATA[some
    data on
    multiple lines]]></strTask>
    </root>
    If i save it as Unix file, than SAX parser works correctly and characters() function works only once per strTask tag.
    But if i save the file in DOS mode, then SAX calls characters() function every time new line is encountered during the same strTask tag.
    what can be a clue?

    i have the following XML file:
    <?xml version='1.0' encoding='utf-8'?>
    <root>
    <strTask><![CDATA[some
    data on
    multiple lines]]></strTask>
    </root>
    If i save it as Unix file, than SAX parser works
    correctly and characters() function works only once
    per strTask tag.
    But if i save the file in DOS mode, then SAX calls
    characters() function every time new line is
    encountered during the same strTask tag.
    what can be a clue?

  • (newbie) Question about replacing .class files and web.xml file

    I'm new to servlets and I have two quick questions...
    Do I absolutely need a web.xml file to define all my servlets, or can I simply place .class files into the WEB-INF directory and expect them to run?
    If my application server (for example Tomcat) is running and I replace a servlet .class file, do I need to restart the server for the new .class file to take effect?
    ...or are both of these questions specific to the application server I'm using?

    Hi,
    From an article I read:
    With Tomcat 3.x, by default servlet container was set up to allow invoking a servet through a common mapping under the /servlet/ directory.
    A servlet could be accessed by simply using an url like this one:
    http://[domain]:[port]/[context]/servlet/[servlet full qualified name].
    The mapping was set inside the web application descriptor (web.xml), located under $TOMCAT_HOME/conf.
    With Tomcat 4.x the Jakarta developers have decided to stop allowing this by default. The <servlet-mapping> tag that sets this mapping up, has been commented inside the default web application descriptor (web.xml), located under $CATALINA_HOME/conf:
    <!-- The mapping for the invoker servlet -->
    <!--
    <servlet-mapping>
    <servlet-name>invoker</servlet-name>
    <url-pattern>/servlet/*</url-pattern>
    </servlet-mapping>
    -->
    A developer can simply map all the servlet inside the web application descriptor of its own web application (that is highly suggested), or simply uncomment that mapping (that is highly discouraged).
    It is important to notice that the /servlet/ isn't part of Servlet 2.3 specifications so there are no guarantee that the container will support that. So, if the developer decides to uncomment that mapping, the application will loose portabiliy.
    And declangallagher, I will use caution in future :-)

  • Replaced my files and have to re-link all files

    being new to iTunes I replaced all my mp3s to 1 locatioan AFTER I installed iTunes (and made my library). Now I have to re-link all files to the list in my library.
    Can I re-run the making of my library (search my computer for all mp3 files), so I don(t have to link over 400 files?

    Yes you can.
    - Delete all the song references within iTunes (not the PC song files)
    - Once your iTunes Library is blank: File=>Add Folder and select the main music folder on your PC
    - Repeat File=>Add Folder for other folders if you have them
    That should do it for you.

  • Replace excel file and close

    Does anyone know how to replace an existing excel file without having to open the excel program?
    I want to write data into the excel without having to open the excel program.
    Thank you
    -bm-

    Bus,
    You can also use the write to "spreadsheet file.vi" and set the append parameter to false. If you specify a file that already exists, a dialog box will appear asking if you want to overwrite. Saying yes will overwrite the file. This process will allow you to replace an excel file without ever having opened excel.
    Best Regards
    Chris C
    Applications Engineering
    National Instruments
    Chris Cilino
    National Instruments
    LabVIEW Product Marketing Manager
    Certified LabVIEW Architect

  • Does Time Machine replace changed files and delete old files?

    I haven't upgraded to Leopard yet, but my son is a NEW CONVERT to the Mac; has uses Dells for years. He has a new Macbook Pro with Leopard. I use SuperDuper! with my Tiger Mini Mac.
    I don't understand what Time Machine does. Does it continually update files on the target device, and if so how does it handle deleted and renamed files on the source device.
    Thanks.

    Time Machine takes a snapshot of the drive it is backing up every hour. If a file is new, renamed or modified since its last backup, Time Machine will make a physical copy of that file. To conserve drive space Time Machine will only make hard links back to its previously backed up files for files that exist on its source drive which remain unchanged. Hard links work in a somewhat similar fashion as aliases. If a file has been deleted Time Machine won't make a copy or hard link. You can read about how hard links work in Time Machine in this Ars Technica review.
    http://arstechnica.com/reviews/os/mac-os-x-10-5.ars/14
    If a file is not on the hard drive for over an hour and is deleted before Time Machine makes its hourly backup that file will not be in any of Time Machine's backups.
    Time Machine only retains the first hourly backup of the day as its daily backup. The other hourly backups get deleted in the course of the day. That means that to be retained in the daily backups a file must be on the hard drive for over a day or be physically present on the source drive for the first backup of the day.
    After a month, Time Machine retains the daily backup made on the same day of the week as the initial backup as its weekly backup. If a file is on the source drive for less than a week and is not in the daily backup retained as the weekly it will end up being deleted when Time Machine thins its daily backups.
    When the Time Machine volume fills up, Time Machine will start deleting its earliest backups to make room for new ones.

  • Variable Length Files and ABAP

    I have a comma delimited file that is of a variable length.
    The first 5 fields are fixed, but then I have a counter field and then 2 fields that repeat for each counter. 
    So if the counter field was 3, I’d have 6 additional fields, but if the counter was 5, I’d have 10 additional fields.
    The goal is to end up with 3 records (since the counter was 3) with the 5 fixed fields then the 2 fields respectively.
    Such as if it looks like this:
    Abc,abc,abc,abc,abc,003,1a,1b,2a,2b,3a,3c
    DCE,abc,abc,abc,abc,005,1a,1b,2a,2b,3a,3c,4a,4b,5a,5b
    I need it to look like this or at least be able to read it similar to this.
    Abc,abc,abc,abc,abc,003,1a,1b
    Abc,abc,abc,abc,abc,003,2a,2b,
    Abc,abc,abc,abc,abc,003,3a,3c
    DCE,abc,abc,abc,abc,005,1a,1b
    DCE,abc,abc,abc,abc,005,2a,2b
    DCE,abc,abc,abc,abc,005,3a,3c
    DCE,abc,abc,abc,abc,005,4a,4b
    DCE,abc,abc,abc,abc,005,5a,5b

    Hi,
      I guess rich has written more efficient program anyways this is what I could do.
    data : begin of i_line occurs 0,
            line(100),
            end of i_line.
    data : begin of i_format occurs 0,
            txt1(5),
            txt2(5),
            txt3(5),
            txt4(5),
            txt5(5),
            txt6(5),
            txt7(5),
            txt8(5),
            end of i_format.
       data : comma type c,
          off  TYPE i,
          moff TYPE i,
          mlen TYPE i,
          count type i,
          len(3),
          n type i.
    start-of-selection.
    i_line-line = 'Abc,abc,abc,abc,abc,003,1a,1b,2a,2b,3a,3c'.
    append i_line.
    clear i_line.
    i_line-line = 'DCE,abc,abc,abc,abc,005,1a,1b,2a,2b,3a,3c,4a,4b,5a,5b'.
    append i_line.
    clear i_line.
    comma = ','.
    loop at i_line.
    off = 0.
    count = 0.
    moff = 0.
    while count lt 5.
    count = count + 1.
    find comma in section OFFSET off OF
                    i_line-line
                    MATCH OFFSET moff
                    MATCH LENGTH mlen.
    if sy-subrc = 0.
    off = moff + mlen.
    write : / 'moff',moff,
              'mlen', mlen..
    endif.
    endwhile.
    moff = moff + 1.
    write : i_line-line+moff(3) to len no-zero.
    write :/ 'The len is ', len.
    i_format-txt1 = i_line+0(3).
    i_format-txt2 = i_line+4(3).
    i_format-txt3 = i_line+8(3).
    i_format-txt4 = i_line+12(3).
    i_format-txt5 = i_line+16(3).
    i_format-txt6 = i_line+20(3).
    n = 24.
    do len times.
    i_format-txt7 = i_line+n(2).
    n = n + 3.
    i_format-txt8 = i_line+n(2).
    n = n + 3.
    append i_format.
    enddo.
    endloop.
    loop at i_format.
    write :/ i_format.
    endloop.
    end-of-selection.
    Regards
    Vick

  • Transforming XML File to abap structure

    Hello,
    I am working in a new project for making an input interface.
    The problem to resolv is :
    1>Reading an XML file on a unix Server
    2>Transforming this file in abap structure with the instruction
    call transformation.
    Format of the input file :
    <LISTEART>
    <ART code="A01" label="Designation A01"/>
    <ART code="A02" label="Designation A02"/>
    <ART code="A03" label="Designation A03"/>
    <ART code="A04" label="Designation A04"/>
    <ART code="A05" label="Designation A05"/>
    </LISTEART>
    Format of the abap structure :
    DATA : BEGIN OF ws_art,
      code(4)      TYPE c,
      label(3)  TYPE c,
    END OF ws_art.
    DATA : wt_art LIKE ws_art OCCURS 0 WITH HEADER LINE.
    is it possible to transform the input file to an internal table
    with the call transformation ?
    CALL TRANSFORMATION transfo
       SOURCE XML xml_string
       RESULT para = result.
    Somebody can explain me how to create links between xml file
    and abap structure ?
    with regards 
    JLuc Ledoux
    [email protected]

    Hi,
    try like this.
    TYPES: BEGIN OF day,
    name TYPE string,
    work(1) TYPE c,
    END OF day.
    DATA: BEGIN OF week,
    day1 TYPE day,
    day2 TYPE day,
    day3 TYPE day,
    day4 TYPE day,
    day5 TYPE day,
    day6 TYPE day,
    day7 TYPE day,
    END OF week.
    DATA xml_string TYPE string.
    DATA result LIKE week.
    week-day1-name = 'Monday'. week-day1-work = 'X'.
    week-day2-name = 'Tuesday'. week-day2-work = 'X'.
    week-day3-name = 'Wednesday'. week-day3-work = 'X'.
    week-day4-name = 'Thursday'. week-day4-work = 'X'.
    week-day5-name = 'Friday'. week-day5-work = 'X'.
    week-day6-name = 'Saturday'. week-day6-work = ' '.
    week-day7-name = 'Sunday'. week-day7-work = ' '.
    CALL TRANSFORMATION ...
    SOURCE root = week
    RESULT XML xml_string.
    CALL TRANSFORMATION ...
    SOURCE XML xml_string
    RESULT root = result.
    Regards,
    Vijay

  • URGENT : Writing to UNIX file problem !

    Hi friends,
    I am stuck at a crucial point while uploading a UNIX file from ABAP program.
    I am using open dataset & then transfer to...the file path.
    But when I go and check the UNIX file it is split into 2 lines (it is supposed to be a
    record with 1 line with 1500 characters) ! It shows a maximum of 255 chars in one line.Moreover,while I download to a text file via Txn CG3Y,some data are missing or truncated etc.
    Please suggest how can I create a record with 1500 characters in UNIX and download it successfully with full data or how can I ensure proper data has been transferred as the record display is truncated.I checked the program its fine,only after transferring I get the problem.
    Thanks,
    Sandip.

    The files would not get truncated. The file actually exists in App. server but you will be able to see only uptil 255 characters. You can check the same by downloading it onto Pres. server by specifying  file type as BIN when you are downloading through CG3Y

  • Unix file problem

    Hi gurus,
          I am creating program which reads the data from unix file  and print it.
    but i am having one major problem while reading that data. when i read the currency value from the file it displays #sign every time wht can i do to eliminate this
    please give me the solution ASAP.
    thanks in advance.
    Vinod

    Hi
    sign comes ... when the mode of writing that file is other than ASC.
    if you write the file to app server in ASC.. things will solv in many cases..

  • Bypassing the replace prompt when replacing a file that already exits

    I want to bypass the "replace prompt" when replacing the file I know already exits.  In the program when I ask it to replace 1 file I know it needs to replace several other different files.  I just want one original promt to replace the file and all other to be bypassed and just have the program replace the file without a promp.  The program uses several "write characters to file" vi and several write to spreedsheet file" vi.

    you can edit the write to spreadsheet and write characters nodes, they are plain VIs.
    Now simply wire a False diagram constant to the advisory dialog input of the open/create/replace node in each of the two mentioned VIs. Giive them a different icon (e.g. change the background color) and save them under a new name elsewhere. Save them in user.lib and they'll even show up in the user palette.
    LabVIEW Champion . Do more with less code and in less time .

  • Transfering trailing space to unix file.

    I have a variable of length (400) type c.
    When I transfer this variable to a unix file and if
    <b>the variable is blank or assigned 400</b> spaces nothing seems to show up in the unix file(not even the spaces).
    This is the also true for structures that end with a
    char component and are space filled. <b>When transferred the trailing spaces in a line are truncated</b>.
    How can i overcome this if i have to write even these spaces into the file?

    Hi,
    Use the TRANSFER statement with LENGTH.
    TRANSFER <f> to <dsn> [LENGTH <len>].
    You can specify the length of the data you want to transfer using the LENGTH addition. The system then transfers the first <len> bytes into the file. If <len> is too short, excess bytes are truncated. If <len> is greater than the length of the field, the system adds trailing blanks.
    OPEN DATASET FNAME FOR OUTPUT IN TEXT MODE.
    TRANSFER: RECORD TO FNAME LENGTH 400,
    CLOSE DATASET FNAME.
    Regards,
    Maha

Maybe you are looking for

  • Create a folder with date and time

    hey yall. i'm working on a program to assign files to a created directory. for the sake of organization, i want to create a folder that is the date and time it was created. (ie c:\\new\\02-Jun-2008\\file.txt) i know i'm missing something. here's the

  • White flash in IE 7 with vertical menu

    How do I get rid of the whitebox that flashes with a vertical menu in IE 7? This works fine in other browsers. Here is a sample page look at in IE 7 to see the problem

  • Apple TV keeps telling me can't access itunes store.  Try again later

    I have had this problem for a while. I can get all my itunes stuff on to my Apple TV, including photo, downloaded movie, youtube and trailers, but everytime I try to rent a movie, that line comes up! Somebody please help. I'm not increibly computer l

  • Moving a Secondary Domain and Its Associated GWIA

    I need to free up a server for my GroupWise 2014 move from stand-alone hardware to a brand new SAN/Virtual environment and I could use some tips so I don't screw it up by forgetting something (and I don't want to do it the hard way, any tips to make

  • Disk Failing

    Our Apple Time Capsule has started to report "Disk Failing" Can we replace the disk?  Can we fix the disk? Help!