How To Automatically Update  a Field in Table

Hi.
I have a table :
PAYMENT_PERIOD
ID char(10()
DUE_DATE date
VALID Char(1)
In above table ID is customer's ID, DUE_DATE field contains date greater than Current Date and VALID field can contain either 'V' or 'I'. Initially when I insert row in table VALID is V and DUE_DATE is any date greater than Current Date.
My Problem is
When Due_Date becomes less than Current Date then VALID field should be automatically updated by 'I'.
How can I do that?
Thanks.

Karthick_Arp wrote:
978184 wrote:
Hi.
I have a table :
PAYMENT_PERIOD
ID char(10()
DUE_DATE date
VALID Char(1)
In above table ID is customer's ID, DUE_DATE field contains date greater than Current Date and VALID field can contain either 'V' or 'I'. Initially when I insert row in table VALID is V and DUE_DATE is any date greater than Current Date.
My Problem is
When Due_Date becomes less than Current Date then VALID field should be automatically updated by 'I'.
How can I do that?
Thanks.Use a TRIGGER or even better have a custom Transaction-API to do the job.And what event causes said trigger to fire?
From what we know so far, the only thing that makes the row "invalid" is the passing of time and the relation of DUE_DATE to SYSDATE. As John said, don't store VALID at all, just calculate it when needed.

Similar Messages

  • Update PRODH field from table T179T

    hi,
    i want to update PRODH field from table T179T into table VBRP. for this we
    need to take selection option also.
    selection option will be :
    ·             Sales Organization (field VBRK-VKORG)
    ·       Billing Date Range (VBRK-FKDAT)
    ·       Distribution Channel (Vbrk-vtweg
    while i have done this for one field by using hard code but like:
    TABLES: VBRP.
    CLEAR VBRP.
    UPDATE VBRP SET PRODH = 'PLC01' WHERE VBELN = '0008300051'.
    SELECT SINGLE * FROM VBRP WHERE VBELN = '0008300051'.
    WRITE: VBRP-VBELN,VBRP-PRODH.
    but this is not the right way. please guide me how to solve this.

    TABLES: VBRP.
    CLEAR VBRP.
    UPDATE VBRP SET PRODH = 'PLC01' WHERE VBELN = '0008300051'.
    <b>commit work.</b>
    SELECT SINGLE * FROM VBRP WHERE VBELN = '0008300051'.
    WRITE: VBRP-VBELN,VBRP-PRODH.
    use commit work after update statement.
    But this code would make vbrp-vbeln as plc01 only.
    If you want to get the prodh value from t179t, then write a sleect on t179t and then update.
    TABLES: VBRP.
    CLEAR VBRP.
    select single prodh
      from t179t
    where......
    UPDATE VBRP SET PRODH = t179-prodh WHERE VBELN = '0008300051'.
    commit work.
    SELECT SINGLE * FROM VBRP WHERE VBELN = '0008300051'.
    WRITE: VBRP-VBELN,VBRP-PRODH.

  • Updating NETPR field of table EINE using BAPI

    Hello All,
    I have a requirement to update info record data in tables EINE, EINA, KONP. The fields to be updated are KSCHL, KBETR and NETPR. I am able to successfully update KBETR and KSCHL fields using bapi BAPI_PRICES_CONDITIONS. But I am unable to find any field in the bapi structures that would update NETPR field.
    Request you to please suggest how can I update NETPR successfully in table EINE.
    Thanks in advance.
    Anand

    Hi Anand,
                         Use the Function Module 'ME_DIRECT_INPUT_INFORECORD' to update/change the info record values.
    Pass the netpr value in ls_eine structure.
    To get better understanding on using this function module, please have a look on this link
    Create new inforecord with standard-condition via FM
    Regards,
    Arun Prasath Kumar.
    Edited by: Arun Prasath Kumar on Jan 17, 2011 12:09 PM

  • How can i update rows  in a table based on a match from a select query

    Hello
    How can i update rows in a table based on a match from a select query fron two other tables with a update using sqlplus ?
    Thanks Glenn
    table1
    attribute1 varchar2 (10)
    attribute2 varchar2 (10)
    processed varchar2 (10)
    table2
    attribute1 varchar2 (10)
    table3
    attribute2 varchar2 (10)
    An example:
    set table1.processed = "Y"
    where (table1.attribute1 = table2.attribute1)
    and (table1.attribute2 = table3.attribute2)

    Hi,
    Etbin wrote:
    Hi, Frank
    taking nulls into account, what if some attributes are null ;) then the query should look like
    NOT TESTED !
    update table1 t1
    set processed = 'Y'
    where exists(select null
    from table2
    where lnnvl(attribute1 != t1.attribute1)
    and exists(select null
    from table3
    where lnnvl(attribute2 != t1.attribute2)
    and processed != 'Y'Regards
    EtbinYes, you could do that. OP specifically requested something else:
    wgdoig wrote:
    set table1.processed = "Y"
    where (table1.attribute1 = table2.attribute1)
    and (table1.attribute2 = table3.attribute2)This WHERE clause won't be TRUE if any of the 4 attribute columns are NULL. It's debatable about what should be done when those columns are NULL.
    But there is no argument about what needs to be done when processed is NULL.
    OP didn't specifically say that the UPDATEshould or shouldn't be done on rows where processed was already 'Y'. You (quite rightly) introduced a condition that would prevent redo from being generated and triggers from firing unnecessarily; I'm just saying that we have to be careful that the same condition doesn't keep the row from being UPDATEd when it is necessary.

  • How to automatically update products and product categories?

    Hi friends
    How to automatically update products and product categories.Is it possible?
    regards
    venkat

    Hi,
    The delta load does not work for product categories but only products.So to bring in the new product categories into SRM you will need to start the load of the object DNL_CUST_PROD1 again.
    The CRM middleware allows the following two methods for replication.
    -Initial loads:
    Launched manually (R3AS), the objects (customizing or business) are replicated between SRM and R/3, according to the filters you've put on the object (R3AC1 for Business objects like MATERIAL, R3AC3 for customizing objects like DNL_CUST_PROD0 and 1).
    -Delta loads:
    This option is only possible for Business objects, which is the case of MATERIAL.
    With this option a daemon is launched between the 2 servers. Every modification made on an object on SRM or R/3 is transfered as soon as this object is contained in the filter retrictions (creation and/or modification). this is done through transaction R3AC4.
    Also refer the foll thread:
    Material group from R/3 to COMM_CATEGORY (SRM)
    Related notes : OSS notes 872819 and 720819.
    BR,
    Disha.
    DO  reward points for helpful answers.

  • How to update key fields for table

    Hi,
    how to update key fields for a table.The update statement is not working for the same.
    Regards,

    Hi,
    See the below example.
    TABLES SPFLI.
    DATA WA TYPE SPFLI.
    MOVE 'AA' TO WA-CARRID.
    MOVE '0064' TO WA-CONNID.
    MOVE 'WASHINGTON' TO WA-CITYFROM.
    UPDATE SPFLI FROM WA.
    MOVE 'LH' TO SPFLI-CARRID.
    MOVE '0017' TO SPFLI-CONNID.
    MOVE 'BERLIN' TO SPFLI-CITYFROM.
    UPDATE SPFLI.
    CARRID and CONNID are the primary key fields of table SPFLI. All fields of those lines where the primary key fields are "AA" and "0064", or "LH" and "0017", are replaced by the values in the corresponding fields of the work area WA or the table work area SPFLI.
    Regards,
    raj.

  • How to automatically update InfoPath Form fields(Design) when a new Column is created in SharePoint list?

    Hi All , 
    We have a scenario to automatically update the Infopath form(List Form) fields(Field Name and Control) when ever a new Column is created in the SharePoint list. Is it possible to do this? any options or suggestions?
    Thanks and Regards,
    Nandini

    Hi Nandini,
    I am not very sure will this be going to help you. Ideally, it's not so easy to communicate with infopath using object model. But still you can give it a try using below link :
    http://social.msdn.microsoft.com/forums/sharepoint/en-US/00125fdc-2115-47ea-8e8b-1ca9e5942f83/update-infopath-form-field-in-event-receiver
    I think the above solution is trying to update the field. Addition to that you can try creating a field and control.
    Let me know if it helps  !!
    Thanks

  • How to Automatically update current months figure in 9ke5

    Hi all
    I am working on a report that will run in the background and then update the current month figure in 9ke5
    Such as for month October for plant xxx and profit center xxx
    I know all the necessary parameters such as the comp code, period year, controlling area
    Do you know which table the statistical key figures use?
    When i do f1 i see an internal structure
    Please let me know
    Cheers

    Karthick_Arp wrote:
    978184 wrote:
    Hi.
    I have a table :
    PAYMENT_PERIOD
    ID char(10()
    DUE_DATE date
    VALID Char(1)
    In above table ID is customer's ID, DUE_DATE field contains date greater than Current Date and VALID field can contain either 'V' or 'I'. Initially when I insert row in table VALID is V and DUE_DATE is any date greater than Current Date.
    My Problem is
    When Due_Date becomes less than Current Date then VALID field should be automatically updated by 'I'.
    How can I do that?
    Thanks.Use a TRIGGER or even better have a custom Transaction-API to do the job.And what event causes said trigger to fire?
    From what we know so far, the only thing that makes the row "invalid" is the passing of time and the relation of DUE_DATE to SYSDATE. As John said, don't store VALID at all, just calculate it when needed.

  • LSMW automatically update 1:1 translation table

    In LSMW, under the 1:1 translation table... control data tab.  I noticed there was a checkbox called "1:1 Translation Table Added to Automatically".  If this checkbox is checked, is there a program that can be executed to automatically upload a file from the R/3 application server to update the 1:1 translation table in the background?

    Karthick_Arp wrote:
    978184 wrote:
    Hi.
    I have a table :
    PAYMENT_PERIOD
    ID char(10()
    DUE_DATE date
    VALID Char(1)
    In above table ID is customer's ID, DUE_DATE field contains date greater than Current Date and VALID field can contain either 'V' or 'I'. Initially when I insert row in table VALID is V and DUE_DATE is any date greater than Current Date.
    My Problem is
    When Due_Date becomes less than Current Date then VALID field should be automatically updated by 'I'.
    How can I do that?
    Thanks.Use a TRIGGER or even better have a custom Transaction-API to do the job.And what event causes said trigger to fire?
    From what we know so far, the only thing that makes the row "invalid" is the passing of time and the relation of DUE_DATE to SYSDATE. As John said, don't store VALID at all, just calculate it when needed.

  • How does the Updated by Field Work....

    Hi Experts,
    Can anyone help on how the *Updated By* field values are populated, specially when the values are updated through a Workflow.
    I read the following in the MDM Documentation.
    If trigger action is Record Add, Record Update, or Record Import for a workflow. The [System] is the creator and launcher of the job but is not a real user.
    This is even true if the Owner of the workflow is the Admin.
    After our server migration was done, instead of showing [System] as the Updated By it now shows the Admin.
    What could be the reason for this. Do i need to contact SAP or is there something that needs to be done at the respository level to get the Updated By field to work as expected.
    Regards,
    Aditya.

    Hi Aditya,
    As far as i am concerned, this is not true. Field Updated by type of User Stamp should only show user's which are there in User's table of MDM console under node Admin-->Users. When we don't have any User of repository with name System, there is no point it will show you user System for field Updated by.
    Query 1: Can you please confirm, do you have this User "system" available in your repository under node admin-->Users in MDM console ?
    Query 2: Also, After our server migration was done, instead of showing System as the Updated By it now shows the Admin.
    I seriously have doubt on this. Can you please check do you have really user System for existing records too? I mean you can do Free-form search for field Updated by with value system. I am sure even for existing records (whether in before server migration or in existing) you will not get single record with field updated by "system" . Can you please confirm on this ?
    May be I am wrong, so kindly revert with your findings and confirm above both queries..?
    Regards,
    Mandeep Saini

  • Automatically Updated Form Fields

    How can I set a field in a PDF form to automatically update with the entry in another field.  I need to do this for both free form and numerically formatted fields.
    Thanks

    Can you be a little more specific about what you mean by 'automatically update with the entry in another field'? That could be interpreted different ways, each requiring a different solution in the PDF. Do you want the fields to share the same value? Do you need a calculated value? Do you need to set the value in field A using a matching value from the entered value in field B?

  • How to find out important fields in table like MARA?

    How to find out important fields in a table for example like MARA?
    Details: In R/3 or ECC table for example MARA;
    1) How to find out what are the important fields?
    2)Does the table have only key figures not characteristics right?
    3) There are so many tables in FI; Can you please tell me what are the important tables?
    4) There is any easy automatic way to figure out that the particular datasource for example 2lis_02_item is pulling data from so and so table. I like to know the process not the results please.
    Thanks in advance.
    York.

    Hi York,
       Let me go by points:
    1. There is nothing like important fields ... The question could be Key fields ... the fields which identify a record uniquely ... If you go to SE11, and go inot the dispaly of MARA table ... you will see that there is tick mark under key to indicate that the field is a key field ... All the fields which are so marked would identify a record in the table uniquely. If your question is otherwise ... (Important fields) ... then it depends on the purpose you wnat to meet ... Some fields might be important for me but not for you ... so there is not hard nad fast rule for important fields.
    2. No... Tables in R/3 or ECC would contain both Key figures and characteristics.
    3. Important tables in FI would be BKPF, BSEG and BSET.
    4. The procedure for finding out which table are used by say 2lis_02_item would be different from that of other non LO/LIS extractors.
    In case of LO/LIS turn on the trace (below process) while populating the setup tables and for thoers while executing RSA3.
    1. Open one session and go to ST05, click on "Activate Trace"
    2. Open another session and execute the transaction you want to track for the tables it is going to hit.
    3. Go to the session of point 1 above and click on DEACTIVATE TRACE
    4. Click on DISPLAY Trace
    This will show you all the tables that were hit while extracting data. Point to remember here is ... it will hit some standard tables as well ... so you will have to filter out what is relevant from what is not.
    Hope this helps.
    best regards,
    Kazmi

  • OWB: how can automatic updation  perform in staging database using OWB

    I am using OWB-etl to fetch data from source database and store to staging db.
    in target table operator i am using insert operation.
    it is inserting data fien.
    but my requirement is target database must be automatically updated with what ever modification made to source data base.
    can u pls help me how to achive this ?
    Thanks alot ...
    k azamtulla khan

    Hi,
    why do you want to do this using OWB, is it not easier to create a before/after insert/update trigger on source table so that your target table is updated automatically. You can benefit by using owb in scenarios where you need to transform and load data and then schedule this process and for the rest of it i would recommend using triggers for row level activities such as update.

  • Updating Custom field in Table BUT000 using BAPI 'BAPI_ISUPARTNER_CHANGE'.

    Hi,
    I have added a new custom field in table BUT000. Now i want to update that field with 'X' and i have used EXTENSIONIN parameter in the BAPI 'BAPI_ISUPARTNER_CHANGE'. i have populated the field name(Custom field name) and value 'X' to that structure and passed to BAPI. But that field value was not getting updated. So can any one help me how to resolve this issue.
    Thanks,
    Sushma

    Hi Ravi,
    Thanks for your response.
    I have passed the Structure name  in parameter EXTENSIONIN, but still i am facing the same problem.
    Thanks,
    Sushma

  • How can i update more than one table at a time?

    i would like to update more than one table at a time. In Java Studio creator2 how can i do table updation?

    Hi,
    Please go through the below thread might be of help to you.
    http://forum.sun.com/jive/thread.jspa?forumID=123&threadID=51839
    RK

Maybe you are looking for