Workflow to find the superior

I am designing a workflow for the leave approval ,that gets triggered from a form.
The Form has a LOV.From the LOV I select the number of levels of supervisors
to whom the approval should be forwarded.
In the workflow I have wriiten a procedure that selects the supervisor of the person and then sends a notifiacation to him. Then it checks if this person has a higher supervisor. if yes then it is send for approval to the higher one.
But my workflow is going out after one level of approvel only.
the following are the procedures written.
/*PROCEDURE TO CHECK FOR HIGHER APPROVER*/
CREATE OR REPLACE procedure APPS.higher_approval(
itemtype IN VARCHAR2,
itemkey IN VARCHAR2,
actid IN NUMBER,
funcmode IN VARCHAR2,
resultout OUT NOCOPY VARCHAR2
as
lv_person_name varchar2(100);
lv_approver varchar2(100);
lv_person_id varchar2(100);
lv_supervisor_id number;
lv_superior_id varchar2(100);
lv_counter1 number;
lv_counter_type varchar2(100);
begin
lv_counter_type := wf_engine.GetItemAttrtext
(itemtype => itemtype,
itemkey => itemkey,
aname => 'COUNTER_TYPE');
lv_counter1 := wf_engine.GetItemAttrtext
(itemtype => itemtype,
itemkey => itemkey,
aname => 'COUNTER1');
if lv_counter1 <> lv_counter_type
then
lv_person_name := wf_engine.GetItemAttrtext
(itemtype => itemtype,
itemkey => itemkey,
aname => 'APPROVAR_NAME');
begin
select full_name into lv_approver
from per_all_people_f
where person_id =(SELECT supervisor_id
--INTO lv_supervisor_id
FROM per_all_assignments_f,per_all_people_f
WHERE per_all_people_f.PERSON_ID = (SELECT EMPLOYEE_ID FROM FND_USER WHERE
USER_NAME=lv_person_name ));
EXCEPTION
when others
then
lv_approver := NULL;
end;
if lv_approver IS NOT NULL
then
wf_engine.setItemAttrText
(itemtype => itemtype,
itemkey => itemkey,
aname => 'APPROVAR_NAME',
avalue => upper(lv_approver));
lv_counter1:=lv_counter1+1;
wf_engine.setItemAttrText
(itemtype => itemtype,
itemkey => itemkey,
aname => 'COUNTER1',
avalue => upper(lv_counter1));
resultout :='YES';
else
resultout :='NO';
end if;
elsE
resultout:='NO';
end if;
end;
can any please help me solve my problem?

Hi,
lv_counter1 is a number. You are using the GetItemAttrTEXT API to retrieve it. What is the datatype of the attribute?
Does UPPER work on a number - UPPER(lv_counter1) doesn't seem right to me.
You aren't checking what the function mode is in your code, so if this is looping and the revisit flag isn't set correctly, then it will run in cancel mode as well as in run mode.
HTH,
Matt
WorkflowFAQ.com - the ONLY independent resource for Oracle Workflow development
Alpha review chapters from my book "Developing With Oracle Workflow" are available via my website http://www.workflowfaq.com
Have you read the blog at http://thoughts.workflowfaq.com ?
WorkflowFAQ support forum: http://forum.workflowfaq.com

Similar Messages

  • Get the superior for the manager of a position?

    Hi experts,
    I'm trying to solve this issue and I'm not sure how to go up in OM structure. I want to return the manager for a position given, this is ok, but when the manager position is vacant I have to go up in the structure and get the superior-superior of this position and if this position is vacant, I have to go up again in the structure, can anybody tell me if there is any function or any relationship for doing this? I was thinking in get the organizational unit for the position and then the position in which this organizational units belongs...is this correct?!
    Thanks in advance,
    Best Regards,
    Rebeca

    I have seen two ways this is done. One is using reports to (002) relation. Get the reports to relation
    of the position to find the superior position of the manager and then find out its holder. Otherway
    is find the org unit in which manager's position belongs to (003). Then find the org unit to which
    this org unit belongs to. Find manager of that org unit.
    It depends on how org management is done in the system.
    Thanks,
    Aravind

  • From which table we can find the stuck process in workflow from background

    Hi There,
    from which table we can find the stuck process
    in workflow from background.
    i mean the table which store information about going on process.
    It's Urgent
    Thank's
    Bachan
    Message was edited by:
    Bachan

    You can also run "bde_wf_item.sql" script.
    Note: 187071.1 - bde_wf_item.sql - Runtime Data of a Single Workflow Item
    https://metalink.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=187071.1
    "Oracle Workflow Cartridge (WF): Workflow Item Details Data Collection Test" should be also helpful.
    Note: 369576.1 - Oracle Workflow Cartridge Workflow Item Details Data Collection Test
    https://metalink.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=369576.1

  • How to find the SAP ID of workflow amdin?

    Hi,
    I need to send one notification mail to workflow admin in my worklfow . Please can anybody give me the table name or give me the  FM available to find the workflow admin.
    Please it urgent.
    thanks
    Manju

    HI  Manjunath,
    I guess you have asked the same question in BPM workflow forum.Please get the answer from there..
    Pankaj

  • How to find the workflow admins for all costcenters ?

    Dear SRM gurus
    We are using Classic scenario with N th step workflow with BADI.
    we have a requirement.
    How to find the workflow admins for the particular costcenters.
    we used HRV1222A where ATTRIB EQ <Z attribute>(This is our own attribute to group all the costcenters)
    used table HRP1001 to find the Admins but results are not correct because it is not showing my user id(I have all authorisations).
    Is there anyway to find all the admins for a cost center(users are more than 7000+)
    can anybody send work flow related presentations or cookbook
    Thanks in Advance.
    srinu

    hi
    I have not received any thing.Please send again
    [email protected]
    [email protected]

  • How to find the recent changes done in the workflow by user id ?

    Hello all,
    How to find the recent changes done in the workflow by user id ?
    I have made changed in Production system .
    Like changing the status ,
    changing the agent ,
    but for these it will , not ask for any request .
    So i want to know is there any method to find what are the changes done by me ?
    Thanks and regards
    Prem

    Hi,
    This is caused by mandant settings in scc4. It's better not to make changes in PRD, because then your DEV en QA systems differ.
    Kind regards, Rob Dielemans

  • Standard report Programs to find the current status of workflows

    Hi Experts,
                       Are there any Standard report Programs to find the current status of workflows or workflows which are pending.
    Regards,
    Hari

    Go to SWI1 t-code
    Give the appropriate Status - Ready or Inprocess or Waiting
    Input the Task - either WF Template or Standard Task.
    Choose the time period and execute the report.
    Regards,
    PR.

  • How to find the WI of the Workflow based on Object Key of DIR (DMS)

    Hi Gurus,
    We have developed a DIR workflow for status change, where we are using DRAW as the Business Object.
    We are not able to fetch the Work item ID of the Workflow based on the ObjectKey(Concatenation of DOCTYPE DOCNUMBER DOCPART DOCVERSION).
    Tried to use the View SWIVOBJECT, also Found no values related to the container table SWW_CONTOB when the Wiorkflow is triggered. But we can see the Contianer values in the workflow log.
    Is there a way to find the relation DIR and the Work item ID if the Workflow for Documents? For Documents(DIR), anything needs to be done explicitly? 
    Need to resolve this as we have too many things based on this including Reporting part to fetch the approval details of the workflow. 
    Thanks..
    Regards,
    Prathap
    Edited by: Prathap on Feb 18, 2011 5:37 PM

    Hi,
    You can use FM SAP_WAPI_WORKITEMS_BY_TASK and use the filters.
    Afterwards, for every wi id you should get their instances using class cl_swf_run_wim_factory=>find_by_wiid.
    Then, get instance of wf container using if_swf_run_wim.
    Now you can use interface if_swf_ifs_parameter_container to get parameters or variables.
    Regards,

  • How to find the last modified date of a workflow.

    How to find the last modified date of a workflow.
    thanks.

    Hi,
    There is nothing as standard that does this - you could write some code to determine the latest begin_date from each of the workflow tables and assume that this was the last time that the definition changed.
    What you need is something like this:
    select max(wfa.begin_date)
    from   wf_process_activities  wpa
    ,      wf_activities          wfa
    ,      wf_item_types_tl       wit
    where  wpa.activity_item_type = wfa.item_type
    and    wpa.activity_name      = wfa.name
    and    wfa.version            = (select max(version) from wf_activities wfa1 where wpa.activity_item_type = wfa1.item_type and wpa.activity_name = wfa1.name )
    and    wpa.process_item_type  = 'your item type'
    and    wpa.process_item_type  = wit.namewhich I think gives what you want.
    HTH,
    Matt
    Alpha review chapters from my book "Developing With Oracle Workflow" are available on my website:
    http://www.workflowfaq.com
    http://forum.workflowfaq.com
    NEW! - WorkflowFAQ Blog at http://thoughts.workflowfaq.com

  • Where can I find the source code of the sshr workflow source file?

    Dear all:
    Where can I find the source code of the sshr workflow?
    Regards
    Terry

    Dear all:
    I found the answer, usually the workflow of the self-service 4.1 is HRSSA
    Regards
    Terry

  • How to find  the existing workflows

    Hi Gurus,
    How to find  the existing workflows, and assign a  user  to a role.
    Suitably rewarded for helpful answers.
    B S B

    Hi,
    You can find existing workflow in Transaction PFTC.
    Select Task Type as Workflow Template(WS) and either do F4 on Task
    or put some description and press enter.
    For assigning a user to a role, check transaction PPOCW. (If in an Org. Unit) or through SU01.
    Regards,
    Ashish

  • How to find the active workflows in the system

    Hi,
    we are going for upgrade, we want to find out the active workflows in the system
    please guide me, how to find the active workflows in the system
    is there any standard table to find the active workflows in the system
    please suggest me the step by step process to find the active workflows.
    thanks,
    chandra

    Welcome to the Forums.
    Please go through the FAQ of the Forum.
    You has posted your query in the wrong Forum, this one is dedicated to Oracle Forms.
    Please try {forum:id=1050}.
    Regards,

  • How to find the workflow for Change Request for the PO's

    Hi All,
    We have a PO which is pending and we can't receipt it again nor make payment on this. After checking the Approval history for that PO we found that the change request has been made. The change request was to change the amount to be paid to R39196 instead of R58237.00. We don't know where to check the workflow for the change request to identify the cause.
    what i need to know is how to find the workflow for that change request? The other workflows can be checked using the po_header_id for the PO's but i am confused with the change request workflow
    Your input will be highly appreciated.
    Thanks in advance
    Rgds,
    Sonia

    For 11.5.10.2 run this query to determine the keys to search on:
    Select wf_item_type, wf_item_key from APPS.po_change_requests where document_type = 'PO' and Document_num = 'put-PO-number-here'
    Then use the keys returned by the query to look up the Workflow in
    Workflow Administrator Web Applications / Administrator Workflow / Status Monitor
    Search using the results returned in fields "Type Internal Name" and "Item Key" in Status Monitor
    The query for change requests on a specific Requisition would be:
    Select wf_item_type, wf_item_key from APPS.po_change_requests where document_type = 'REQ' and Document_num = 'put-Req-number-here'

  • InCopy workflow in InDesign: Is there a way to find the document in which an ICML file has NOT been checked IN again before saving the doc?

    The situation:
    We are working with the InCopy feature (checking in and checking out ICML files).
    The problem:
    I might have saved a document with an ICML file still checked out.
    The question:
    Is there a way to find out which document was saved with the ICML file still checked out?
    or in other words:
    Is there a way to find the document in which an ICML file has NOT been checked IN again before saving the doc?
    Thanks for any help!

    Hello Sumit Singh,
    thank you for your answer and your reasonable recommendation. Unfortunately, this only works when the ICML content is used in one INDD file. In our case, we use ICML content in multiple docs (various manuals with the same safety instructions, warranties, adresses etc.).
    So, is there a way to trace back where an ICML has been used?
    Is it possible to find out in which document the ICML is still checked out?

  • How can we find the Idoc number which posts the material document in SAP

    Hi All,
    How can we find the Idoc number which posts the material document in SAP. We could not able to find the IDOC number from the material document which was posted by Idoc.
    Thanks
    Chandru

    Hi,
    In MIGO you can go to service of object(Just above show overview) and check 5th option workflow you will find the idoc number.
    regards
    suresh

Maybe you are looking for

  • Security problem about JCOM

    Hi, Now we are using IIS/ASP page to connect to EJB. This is the code below: Dim mobjHome Dim mobjBean dim mobjList Private Function BindObjects() Dim objTemp 'Handle errors On Error resume next 'Initialize function value BindObjects = True 'Access W

  • JTextPane (Word processor)

    Does any one know how to get caret / cursor position on JTextPane from MouseEvent (MouseDragged) ? Thanks in advance, Anom

  • Is it possible to put different movieclips in the same array?

    Hello. I have two different bullet movieclips. I would like to put them both into one bullet array, but it seems that all instances of the second movieclip are not controlled by bullet_ary[i]

  • Lost all my saved passwords and the master password. Why and how?

    1. I have a blog that has Zazzle marketing "flash panels." About 4 months ago, I stopped being able to see them, even though others on Zazzle could see them. Yesterday I disabled AdBlock Plus and Adblock Helper so that I could see the flash panels. I

  • I get noise when I combine left and right from the headphone output.

    I need to combine the left and right channels of a Macbook Pro at the output connector.  When I build the cable to do this, there is significant static noise introduced.  If I break the short between left and right, the noise goes away. (I'm doing th