HR_INFOTYPE_OPERATION from dynamic action?
hi
plz send me the sample code for calling subroutine (using the above mentioned FM) from dynamic action ..
Regds
Gunjan
It's here a little example.
FUNCTION ZHR_INFOTYPE_OPERATION.
*"*"Lokale Schnittstelle:
*" IMPORTING
*" VALUE(ZINFTY) LIKE PRELP-INFTY
*" VALUE(ZNUMBER) LIKE P0001-PERNR
*" VALUE(ZSUBTYPE) LIKE P0001-SUBTY OPTIONAL
*" VALUE(ZOBJECTID) LIKE P0001-OBJPS OPTIONAL
*" VALUE(ZLOCKINDICATOR) LIKE P0001-SPRPS OPTIONAL
*" VALUE(ZVALIDITYEND) LIKE P0001-ENDDA OPTIONAL
*" VALUE(ZVALIDITYBEGIN) LIKE P0001-BEGDA OPTIONAL
*" VALUE(ZRECORDNUMBER) LIKE P0001-SEQNR OPTIONAL
*" VALUE(ZRECORD) type p0014 "use the infotype number you need
*" VALUE(ZOPERATION) LIKE PSPAR-ACTIO
*" VALUE(ZTCLAS) LIKE PSPAR-TCLAS DEFAULT 'A'
*" VALUE(ZDIALOG_MODE) TYPE C DEFAULT '0'
*" VALUE(ZNOCOMMIT) LIKE BAPI_STAND-NO_COMMIT OPTIONAL
*" VALUE(ZVIEW_IDENTIFIER) LIKE P0003-VIEKN OPTIONAL
*" VALUE(ZSECONDARY_RECORD) OPTIONAL
*" EXPORTING
*" VALUE(ZRETURN) LIKE BAPIRETURN1 STRUCTURE BAPIRETURN1
*" VALUE(ZKEY) LIKE BAPIPAKEY STRUCTURE BAPIPAKEY
CALL FUNCTION 'BAPI_EMPLOYEE_ENQUEUE'
EXPORTING
number = znumber.
CALL FUNCTION 'HR_INFOTYPE_OPERATION'
EXPORTING
infty = zinfty
number = zpernr
subtype = zsubty
objectid = zobjps
lockindicator = zsprps
validityend = zvalidityend
validitybegin = zvaliditybegin
recordnumber = zrecordnumber
record = zrecord
dialog_mode = zdialog_mode
operation = zmod
IMPORTING
return = zreturn.
CALL FUNCTION 'BAPI_EMPLOYEE_DEQUEUE'
EXPORTING
number = znumber..
COMMIT WORK AND WAIT.
endfunction.
bye
enzo
Similar Messages
-
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 and Dynamic Actions
Does HR_INFOTYPE_OPERATION trigger Dynamic Action?
If not, how this needs to be handled?your best bet would be the person who created the dynamic action.. usually the functional analyst.. you can take a look at the entries in v_t588z via SM30/31.Once you display the entires, an F1 on each field on the screen will tell you what it is for & F4 will give you the possible options..
~Suresh -
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 -
Hi ALL,
I have form based on table issues.
In that form, there is a item issue_summary.
and also on the same page there is interactive report.
I want, when user enter issue-summary, then it should search in table and
populate IR with the related issues.
Can anybody please help me, how we can do this?
Thanx
OmyHI Machaan,
Just noticed one issue..
my IR query is
select "IT_ISSUES"."ISSUE_NUMBER" as "ISSUE_NUMBER",
"IT_ISSUES"."ISSUE_SUMMARY" as "ISSUE_SUMMARY"
from "IT_ISSUES" "IT_ISSUES"
where upper(issue_summary) like upper('% '|| :P7_issue_summary || ' %')
so, what is happening is:
when page loads first time, IR shows all data in table because column is null. otherwise when I enter data, then it filters fine.
How can I overcome this issue..
Thanx
Omy. -
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 friends,
I have question on Dynamic Actions in HR module. I try to call a subroutine from Dynamic Actions. I have to pass P0041-DAT01, P0041-DAT02, P0041-DAT03, P0041-DAT04 parameters to the subroutine. I don't know the procedure / syntax to pass parameters. Can any one give me the example for this requirement. You help will be greatly appriciated.
Thanks in advance.
HariHello Hari
I did this some time ago so I am not sure if my description will be complete. However, I can describe you what I did.
I defined a report containing a FORM routine that should be dynamically called.
In the header section of the report I have the following statement:
INCLUDE mppdat00. " Common Part SAPFP50M
As data definitions I added the required infotype tables:
TABLES: p0000. " Personal-Stammsatz Infotyp 0000 (Massnahmen)
TABLES: p0001. " Personal-Stammsatz Infotyp 0001 (Org. Zuordnung)
TABLES: p0002. " Personal-Stammsatz Infotyp 0002 (Daten zur Person)
Now in the FORM routine I work directly with the variables (p0000, p0001, ...). When the FORM routine is dynamically called these variables contain the values of the infotypes.
Regards
Uwe -
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 -
How to create a dynamic action from link column in classic report
I Have an apex page that display a modal window utilizing jquery. In the modal window I have a classic report with a link column that I want to capture its click event.
I was thinking I could create a dynamic action with selection type=jquery selector. Not for sure if I need to do anything on link column and do not know the syntax
for jquery selector. Would appreciate any help or direction???Thank you for your response. I am very new to Jquery so don't understand all that well.
What I did:
I created a dynamic action
Event: Click
Selection Type: jQuery Selector
jQuery Selector: tdheaders
Created True Actions
I created an alert to see if this is being executed.
Alert 'I made it here'
What I have:
I created a report region with the following query:
Select empno, ename, 'SELECT' from emp
where (ename like '%'||ltrim(rtrim(:P2_SEARCHPU))||'%'
or :P2_SEARCHPU is null)
I created 'SELECT' column as Link Column
Report Attributes
Link Text Select
Target Page in this Application
Page 2
Region Header
<div id="ModalForm2" title="Employee List" style="display:none">
Region Footer
</div>
This report is displayed in a modal form when a button is clicked.
Code for modal window in Page Header
<script type="text/javascript">
$( function() {
$('#ModalForm2').dialog(
{ modal : true ,
autoOpen : false ,
buttons : {
Cancel : function() {
closeForm2();
function openForm2()
$('#ModalForm2').dialog('open');
function closeForm2()
$('#ModalForm2 input[type="text"]').val('');
$('#ModalForm2').dialog('close');
</script>
I am trying to capture the click event on the link column of the report in the modal form. I want to pass a couple of column values
back to the main form and close the modal window. I do not want to do the submit that happens if I click on the link column and link back to the main page(2)
If I let the submit to happen, all other entered fields are cleared on my main form.
Just don't understand the jQuery selector. I have no problem catching the button clicks on the modal form. -
Execute javascript from plsql in a dynamic action.
Is it possible to execute javascript with htp.p from a plsql block in a dynamic action (on change).
I have tried it but I get a JSON error.
The reason I want to to this is:
I have to check something with plsql and depending on the result I want to do something in javascript.
I now going to try it with ajax from javascript, but if somebody has a other way to do this i like to hear it.
Thanks,
Fred.Very neat, many thanks.
I now have a 'Set Value' 'Javascript Expression' action of 'this.triggeringElement.id;' to set a hidden *but unprotected* page item. This is followed by the 'Execute PL/SQL' action which simply calls a package procedure and passes the name of the triggering item. The procedure then sets the session state(s) as required.
Thank you! -
Dynamic action setvalue from pl/sql function
Hi,
I have a currency table with exchange rate column.
I created a form that allow user to select currency from the table and get the rate into Px_RATE page items.
I would like to implement it using Dynamic action in apex 4
Please help me on this case
Thanks & regardsHi,
You can achieve this by defining a dynamic action as follows...
#1 - Right click on the page item used to select the currency (let's call it P1_CURRENCY for purposes of this example) and select 'Create Dynamic Action'
#2 - Select 'Advanced' as we're going to use the 'Set Value' dynamic action type, which is not available in the 'Standard' branch of the wizard.
#3 - Name your dynamic action, say 'GET RATE', click 'Next'.
#4 - Leave the 'When' attributes as default, this just defines that the dynamic action will fire whenever the currency item changes, click 'Next'.
#5 - For the 'True Action > Action' select 'Set Value'
#6 - Think about whether you want to set the value on page load from the dynamic action also, if so leave the 'Fire on Page Load' checkbox checked.
#7 - [Assuming you have a simple PL/SQL API that returns the rate, say get_rate for example] Select 'Set Type' of 'PL/SQL Function Body'
#8 - For 'PL/SQL Function Body' specify something like: return get_rate(:P1_CURRENCY);#9 - For 'Page Items to Submit', specify the currency item P1_CURRENCY and click 'Next'
#10 - For the 'Affected Elements' specify 'Item' and then select the page item where you want to return the rate value, say P1_RATE.
#11 - Click 'Create'.
Let me know if this works for you or if you have any further questions.
Regards,
Anthony. -
Using HR_INFOTYPE_OPERATION in external subroutine for Dynamic Actions
Hi,
I am calling an external subroutine in the Dynamic Actions of an Infotype. In this external subroutine, I am using HR_INFOTYPE_OPERATION to modify OTHER records of the same Infotype number.
However, when I tried to trigger the Dynamic Actions in PA30, the other infotypes get modified as intended. But when I refreshed the PA30 screen, the changes were reversed back as if the HR_INFOTYPE_OPERATION were not carried out at all. I have COMMIT WORK after the HR_INFOTYPE_OPERATION, refreshed the buffer. But it doesn't seem to work.
My question is: Can i use HR_INFOTYPE_OPERATION in an external subroutine which is called during dynamic actions? As I have some complicated logic, I do not want to embed the coding in the Dynamic Actions. Is there a way for HR_INFOTYPE_OPERATION to work in the external subroutine with the changes being committed to the database?
Thank you.Hi,
I remember the same problem being faced by some of the forum members.
Suresh Datti had replied that "Call the subroutine in a nother program using a SUBMIT statement. This will create two sessions and will update the DB". This was working fine for the users.
Hope you can try this.
Just call a program using SUBMIT statement and code your form routine inside that.
Hope this helps you.
Regards,
Subbu. -
Call a Automatic Row Fetch from a Dynamic Action
Hi,
can I execute the Automatic Row Fetch from a dynamic action?
I only found this post (Dynamic Actions to call Automatic Row Processing (DML) but the link where the solution is does not work :(
Thanks,
Edited by: Elena.mtc on 09-nov-2012 5:46Elena.mtc wrote:
I forgot to say, for several reasons, I don't want to submit the page. So that's where I find the complexity in calling the ARf.
Thanks.You cannot fire the ARF because it is designed to run when the page is rendered and it cannot be called as a standalone
Create a dynamic action as follows to fetch the form detials
Action: Execute PL/SQL Code
PL/SQL Code:
begin
select ename, job, mgr, hiredate, sal
into :P4_ENAME, :P4_JOB, :P4_MGR, :P4_HIREDATE, :P4_SAL
from emp
where empno = :P4_EMPNO;
exception
when others then
null;
end;
Page Items to Submit: P4_EMPNO
Page Items to Return: P4_ENAME,P4_JOB,P4_MGR,P4_HIREDATE,P4_SAL
See this working example: http://apex.oracle.com/pls/apex/f?p=32940:4
Login as test/test
If you want to make it more dynamic you can query the APEX metadata to find the form items on your current page
select * from apex_application_page_db_items
where page_id =:APP_PAGE_ID
and application_id = :APP_ID; -
Dynamic Action when GB_Job / Postion Change from G1 to G2,or G5,or G6
Hi All
Does any body have any idea how can I write Dynamic Action for, when the position is changed from in subgroup G1 to G2, or G5 or G6 for action infotype 0000, i want a prompt should apper mentioning Emploee Benefits need to be changed, when this action occurs.
Any help will be highly appreciated
regards
AJIf it is just to prompt the User to change the benfits, you can use the AFTER_INPUT method in the BAdI HRPAD00INFTY.
~Suresh -
Returning System Messages From A Called Routine In Dynamic Actions
I am triggering a call to a custom ABAP program from a Dynamic Action. This program is doing updates and the user was asking me if I could return any system messages back so that the person doing the action would see them. I've done some looking and can't seem to find an answer so I've come to the experts. Any help is appreciated.
Problem solved.
Maybe you are looking for
-
How do i share files beween 2 computers on the same local net
I have a iMac and a MacBook. I usually use the iMac but when I go on vacation I take the MacBook. How do I get the files and bookmarks from the iMac to the MacBook?
-
Watching movies on projector hooked up as second monitor
Hey all, here's a real good question for you. I currently have a projector (nec lt84 OLD!!!) and love it. It's hooked up to my G5 DC 2.0ghz with the 128meg geforce 6600lt (the stock video card with the dual core 2.0ghz). The projector's resolution is
-
Hi, I have a problem with my iPod shuffle
Hi, the music is heard as if slip. It listens like a karaoke track, the voices and the music background and stronger. Can somebody help me? Thanks a lot!
-
CS4-JS : Read XML file and getting Attributes
Dear All, How to get the Attributes based on the RootElements. For Example: //========================== XML File : Start ================================// <stag> <cust> <custname>120</custname> <atagst name="alpha" attributena
-
is it's right practice whether all exchange 2010 role servers in Dmz zone?? or need to place only cas server in DMZ ZOne??