The following lines contain the word 'select', 'insert', 'update' or 'delete':
SELECT (NVL(MAX(TAB_ID), 0) + 1)
INTO l_Bsc_Tab_Entity_Rec.Bsc_Tab_Id
FROM BSC_TABS_B;
SELECT (NVL(MAX(TAB_INDEX), 0) + 1)
INTO l_Bsc_Tab_Entity_Rec.Bsc_Tab_Index
FROM BSC_TABS_B;
x_Bsc_Tab_Entity_Rec.Bsc_Last_Updated_By := 0;
x_Bsc_Tab_Entity_Rec.Bsc_Last_Update_Login := 0;
procedure Update_Tab(
p_commit IN varchar2 := FND_API.G_FALSE
,p_Bsc_Tab_Entity_Rec IN BSC_SCORECARD_PUB.Bsc_Tab_Entity_Rec
,x_return_status OUT NOCOPY varchar2
,x_msg_count OUT NOCOPY number
,x_msg_data OUT NOCOPY varchar2
) is
begin
FND_MSG_PUB.Initialize;
BSC_SCORECARD_PVT.Update_Tab( p_commit
,p_Bsc_Tab_Entity_Rec
,x_return_status
,x_msg_count
,x_msg_data);
x_msg_data := x_msg_data||' -> BSC_SCORECARD_PUB.Update_Tab ';
x_msg_data := SQLERRM||' at BSC_SCORECARD_PUB.Update_Tab ';
x_msg_data := x_msg_data||' -> BSC_SCORECARD_PUB.Update_Tab ';
x_msg_data := SQLERRM||' at BSC_SCORECARD_PUB.Update_Tab ';
end Update_Tab;
procedure Delete_Tab(
p_commit IN varchar2 := FND_API.G_FALSE
,p_Bsc_Tab_Entity_Rec IN BSC_SCORECARD_PUB.Bsc_Tab_Entity_Rec
,x_return_status OUT NOCOPY varchar2
,x_msg_count OUT NOCOPY number
,x_msg_data OUT NOCOPY varchar2
) is
begin
FND_MSG_PUB.Initialize;
BSC_SCORECARD_PVT.Delete_Tab( p_commit
,p_Bsc_Tab_Entity_Rec
,x_return_status
,x_msg_count
,x_msg_data);
x_msg_data := x_msg_data||' -> BSC_SCORECARD_PUB.Delete_Tab ';
x_msg_data := SQLERRM||' at BSC_SCORECARD_PUB.Delete_Tab ';
x_msg_data := x_msg_data||' -> BSC_SCORECARD_PUB.Delete_Tab ';
x_msg_data := SQLERRM||' at BSC_SCORECARD_PUB.Delete_Tab ';
end Delete_Tab;
SELECT responsibility_id
FROM fnd_responsibility
WHERE INSTR(','||p_Resposibility_Key||',',','||responsibility_key||',') > 0;
SELECT COUNT(1)
INTO l_Count
FROM bsc_user_tab_access
WHERE tab_id = p_Bsc_Tab_Entity_Rec.Bsc_Tab_Id
AND responsibility_id = CD.responsibility_id;
SELECT T.SHORT_NAME
INTO l_Tab_Short_Name
FROM BSC_TABS_B T
WHERE T.TAB_ID = l_Bsc_Tab_Entity_Rec.Bsc_Tab_Id;
procedure Update_System_Time_Stamp(
p_commit IN varchar2 := FND_API.G_FALSE
,p_Bsc_Tab_Entity_Rec IN BSC_SCORECARD_PUB.Bsc_Tab_Entity_Rec
,x_return_status OUT NOCOPY varchar2
,x_msg_count OUT NOCOPY number
,x_msg_data OUT NOCOPY varchar2
) is
begin
FND_MSG_PUB.Initialize;
BSC_SCORECARD_PVT.Update_System_Time_Stamp( p_commit
,p_Bsc_Tab_Entity_Rec
,x_return_status
,x_msg_count
,x_msg_data);
x_msg_data := x_msg_data||' -> BSC_SCORECARD_PUB.Update_System_Time_Stamp ';
x_msg_data := SQLERRM||' at BSC_SCORECARD_PUB.Update_System_Time_Stamp ';
x_msg_data := x_msg_data||' -> BSC_SCORECARD_PUB.Update_System_Time_Stamp ';
x_msg_data := SQLERRM||' at BSC_SCORECARD_PUB.Update_System_Time_Stamp ';
end Update_System_Time_Stamp;
procedure Update_Tab_Time_Stamp(
p_commit IN varchar2 := FND_API.G_FALSE
,p_Bsc_Tab_Entity_Rec IN BSC_SCORECARD_PUB.Bsc_Tab_Entity_Rec
,x_return_status OUT NOCOPY varchar2
,x_msg_count OUT NOCOPY number
,x_msg_data OUT NOCOPY varchar2
) is
begin
FND_MSG_PUB.Initialize;
BSC_SCORECARD_PVT.Update_Tab_Time_Stamp( p_commit
,p_Bsc_Tab_Entity_Rec
,x_return_status
,x_msg_count
,x_msg_data);
x_msg_data := x_msg_data||' -> BSC_SCORECARD_PUB.Update_Tab_Time_Stamp ';
x_msg_data := SQLERRM||' at BSC_SCORECARD_PUB.Update_Tab_Time_Stamp ';
x_msg_data := x_msg_data||' -> BSC_SCORECARD_PUB.Update_Tab_Time_Stamp ';
x_msg_data := SQLERRM||' at BSC_SCORECARD_PUB.Update_Tab_Time_Stamp ';
end Update_Tab_Time_Stamp;
select PARENT_TAB_ID into l_tab_parent
from BSC_TABS_VL where TAB_ID = l_tab_child;
SELECT function_id INTO l_function_id
FROM fnd_form_functions
WHERE function_name= p_user_access;
SELECT COUNT(GNT.grant_guid)
INTO l_count
FROM FND_GRANTS GNT,
FND_OBJECTS b,
FND_MENUS m,
FND_MENU_ENTRIES e
WHERE GNT.PROGRAM_NAME = 'BSC_PMD_GRANTS'
AND b.OBJ_NAME = 'BSC_TAB'
AND GNT.OBJECT_ID = b.OBJECT_ID
AND GNT.INSTANCE_PK1_VALUE = to_char(p_tab_id)
AND ( GNT.GRANTEE_TYPE = 'USER' AND GNT.GRANTEE_KEY = UPPER(l_user_name))
AND GNT.START_DATE <= sysdate
AND (GNT.END_DATE IS NULL OR GNT.END_DATE >= sysdate )
AND m.MENU_ID = GNT.MENU_ID
AND e.MENU_ID = m.MENU_ID
AND e.function_id = l_function_id;
the scorecards and its contents. He cannot do any upadte/delete
operations.
Input parameters : p_tab_id,p_user_name
output : 'Y' indicating user has View Acces otherwsie not.He comes under
designer and administrator access. so he can do update , view and delete
operations
***********************************************************************************/
FUNCTION Check_Tab_UserAccess(
p_tab_id IN NUMBER
,p_user_name IN VARCHAR2
,p_user_access IN VARCHAR2
)return VARCHAR2 IS
l_isaccess boolean ;
SELECT function_id INTO l_function_id
FROM fnd_form_functions
WHERE function_name= p_user_access;
SELECT COUNT(GNT.grant_guid)
INTO l_count
FROM FND_GRANTS GNT,
FND_OBJECTS b,
FND_MENUS m,
FND_MENU_ENTRIES e
WHERE GNT.PROGRAM_NAME = 'BSC_PMD_GRANTS'
AND b.OBJ_NAME = 'BSC_TAB'
AND GNT.OBJECT_ID = b.OBJECT_ID
AND GNT.INSTANCE_PK1_VALUE = to_char(p_tab_id)
AND ( GNT.GRANTEE_TYPE = 'USER' AND GNT.GRANTEE_KEY = UPPER(l_user_name))
AND GNT.START_DATE <= sysdate
AND (GNT.END_DATE IS NULL OR GNT.END_DATE >= sysdate )
AND m.MENU_ID = GNT.MENU_ID
AND e.MENU_ID = m.MENU_ID
AND e.function_id = l_function_id;
SELECT COUNT(1)
INTO l_resp_count
FROM bsc_user_tab_access
WHERE tab_id = p_tab_id
AND responsibility_id =l_resp_id
AND (SYSDATE BETWEEN NVL(start_date, SYSDATE) AND NVL(end_date, SYSDATE));
SELECT parent_tab_id,name
INTO l_parent_tab_id, x_par_tab_name
FROM bsc_tabs_vl
WHERE tab_id = p_tab_id;
SELECT name
INTO l_name
FROM BSC_TABS_VL
WHERE tab_id = l_parent_tab_id;
SELECT parent_tab_id
INTO l_parent_tab_id
FROM bsc_tabs_b
WHERE tab_id = l_parent_tab_id1;
SELECT tab_id,name
FROM bsc_tabs_vl
WHERE parent_tab_id = p_tab_id;
SELECT grantee_key,instance_pk1_value
INTO l_grantee_key, l_tab_id
FROM fnd_grants
WHERE grant_guid = l_single_grant_guid;
If null then do verify if any of the parent_tabs are having update access.
if no then return false whcih will disbale the re-ordering button
on the top of the VO.
2.IF not null then check if it having the child or not.
if not then return empty it means re-ordering is not to be shown.
3. if it is the parent then verify if all the childs are having the update access.
if all the childs are having the update access then only the reordering button should be enabled.
else it will be disabled.
/********************************************************************/
FUNCTION is_Tab_Ordering_Enabled(
p_tab_id IN NUMBER
,p_user_name IN VARCHAR2
)RETURN VARCHAR2 IS
CURSOR c_root_tab_ids IS
SELECT tab_id
FROM BSC_TABS_VL
WHERE PARENT_TAB_ID IS NULL;
SELECT tab_id
FROM BSC_TABS_VL
WHERE PARENT_TAB_ID = p_tab_id;
,p_user_access => 'BSC_SCORECARD_ACCESS_UPDATE'
);
,p_user_access => 'BSC_SCORECARD_ACCESS_UPDATE'
);