Home » Applications » Oracle Fusion Apps & E-Business Suite » How to get Responsibility name in shell script. (Apps-11.5.10.2)
How to get Responsibility name in shell script. [message #410724] Mon, 29 June 2009 23:34 Go to next message
suman.g
Messages: 89
Registered: June 2009
Member
Hi All,

Good morning..

I am not sure about the topic so I am putting my question here under Unix.
In my concurrent Program having execution type as 'host', calling shell script.
How can I get the Responsibility name, from which the concurrent program has been submitted in shell script and pass it as parameter in CONCSUB command (to submit another concurrent program internally from the current .sh)?

Thanks in advance.

Regatds,
Suman
Re: How to get Responsibility name in shell script. [message #410973 is a reply to message #410724] Wed, 01 July 2009 06:11 Go to previous messageGo to next message
vamsi kasina
Messages: 2112
Registered: October 2003
Location: Cincinnati, OH
Senior Member
Can your script accept any parameters?
Can you define parameters in the concurrent program?
If so, how many parameters you are passing to the script?
If so, you can pass responsibility name as the default value of the parameter.
select responsibility_name
from fnd_responsibility_vl
where responsibility_id = $PROFILES$.RESP_ID;
By
Vamsi

[Updated on: Wed, 01 July 2009 06:11]

Report message to a moderator

Re: How to get Responsibility name in shell script. [message #410987 is a reply to message #410724] Wed, 01 July 2009 07:25 Go to previous messageGo to next message
suman.g
Messages: 89
Registered: June 2009
Member
Hi Vamsi,

Can your script accept any parameters?
-Yes

Can you define parameters in the concurrent program?
-Yes
If so, how many parameters you are passing to the script?
-I have defined email address parameter in the concurrent program and passing this to script.

Thanks for giving solution.
Sorry for not being specific but the main requirement was to get the session login language and responsibility name (based on the language) in the script itself.
Till yesterday I couldn't get any proper solution so I had used below code in the script itself:

SELECT res.RESPONSIBILITY_NAME
FROM fnd_responsibility_tl res,
fnd_languages lang,
fnd_concurrent_requests req
WHERE req.RESPONSIBILITY_ID = res.RESPONSIBILITY_ID
AND req.NLS_LANGUAGE=lang.NLS_LANGUAGE
AND lang.LANGUAGE_CODE=res.language;

Can you please suggest some solution to get session language and resp name in script itself as Resp name differs with lang.

Regards,
Suman
Re: How to get Responsibility name in shell script. [message #411009 is a reply to message #410987] Wed, 01 July 2009 08:28 Go to previous messageGo to next message
vamsi kasina
Messages: 2112
Registered: October 2003
Location: Cincinnati, OH
Senior Member
I'm confused now.
Do you know how many rows the following will return?
SELECT res.RESPONSIBILITY_NAME
FROM fnd_responsibility_tl res,
fnd_languages lang,
fnd_concurrent_requests req
WHERE req.RESPONSIBILITY_ID = res.RESPONSIBILITY_ID
AND req.NLS_LANGUAGE=lang.NLS_LANGUAGE
AND lang.LANGUAGE_CODE=res.language;
fnd_responsibility_vl will give you the language specific responsibility name.
But to get that you need to know the responsibility_id. Right?
Why can't you use the procedure, which I've mentioned in my previous post.

By
Vamsi

[Updated on: Wed, 01 July 2009 08:33]

Report message to a moderator

Re: How to get Responsibility name in shell script. [message #411316 is a reply to message #410724] Fri, 03 July 2009 01:56 Go to previous messageGo to next message
suman.g
Messages: 89
Registered: June 2009
Member
This query will fetch one row only.

SELECT res.RESPONSIBILITY_NAME
FROM fnd_responsibility_tl res,
fnd_languages lang,
fnd_concurrent_requests req
WHERE req.RESPONSIBILITY_ID = res.RESPONSIBILITY_ID
AND req.NLS_LANGUAGE=lang.NLS_LANGUAGE
AND lang.LANGUAGE_CODE=res.language;


Actually fnd_responsibility_tl tables stores resps names based on the langugae.
for eg. in 'US' lang,Resp name is 'Purchasing Superuser'
but in 'D' lang, resp name is 'Einkauf Superuser' but in the table fnd_responsibility_vl stores only for 'US' lang.

Yes Vamsi, I can use the procedure, which you have mentioned but one doubt I have is that if I submit any request in any language loging then it will be seen in all languages...means language should not come in pictures.. rite??
Can you please suggest something ...?

Regards,
Suman
Re: How to get Responsibility name in shell script. [message #411375 is a reply to message #411316] Fri, 03 July 2009 05:20 Go to previous messageGo to next message
vamsi kasina
Messages: 2112
Registered: October 2003
Location: Cincinnati, OH
Senior Member
I don't know why you think that sql will give only one row.
It will give many rows as you don't have any filter on that and just having join between 3 tables, which are having many rows.

Yes, you are right. fnd_responsibility_tl contains all languages data.

No, you are wrong. fnd_responsibility_vl doesn't contain only US data.
It is just a view on fnd_responsibility_tl by filtering the language = USERENV('LANG').
So, it is depending on the language you logged in.
If you have logged in using US, then you see the data for US in fnd_responsibility_vl.
If you have logged in using D, then you see the data for D in fnd_responsibility_vl.

Basically you have to use fnd_responsibility_vl and pass the reponsibility_id to the sql, which I've given, then you can see the responsibility_name in the language, using which you have logged in.

Hope I'm clear this time.

By
Vamsi
Re: How to get Responsibility name in shell script. [message #411377 is a reply to message #410724] Fri, 03 July 2009 05:29 Go to previous messageGo to next message
kecd_deepak
Messages: 52
Registered: December 2007
Member
Hi,
As i understand, you can get the responsibility detail according to concurrent_request_id.
You are on right track.....just execute sql query from your host program to find the details.

As..

resp_details=`sqlplus -s $<LOGIN/PASSWORD> << END_OF_SQL
set pages 0
set lines 200
set feedback off

select fa.application_short_name || '#' ||
fr.responsibility_name || '#' ||
fr.responsibility_id || '#' ||
fr.application_id
from fnd_concurrent_requests fcr,
fnd_application fa,
fnd_responsibility_tl fr
where fr.language = 'US'
and fr.responsibility_id = fcr.responsibility_id
and fr.application_id = fa.application_id
and fcr.responsibility_application_id = fa.application_id
and fcr.request_id = $CONC_REQUEST_ID
;
END_OF_SQL
`

Now you can cut the output string to get the fields.


Thanks
DPK
Re: How to get Responsibility name in shell script. [message #411413 is a reply to message #411377] Fri, 03 July 2009 07:41 Go to previous messageGo to next message
suman.g
Messages: 89
Registered: June 2009
Member
Sorry for my typo error..Sad

the correct query is :

select distinct res.RESPONSIBILITY_NAME
from fnd_responsibility_tl res,
fnd_languages lang,
fnd_concurrent_requests req
where req.RESPONSIBILITY_ID = res.RESPONSIBILITY_ID
and req.NLS_LANGUAGE=lang.NLS_LANGUAGE
and lang.LANGUAGE_CODE=res.language
and req.request_id = $REQID;

Now I got to know why you asked, how many rows it will return.. Sorry Sir.Thanks to correct me.

I will try the solutions given by you and let you know if any other problem comes.

Many thanks.
Suman





Re: How to get Responsibility name in shell script. [message #411440 is a reply to message #411413] Fri, 03 July 2009 10:57 Go to previous messageGo to next message
vamsi kasina
Messages: 2112
Registered: October 2003
Location: Cincinnati, OH
Senior Member
Fine.
Can you clarify the following?
1. Do you want to see the responsibility name from your new concurrent program (shell script) in the language,
using which you have submitted that request_id which you are providing as the parameter?
(Or)
2. Do you want to see the responsibility name from your new concurrent program (shell script) in the language,
using which you are submitting the new concurrent program?

For 1, you can use your sql.
For 2, you have to use mine by providing the responsibility_id
(Or) by changing your query to use _vl instead of using NLS_LANGUAGE and get rid of fnd_languages.
SELECT res.responsibility_name 
FROM   fnd_responsibility_vl res, 
       fnd_concurrent_requests req 
WHERE  req.responsibility_id = res.responsibility_id 
       AND req.request_id = $REQID;
By
Vamsi
Re: How to get Responsibility name in shell script. [message #411601 is a reply to message #410724] Sun, 05 July 2009 23:38 Go to previous message
suman.g
Messages: 89
Registered: June 2009
Member
Hi,

Good Morning...

I am not passing anything as parameter.
I tried with both queries and both are working fine.But using your query, it is more faster.

Thanks a lot. Smile

Earlier I was thniking that if we submit any CP request in one language login can't be seen in other language login for same user, but my doubt is clear now after implementing your query.

This is a good learning for me.....
Many thanks...

Regards,
Suman
Previous Topic: How to create duplicate Invoice report.
Next Topic: Default vaules for Information Template (Purchasing)
Goto Forum:
  


Current Time: Mon May 06 05:26:41 CDT 2024