Saturday 26 March 2011

Some prerequisite Before using API.


If we want to call any API using backend then we need to take care for the below mentioned points.

set policy context.
mo_global.set_policy_context(access_mode,org_id)

Calling Program Context before using any API.
fnd_global.apps_initialize ( user_id in number,
                                      resp_id in number,
                                     resp_appl_id in number,
                                     security_group_id in number default 0);


Return Status after using API. (x_return_status)
• Success (FND_API.G_RET_STS_SUCCESS)
• Error (FND_API.G_RET_STS_ERROR)
• Unexpected error (FND_API.G_RET_STS_UNEXP_ERROR)
Messages
FND_MSG_PUB.Initialize  or    p_init_msg_list   Default  FND_API.G_FALSE
Debug Messages after using API.
arp_standard.enable_file_debug(<pathname>, <filename>)
<pathname> 
select value from v$parameter where name = 'utl_file_dir',
arp_standard.enable_file_debug ('/sqlcom/log','txt.log')

To get the resp_id and resp_appl_id use the below queries
SELECT APPLICATION_ID, RESPONSIBILITY_ID
                          FROM FND_RESPONSIBILITY_TL
                          WHERE RESPONSIBILITY_NAME='xxmz Custom';
SELECT USER_ID FROM FND_USER WHERE USER_NAME='OPERATIONS';
API for getting Error messages in program after using API.
pa_interface_utils_pub. get_messages
                                    (p_encoded        IN   VARCHAR2  ,
                                      p_msg_index      IN NUMBER    ,
                                      p_msg_count      IN NUMBER    ,
                                      p_msg_data       IN  VARCHAR2  ,
                                      p_data             OUT NOCOPY           VARCHAR2,  
                                      p_msg_index_out  OUT NOCOPY    NUMBER  
                                     );

No comments:

Post a Comment