DBA Data[Home] [Help]

PACKAGE BODY: APPS.JL_CO_FA_POST_PKG

Source


1 PACKAGE BODY  jl_co_fa_post_pkg AS
2 /* $Header: jlcofgpb.pls 120.5 2008/01/26 04:50:30 vgadde ship $ */
3 
4 /* ======================================================================*
5  | FND Logging infrastructure                                           |
6  * ======================================================================*/
7 G_PKG_NAME                  CONSTANT VARCHAR2(30) := 'JL_CO_FA_POST_PKG';
8 G_CURRENT_RUNTIME_LEVEL     CONSTANT NUMBER       := FND_LOG.G_CURRENT_RUNTIME_LEVEL;
9 G_LEVEL_UNEXPECTED          CONSTANT NUMBER       := FND_LOG.LEVEL_UNEXPECTED;
10 G_LEVEL_ERROR               CONSTANT NUMBER       := FND_LOG.LEVEL_ERROR;
11 G_LEVEL_EXCEPTION           CONSTANT NUMBER       := FND_LOG.LEVEL_EXCEPTION;
12 G_LEVEL_EVENT               CONSTANT NUMBER       := FND_LOG.LEVEL_EVENT;
13 G_LEVEL_PROCEDURE           CONSTANT NUMBER       := FND_LOG.LEVEL_PROCEDURE;
14 G_LEVEL_STATEMENT           CONSTANT NUMBER       := FND_LOG.LEVEL_STATEMENT;
15 G_MODULE_NAME               CONSTANT VARCHAR2(80) := 'JL.PLSQL.JL_CO_FA_POST_PKG.';
16 
17 x_last_updated_by              NUMBER(15);
18 x_last_update_login            NUMBER(15);
19 x_request_id                   NUMBER(15);
20 x_program_application_id       NUMBER(15);
21 x_program_id                   NUMBER(15);
22 x_sysdate                      DATE;
23 x_statement                    VARCHAR2(20);
24 
25 PROCEDURE find_who_columns;
26 
27 ----------------------------------------------------------------------------
28 -- PROCEDURE                                                              --
29 --   purge_adjustment                                                     --
30 --                                                                        --
31 -- DESCRIPTION                                                            --
32 --   Use this procedure for posting from jl_co_fa_adjustments table to    --
33 -- gl_interface table.                                                    --
34 -- PURPOSE:                                                               --
35 --   Oracle Applications Rel 11.0                                         --
36 --                                                                        --
37 -- PARAMETERS:                                                            --
38 --            p_book                                                      --
39 --                                                                        --
40 -- HISTORY:                                                               --
41 --    08/21/98     Sujit Dalai    Created                                 --
42 --    10/23/98     Sujit Dalai    Changed the messages                    --
43 ----------------------------------------------------------------------------
44 
45 PROCEDURE post(ERRBUF      OUT NOCOPY VARCHAR2,
46                RETCODE     OUT NOCOPY VARCHAR2,
47                p_book         VARCHAR2) IS
48 
49   x_set_of_book_id               fa_book_controls.set_of_books_id%TYPE;
50   x_deprn_calendar               fa_book_controls.deprn_calendar%TYPE;
51   x_gl_je_source                 xla_subledgers.je_source_name%TYPE;    -- Bug 5136047
52   x_distribution_source_book     fa_book_controls.distribution_source_book%TYPE;
53   x_period_counter               VARCHAR2(150);
54   x_period_closed                VARCHAR2(150);
55   x_user_je_source_name          gl_je_sources.user_je_source_name%TYPE;
56   x_currency_code                gl_sets_of_books.currency_code%TYPE;
57   x_period_name                  fa_deprn_periods.period_name%TYPE;
58   x_end_date                     fa_calendar_periods.end_date%TYPE;
59   x_status                       VARCHAR2(50) := 'NEW';
60   x_actual_flag                  VARCHAR2(1)  := 'A';
61   x_batch_name                   VARCHAR2(150);
62   x_batch_description            VARCHAR2(150);
63   x_journal_entry_name           VARCHAR2(150);
64   x_journal_entry_description    VARCHAR2(150);
65   x_entered_dr                   NUMBER;
66   x_entered_cr                   NUMBER;
67   call_status                    BOOLEAN;
68   err_num                        NUMBER;
69   err_msg                        VARCHAR2(200);
70   SAME_AS_PERIOD_CLOSED          EXCEPTION;
71   PERIOD_NOT_DEFINED             EXCEPTION;
72   l_api_name            CONSTANT VARCHAR2(30) := 'POST';
73 
74 
75   CURSOR c_category IS
76    SELECT c.je_category_name,
77          c.user_je_category_name
78     FROM gl_je_categories c,
79          fa_book_controls b
80    WHERE b.book_type_code = p_book
81     AND  c.je_category_name IN ( b.global_attribute6,
82                                  b.global_attribute7,
83                                  b.global_attribute8,
84                                  b.global_attribute9,
85                                  b.global_attribute10,
86                                  b.global_attribute11,
87                                  b.global_attribute12,
88                                  b.global_attribute13,
89                                  b.global_attribute14,
90                                  b.global_attribute15,
91                                  b.global_attribute16,
92                                  b.global_attribute17,
93                                  b.global_attribute18)
94    UNION
95    SELECT c.je_category_name,
96          c.user_je_category_name
97     FROM gl_je_categories c
98    WHERE   c.je_category_name IN
99        (SELECT b.je_category_name
100          FROM xla_event_class_attrs b
101          WHERE b.application_id = 140);
102 
103    CURSOR c_adjustment(p_counter  NUMBER,
104                        p_je_category_name VARCHAR2) IS
105    SELECT source_type_code,
106           debit_credit_flag,
107           code_combination_id,
108           sum(adjustment_amount) x_amount
109      FROM jl_co_fa_adjustments
110     WHERE book_type_code = p_book
111       AND period_counter_created = p_counter
112       AND je_category_name = p_je_category_name
113       AND NVL(posting_flag, 'E') <> 'C'
114    GROUP BY source_type_code,
115             debit_credit_flag,
116             code_combination_id;
117 
118 
119 
120 BEGIN
121 
122   IF ( G_LEVEL_PROCEDURE >= G_CURRENT_RUNTIME_LEVEL) THEN
123      FND_LOG.STRING(G_LEVEL_PROCEDURE,G_MODULE_NAME||l_api_name||'.BEGIN',G_PKG_NAME||': '||l_api_name||'(+)');
124   END IF;
125 
126   fnd_message.set_name('JL', 'JL_CO_FA_PARAMETER');
127   fnd_file.put_line( FND_FILE.LOG, fnd_message.get);
128   fnd_file.put_line(FND_FILE.LOG, '----------------------------------------');
129   fnd_message.set_name('JL', 'JL_CO_FA_BOOK');
130   fnd_message.set_token('BOOK', p_book);
131   fnd_file.put_line( 1, fnd_message.get);
132   fnd_file.put_line(FND_FILE.LOG, '----------------------------------------');
133 
134               ---------------------------------------------------------
135               --             Find who_columns values                 --
136               ---------------------------------------------------------
137 
138         find_who_columns;
139 
140              ---------------------------------------------------------
141              -- Get Depreciation  Book Parameter                 --
142              ---------------------------------------------------------
143   x_statement := 'BOOK_INFO';
144 /* Bug 5136047:
145    In R12 due to SLA uptake, core FA no longer allows "GL journal entry source"
146    to be entered using Book Controls window.
147    "GL journal entry source" is set at the application level in SLA.
148    Though, gl_je_source value is available in fa_book_controls
149    for books upgraded from R11i, the source of truth is always as follows.
150    The "GL journal entry source" will be derived from JE_SOURCE_NAME from
151    XLA_SUBLEDGERS for application_id = 140.
152    Hence, there is no need to look at fa_book_controls for books upgraded
153    from R1i.
154 
155   SELECT bc.set_of_books_id,
156          bc.deprn_calendar,
157          bc.gl_je_source,
158          bc.distribution_source_book,
159          (bc.global_attribute19 +1), -- Period counter for which posting is to be performed.
160          bc.global_attribute5,
161          js.user_je_source_name
162     INTO x_set_of_book_id,
163          x_deprn_calendar,
164          x_gl_je_source,
165          x_distribution_source_book,
166          x_period_counter,
167          x_period_closed,
168          x_user_je_source_name
169     FROM fa_book_controls bc,
170          gl_je_sources js
171    WHERE book_type_code = p_book
172      AND js.je_source_name = bc.gl_je_source;
173 */
174 
175   SELECT bc.set_of_books_id,
176          bc.deprn_calendar,
177          bc.distribution_source_book,
178          (bc.global_attribute19 +1), -- Period counter for which posting is to be performed.
179          bc.global_attribute5
180     INTO x_set_of_book_id,
181          x_deprn_calendar,
182          x_distribution_source_book,
183          x_period_counter,
184          x_period_closed
185     FROM fa_book_controls bc
186    WHERE book_type_code = p_book;
187 
188   SELECT xs.je_source_name,
189          js.user_je_source_name
190     INTO x_gl_je_source,
191          x_user_je_source_name
192     FROM gl_je_sources js,
193          xla_subledgers xs
194    WHERE js.je_source_name = xs.je_source_name
195      AND xs.application_id = 140;
196 
197 
198   IF ( G_LEVEL_STATEMENT >= G_CURRENT_RUNTIME_LEVEL) THEN
199     fnd_file.put_line( 1, 'Set of book id :'||to_char(x_set_of_book_id));
200     FND_LOG.STRING(G_LEVEL_STATEMENT,G_MODULE_NAME||l_api_name, 'Set of book id :'||to_char(x_set_of_book_id));
201     fnd_file.put_line( 1, 'Depreciation Calender :'||x_deprn_calendar);
202     FND_LOG.STRING(G_LEVEL_STATEMENT,G_MODULE_NAME||l_api_name, 'Depreciation Calender :'||x_deprn_calendar);
203     fnd_file.put_line( 1, 'Gl je source :'||x_gl_je_source);
204     FND_LOG.STRING(G_LEVEL_STATEMENT,G_MODULE_NAME||l_api_name, 'Gl je source :'||x_gl_je_source);
205     fnd_file.put_line( 1, 'Distribution source book :'||x_distribution_source_book);
206     FND_LOG.STRING(G_LEVEL_STATEMENT,G_MODULE_NAME||l_api_name, 'Distribution source book :'||x_distribution_source_book);
207     fnd_file.put_line( 1, 'Period counter :'||x_period_counter);
208     FND_LOG.STRING(G_LEVEL_STATEMENT,G_MODULE_NAME||l_api_name, 'Period counter :'||x_period_counter);
209     fnd_file.put_line( 1, 'Period closed :'||x_period_closed);
210     FND_LOG.STRING(G_LEVEL_STATEMENT,G_MODULE_NAME||l_api_name, 'Period closed :'||x_period_closed);
211     fnd_file.put_line( 1, 'User je source name :'||x_user_je_source_name );
212     FND_LOG.STRING(G_LEVEL_STATEMENT,G_MODULE_NAME||l_api_name, 'User je source name :'||x_user_je_source_name );
213    END IF;
214 
215              ---------------------------------------------------------
216              -- Get Calendar parameters                             --
217              ---------------------------------------------------------
218   x_statement := 'CAL_INFO';
219   SELECT period_name
220     INTO x_period_name
221     FROM fa_deprn_periods
222    WHERE book_type_code = p_book
223      AND period_counter = x_period_counter;
224 
225     -----------------------------------------------------------------------------
226     --  Write close globalization period name on log file                      --
227     -----------------------------------------------------------------------------
228 
229     fnd_message.set_name ('JL', 'JL_ZZ_FA_PERIOD_NAME');
230     fnd_message.set_token ('PERIOD_NAME', x_period_name);
231     fnd_file.put_line (1, fnd_message.get);
232 
233   IF ( G_LEVEL_STATEMENT >= G_CURRENT_RUNTIME_LEVEL) THEN
234    fnd_file.put_line( 1, 'Period Name :'||x_period_name);
235    FND_LOG.STRING(G_LEVEL_STATEMENT,G_MODULE_NAME||l_api_name, 'Period Name :'||x_period_name);
236   END IF;
237 
238 
239   SELECT end_date
240     INTO x_end_date
241     FROM fa_calendar_periods
242    WHERE calendar_type = x_deprn_calendar
243      AND period_name = x_period_name;
244 
245   IF ( G_LEVEL_STATEMENT >= G_CURRENT_RUNTIME_LEVEL) THEN
246     fnd_file.put_line( 1, 'End Date :'||x_end_date);
247     FND_LOG.STRING(G_LEVEL_STATEMENT,G_MODULE_NAME||l_api_name, 'End Date :'||x_end_date);
248   END IF;
249 
250              ---------------------------------------------------------
251              -- If last period posted and period counters are not   --
252              -- defined  then stop the program with error           --
253              ---------------------------------------------------------
254 
255   IF ((x_period_counter IS NULL) OR (x_period_closed IS NULL)) THEN
256     RAISE PERIOD_NOT_DEFINED;
257   END IF;
258 
259   x_statement := 'CURR_INFO';
260   SELECT currency_code
261     INTO x_currency_code
262     FROM gl_sets_of_books
263    WHERE set_of_books_id = x_set_of_book_id;
264 
265   IF ( G_LEVEL_STATEMENT >= G_CURRENT_RUNTIME_LEVEL) THEN
266     fnd_file.put_line( 1, 'Currency Code :'||x_currency_code);
267     FND_LOG.STRING(G_LEVEL_STATEMENT,G_MODULE_NAME||l_api_name, 'Currency Code :'||x_currency_code);
268   END IF;
269 
270              ---------------------------------------------------------
271              -- If last period posted is same as period closed by   --
272              -- Globalization then stop the program with error      --
273              ---------------------------------------------------------
274   IF (NVL(x_period_counter, -998) -1) = NVL(x_period_closed, -999) THEN
275      Raise SAME_AS_PERIOD_CLOSED;
276   END IF;
277 
278              ---------------------------------------------------------
279              -- Process following for each gl_category_name         --
280              ---------------------------------------------------------
281 
282   FOR rec_category IN c_category LOOP
283 
284      fnd_message.set_name('JL', 'JL_CO_FA_JE_CATEGORY');
285      fnd_message.set_token('JE_CATEGORY', rec_category.user_je_category_name);
286      fnd_file.put_line( 1, fnd_message.get);
287 
288      IF ( G_LEVEL_STATEMENT >= G_CURRENT_RUNTIME_LEVEL) THEN
289        fnd_file.put_line( 1, 'Je category name :'||rec_category.je_category_name);
290        FND_LOG.STRING(G_LEVEL_STATEMENT,G_MODULE_NAME||l_api_name, 'Je category name :'||rec_category.je_category_name);
291      END IF;
292 
293      x_batch_name := x_user_je_source_name||' '||rec_category.user_je_category_name||' '||
294                      p_book||'/'||x_period_name;
295 
296      IF ( G_LEVEL_STATEMENT >= G_CURRENT_RUNTIME_LEVEL) THEN
297        fnd_file.put_line( 1, 'Batch Name :'||x_batch_name);
298        FND_LOG.STRING(G_LEVEL_STATEMENT,G_MODULE_NAME||l_api_name, 'Batch Name :'||x_batch_name);
299      END IF;
300 
301      x_batch_description := p_book||'/'||x_period_name||' '||x_user_je_source_name||' '||
302                             rec_category.user_je_category_name;
303      IF ( G_LEVEL_STATEMENT >= G_CURRENT_RUNTIME_LEVEL) THEN
304        fnd_file.put_line( 1, 'Batch description :'||x_batch_description);
305        FND_LOG.STRING(G_LEVEL_STATEMENT,G_MODULE_NAME||l_api_name, 'Batch description :'||x_batch_description);
306      END IF;
307 
308      x_journal_entry_name := x_batch_name;
309      x_journal_entry_description := x_batch_description;
310 
311      IF ( G_LEVEL_STATEMENT >= G_CURRENT_RUNTIME_LEVEL) THEN
312        fnd_file.put_line( 1, 'Journal Entry_name :'||x_journal_entry_name);
313        FND_LOG.STRING(G_LEVEL_STATEMENT,G_MODULE_NAME||l_api_name, 'Journal Entry_name :'||x_journal_entry_name);
314        fnd_file.put_line( 1, 'Journal Entry description :'||x_batch_description);
315        FND_LOG.STRING(G_LEVEL_STATEMENT,G_MODULE_NAME||l_api_name, 'Journal Entry description :'||x_batch_description);
316      END IF;
317 
318 
319      FOR rec_adjustment IN c_adjustment(x_period_counter, rec_category.je_category_name) LOOP
320 
321        IF ( G_LEVEL_STATEMENT >= G_CURRENT_RUNTIME_LEVEL) THEN
322          fnd_file.put_line( 1, 'Book_type_code :'||rec_adjustment.source_type_code);
323          FND_LOG.STRING(G_LEVEL_STATEMENT,G_MODULE_NAME||l_api_name, 'Book_type_code :'||rec_adjustment.source_type_code);
324          fnd_file.put_line( 1, 'debit credit flag :'||rec_adjustment.debit_credit_flag);
325          FND_LOG.STRING(G_LEVEL_STATEMENT,G_MODULE_NAME||l_api_name, 'debit credit flag :'||rec_adjustment.debit_credit_flag);
326          fnd_file.put_line( 1, 'code_combination_id :'||rec_adjustment.code_combination_id);
327          FND_LOG.STRING(G_LEVEL_STATEMENT,G_MODULE_NAME||l_api_name, 'code_combination_id :'||rec_adjustment.code_combination_id);
328          fnd_file.put_line( 1, 'Amount :'||to_char(rec_adjustment.x_amount));
329          FND_LOG.STRING(G_LEVEL_STATEMENT,G_MODULE_NAME||l_api_name, 'Amount :'||to_char(rec_adjustment.x_amount));
330       END IF;
331 
332       IF rec_adjustment.x_amount <> 0 THEN
333 
334         IF  (rec_adjustment.debit_credit_flag = 'DR') then
335           x_entered_dr := rec_adjustment.x_amount;
336           x_entered_cr := 0;
337         ELSIF (rec_adjustment.debit_credit_flag = 'CR') then
338           x_entered_dr := 0;
339           x_entered_cr := rec_adjustment.x_amount;
340         ELSE
341           x_entered_dr := 0;
342           x_entered_cr := 0;
343         END IF;
344 
345         IF (x_entered_dr > 0 OR x_entered_cr >0 ) THEN
346 
347 
348         IF ( G_LEVEL_STATEMENT >= G_CURRENT_RUNTIME_LEVEL) THEN
349           fnd_file.put_line( 1, 'Inserting row into GL_INTERFACE');
350           FND_LOG.STRING(G_LEVEL_STATEMENT,G_MODULE_NAME||l_api_name, 'Inserting row into GL_INTERFACE');
351         END IF;
352 
353 
354         INSERT  INTO  gl_interface (status,
355                                     set_of_books_id,
356                                     accounting_date,
357                                     currency_code,
358                                     date_created,
359                                     created_by,
360                                     actual_flag,
361                                     user_je_category_name,
362                                     user_je_source_name,
363                                     entered_dr,
364                                     entered_cr,
365                                     reference1,
366                                     reference2,
367                                     reference4,
368                                     reference6,
369                                     reference10,
370                                     reference21,
371                                     reference22,
372                                     code_combination_id)
373                             VALUES( x_status,
374                                     x_set_of_book_id,
375                                     x_end_date,
376                                     x_currency_code,
377                                     x_sysdate,
378                                     x_last_updated_by,
379                                     x_actual_flag,
380                                     rec_category.user_je_category_name,
381                                     x_user_je_source_name,
382                                     x_entered_dr,
383                                     x_entered_cr,
384                                     x_batch_name,
385                                     x_batch_description,
386                                     x_journal_entry_name,
387                                     p_book,
388                                     x_batch_description,
389                                     rec_category.je_category_name,
390                                     jl_co_fa_adj_je_header_s.NEXTVAL,
391                                     rec_adjustment.code_combination_id);
392 
393 
394        IF ( G_LEVEL_STATEMENT >= G_CURRENT_RUNTIME_LEVEL) THEN
395          fnd_file.put_line( 1, 'Inserted row into GL_INTERFACE');
396          FND_LOG.STRING(G_LEVEL_STATEMENT,G_MODULE_NAME||l_api_name, 'Inserted row into GL_INTERFACE');
397        END IF;
398 
399 
400              ---------------------------------------------------------
401              -- Update jl_co_fa_adjustments                         --
402              ---------------------------------------------------------
403 
404         UPDATE jl_co_fa_adjustments
405            SET sequence_line = jl_co_fa_adj_je_header_s.CURRVAL,
406                posting_flag = 'C',
407                last_update_date = x_sysdate,
408                last_updated_by = x_last_updated_by,
409                last_update_login = x_last_update_login,
410                program_update_date = x_sysdate
411         WHERE  book_type_code = p_book
412            AND je_category_name = rec_category.je_category_name
413            AND NVL(posting_flag, 'E') <> 'C'
414            AND period_counter_created = x_period_counter
415            AND code_combination_id = rec_adjustment.code_combination_id
416            AND debit_credit_flag = rec_adjustment.debit_credit_flag
417            AND source_type_code = rec_adjustment.source_type_code;
418 
419       END IF;
420 
421       END IF;
422 
423     END LOOP;
424 
425   END LOOP;
426 
427   UPDATE fa_book_controls
428      SET global_attribute19 = x_period_counter,
429          last_update_date = x_sysdate,
430          last_updated_by = x_last_updated_by
431    WHERE book_type_code = p_book;
432 
433   COMMIT;
434 
435   IF ( G_LEVEL_PROCEDURE >= G_CURRENT_RUNTIME_LEVEL) THEN
436      FND_LOG.STRING(G_LEVEL_PROCEDURE,G_MODULE_NAME||l_api_name||'.END',G_PKG_NAME||': '||l_api_name||'(-)');
437   END IF;
438 
439 EXCEPTION
440 
441   WHEN PERIOD_NOT_DEFINED THEN
442     fnd_message.set_name('JL', 'JL_CO_FA_PERIOD_NOT_DEFINED');
443     fnd_message.set_token('BOOK', p_book);
444 --  err_msg := fnd_message.get;
445     fnd_file.put_line (fnd_file.log, fnd_message.get);
446     call_status := fnd_concurrent.set_completion_status('ERROR','');
447 /*
448     app_exception.raise_exception (exception_type => 'APP',
449        exception_code =>
450        jl_zz_fa_utilities_pkg.get_app_errnum('JL', 'JL_CO_FA_PERIOD_NOT_DEFINED'),
451        exception_text => err_msg);
452 */
453 
454   WHEN SAME_AS_PERIOD_CLOSED THEN
455     fnd_message.set_name('JL', 'JL_CO_FA_SAME_AS_PERIOD_CLOSED');
456     fnd_message.set_token('BOOK', p_book);
457     fnd_message.set_token('PERIOD', x_period_name);
458 --  err_msg := fnd_message.get;
459     fnd_file.put_line (fnd_file.log, fnd_message.get);
460     call_status := fnd_concurrent.set_completion_status('ERROR','');
461 /*
462      app_exception.raise_exception (exception_type => 'APP',
463        exception_code =>
464        jl_zz_fa_utilities_pkg.get_app_errnum('JL', 'JL_CO_FA_SAME_AS_PERIOD_CLOSED'),
465        exception_text => err_msg);
466 */
467 
468   WHEN OTHERS THEN
469       IF x_statement = 'BOOK_INFO' THEN
470         fnd_message.set_name('JL', 'JL_ZZ_FA_EXEC_FAILURE');
471         fnd_message.set_token('NUMBER', '1');
472 --      err_msg := fnd_message.get;
473         fnd_file.put_line (fnd_file.log, fnd_message.get);
474         ROLLBACK;
475         call_status := fnd_concurrent.set_completion_status('ERROR','');
476 /*
477         app_exception.raise_exception (exception_type => 'APP',
478         exception_code =>
479         jl_zz_fa_utilities_pkg.get_app_errnum('JL', 'JL_ZZ_FA_EXEC_FAILURE'),
480         exception_text => err_msg);
481 */
482 
483       ELSIF x_statement = 'CURR_INFO' THEN
484         fnd_message.set_name('JL', 'JL_ZZ_FA_EXEC_FAILURE');
485         fnd_message.set_token('NUMBER', '2');
486 --      err_msg := fnd_message.get;
487         fnd_file.put_line (fnd_file.log, fnd_message.get);
488         ROLLBACK;
489         call_status := fnd_concurrent.set_completion_status('ERROR','');
490 /*
491         app_exception.raise_exception (exception_type => 'APP',
492         exception_code =>
493         jl_zz_fa_utilities_pkg.get_app_errnum('JL', 'JL_ZZ_FA_EXEC_FAILURE'),
494         exception_text => err_msg);
495 */
496 
497       ELSIF x_statement = 'CAL_INFO' THEN
498         fnd_message.set_name('JL', 'JL_ZZ_FA_EXEC_FAILURE');
499         fnd_message.set_token('NUMBER', '3');
500 --      err_msg := fnd_message.get;
501         fnd_file.put_line (fnd_file.log, fnd_message.get);
502         ROLLBACK;
503         call_status := fnd_concurrent.set_completion_status('ERROR','');
504 /*
505         app_exception.raise_exception (exception_type => 'APP',
506         exception_code =>
507         jl_zz_fa_utilities_pkg.get_app_errnum('JL', 'JL_ZZ_FA_EXEC_FAILURE'),
508         exception_text => err_msg);
509 */
510 
511       ELSE
512         fnd_message.set_name('JL', 'JL_CO_FA_GENERAL_ERROR');
513         fnd_file.put_line( fnd_file.log, fnd_message.get);
514         err_num := SQLCODE;
515         err_msg := substr(SQLERRM, 1, 200);
516         ROLLBACK;
517         RAISE_APPLICATION_ERROR( err_num, err_msg);
518       END IF;
519 END post;
520 
521 
522 ----------------------------------------------------------------------------
523 -- PROCEDURE                                                              --
524 --   find_who_columns                                                     --
525 --                                                                        --
526 -- DESCRIPTION                                                            --
527 --   Use this procedure to find the values for WHO columns.               --
528 --                                                                        --
529 -- PURPOSE:                                                               --
530 --   Oracle Applications Rel 11.0                                         --
531 --                                                                        --
532 -- PARAMETERS:                                                            --
533 -- HISTORY:                                                               --
534 --    08/12/98     Sujit Dalai    Created                                 --
535 ----------------------------------------------------------------------------
536 
537 PROCEDURE find_who_columns IS
538 
539     l_api_name           CONSTANT VARCHAR2(30) := 'FIND_WHO_COLUMNS';
540 
541   BEGIN
542 
543     IF ( G_LEVEL_PROCEDURE >= G_CURRENT_RUNTIME_LEVEL) THEN
544        FND_LOG.STRING(G_LEVEL_PROCEDURE,G_MODULE_NAME||l_api_name||'.BEGIN',G_PKG_NAME||': '||l_api_name||'(+)');
545     END IF;
546 
547     x_last_updated_by := fnd_global.user_id;
548     x_last_update_login := fnd_global.login_id;
549     x_request_id := fnd_global.conc_request_id;
550     x_program_application_id := fnd_global.prog_appl_id;
551     x_program_id  := fnd_global.conc_program_id;
552     x_sysdate     := SYSDATE;
553 
554     IF ( G_LEVEL_STATEMENT >= G_CURRENT_RUNTIME_LEVEL) THEN
555       fnd_file.put_line( 1, 'last_update_login:'||to_char(x_last_update_login));
556       FND_LOG.STRING(G_LEVEL_STATEMENT,G_MODULE_NAME||l_api_name, 'last_update_login:'||to_char(x_last_update_login));
557       fnd_file.put_line( 1, 'last_updated_by:'||to_char(x_last_updated_by));
558       FND_LOG.STRING(G_LEVEL_STATEMENT,G_MODULE_NAME||l_api_name, 'last_updated_by:'||to_char(x_last_updated_by));
559       fnd_file.put_line( 1, 'last_request_id:'||to_char(x_request_id));
560       FND_LOG.STRING(G_LEVEL_STATEMENT,G_MODULE_NAME||l_api_name, 'last_request_id:'||to_char(x_request_id));
561       fnd_file.put_line( 1, 'x_program_application_id :'||to_char(x_program_application_id ));
562       FND_LOG.STRING(G_LEVEL_STATEMENT,G_MODULE_NAME||l_api_name, 'x_program_application_id :'||to_char(x_program_application_id ));
563       fnd_file.put_line( 1, 'x_program_id :'||to_char(x_program_id ));
564       FND_LOG.STRING(G_LEVEL_STATEMENT,G_MODULE_NAME||l_api_name, 'x_program_id :'||to_char(x_program_id ));
565       fnd_file.put_line( 1, 'x_sysdate :'||to_char(x_sysdate ));
566       FND_LOG.STRING(G_LEVEL_STATEMENT,G_MODULE_NAME||l_api_name, 'x_sysdate :'||to_char(x_sysdate ));
567     END IF;
568 
569     IF ( G_LEVEL_PROCEDURE >= G_CURRENT_RUNTIME_LEVEL) THEN
570        FND_LOG.STRING(G_LEVEL_PROCEDURE,G_MODULE_NAME||l_api_name||'.END',G_PKG_NAME||': '||l_api_name||'(-)');
571     END IF;
572 
573 END find_who_columns;
574 
575 END jl_co_fa_post_pkg;