Anda di halaman 1dari 2

API XLA_EVENTS_PUB_PKG.

CREATE_EVENT
Description
This API creates a new event. This function has two specifications, one with the
p_budgetary_control flag and another without it.
Validations
The API checks all source information for valid application, legal entity, event
entity,and source IDs. It ensures that the required parameters are not null and
also validates the event type and event status.
No validations are performed against the reference columns and event number.
However, if no event number is passed, the routine populates the next highest ev
ent number for that transaction. The event date is truncated.
Return Value
If an event is created successfully, then the function returns its event ID.
The above API is used to create the Events.
FUNCTION XLA_EVENTS_PUB_PKG.create_event
(p_source_event_info IN xla_events_pub_pkg.t_event_source_info
,p_event_type_code IN VARCHAR2
,p_event_date IN DATE
,p_event_status_code IN VARCHAR2
,p_event_number IN INTEGER DEFAULT NULL
,p_reference_info IN xla_events_pub_pkg.t_event_reference_info
DEFAULT NULL
,p_valuation_method IN VARCHAR2
,p_transaction_date IN DATE DEFAULT NULL
,p_security_context IN xla_events_pub_pkg.t_security
,p_budgetary_control_flag IN VARCHAR2)
RETURN INTEGER;
The mandatory parameters for this API are:
Event Type Code
Event Status Code
Event Date
Event Source Info
Source Application Id
Application Id
Ledger Id
Event Type Code

What s there in the package or rather how this API works?


1.
Internally this API calls the package xla_events_pkg
2.
Check/validates the mandatory parameters.
3.
Check to see that API is not called for Manual Events.
4.
Validate Parameters which includes.
5.
Using the above mandatory parameters it fetches the Entity Info from tab
les xla_transaction_entities, xla_events and xla_entity_types_b and saves in the
global variables. Here is the query for your reference:
6.
Then checks if Event_ID is Null, in case of NULL it inserts a new record
in the XLA_TRANSACTION_ENTITIES table using the above parameters.
7.
Once the new record gets inserted in the XLA_TRANSACTION_ENTITIES table,

it uses the new entity_id to insert data in the XLA_EVENTS table


SELECT xte.entity_id
,xte.entity_code
,xte.transaction_number
,max(xe.event_number)
,xet.enable_gapless_events_flag
FROM xla_transaction_entities xte
,xla_events
xe
,xla_entity_types_b xet
WHERE xte.application_id
= p_source_info.application_id
AND xte.ledger_id
= p_source_info.ledger_id
AND xte.entity_code
= p_source_info.entity_type_code
AND NVL(xte.source_id_int_1,-99) = NVL(p_source_info.source_id_int_1,-99)
AND NVL(xte.source_id_int_2,-99) = NVL(p_source_info.source_id_int_2,-99)
AND NVL(xte.source_id_int_3,-99) = NVL(p_source_info.source_id_int_3,-99)
AND NVL(xte.source_id_int_4,-99) = NVL(p_source_info.source_id_int_4,-99)
AND NVL(xte.source_id_char_1,' ') = NVL(p_source_info.source_id_char_1,' ')
AND NVL(xte.source_id_char_2,' ') = NVL(p_source_info.source_id_char_2,' ')
AND NVL(xte.source_id_char_3,' ') = NVL(p_source_info.source_id_char_3,' ')
AND NVL(xte.source_id_char_4,' ') = NVL(p_source_info.source_id_char_4,' ')
AND NVL(xte.valuation_method,' ')
= NVL(p_valuation_method,' ')
AND xe.entity_id
= xte.entity_id
AND xet.application_id
= xte.application_id
AND xte.entity_code
= xet.entity_code
GROUP BY
xte.entity_id,
xte.entity_code,
xte.transaction_number,
xet.enable_gapless_events_flag;