Monday 18 September 2017

Oracle FND Message in oracle reports


Create Message in oracle apps as per below screen shot. 




Below is a small example to get the message text:

DECLARE
  msg VARCHAR2(2000);
BEGIN
  fnd_message.set_name ('XX', 'XX_VENDOR_REJECTED_CBT');
  msg := fnd_message.get;
  dbms_output.put_line(msg);
END; 

Where ‘XX’ is the application short name in which the message is defined and ‘XX_ VENDOR_REJECTED_CBT'’ the name of the message.

FND_MESSAGE.SET_NAME: this sets a message name in the global area without actually retrieving the message from Message Dictionary.

FND_MESSAGE.GET: Retrieves a translated and token-substituted message from the message stack and then clears that message from the message stack. GET returns upto 2000 bytes of message.

Tokens to change Message content dynamically


DECLARE
  l_VENDOR_name VARCHAR2(200);
  msg         VARCHAR2(2000);
BEGIN
  --
  SELECT description
  INTO l_user_name
  FROM fnd_user
  WHERE user_name = 'DEV_TEAM';
  --
  fnd_message.set_name ('XX', 'XX_ VENDOR_REJECTED_CBT');
  fnd_message.set_token('MSG_VENDOR_NAME', l_VENDOR_name);
  msg := fnd_message.get;
  dbms_output.put_line(msg);
END;


No comments:

Post a Comment

AOL SYLLABUS: PREREQUISITE SQL PL/SQL D2K GENERAL INTRODUCTION KNOW HOW OF ERP Version of Oracle Apps 11i Comparison of 10.7/11...