Dynamic Actions - Date Specificatoins - Retirement date

Hi Experts,
can any one help me in Dynamic actoins i want to caliculate Retiremetn date automatically infotype 0041 - Date specificatoin one item called Retirement date to call this date type through feature DATAR i have updated the date type but to update the value in the field **************
0002     04     01     P     *P0000-MASSN='HI'
0002     04     02     P     *T001P-MOLGA='40'
0002     04     03     I     *INS,0041,,,(P0000-BEGDA),(P0000-ENDDA)
0002     04     212     W     *P0041-DAR04='16'
0002     04     213     W     P0041-DAT04=************
what i have to give the return value to be automatically caliculted and it should be updated in infotype 0041 - date specifications
logic is Date of birth + 58 years  - hire date = Retirment date
i dont have good knowledge in programming/techinical
can any one can help in this

Hi kumar,
0002 04 01 P *P0000-MASSN='HI'
0002 04 02 P *T001P-MOLGA='40'
0002 04 03 F GET_DATE(ZPUDYN01)
0002 04 04 I *INS,0041,,,(P0000-BEGDA),(P0000-ENDDA)
0002 04 212 W *P0041-DAR04='16'
0002 04 213 W *P0041-DAT04=RP50D-DATE1
Requirement :
The routine GET_DATE in programm ZPUDYN01 calculates the date and gives the value to field RP50D-DATE1. You could calculate the date at your own and also read other infotypes.
REPORT ZPUDYN01.
Here, we have routines called by dynamics measures (table t588z).
TABLES: p0000, rp50d.
DATA: data_pa LIKE p0000-begda.
FORM get_date.
  PERFORM day_plus_years(sapfp500) USING p0000-begda
                                         1
                                         data_pa.
  rp50d-date1 = data_pa - 1.
ENDFORM.                    "get_date
Hope this helps
Regards
Bernd
Message was edited by:
        Bernd Köhn

Similar Messages

  • Infotype 0041 - Issue regarding entry date, leave date and retire date

    Hi experts out there,
    I'm trying to achieve information concerning:
    1. Entry date
    2. Leave date (employee has resigned or will resign) -> Last day of work
    3. Retire date
    4. Last day of pay
    Can I get this information from infotype 0041?
    Another problem I have is if I do a <i>Pre-Hire Action</i> (Tcode: <b>PA40</b>) and enter a future date for a new hired employee then I cannot find the corresponding record in PA0041. Do I do something wrong?
    Any advise would be very appreciated.
    Many thanks in advance.
    /hw

    Hadi,
       You can get that information from Infotype 0041, but it depends if the user that executed the action entered the <b>date type</b> and corresponding <b>date</b> when reached infotype 0041, if he/she didnt so, it just wont be there. It is not entered automatically.
    "<i>It's actually not the answer of my questions because I've been wondering why I cannot find the corresponding record of a Pre-Hire Action (TCODE: PA40) in PA0041 (regardless of if I use SE16 or function modules)"</i>
    You will find the records of the actions that were excuted for the employee in infotype 0000 (table PA0000). Infotype 0041 is used to store special dates for the employees (such as date of hiring, next promotion and the like), but it is up to the user if they are stored or not.
    Hope that helps

  • End date should be the retirement date

    Hai
    In PA module, irrespective of employees retirement date ( ex. Retirement age is 58 yrs), system shows the default end date as 31.12.9999. but client needs the end date should be the retirement date. How to configure this scenario?

    Mbq,
    The following is an example of dynamic action that creates a date info in IT0041 as soon as employee is hired. The date of retirement is 58 years after the hire date.
    0000 04 10 *** CREATE INFOTYPE 41 WHEN HIRING****
    0000 04 61 P P0000-MASSN='06'
    0000 04 62 I COP,0041,,,,
    0000 04 63 W P0041-DAR12='08'
    0000 04 64 W P0041-DAT12=P0000-BEGDA
    0000 04 65 W P0041-VTRAN='58' number
    0000 04 66 W P0041-VTRZH='013' time unif from table T538T
    0000 04 67 W P0041-VTROP='-' operation '+' or '-'
    The above code should be added to T588Z table.
    You can enhance the code according to ypur requirements.
    Regards,
    Dilek

  • Dynamic action with set value on date field

    Hi,
    I'm using APEX 4.02
    I'm trying to calculate the age based on the date of birth dynamically on a form. I'm trying to do this with a (advanced)dynamic action with set value.
    I'm able to get this kind of action working based on a number field etc, but NEVER on a date field.
    I've read all posts on this subject but so far no solution. Even if I try to simply copy the value over to another date field or typecast it to a string ( to_char function ) it does not work. So for me the problem seems to be in the source field being a date field.
    I've tried using the source value as is in a select statement :
    select :P33_GEBOORTEDATUM from dual;
    and also type casted based on the date format :
    select TO_DATE(:P33_GEBOORTEDATUM,'DD-MON-YYYY') from dual
    but still no luck.
    On the same form I don't have any issues as long as the calculation is based on number fields, but as soon as I start using dates all goes wrong.
    Any suggestions would be greatly appreciated. If you need any extra info just let me know.
    Cheers
    Bas
    b.t.w My application default date format is DD-MON-YYYY, maybe this has something to do with the issue .... ?
    Edited by: user3338841 on 3-apr-2011 7:33

    Hi,
    Create a dynamic action named "set age" with following values.
    Event: Change
    Selection Type: Item(s)
    Item(s): P1_DATE_OF_BIRTH
    Action: Set value
    Fire on page load: TRUE
    Set Type: PL/SQL Expression
    PL/SQL Expression: ROUND( (SYSDATE - :P1_DATE_OF_BIRTH)/365.24,0)
    Page items to submit: P1_DATE_OF_BIRTH
    Selection Type: Item(s)
    Item(s): P1_AGE
    Regards,
    Kartik Patel
    http://patelkartik.blogspot.com/
    http://apex.oracle.com/pls/apex/f?p=9904351712:1

  • Date Picker with Dynamic Action

    Hi
    I have a situation where a DA is fired onchange of a date field using the apex 4 date picker item type.
    The DA does a number of calculations and database requests, so it can take a few seconds over our slow internet connection.
    While the DA is executing, the calendar remains displayed. The application demands that I display at least 1 or preferably 2 months as well as the current month to facilitate the user entry, which means much of the page is obscured. Not only would it be nice so see the various fields in multiple regions being updated progressively, it would also be reassuring for the user to see that the application has not "hung".
    Is this the expected behavior? Is there a technique to close the date picker before the DA actions are triggered?
    Thanks for your advice.
    CS

    Hi,
    Try this write a Zprogram for this.
    REPORT  Zget_date.
    TABLES : RP50D, PA0041, P0041, PA0019.
    PERFORM Z_date.                       "3CML Dynamic action for IT0000
    FORM Z_date.
      DATA: DATE1 LIKE SY-DATUM.
      DATA: DATE2 LIKE SY-DATUM.
      SELECT * FROM  PA0041
               WHERE  DAR01 EQ '11'
                AND PERNR  = P0041-PERNR
                AND BEGDA  = P0041-BEGDA.
        DATE1 =  PA0041-DAT01.
        DATE2 = DATE1 + 1.
        RP50D-DATE1 = DATE2.
        EXIT.
      ENDSELECT.
    ENDFORM.       
    and use this in your dynamic action.
    F Z_date(Zget_date)
    W P0041-DAT01=RP50D-DATE2
    Hope this will solve your problem.
    Regards,
    ARU

  • Dynamic Action On Date Picker

    Hi,
    I need help with understanding dynamic actions. I have two date pickers, I want the value of the first date picker to be the minimum date of the second date picker. To achieve this I have a hidden item whose value I want to reflect the selected date in the required format. In the dynamic action on the date picker I have no condition, and the true action is set to execute the following pl/sql code
    :P200220000_Y_MIN_DT := TO_CHAR(TO_DATE(:P200220000_Y_STR, 'DD-MON-YYYY'), 'YYYYMMDDHH24MI');. The items to submit field contains both the first date picker and the hidden item.
    The "P200220000_Y_MIN_DT" is now passed into the minimum date field of the second date picker. The problem is when the date is changed the hidden item does not get the value until the page is refreshed.
    Am I doing something wrong or just have not mastered the use of dynamic action or are my colleagues right use AJX call backs not dynamic actions.
    Thanks
    Aderemi

    Hi Aderemi,
    first of all as already explained, the min/max values are already used on the server side when the necessary code for the date picker is rendered. When you changed the referenced values in the browser, these values will not change the behavior of the client side date picker widget. But when you submit the page, the new min/max values will be used by the date picker validation check on the server.
    To over the client side date picker display issue, you could directly call the date picker JavaScript code and pass in the new min/max values. Have a look at http://jqueryui.com/demos/datepicker/
    So for example you could have a dynamic action of type "Execute JavaScript code" which executes the following Javascript code.
    apex.jQuery('#P200220000_MY_DATE_PICKER').datepicker("option", "minDate", "-1m");I think that should work. Note: I haven't tested if that really works and it's also some kind of unsupported, because it uses the underlaying jQueryUI APIs the APEX date picker is using. This could change in the future and would invalidate your code.
    Regards
    Patrick
    My Blog: http://www.inside-oracle-apex.com
    APEX 4.0 Plug-Ins: http://apex.oracle.com/plugins

  • Dynamic action - Cache server data

    APEX 4.2.2
    Is there a way to cache server side data in a global (page/document level) Javascript vector (bunch of key-value pairs) (associative array, array of objects or some such)? This way the data can be used by subsequent dynamic actions' Javascript code without querying the server over and over.
    I see that apex_util.json_from_sql is still undocumented after all these years. Are there any examples of using that API to do this sort of thing? Can someone please share?
    Thanks

    https://apex.oracle.com/pls/apex/f?p=57688:24
    I took a shot at this and it seems to work well using Javascript global objects for data storage. Hope this helps someone.
    1. Page attributes - Javascript global variables var gData,gLookup={};2. On-demand application process Get_Emps as apex_util.json_from_sql('select empno,ename from emp');3. Page Load dynamic action to invoke the application process and cache the data var get = new htmldb_Get(null,$v('pFlowId'),'APPLICATION_PROCESS=Get_Emps',$v('pFlowStepId'));
    var retval=get.get();get=null;
    gData=apex.jQuery.parseJSON(retval);
    $.each(gData.row,function(i,obj){
       gLookup[obj.EMPNO]=obj.ENAME;
    });4. EMPNO page item - Standard OnChange dynamic action to SetValue of ENAME page item using the cached data - Javascript expression gLookup[$v(this.triggeringElement)]
    We document something when it is ready to be supported. This specific procedure isn't something we haven't invested in, and thus, per our discretion, have elected not to document or support it at this time.Fair enough.

  • Adding period to a date in Dynamic action

    Hi Gurus,
    We have a requirement where we need to create a IT2010 with a start date less than the action date.
    For E.g If action is run on 02.07.2011 then IT 2010 should be created with 01.07.2011.
    Please help.

    Create program that can be called as a routine in Dynamic Action (table V_T588Z)
    1.    Within the dynamic action, the routine (ZXXXX) will be called (Configured by the functional consultant) with the GETDATE subroutine:
    P2010-BEGDA=RP50D-DATE1
    2.     In the program, we need to minus 1 from the hire date.
    Program     ZXXXX
    Tables : P0000, rp50d
    Form getdate
          Rp50d-date1 = p0000-begda u2013 1
    Endform

  • Get infotype data in e-mail/sapscript - Dynamic action-

    Hello,
    we developed a dynamic action sending a mail if an employee leave the company.
    We can catch data in infotype 0000 and 0001 in the sapscript used in the mail, but we would like also fetch data from other infotypes.
    We tried to generate an ABAP code from an ad hoc query, but it was impossible to get the return tables in the sapscript.
    Are there other solutions to get infotype data in saps scripts?
    Kr,

    Hi ,
    you can follow the below solution .
    1. Create a custom report for the leaving/terminated employees by using the action in infotype 0000 with field massn, massg.
    2. you will get all the employees from table pa0000 who are laving between a date interval .
    3. by using the personnel numbers from pa0000 get other infotypes information.
    4. create a smartform/script for your requirement.
    5. using the program you can send the data to the employees.
    another way .
    if you know the name of the script you can create some variables for the other fields from other infotypes in that script and you can populate the variable values using perform in program command using a custom program in that script.

  • Dynamic Actions not firing when using date picker?

    The dynamic actions don't seem to be triggering when selecting a date from the date picker, but trigger just fine when the dates are manually entered. Anyone else have this problem and if so is there a workaround to get it to work from the date picker as well? I am using Application Express 4.0.1.00.03
    And how can I report this problem?

    I'm already using Change.
    If it matters, I have it set to:
    Event: Select
    Selection Type: Item
    Condition: No Condition
    My action type is just an alert right now since all I want to do is to see if I can trigger it (as in you have to walk before you can run).
    Event Scope: Live
    Conditon type: Dynamic Action not Conditional
    Authorization Scheme: No Authorization Required

  • Concatenating data for field assignment in Dynamic Action

    In a dynamic action I am creating a record in a custom infotype.  In one of the custom infotype fields I need to assign a value of the number 28 concatenated with the personnel number.  The line in the dynamic action is
    W P9007-Z_INS_EE_PK = '28'&Pernr but the problem is I cannot get a concatenation to work.  How do you go about concatenating data together in a field assignment?

    Hi David,
    For this, you will have to write a small routine in a program and then call it in the dynamic action. Consult your technical team on this. Get them to write a routine which would concatenate the value and pass it to field RP50D-FIELD1. You would then call the routine and default the fields as shown below:
    F ZPROGRAM(Z_CONCATENATE)
    I INS,9007,,,
    W P9007-Z_INS_EE_PK=RP50D-FIELD1
    Here, ZPROGRAM is the name of the program and Z_CONCATENATE is the routine which would contain the logic to populate field RP50D-FIELD1 with concatenated value.
    Donnie

  • Dynamic action on IT0035 to create data in IT0171 - URGENT

    Dear HR-ABAP Gurus
    I am new to HR Programming and I am in a situation to achieve the following.
    Through a subroutine pool program ZSUBPGR:
    1. Based on the personnel number, start date and end date of the IT0035 subtype ‘9SOP’ created, program shall retrieve the corresponding IT0171 records.
    If records are found, they need to go into an internal table.
    2. Determine the start and end dates of IT0171 records, which overlap with the IT0035 period. Once determined, proceed to create the IT0171 records changing P0171-BENGR of the record to ‘OVRS’ for the overlapped period.
    This will end in creation of records in IT0171.
    Please help me out by giving some valuable guidelines/sample code towards its resolution at your earliest.
    Thanking you guys in advance... Cheers

    Thanks a lot
    Do you have any sample code that might be of any help in writing the subroutine?
    It will be very much appreciated.
    Thanks

  • Dynamic action on IT0035 to create data in IT0171

    Dear HR-ABAP Gurus
    I am new to HR Programming and I am in a situation to achieve the following.
    Through a subroutine pool program ZSUBPGR:
    1. Based on the personnel number, start date and end date of the IT0035 subtype ‘9SOP’ created, program shall retrieve the corresponding IT0171 records.
    If records are found, they need to go into an internal table.
    2. Determine the start and end dates of IT0171 records, which overlap with the IT0035 period.  Once determined, proceed to create the IT0171 records changing P0171-BENGR of the record to ‘OVRS’ for the overlapped period.
    This will end in creation of records in IT0171.
    Please help me out by giving some valuable guidelines/sample code towards its resolution at your earliest.
    Thanking you guys in advance... Cheers

    Thanks a lot
    Do you have any sample code that might be of any help in writing the subroutine?
    It will be very much appreciated.
    Thanks

  • Dynamic actions - how to create an infotype with a date - 1 day.

    Hi everyone,
    I need a requirement to change an infotype through dynamic action with ENDDA = BEGDA of maintaned infotype(0000) - 1 day.
    In other words when a  personel action is performed, another infotype (2001) should appear for change, and in the validity period of this infotype should end with the day before the start of the personel action.
    is it possible to achieive this using dynamic actions? how?
    Thanks!
    Stanislaw Adamski

    Hi Adamski,
    A dynamic action has the following components.
    Infotype Number (INFTY): specifies the infotype for which you want the dynamic action triggered
    Subtype (SUBTY): narrows the focus to a specific subtype
    Field Name (FIELDN): starts your action when a maintenance function is performed on a particular field
    Function (FC): specifies the various maintenance operations to which your dynamic action would respond. They are 02 (change); 04 (create); 06 (create and change); 08 (delete); 10 (change and delete); 12 (create and delete). Dynamic actions are only applicable in maintenance operations, not in display functions.
    Sequence Number (NO): refers to a sequential number.
    Step (A): specifies a particular type of action. No dynamic action is executed if the function character has a value other than one of the following:
                 P: Plausibility checks, which allow you to check certain conditions.          
                 I: Calls an infotype for processing
                 W: Called after the I statement and used to assign values to screen fields while creating or copying another infotype record through the I statement 
                  F: Calls a FORM routine (subroutines in ABAP) during your action. The routine may reside in or out the module pool MPNNNN00.
                 V: Lets you treat collectively a number of fields for which you want to define a common dynamic action
                  M: Sends SAP Office mail
    Variable function part: The variable function part along with the step indicator forms the core part of your action. It specifies the processing details when the dynamic action is triggered. For example: 
    you have to look for the scenario what you are planning tyo create .
    The maintenance of dynamic actions is done via the view V_T588Z, as shown in 1 (IMG menu path Personnel Management>Global Settings in Personnel Management>Basic Settings>Infotypes>Create Dynamic Actions
    Here you havev to use conditions INS for the infotype what you want to create..
    Please brief the light on the scenario.
    Warm Regards,
    Kapil Kaushal

  • HR - Dynamic action is data saved in table ? is pernr locked ?

    hi,
         I am using a dynamic action to calculate may values,
    to calculate those values i am in need of all the values present on the screen of custom infotype, but due to some problem , i will have only pernr with me . dynamic action will trigger a report program which inturn will trigger one more report program in the second report program , if i use select queries , will i get those values which was stored in the infotype while my dynamic action triggerred ?
    ot those are still to be saved in database table ?
    is the pernr is locked by the infotype while i am in my second report program ?

    the pernr will be locked but will not prevent you from READING other infotype records in your report.. You can use HR_READ_INFOTYPE function module to access the other infotype records..
    ~Suresh

Maybe you are looking for

  • Excise duty and freight amount not capture

    Dear All, Stock transfer between two plants (MFG to SALES) I have assigned Excise and freight condition in RM2000 pricing schema and done the stock transfer(VL10B,VF01,J1IIN) from one plant to another plant, But at the time of MIGO at receiving plant

  • Can´t add music and videos to iTunes

    If I try to add music or videos to my iTunes library nothing happens at all, even if the files are mp3 and mp4. But there´s no error shown to me. Just nothing happens. I know that this question was already asked, but there´s no answer which helpes me

  • Applet function call from javascript

    Hi, I'm haveing a problem with accesing applet's functions from Javascript in Mozilla. IE works fine but in Mozilla I get the following error: Error: document.applets[0] has no properties The code used is: document.applets[0].test(); The applet has t

  • 2 Process Forms and 2 Provisioning Flows for each of these process forms

    Hi, I was just wondering is it possible to Create 2 Process Forms for a same Resource/Object form? I know there can be two Provisioning flows, how to determine which flow to go to after approval? Is it possible based on rules in object form? How to m

  • Ideal Linux distro for a computer lab

    I'm looking for a good Linux distribution to install on a ~40 PCs programming laboratory. The desktops need to be user-friendly for both Linux and non-Linux users (which means that's probably a KDE/Gnome desktop). I think that a rolling-release distr