Last run date & time & multiple files handling

Hi frnds,
i am working on an outbound interface in which i am retrieving data from custom db table,processing it with other db tables and writing  the final output into a file into the application server and updating the custom db table.
Now i have an issue here when i am giving plant as input in selection screen (select-options), i should also get those plants from my custom table which have no last run date and time.
How to get that?
Next part of my question is for multiple plants entry,multiple files have to created in application server.
Presently, i have concatenated the file path n name.Do i need to loop the same with s_werks.Will it work
Also i used an internal table for update data storage.When multiple plants are their how to handle the updation.
Rgds,
Simran

Hi.
In ur reply i did'nt understood two things
1) this is how i'm doin the selection
    select lt_run_dt
           lt_run_tm
    into table itab1
    from z_table
    where prog_name EQ sy-repid
    AND   plant IN s_werks
will it give me plants whose last_run_date and last_run_time are not in the z table?
2)  If you are going with select-option from parameter, then if you have to write a FILE per PLANT. Then you can loop at plant->extract the data-> write to app server-update z table->end loop
Does that means:
loop at s_werks
open dataset
transfer
modify
endloop
Kindly clarify to solve this issue.
Rgds,
Simran

Similar Messages

  • How do I get the last changed date & time of a file in app server?

    Hi Experts,
    How do I get the last changed date & time of a file in app server?
    Thanks!
    - Anthony -

    Hi,
    that's what I use...
      CALL 'C_DIR_READ_FINISH'.             " just to be sure
      CALL 'C_DIR_READ_START' ID 'DIR' FIELD p_path.
      IF sy-subrc <> 0.
        EXIT. "Error
      ENDIF.
      DO.
        CLEAR l_srvfil.
        CALL 'C_DIR_READ_NEXT'
          ID 'TYPE'   FIELD l_srvfil-type
          ID 'NAME'   FIELD l_srvfil-file
          ID 'LEN'    FIELD l_srvfil-size
          ID 'OWNER'  FIELD l_srvfil-owner
          ID 'MTIME'  FIELD l_mtime
          ID 'MODE'   FIELD l_srvfil-attri.
    *    l_srvfil-dir = p_path .
        IF sy-subrc = 1.
          EXIT.
        ENDIF." sy-subrc <> 0.
        PERFORM p_to_date_time_tz
          USING    l_mtime
          CHANGING l_srvfil-mod_time
                   l_srvfil-mod_date.
        TRANSLATE l_srvfil-type TO UPPER CASE.               "#EC TRANSLANG
        PERFORM translate_attribute CHANGING l_srvfil-attri.
        CHECK:
          NOT l_srvfil-file = '.',
          l_srvfil-type = 'D' OR
          l_srvfil-type = 'F' .
        APPEND l_srvfil TO lt_srvfil.
      ENDDO.
      CHECK NOT lt_srvfil IS INITIAL.
      pt_srvfil = lt_srvfil.
    FORM p_to_date_time_tz  USING    p_ptime  TYPE p
                            CHANGING p_time   TYPE syuzeit
                                     p_date   TYPE sydatum.
      DATA:
        l_abaptstamp TYPE timestamp,
        l_time       TYPE int4,
        l_opcode     TYPE x VALUE 3,
        l_abstamp    TYPE abstamp.
      l_time = p_ptime.
      CALL 'RstrDateConv'
        ID 'OPCODE' FIELD l_opcode
        ID 'TIMESTAMP' FIELD l_time
        ID 'ABAPSTAMP' FIELD l_abstamp.
      l_abaptstamp = l_abstamp.
      CONVERT TIME STAMP l_abaptstamp TIME ZONE sy-zonlo INTO DATE p_date
          TIME p_time.
    ENDFORM.                    " p_to_date_time_tz
    Regards,
    Clemens

  • Create a listing of reports with last run date and # of times run

    Hi All,
    I want to create a listing of reports with last run date and number of times report is run in the past 18 months.
    If anybody can please help me with the query for the same.
    Regards,
    Sk
    Edited by: user10989244 on Aug 18, 2009 7:12 AM

    Hi Sk
    Assuming you have the collection of statistics enabled, which it is out of the box, you can get the information you need from the EUL5_QPP_STATS table. This script will help:
    SELECT
    QPP.QS_DOC_OWNER WORKBOOK_OWNER,
    QPP.QS_DOC_NAME WORKBOOK_NAME,
    QPP.QS_DOC_DETAILS WORKSHEET_NAME,
    QPP.QS_CREATED_BY RUN_BY,
    TRUNC(MAX(QPP.QS_CREATED_DATE)) LAST_USED_DATE,
    COUNT(QPP.QS_ID) TIMES_USED
    FROM
    EUL5_QPP_STATS QPP
    WHERE
    QPP.QS_CREATED_DATE >= ADD_MONTHS(SYSDATE, -18)
    GROUP BY
    QPP.QS_DOC_OWNER,
    QPP.QS_DOC_NAME,
    QPP.QS_CREATED_BY,
    QPP.QS_DOC_DETAILS
    ORDER BY 1,2,3;
    Best wishes
    Michael

  • How to get the last run date.

    We intend to develop an incremental data load mapping using this strategy:
    1) The mapping reads the date it was last run from an auxiliary table.
    2) It selects from the source only those rows that were inserted or updated after said date.
    3) Then, a post-mapping process updates the last run date in the auxiliary table, using SYSDATE.
    The problem with this logic is that there is a gap: if the mapping starts running at 1:00 and ends at 2:00, the rows that are inserted in between will never be loaded.
    Is there any way to get the value when the mapping started running? Is there a better way to do this?
    Any help would be appreciated.
    Juan Algaba

    There is always the possibility of some record updates slipping through the crack if you are depending on dates unless you are very carefull. All of the audit tasks that the OWB-generate code performes take time. Any pre- or post- process that needs to run takes time. So which date is the best cuttoff point to equate to "when the last run of the merge (or insert or update) statement completed"?
    Plus, how do you handle reloads if the previous load failed and your mapping had incremental commits?
    Is your source on another server? If so, are the dates in perfect synch? The audit tables populate with sysdate of your runtime schema. Is that the same as the sysdate on your source remote database?
    I would qualify my query to look for all updates since the start of the last run that finished successfully - adjusted if neccesary for sysdate differences if it is on a remote schema. And make sure that your code handles any reloads gracefully in the event that this brings back data that you have already loaded once. .
    Because we use Oracle Streams to load a local staging area, we also have custom code to dump the primary keys of all data changes to utility staging tables while streams is updating the local copy. So, our Person table has an st_Person_delta table that just holds the primary keys that have been updated by Streams since the last ETL run.
    During datamart load we disable the streams apply to stabilize our environment, and join these lists of pk's to their source tables to drive our ETL. So we only select data where Streams has performed an update to the row since our last run. When we are done our ETL, we truncate the primary key staging tables, and then turn streams back on to start loading up our new delta into our staging tables again..
    The ETL gets pretty complex though when many tables join together in one mapping and you need to check all possible source table deltas to see if any of them got updated to determine the delta for a given dimension or fact record, but it works great once you get it all done.

  • MBAM "Enterprise Compliance Report" not updating "Last Contact" date/time for any/all systems.

    Running BitLocker/MBAM 1.0.1237.1.
    About 1 month ago, "Last Contact" date/time listed in MBAM "Enterprise Compliance Report" stopped updating (last updated 1 month ago) for all systems. However, reporting against these exact same systems individually via
    "Computer Compliance Report" shows current/correct "Last Contact" date/time (last updated today).
    Have tried http://support.microsoft.com/kb/2620269/en-us but no luck.
    Hoping someone has experienced this before, fixed, and can share insights.
    Thx,
    DCL

    You may want to look for communication errors under the MBAM node in Event Viewer.
    You may also want to review the registry settings discussed under the
    Configure Lab Computers for MBAM Evaluation section of this TechNet article:
    HKLM\Software\Policies\Microsoft\FVE\MDOPBitLockerManagement\ClientWakeupFrequency
    HKLM\Software\Policies\Microsoft\FVE\MDOPBitLockerManagement\StatusReportingFrequency
    HKLM\Software\Microsoft\MBAM\NoStartupDelay
    Specifically the StatusReportingFrequency
    key.
    Brandon
    MDOP on the Springboard Series on TechNet

  • Writing Data to Multiple Files

    Hi,
    I got a problem while writing the data to multiple files.
    Actually my requirement is,
    I want to read the data from multiple files and retrieve the required data from those and save that data into separate files.
    Meaning if i read the data from "D:\kiran\kk\123\kiran.txt" the retrieved data should be saved in "D:\kiran\kk\kiran.txt" the file name should be created with the input file name.
    here is my code,
    //here i am taking the files into loop
    for(int i=0;i<files.length;i++){
    try{                   
    //reading the files
    BufferedReader br=new BufferedReader(new FileReader(files));
    //creating a new file for writing the retrieved data
    pw=new PrintWriter("D:\\Kiran\\kk"+File.separator.concat(str[i]));
    String line=br.readLine();
    while(line!=null){
    line=br.readLine();
    //here i am matching the required data
    Matcher m = Pattern.compile("name(\\s*\\W*\\w*\\W*.\\w*.)|invoice (\\W*(\\d+))|amount(\\W*(\\d+),\\d*)|site(\\s*Rs\\.[\\d]*,[\\d]*/-)", Pattern.CASE_INSENSITIVE).matcher(line);
    while(m.find()){                           
    System.out.println(m.group());
    //here printing the retrieved data to a file
    pw.println(m.group());
    br.close();
    but i am ending up with some issues.
    Data is reading properly from all the files, but when i write that data into individual files the data which is retrieved from last file is only printing into the file which is created last.
    Please help me regarding this,
    Thanks,
    Kiran

    D:\kiran\kk\123\
    In this folder some files are there say,
    kk.txt,kiran.txt,praveen.txt and so on, i can read the entire data from those files and also retrieving the required data like name,data etc. from all the files. Now the retrieved data should be stored in individual files means, if the data is retrieved from kk.txt then that particular data should be stored in the file with the same file name but in different location likewise it should happen for all the files those are in that folder.
    Thanks,
    Kiran

  • Help find the Last run date from previous month

    Hi all
    I am stuck trying to find the Last Run Date from the previous month.
    select distinct(date_ran) from TABLE X where date_ran like '%/11-%' order by date_ran desc gives
    "03/30/11-06:19
    "03/25/11-03:01
    "03/24/11-03:00
    "03/23/11-03:00
    "03/22/11-03:00
    "03/21/11-03:00
    "03/18/11-03:00
    "03/17/11-00:00
    "03/16/11-06:31
    "02/15/11-07:42
    "02/15/11-06:00
    "02/14/11-08:19
    Here the result I am trying to acheive is 02/15/11-07:42 ;Note the column date_ran is a VARCHAR2(255) and not a TIMESTAMP
    I tried
    select ADD_MONTHS(to_date(max(date_ran), 'MM/DD/YYYY-HH24:MI'),-1)
    from daily_tests_a
    where date_ran like '%/11-%'
    order by date_ran desc
    which returns 2/28/0011 6:19:00 AM and that is not the result I am looking for
    Regards
    SMK

    Welcome to the forum!
    user2931503 wrote:
    Hi all
    I am stuck trying to find the Last Run Date from the previous month.
    select distinct(date_ran) from TABLE X where date_ran like '%/11-%' order by date_ran desc gives
    "03/30/11-06:19
    "03/25/11-03:01
    "03/24/11-03:00
    "03/23/11-03:00
    "03/22/11-03:00
    "03/21/11-03:00
    "03/18/11-03:00
    "03/17/11-00:00
    "03/16/11-06:31
    "02/15/11-07:42
    "02/15/11-06:00
    "02/14/11-08:19
    Here the result I am trying to acheive is 02/15/11-07:42 ;Note the column date_ran is a VARCHAR2(255) and not a TIMESTAMPThat's a very bad idea. Points in time should always be stored in DATE (or maybe TIMESTAMP) columns. If not, you're going to waste resources converting them to DATEs whenever you need them to behave like DATEs, and risk run-time errors because of bad data.
    Normally, the "previous" month means the month before the current month. In April, the previous month is March.
    By "previous" month, do you mean the 2nd latest month in the table? That is, this data contains data from February and March, 2011; March 2011 is the latest of those months, February 2011 is the next-to-last, and so is that why you want a date from February?
    I tried
    select ADD_MONTHS(to_date(max(date_ran), 'MM/DD/YYYY-HH24:MI'),-1)
    from daily_tests_a
    where date_ran like '%/11-%'
    order by date_ran desc
    which returns 2/28/0011 6:19:00 AM and that is not the result I am looking for
    Regards
    SMKTry this:
    WITH   got_real_date   AS
         SELECT     TO_DATE ( SUBSTR (date_ran, 1, 14)
                   , 'MM/DD/RR-HH24:MI'
                   )     AS real_date
         FROM     table_x
    --     WHERE     ...     -- If you need any filtering, put it here
    SELECT     TO_CHAR ( MAX (real_date)
              , 'MM/DD/RR-HH24:MI'
              )     AS last_date
    FROM    got_month_num
    WHERE     real_date     < (
                               SELECT  TRUNC (MAX (real_date), 'MONTH')
                         FROM    got_real_date
    ;Edited by: Frank Kulash on Apr 5, 2011 3:59 PM

  • Save data to multiple files

    Hi!
    I am trying to save measurement data to multiple files using the Write to measurement Express VI. The problem is that no matter what I do the program always save the data to one huge file, even if I configure the VI to save the data as a series of separate files.
    I am using LabVIEW 8.2 and a NI USB-6251 to collect data from LASER based optical measurement system. The sampling rate is of the order 25-100kHz and the measurements are 1-5 minutes.
    The attachment is picture of the LabVIEW program I am using.
    Greatful for some advice......
    Attachments:
    LVprogram.JPG ‏73 KB

    Your file path is only one & the same variable that always throws the same file path to the Write to Measurement File VI; so, it does its job correctly. What you ve to do is, if you want different files, you need to supply different names for them either manually or programmatically.
    You can achieve htis easily, if you think a little bit more...
    - Partha
    LabVIEW - Wires that catch bugs!

  • How to display document last modfied date time in core result web part?

    Hi,
    We have a requirment in the sharepoint application where we need to display last modified date&time of document in core result web part.
    To support this we have specify the property <Column Name="Write"/> in custom XSL.
    But it displays only the modified date.Is there is way to display modified date and time as well?
    D.Ganesh

    If you want to modify the
    XML can do i tin the
    template "DisplayTemplate":
    An example:
    Replace
    <xsl:value-of select="write" />
    by
    <xsl:value-of select="ddwrt:FormatDate($write, 1033, 2)"/>
    But I think the managed property"Write"
    is returned only as
    Date without
    Time. By
    this time will
    always 00:00.
    To see the resulting XML
    can replace
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
    <xsl:template match="/">
    <xmp><xsl:copy-of select="*"/></xmp>
    </xsl:template>
    </xsl:stylesheet>
    Where you see the format
    of "write"
    http://msdn.microsoft.com/en-us/library/ms546985(v=office.14).aspx
    Miguel de Hortaleza

  • To find last run date of custom concurrent program in oracle apps

    Hello Exports,
    Can you pls tell me how to find last run date of custom concurrent program in oracle apps.( thr Backend query )
    Thanks in advance,
    Edited by: 981527 on Mar 7, 2013 3:01 AM

    try the below:
    select fcp.user_concurrent_program_name
    ,fcr.request_date
    ,fu.user_name
    ,fcr.actual_start_date
    ,fcr.actual_completion_date
    ,fcr.phase_code
    ,fcr.status_code
    ,fcr.argument1
    ,fcr.argument2
    ,fcr.argument3
    from fnd_concurrent_programs_vl fcp
    ,fnd_concurrent_requests fcr
    ,fnd_user fu
    where fcp.user_concurrent_program_name like 'Payroll Run'
    and fcp.concurrent_program_id = fcr.concurrent_program_id
    and fcr.requested_by = fu.user_id
    order by fcr.actual_completion_date desc

  • How to find the last update date time and user of record field peoplecode

    how to find the last update date time record field peoplecode?
    Thank you.

    One can check the last update date time using the following query
    SELECT LASTUPDDTTM FROM PSPCMPROG WHERE OBJECTVALUE1 LIKE 'RECNAME' AND OBJECTVALUE2 LIKE 'FIELDNAME'

  • How to find the last run date of the report..

    please any one one help me
    how to find last run date of the report...
    for example if my report is zgrir...if i am exuted in last week
    if want to find when it executed
    last run date is req
    please any one help me...

    The trasaction stat is limited because i want all the execution date even if it is 3 years ago.
    I have tryied the transaction st03 but it is limited to 3 months ago.
    check transaction STAT and it's report RSSTAT00.
    U can copy RSSTAT00 into ZRSSTAT00 and modify corresponding.
    *& Report ZDSAP *
    REPORT ZDSAP .
    DATA: d_ref TYPE REF TO data,
    d_ref2 TYPE REF TO data ,
    i_alv_cat TYPE TABLE OF lvc_s_fcat,
    ls_alv_cat LIKE LINE OF i_alv_cat.
    TYPES tabname LIKE dcobjdef-name .
    parameter: p_tablen type tabname.
    data: begin of itab occurs 0.
    INCLUDE STRUCTURE dntab.
    data: end of itab.
    FIELD-SYMBOLS : <F_FS> TYPE table,
    <F_FS1> TYPE TABLE,
    <F_FS2> TYPE ANY,
    <F_FS3> TYPE TABLE.
    REFRESH itab.
    CALL FUNCTION 'NAMETAB_GET'
    EXPORTING
    langu = sy-langu
    tabname = p_tablen
    TABLES
    nametab = itab
    EXCEPTIONS
    no_texts_found = 1.
    LOOP AT itab .
    ls_alv_cat-fieldname = itab-fieldname.
    ls_alv_cat-ref_table = p_tablen.
    ls_alv_cat-ref_field = itab-fieldname.
    APPEND ls_alv_cat TO i_alv_cat.
    ENDLOOP.
    internal table build
    CALL METHOD cl_alv_table_create=>create_dynamic_table
    EXPORTING it_fieldcatalog = i_alv_cat
    IMPORTING ep_table = d_ref .
    ASSIGN d_ref->* TO <F_FS>.
    SELECT * FROM (p_tablen) INTO CORRESPONDING FIELDS OF TABLE <F_FS>.
    LOOP AT <F_FS> ASSIGNING <F_FS2>.
    *your code goes here.
    ENDLOOP.

  • Add Last Updated Date/Time to Cube

    Is there a way that you can display a date field in EXCEL when a user logs in to a cube so that they can see when the cube was last updated (date/time)? I am currently attaching a note using linked objects but would like to find a more automated solution.

    At a previous job, we managed to pick up the system date during the batch and write it into the Database/Set note (from app manager). I can't remember the exact details but pretty sure we used the API.Then people could see when they logged in whether the database had been updated or not.At another place we sent out automated e-mails at the end of each update to those users with access to the database.Ideas only I'm afraid but hope it helps.

  • Need a FM which returns the last modified date& time

    Hi,
    Kindly Suggest me if any Function Module is there which returns the last modified date& time for tables HRP1000 and HRP1001.
    Rgds
    Kishor.C

    just check the following tables..
    CDHDR - Change document header
    CDPOS - Change document items
    you can use this function module..
    BPCT_CHANGEDOCUMENT_DISPLAY
    Edited by: Arunima Rudra on Apr 14, 2009 4:49 PM

  • Calculating 60 days from last run date and sum a total for those 60 days

    I need to calculate 60 days from last run date (I will create prompts), then take that number to sum a total of items.
    Can someone be of assistance.

    Hi,
    You can create a calculation to calculate 60 days before your run date. e.g. if rundate is your date item then the calculation will be:
    rundate-60
    Rod West

Maybe you are looking for

  • In Update_Opportunity_Pre error while updating opportunity status

    Hello, We are encountering an error 'In Update_Opportunity_Pre' in the log when trying to update apportunity status to a closed status using Update Opportunity API. Has anyone encountered this error before? If so, I would appreciate if you could shar

  • Questions about connection from JDeveloper to BAM 11g TP4

    1. Is it possible to connect from JDeveloper 10.1.3.x to BAM 11g TP4? If yes, is the domain name obligatory for connection? 2. Is it possible to connect from JDeveloper 11g TP4 (on remote machine) to BAM 11g TP4? Thank you for answers Edited by: Olga

  • Html snippets don't work in iWeb 09.

    I've not added an html snippet to my site for a while, but they've worked in the past. Now they look fine when I'm working in iWeb, but when I go to the site after uploading, there's nothing visible. If I select all, I can see the box that should be

  • JSF desing: Application with similar pages

    I have a design question regarding JSF. Sometimes, a web application consists of a set of pages that look basically the same but perform different operations in the background. As an example, consider Google that offers several search types (normal s

  • Advanced File Attachment

    Hi to all; I'm practicing with javascript file attachment using dataObjects. I created a simple list box to show up all the files attached to the form linked to an Upload Button click event. Obviously if someone changes the attachment list through th