EBS dynamic creation of account portfolio

Posted by faydra92 on Sat, 19 Oct 2019 21:59:28 +0200

Original link: http://www.cnblogs.com/riasky/p/3481589.html

Objective: to use the program to dynamically create account portfolio. If the account combination exists, the existing ID will be returned; if not, the account combination will be created dynamically and the ID will be returned.

Implementation steps:

1. Get the chart of accounts ID

2. Get the account elastic field separator

3. Call the standard API to get the account combination id

The specific implementation is as follows:

1. Get the chart of accounts ID implementation code:

SELECT sob.chart_of_accounts_id  
  INTO l_id_flex_num  
  FROM financials_system_params_all fsp, gl_sets_of_books sob  
 WHERE org_id = p_org_id  
   AND sob.set_of_books_id = fsp.set_of_books_id;  


2. Get the code of account elastic field separator:

SELECT concatenated_segment_delimiter  
  INTO l_segment_delimiter  
  FROM fnd_id_flex_structures  
 WHERE application_id = 101  
   AND id_flex_code = 'GL#'  
   AND id_flex_num = l_id_flex_num;


3. Call the standard API to get the account combination id implementation code:

 

l_concatenated_segments := l_segment1 || l_segment_delimiter ||  
                             p_segment2 || l_segment_delimiter ||  
                             p_segment3 || l_segment_delimiter ||  
                             l_segment4 || l_segment_delimiter ||  
                             l_segment5 || l_segment_delimiter ||  
                             l_segment6 || l_segment_delimiter ||  
                             l_segment7 || l_segment_delimiter ||  
                             l_segment8 || l_segment_delimiter ||  
                             l_segment9 || l_segment_delimiter ||  
                             l_segment10 || l_segment_delimiter ||  
                             l_segment11 || l_segment_delimiter ||  
                             l_segment12 || l_segment_delimiter ||  
                             l_segment13 || l_segment_delimiter ||  
                             l_segment14 || l_segment_delimiter ||  
                             l_segment15 || l_segment_delimiter ||  
                             l_segment16 || l_segment_delimiter ||  
                             l_segment17 || l_segment_delimiter ||  
                             l_segment18 || l_segment_delimiter ||  
                             l_segment19 || l_segment_delimiter ||  
                             l_segment20 || l_segment_delimiter ||  
                             l_segment21 || l_segment_delimiter ||  
                             l_segment22 || l_segment_delimiter ||  
                             l_segment23 || l_segment_delimiter ||  
                             l_segment24 || l_segment_delimiter ||  
                             l_segment25 || l_segment_delimiter ||  
                             l_segment26 || l_segment_delimiter ||  
                             l_segment27 || l_segment_delimiter ||  
                             l_segment28 || l_segment_delimiter ||  
                             l_segment29 || l_segment_delimiter ||  
                             l_segment30 || l_segment_delimiter;  
  l_gcc_account_id := apps.fnd_flex_ext.get_ccid(application_short_name => 'SQLGL',  
                                                 key_flex_code          => 'GL#',  
                                                 structure_number       => l_id_flex_num,  
                                                 validation_date        => to_char(SYSDATE,  
                                                                                   apps.fnd_flex_ext.DATE_FORMAT),  
                                                 concatenated_segments  => x_concatenated_seg);  
  fnd_file.PUT_LINE(fnd_file.log,  
                    'l_gcc_account_id:' || l_gcc_account_id);  
  IF l_gcc_account_id = 0 THEN  
    RETURN NULL;  
  END IF;  


Note: if the account ID returns 0, the creation is not successful.

 

 

 

Error reason: the parameter passed in is incorrect or the account combination is not verified.

 

Reproduced at: https://www.cnblogs.com/riasky/p/3481589.html