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,
Jeff
Hi 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
Similar Messages
-
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 from dynamic action?
hi
plz send me the sample code for calling subroutine (using the above mentioned FM) from dynamic action ..
Regds
GunjanIt'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 -
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" -
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. -
Problem setting a hidden item value when button clicked with dynamic action or pl/sql process
Apex 4.1
Oracle 11g
I have a page that consists of a main region and several sub regions. I have a pl/sql process in After Header SET_DISPLAY(:P400_DISPLAY :='MAIN';)
Three subregions have a contional display where P400_DISPLAY = STORE. This works in hiding the sub regions.
Now I want to change the P400_DISPLAY value to STORE to show the subregions when I hit a button.
I tried creating a dynamic action for on click of the add button but get the following error:
The selected button uses a 'Button Template' that does not contain the #BUTTON_ID# substitution string
I went to the templates and found:
Substitution Strings
Substitution strings are used within sub templates to reference component values. This report details substitution string usage for this template.
Substitution String
Referenced
From
Description
#LINK#
Yes
Template
To be used in an "href" attribute
#JAVASCRIPT#
No
To be used in an "onclick" attribute
#LABEL#
Yes
Template
Button Label
#BUTTON_ATTRIBUTES#
No
Button Attributes
#BUTTON_ID#
No
Generated button ID will be either the button's Static ID if defined, or if not will be an internally generated ID in the format 'B' || [Internal Button ID]
I then tried creating a page process, pl/sql, :P400_DISPLAY :='STORE'; when the appropriate button is pressed. The button action is submit page. However, it does not change the P400_DISPLAY value and the subregions stay hidden.
Suggestions please on how to fix the template or change the P400_DISPLAY value?The root issue is that, although you change the value of your page item, it isn't visible to other areas of the page until it is in the session. So, any other action based on the value of your page item; the visibility of a control, a report based on the item's value, etc. will all be unaffected by changing the value of the page item until it has been changed in the session. Even after this the items are stored in the session, you must thereafter do something to cause the value to be reevaluated. To see the effect of this, observe that your page loads and evaluates the value of your page item, it sees that is "MAIN" and hides the regions. However, it doesn't reevaluate them after this.
So; your choices to get this value set in the session are to either Submit the page, or use JavaScript to set the value in the session. If you use the latter of these, you'll have to do some further work to cause the visibility tests to be re-run, So, let's stick with with the submit method.
What you've done above sounds correct for this but, there are a lot of decisions you could have made that might have caused things not to happen in the correct sequence.
Firstly, let's confirm that what I describe above is your problem. From the development environment, load the page, click the button to change the value and submit. Now, click the link labelled Session. Is it still set to MAIN? If so; this is your issue.
Let's start with the your After Header computation. Did you set it to *only* run if the current value of your page item is NULL??? If not, that's your problem.
Load Page -> Item set to 'Main' by Computation -> Click Button -> Item set to STORE -> Submit -> Load Page -> Item set to 'Main' by Computation
See the problem?
Assuming this isn't the issue, you created a Branch to the same page, right? What is your process point for the Branch? Is it *After* Validation, Computation etc? Because if not, you aren't changing the value before the submit happens.
I bet it is the first issue but, take a look at these.
Cheers,
-Joe -
Dynamic Action based on Interactive Report Select List Value
I'd like to perform a Dynamic Action when a user selects one of 3 options from a Select List within an Interactive Report:
select APEX_ITEM.SELECT_LIST(
p_idx => 3,
--p_value => deptno,
p_list_values => 'Copy;Copy,Delete;Delete,Export to PDF;Export to PDF',
--p_attributes => 'style="color:red;"',
p_show_null => 'YES',
p_null_value => NULL,
p_null_text => '--Select--',
--p_item_id => 'f03_#ROWNUM#',
p_item_id => 'P6_IR_SELECT_LIST',
p_item_label => 'Label for f03_#ROWNUM#',
p_show_extra => 'YES') "Actions"
from dual;
When building the Dynamic Action, I chose the following values from the Advanced wizard
Event: Select
Selection Type: DOM Object
DOM Object: P6_IR_SELECT_LIST
Condition: Equal to
Value: "Delete"
True Action: Execute Javascript Code: Alert('Here');
Doesn't seem to be firing...can anyone help?
Thanks in advance,
JohnHi,
I am not sure if the "equal to" condition applies to a DOM object... after all, a DOM object can be anything (any HTML element) not only a field.
Try using a javascript expression instead, like this:
$v('P6_IR_SELECT_LIST')=='Delete'UPDATE: Sorry, I just tested and "equal to" condition works for DOM objects... should have tested before posting!
Luis
Edited by: Luis Cabral on Feb 29, 2012 4:45 PM -
IRR dynamic action filter does not work when condition set.
Hi All
I've set up a filter on an Interactive report using a dynamic action. The fiilter is used to display records that expire within a term ( example 30,60,90 days.) The dynamic action is set to fire On Change. This all works fine as long as I do not set the report condition to only display when P1_DAYS is not null.
I am using a report template that includes #REGION_STATIC_ID# as referenced in this post -
http://anthonyrayner.blogspot.com/2010/07/report-filtering-with-apex-40-dynamic.html
I hoped not to display a blank report region .. wait until after the user selects the "term" before displaying the results. Any workaround suggestions would be appreciated.
Version -
Application Express 4.0.1.00.03
Thanks
MOKindly check the following link for reference.
sample configuration link
http://www.cisco.com/c/en/us/td/docs/wireless/controller/5700/software/release/3se/security/configuration_guide/b_sec_3se_5700_cg/b_sec_1501_3850_cg_chapter_01110.html
http://www.cisco.com/c/en/us/td/docs/wireless/controller/7-0/configuration/guide/c70/c70intf.html
Trouble shooting link
http://www.cisco.com/c/en/us/support/docs/security/secure-access-control-system/113485-acs5x-tshoot.html -
Dynamic action on checkbox using jQuery selectors
Aim: Have a classic report with a checkbox for each record that fires a dynamic action. I'd like to source the relevant ID/value within Javascript (ultimately PL/SQL)
Consider a classic report using the following query
SELECT label
,apex_item.checkbox
(p_idx => 15 -- f42
,p_value => id
,p_attributes => 'id="f15_'||id||'" class="xyz"'
) chk
FROM my_tableDefine a dynamic action with
Event: Click
Selection type: jQuery selector
jQuery selector: .xyz
No condition
Scope:Bind
I have an action executing javascript
var me = this.triggeringElement;
console.log('me:'||me);
console.log('name:'||me.attr('name') );
console.log('id:'||me.attr('id') );
console.log('value:'||me.prop('val'));Affected elements Selection type: Triggering element
When I run the page and check a box, the DA fires, but all output shown in the console log is blank.
I've tried copious variations to get this right, such as using $(this.triggeringElement)
These pages make me feel confident I have the syntax right
http://stackoverflow.com/questions/12038392/oracle-apex-checkbox-to-manipulate-other-values-when-checked-unchecked
http://iadviseblog.wordpress.com/2011/08/24/get-triggering-element-in-da/
But my values are still null?! Anyone know what I've missed?
Apex 4.1.1
Scottvar me = this.triggeringElement;
console.log('me:'||me);
console.log('name:'||me.attr('name') );
console.log('id:'||me.attr('id') );
console.log('value:'||me.prop('val'));<ul>
<li>Concatenation in javascript is with +* and not *||* (which means OR)</li>
<li>Also, this.triggeringElement is a reference to the DOM element, it is not a jQuery object. So wrapping it in $() is required when you wish to access properties through jQuery.</li>
<li>.prop('val') won't work. You need to check for the existence of a property-line attribute, which in case of a checkbox could be "checked".</li>
<li>dynamic action on a report: use scope Live to prevent functionality from working when the report is refreshed/paginated</li>
</ul>
var me = $(this.triggeringElement);
console.log('me:'+me);
console.log('name:'+me.attr('name') );
console.log('id:'+me.attr('id') );
console.log('value:'+me.prop('checked')); -
Dynamic action on File browse change event
Hi Experts,
apex version 4.1
This is what i'm trying to do..
i have a file browse control and a text field. when user selects a file, selected fiel's name (without file type extension) should be set to text field.
I tried adding a dynamic action to file browse control's change event and within pl/sql Set Value logic i queried the wwv_flow_files and tried to return the file name it didn't work. i got no data found error. i assumed file is being inserted into wwv_flow_files when a page submission happens.
In my second approach within the SetValue pl/sql logic i got the file browser control's (by directly accessing field, not by querying wwv_flow_files)value and did some string manipulation and tried to return only the file name. yet i got the same no data found error.
Any idea how can i implement this ?
Thanks in advance.
- kurubaranHi,
I think PL/SQL approach will not work before you submit data to database.
Have you think use $v function to get value from file browser?
http://docs.oracle.com/cd/E23903_01/doc/doc.41/e21676/javascript_api.htm#BGBGDGIH
Regards,
Jari
My Blog: http://dbswh.webhop.net/dbswh/f?p=BLOG:HOME:0
Twitter: http://www.twitter.com/jariolai -
HR Abap ques - Process Dynamic Actions in BDC mode
Hi friends.
We are using HR_INFOTYPE_OPERATION to update some infotypes. The problem is that dynamic action does not get triggered as SY-BINPT = 'X' when we use this FM or BDC to update.
Now, is there any workaround so that we can process dynamic actions via our program?
Can somehow we call the subroutine DYN_ACTION from our program? Can the values of PSAVE etc be availabe in our program?
Has someone done it before -> calling Dyn actions from your program?
Thanks in adv!One more input -> I tried to include the MPPDAT00 in my main program and then call DYN_MEASURE in program <MPxxxx00>. But the values of PSAVE, DYNMEAS, etc don't seem to be there still.
-
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 include dynamic action in bdc
Hi All,
I want to update infotype 17 when an employee has joined through PA40 (Joining action).So i have written a dynamic action for this .But this dynamic ation does not get called in bdc for joining action.
So infotype 17 is not maintained if we do joining through bdc.
I have tried with user-exit zxpadu02 also, calling hr_infotype_operation on saving infotype 0001.But it gives return as 'Employee does not exist'.
Since that infotype 0001 is still not saved.
So what to do.
YogeshHi Amit,
For your information we can call dynamic action from BDC.
go through this link
how to include dynamic actions in bdc -
Raise Application Error on Dynamic Action
Hi
I am using Apex 4.2. On a click of button a Dynamic Action is written, which calls a DB Package. The DB package has exception handlers and also the package has two output parameters
Error Code and Error Msg
So in my code(Dynamic Code) i make a call to the package and checks the value for Erroc Code.
Begin
Package call......
If v_error_code <> '0' Then
Raise SC_Error;
End if;
Exception
When SC_Error Then
RAise_Application_error(v_err_code, v_err_msg);
End;
But when i run the page and I click I get an Internal exception error
Output from Debug -- I am not sure what the Cell in Red colour means, because the package is returning a correct message (before the red line).Can anyone help please??
Thanks
JS
......message: AJAX call returned server error ORA-20003: Customer has already been matched for Execute PL/SQL Code.
4
......is_internal_error: true
4
......apex_error_code: APEX.AJAX_SERVER_ERROR
4
......ora_sqlcode: -20003
4
......ora_sqlerrm: ORA-20003: Customer has already been matched
4
......error_backtrace: ORA-06512: at line 41 ORA-06512: at "SYS.DBMS_SYS_SQL", line 1926 ORA-06512: at "SYS.WWV_DBMS_SQL", line 973 ORA-06512: at "SYS.WWV_DBMS_SQL", line 999 ORA-06512: at "APEX_040200.WWV_FLOW_DYNAMIC_EXEC", line 830 ORA-06512: at "APEX_040200.WWV_FLOW_PLUGIN_UTIL", line 2304 ORA-06512: at "APEX_040200.WWV_FLOW_DYNAMIC_ACTION_NATIVE", line 442
4
......component.type: APEX_APPLICATION_PAGE_DA_ACTS
4
......component.id: 23185203797756209
4
......component.name: NATIVE_EXECUTE_PLSQL_CODE
4
...Execute Error Handling Callout defined on Page or Application Level
4
...Execute Statement: begin declare l_error wwv_flow_error_api.t_error; begin l_error := wwv_flow_error_api.g_error; wwv_flow_error_api.g_error_result := apx_error_utils.handleerror ( p_error => l_error ); end; end;
4
......Values changed by callout:
4
.........message: An unexpected internal application error has occurred. Please get in contact with your system administrator and provide reference# for further investigation.
4
.........display_location: ON_ERROR_PAGE
4
Stop APEX Engine detected
4
Final commit
4
1 - 59Edit: Well, Patrick beat me to the punch because I was taking my jolly time writing this down
Well, if you look below the part you put in red, you can see that a callout is made: ...Execute Error Handling Callout defined on Page or Application Level
With directly below that:
......Values changed by callout:
4
.........message: An unexpected internal application error has occurred. Please get in contact with your system administrator and provide reference# for further investigation.
Since the plsql call is on the serverside, this error is trapped within the error handling function aswell. Your error has simply been obscured by it, and probably because it looks at the error backtrace and determines the error is internal.
Looking at the sample error handling code, this is probably where it goes "wrong":
-- If it's an internal error raised by APEX, like an invalid statement or
-- code which cannot be executed, the error text might contain security sensitive
-- information. To avoid this security problem rewrite the error to
-- a generic error message and log the original error message for further
-- investigation by the help desk.
if p_error.is_internal_error then
I recreated the situation here, and put some debug in the error handling function just so I could see what sort of error is being processed:
apex_debug.message('error code: '||p_error.apex_error_code);
apex_debug.message('sql code: '||p_error.ora_sqlcode);
apex_debug.message('sql errm: '||p_error.ora_sqlerrm);
apex_debug.message('error_backtrace: '||p_error.error_backtrace);
0.05750
0.00007
...Error data:
4
0.05757
0.00006
......message: AJAX call returned server error ORA-20099: raise application error for Execute PL/SQL Code.
4
0.05763
0.00006
......is_internal_error: true
4
0.05769
0.00005
......apex_error_code: APEX.AJAX_SERVER_ERROR
4
0.05774
0.00005
......ora_sqlcode: -20099
4
0.05779
0.00006
......ora_sqlerrm: ORA-20099: raise application error
4
0.05785
0.00005
......error_backtrace: ORA-06512: at line 1 ORA-06512: at "SYS.DBMS_SYS_SQL", line 1926 ORA-06512: at "SYS.WWV_DBMS_SQL", line 1064 ORA-06512: at "SYS.WWV_DBMS_SQL", line 1090 ORA-06512: at "APEX_040200.WWV_FLOW_DYNAMIC_EXEC", line 832 ORA-06512: at "APEX_040200.WWV_FLOW_PLUGIN_UTIL", line 2304 ORA-06512: at "APEX_040200.WWV_FLOW_DYNAMIC_ACTION_NATIVE", line 442
As you can see, the ajax error is an internal error, and that is why it is handled as such in the error handler. With this info you should be able to adjust your handling function. Test for the error code (APEX.AJAX_SERVER_ERROR) and then throw the error message or test for the -20000 range of custom errors for example.
if p_error.is_internal_error then
-- Access Denied errors raised by application or page authorization should
-- still show up with the original error message
-- do not parse ajax server errors here !
if p_error.apex_error_code <> 'APEX.AUTHORIZATION.ACCESS_DENIED'
and p_error.apex_error_code not like 'APEX.SESSION_STATE.%'
and p_error.apex_error_code != 'APEX.AJAX_SERVER_ERROR'
then
It probably does need some more work but you should get the gist of it.
Maybe you are looking for
-
MacBook suddenly turns off at 40% of battery charge and trackpad doesn't work
Hello, I had to replace the battery of my white MacBook (13 inches, mid 2010), because it was swollen, and the capacity was about just 20-30% of its original one. I bought a new one. Specifically, this one. After replacing it, I have those problems:
-
A Unix question: find command
Hi all, Sorry for posting a Unix question here. In the following directory I have: /opt/SonicSoftware/SonicMQ/samples/TopicPubSub/DurableChat>ls DurableChat.class DurableChat.java Readme.txt However, if I try: /opt/SonicSoftware>find -iname DurableCh
-
Hi to all, I have a problem with the light sensor of my MacBook Pro. The light sensor has always worked until I have manually increased the brightness. From that moment the light sensor does not work anymore. Can anyone help me please? Thanks
-
Whlile connecting iPad to computer, battery is not getting charged
What settings to be made so that when I will connect my iPad to computer, my Pad's battery should get recharge. While connecting iPhone, it is getting recharged but not the Pad.
-
hi.... i have two objects currently sharing a layer, and i have used various behaviours and filters on them already, separately as individual objects AND together as a layer. no problem UNTIL i tried to change the rotation of one of the objects in th