Calling earliest record in a dynamic action
Hi all,
I am using dynamic actions to call infotype 0016 when user creates a new record in infotype 19. I am opening this infotype 0016 in change mode.
Now, I want that the earliest record of infotype 0016 should come in the change mode and not the latest one.
Please suggest what to do for that?
Thanks
Ribhu
Hi Do in this way..
Call a routine...
There is a structure RP50D which is accessible in dynamic action...
Structure is :
FIELD1
DATE1
DATE2
FLAG1
.INCLUDE CI_INCLUDE
in side that routine find out the record for ur particular date..
and pass BEGDA and ENNDA for that record to RP50D-DATE1 and RP50D-DATE2.
and in dynamic action call :
COP,0016,,,(RP50D-DATE1),(RP50D-DATE2)
if u want more fields then u can include in CI include..
Hope it will work
reward if helpful
Regards
Prax
Similar Messages
-
Call a routine in a dynamic action.
Hi Experts,
i want to write a routine in which i can give the error msg while saving the infotype 0002 incase the given condition is not fulfilled.
Can you tell me where i can write this routine and how to call it in a dynamic action.
i hav written other types of dynamic actions before but never called any routine before
Plz give me the detailed info regarding writing a routine.
regards
TSHello TS,
You can do that using F in Indicator for step but iam not sure whether it will return an error message. We have user exits for this which might solve your issue. We have userexit PBAS0001 and in this EXIT_SAPFP50M_002 Function module, we need to write the code which ever you want to do.
For Calling FORM in Dynamic actions.
P - Check conditions
I - Maintain infotype record
W - Set default values when creating a new record
V - Reference to another step
F - Call routine
M - Send mail
Say you have a program ZTEST. In this you need to write the form that needs to be called in dynamic action and say for ex:form_test.
You can fill only structure RP50D values, because these values you can get it back to dynamic action. ypu can check for examples in dynamic actions it self which have 'F' indicator step.
Regards,
Kiran I -
Call a transaction code in dynamic action
Hi
How can we call a transaction code in a dynamic action.
TC XD01 is populated when changes is happen in IT0006 subtype 03.
Regards
WSHi,
Please find the below threads which may help you.
Problem in calling dynamic actions in BDC
Create Dynamic Action
Triggering Dynamic actions when updating an Infotype using a FM
Thanks & Regards,
Sandip Biswas. -
HR_INFOTYPE_OPERATION within Dynamic Action
Hello,
I am calling HR_INFOTYPE_OPERATION from within the Dynamic Action. I can debug through it and even have it display the screens and everything appears to work fine. The return structure is clear of any errors and the key structure indicates that the 'MOD' was done with no problem. The infty is 2012.
However once the dynamic action is complete the 2012 records have not been updated. I am passing blank for the no_commit parameter on the FM.
Does HR_INFOTYPE_OPERATION with a 'MOD' operation work from within the dynamic action?
Regards,
JeffHi Jeff,
I am not sure if I get you right. But as for DB commit, it will be triggered automatically once SUBMIT statement is executed (as work process is released). What I have in my program is as follows:
- in T588Z table (dyn.actions) I have invoked subroutine from my custom program
POPUP_SELECTION_FOR_IT0015((YPLPY_PRO_RE_QUOTAGEN1).
- In this YPLPY_PRO_RE_QUOTAGEN1 program I write subroutine wherein I do some coding and submit another report (which do real update).
form POPUP_SELECTION_FOR_IT0015.
"some coding - in my case I am filling P0015 strcutre (as this infotype has to be udpdated) while dyn. action is triggered for IT2002
P0015-PERNR = LS_PSKEY-PERNR = P2002-PERNR.
P0015-SUBTY = LS_PSKEY-SUBTY = P0015-LGART = LGART = IT_RET-FIELDVAL.
P0015-BEGDA = LS_PSKEY-BEGDA = DATUM.
P0015-ENDDA = LS_PSKEY-ENDDA = DATUM.
P0015-UNAME = UNAME.
P0015-INFTY = LS_PSKEY-INFTY = '0015'.
"before I am submiting another program I am passing this strcuture
export P0015 = P0015 PSKEY = LS_PSKEY to memory id 'ZXPADU02_P0015'.
submit YPLPY_PRO_RE_ZXPADU02_2002
and return.
- Now the below program creates my IT0015 and the same time changes to IT2002 are written (DB commit is triggered with SUBMIT)
REPORT yplpy_pro_re_zxpadu02_2002.
data: p0015 like p0015.
data: ls_return TYPE bapireturn1,
ls_pskey like pskey.
IMPORT p0015 = p0015 pskey = ls_pskey FROM MEMORY ID 'ZXPADU02_P0015'.
CALL FUNCTION 'HR_EMPLOYEE_ENQUEUE'
EXPORTING
number = ls_pskey-pernr.
CALL FUNCTION 'HR_INFOTYPE_OPERATION'
EXPORTING
infty = ls_pskey-infty
number = ls_pskey-pernr
subtype = ls_pskey-subty
validityend = ls_pskey-endda
validitybegin = ls_pskey-begda
record = p0015
operation = 'INS'
dialog_mode = '2'
IMPORTING
return = ls_return.
IF NOT ls_return IS INITIAL AND
ls_return-type EQ 'E'.
MESSAGE e000(38) WITH ls_return-message.
ENDIF.
"unlock the EE
CALL FUNCTION 'HR_EMPLOYEE_DEQUEUE'
EXPORTING
number = ls_pskey-pernr.
Works fine for me.
Regards
Marcin -
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 -
How to Send Notification to Manager of the Employee using Dynamic Action..
Hi All,
I am sending a notification using the Dynamic Action for an Infotype.. I am able to send mail using distribution list but I have a requirement to send the notification to employee manager. I am able to determine the Line Manager ID calling the subroutine in the dynamic action. But I am not sure how to send the notification to the manager.
If the email's are maintained in distribution list if I specify the text id in the feature M0001 and distribution list the notifications are sent. I am not sure how to pass the line manager id to get the same notification..
I have seen the option REC1 but infotype 0001 in not having the line manager id..Used the Function Module RH_GET_LEADING_POSITION.
Thanks.. -
Dynamic actions settings to mail generation
Hi
The actions are set for mali generation ,when ever personnel action happen.while testing the mail generation some actions are fine which are set in dynamic actions with out action for reasons.but some of actions are not working which are mentioned action for reason.
one case i set dynamic actions for hiring action with mentioning action reason.that time it will entered in to programing and generating mail.
but in another case i have 3-4 reason for actions that time the program will considering only action type ,its not entering into program considering action for reason.
can any body give me brief advise how to set dynamic action while action having the action reasons.
Regards,
arjunSreehari,
You can configure feature M0001 (Add MASSN/MASSG as your decision operation) and you can call this feature in the dynamic action table T588Z
Reward Points if this is helpful.
Sanghamitra
Message was edited by:
Sanghamitra11 -
Send mail using Dynamic actions
Hello experts,
How to send a mail using Dynamic Actions??
Requirement : Lets say one employee is hired on 26th Aug, so after 10 days he will be confirmed. so on 8th day need to send a mail to concerned person reminding the confirmation date.
so how do i do that using dynamic actions??
Thanks in advance.
SaurabhHi,
In dynamic actions there is an option for calling sub-routine from any program or subroutine pool. So u can make subroutine for sending mail according to ur requirement. An call on th same from dynamic actions.
if u want sample code for this, pls let me know.
<removed_by_moderator>
Regards,
Ranjith
Edited by: Julius Bussche on Aug 26, 2008 3:25 PM -
Re: Dynamic Action is not triggering in LSMW Recording
Hello All,
In SAP HRMS personnel actions if i do using LSMW Recording it is not triggering the dynamic actions.
Is there any mechanism to Trigger dynamic action in LSMW Recording ?
How to find the differences in process with and with out recording ?
Small help is also highly appreciated.
With Regards,
Sunil,
+91-9903695384.Yes. Do one thing. First study the dynamic action. Try to understand what the dynamic action is doing. Is it creating data in other infotype or is it updating some other table. Once it is clear what the dynamic action is doing then you can try to implement the same logic in LSMW. In LSMW there is a provision to add more than one recording and this recording can be called based on some logic..
Thanks & Regards,
Sandip -
HR_INFOTYPE_OPERATION not working when called from Dynamic action
Hi ,
Senario : I would like to execute a form from dynamic action which
creates a record in 0015 (Additional payment IT) .
I have writen the code as shown below am using FM HR_INFOTYPE_OPERATION
. When i execute the program from se38 it is creating a record, however it is
not created when it is called from dynamic action..when i debugged the code in
inside the FM HR_INFOTYPE_OPERATION there is a FM HR_MAINTAIN_MASTERDATA where
they are using call dialog (statement) and
sy-oncom = 'N' when called from Dynamic action and
sy-oncom = 'S' when called executed directly.
I tried to change the sy-oncom to S while run from Dynamic action it created
the record.
So Can anyone explain me abt sy-oncom and how can i resolve the issue..
code..
REPORT ZHRPYENH01 .
perFORM TERMIATION_9000.
INCLUDE DBPNPMAC.
FORM Termiation_9000 *
FORM TERMIATION_9000.
INFOTYPES : 0015.
*data : i .
*i ='c'.
*break-point.
*message i000(000) with i.
TABLES : PRELP.
DATA : P9000 TYPE PA9000." with header line.
DATA : P0000 TYPE STANDARD TABLE OF P0000 WITH HEADER LINE.
DATA : P0015 TYPE STANDARD TABLE OF P0015 WITH HEADER LINE.
DATA : HIRE_DATE LIKE SY-DATUM,
TERM_DATE LIKE SY-DATUM.
DATA : MOLGA LIKE T500L-MOLGA VALUE '25',
SEQNR LIKE PC261-SEQNR.
DATA : RGDIR TYPE STANDARD TABLE OF PC261 WITH HEADER LINE.
DATA : ACTUAL_PERIOD LIKE PA9000-RETENTION.
DATA : PNP-SW-FOUND TYPE SY-SUBRC ,
PNP-SY-TABIX TYPE SY-TABIX.
DATA : TER_PERNR LIKE PA0001-PERNR.
DATA : REF_PERNR LIKE PA0001-PERNR.
data : key type BAPIPAKEY.
data : payed_amount type p0015-BETRG.
data : future_payment_amount type p0015-BETRG.
data : p0002 like pa0002.
types : begin of t_deduction ,
deducation_date like p0015-begda,
future_payment_amount type p0015-BETRG.
types : end of t_deduction.
data : future_deduction type standard table of t_deduction with
*header line.
data : future_deduction type t_deduction .
data : RETURN type BAPIRETURN1.
*data : deduction_p0015 like standard table of p0015 with header line.
data : deduction_p0015 like p0015 .
xxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxx
****Prepare 0015 data for deduction
*deduction for payed amount
clear deduction_p0015.
*refresh deduction_p0015.
deduction_p0015-pernr = REF_PERNR.
*deduction_p0015-pernr = TER_PERNR.
deduction_p0015-lgart = 'M120'.
deduction_p0015-begda = sy-datum + 1 .
deduction_p0015-endda = sy-datum + 1 .
deduction_p0015-BETRG = payed_amount.
deduction_p0015-WAERS = 'SGD'.
deduction_p0015-ZUORD = TER_PERNR.
*append deduction_p0015.
**deduction for future payment amount
*loop at future_deduction.
*clear deduction_p0015.
*deduction_p0015-pernr = REF_PERNR.
**deduction_p0015-pernr = TER_PERNR.
*deduction_p0015-lgart = 'M120'.
*deduction_p0015-begda = FUTURE_DEDUCTION-DEDUCATION_DATE.
*deduction_p0015-endda = FUTURE_DEDUCTION-DEDUCATION_DATE.
*deduction_p0015-BETRG = future_deduction-future_payment_amount.
*deduction_p0015-WAERS = 'SGD'.
*deduction_p0015-ZUORD = TER_PERNR.
*append deduction_p0015.
*endloop.
Create a deduction wage type in 0015 for the employee
break-point.
CLEAR RETURN.
CALL FUNCTION 'BAPI_EMPLOYEET_ENQUEUE'
EXPORTING
NUMBER = REF_PERNR
VALIDITYBEGIN = '18000101'
IMPORTING
RETURN = return
if not return is initial.
message E000(000) with
'Referred Employee could not be locked for referal payment deducation,
please try after some time'.
endif.
CALL FUNCTION 'HR_INFOTYPE_OPERATION'
EXPORTING
INFTY = '0015'
NUMBER = REF_PERNR
SUBTYPE = 'M120'
OBJECTID =
LOCKINDICATOR =
VALIDITYEND = SY-DATUM
VALIDITYBEGIN = SY-DATUM
RECORDNUMBER =
RECORD = deduction_p0015
OPERATION = 'COPY'
TCLAS = 'A'
DIALOG_MODE = '2'
NOCOMMIT =
VIEW_IDENTIFIER =
SECONDARY_RECORD =
IMPORTING
RETURN = return
KEY = key
break-point.
COMMIT WORK.
if not return is initial.
*return-TYPE
*ID
*NUMBER
*MESSAGE
message I000(000) with return-MESSAGE.
endif.
CALL FUNCTION 'BAPI_EMPLOYEET_DEQUEUE'
EXPORTING
NUMBER = REF_PERNR
VALIDITYBEGIN = '18000101'
IMPORTING
RETURN = return
xxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxx
Thanks and regards
-Senthil Bala
Message was edited by: senthil balaHi Senthil
Why at all U want a subroutine to create a record in IT0015 through Dynamic action.There are some standard codes available to update infotypes.
Let me give U an example
14 9CON BETRG 4 2 I INS,0015 This will create a record in IT0015 when IT0014 is updated with Wagetype 9CON
14 9CON BETRG 4 3 W P0015-LGART='5400' Set wagetype for IT0015(Here U can use a subroutine call to set the wagetype)
14 9CON BETRG 4 4 W P0015-BETRG=P0014-BETRG set amount for IT0015(Here U can use a subroutine call to get the amount)
14 9CON BETRG 4 5 W P0015-BEGDA=P0014-ENDDA set the dates(Here U can use a subroutine call to set the dates)
Hope this will help U.
Please award points if helpful -
HR_INFOTYPE_OPERATION called inside Dynamic action
I am writing a subroutine called by dynamic action.
Where using FM 'HR_INFOTYPE_OPERATION' i have to delimit or delete the records of infotype 0167.
Although, HR_INFOTYPE_OPERATION, is executing with return is 0. but there is no change in the infotype reocrd.
The same code written independent without called from Dynamic action, infotype record is been updated.
Any help would be highly appriciated.
Regards
ManvirAlso look at thread !!
Re: Strange behavior of FM u0093HR_MAINTAIN_MASTERDATA u0093
and
Re: Why does the NOCOMMIT parameter not work in HR_INFOTYPE_OPERATION?
Id recommend you to write BDC program . This FM is behaving in a weird way!!!
<b>I used it only for 'INS' ...</b>
Hope thisll give you idea!!
<b>P.S award the points.</b>
Good luck
Thanks
Saquib Khan
"Some are wise and some are otherwise" -
hi experts,
i have an subroutine for dynamice action for creating IT2006 with me.
but i dont no where to call that subroutine can anyone plz tell me how to do this.
where should i write perform statement.
for eg. i want to call that action while creating /changing the record in IT0001.
plz do ASAP.
thanks in advance.
vinod.HI,
Go to IMG>Personnel Management>Personnel Administration>Customizing Procedures>Dynamic Actions
Or Use table T588Z.
Have a look at these links
http://wiki.ittoolbox.com/index.php/Dynamic_Action
http://www.hrexpertonline.com/downloads/Rehan%20Zaidi%20Online%20Portion.doc
Reward points if Helpful.
Regards,
Manoj. -
Info group being not called while using Dynamic Actions
Hi,
I am facing a scenario that, while we execute some action from PA40 like termination, then it will call my subroutine for dynamic actions which will be calculating the last day worked and updating the same in Info Type 0041.
For updating the IT 0041, i am using the function module HR_MAINTAIN_MASTERDATA. and IT0041 is getting updated properly. But now the problem is coming that when the control comes out of subroutine, it is going back to the PA40 Screen and not to the next screen of the Info group.
What can be the cause for the same.
RND I have done on my part: I have commented/uncommented the return parametre RP50D-Date1, commented/uncomented the use of function modules to lock and Unlock the pernr.
Please give ur comments.
Thanks in Advance.Hi Nisha,
Not sure if I have understood correctly, but if you just wanted to calculate leaving date and write the same date in IT0041 then you don't need a function module:
1. Create a small program, as follows:
REPORT ZHR_PY_R0008 .
INCLUDE MPPDAT00.
TYPE-POOLS HRQTA.
TABLES: P0000,
RP50D,
T001P.
ROUTINE CALLED BY TABLE T588Z
FORM CHANGE_DATE.
RP50D-DATE1 = P0000-BEGDA - 1 .
ENDFORM. " CHANGE_DATE
This program will give you the last working day written to RP50D-DATE1
2. Simply enter the following lines into table T588Z:
0000 04 499*- LEAVING ACTION - Populate Infotypes with leave date -*
0000 04 500 P T001P-MOLGA='08'
0000 04 501 P PSPAR-TCLAS='A'
0000 04 502 P PSPAR-MASSN='*'/X (* equals your leaving action types)
0000 04 503 P PSPAR-MASSN='*'/X (* equals your leaving action types)
0000 04 504 F CHANGE_DATE(ZHR_PY_R0008)
0000 04 505 ******** INF.0041 ********
0000 04 506 I COP,0041,,,(P0000-BEGDA),(P0000-ENDDA)/D
0000 04 507 W P0041-DAR07='*' (* equals your date type)
0000 04 508 W P0041-DAT07=RP50D-DATE1
or if you are simply looking to delimit IT0041 with the leave date then replace lines 506-508 with:
0000 04 506 I MOD,0041,,,(RP50D-DATE1),(RP50D-DATE1)/D
0000 04 507W P0041-ENDDA=RP50D-DATE1
This will solve your problem : - ) -
Dear SAP Crew,
In dynamic action, we can call routines through indicatiors.
In that routine, Can we call a report program or schemas???
Kindly clarify with some scenario.
Thks & Rgds
Krish SathyaHi Krish,
In the routine you should be able to SUBMIT the program/report you need to execute.
Cheers,
Aditya -
Dynamic action to create ESI record
Friends
I am using the following code to create ESI record in infotype 588 in Dynamic actions and working for a single payroll area.
0001
04
862
P
T001P-MOLGA='40'
0001
04
863
P
PSPAR-MASSN='S1'
0001
04
864
P
P0001-ABKRS='P3'
0001
04
865
P
P0001-PERSK='W0'
0001
04
866
F
GET_DATE(HBRDYNMS)
0001
04
867
I
INS,0588,0001,,(P0000-BEGDA),(P0000-ENDDA)/D
My requirement is PERSK is same for various payroll areas, hence don't want to create separate codes.
I am trying to insert multiple payroll areas in line no. 864 with the following code
0001 04 864 P0001-ABKRS = 'P1' OR P0001-ABKRS = 'P3' OR P0001-ABKRS = 'P5'/X
But the record is not getting created.
Pl. help to use multiple payroll area option.
regards
Raghuram RIf you are useing for multiple area please use the below
6
1
P
P0001-ABKRS='XX' /X
6
2
P
P0001-ABKRS= 'XX' /X
you shoduld use all the payroll areas with /X which say if payroll X or Y but not only or after X.
Maybe you are looking for
-
Good morning, does anyboby know if and how is possible planning costs on sales orders? Currently, sales orders are set as account assignment; actual costs are accounted without problems on sales orders and report KKBC_KUN properly shows costs. But no
-
To determine the number of rows selected in a table view (BSP)
Hi, My requirement is: I would be selecting 1 row from a table view ( which is made multiselect for another requirement) , and press a button. The functionality of button is to open a popup window based on the row selected. I want to display an error
-
HP Pavilion 15-n261nr windows 7 64 bit usb controller driver
I see to not be able to find the correct driver for the usb controller. The hardware for it is called PCI\VEN_8086&DEV_9C31&SUBSYS_2163103C&REV_04
-
Can't connect to WWAN through the ericson mobile broadband adapter (f3507g)
hello, I have a T400 P/N:7417-TNU with a built in mobile broadband adapter (ericsson). i am using a local (israeli) sim card to connect, the sim is working just fine with an external modem. when i try to connect through access connections it doesn't
-
Credit Memo and Debit Memo extraction by extractor
Hi, I've to extract data from 2lis_13_vditm datasource. Let us say if credit memo and debit memos are coming from this then key figure values are going to be multiplied with -1 for credit memo and debit memo will come +ve values correct?