Tuesday, August 26, 2008

API to insert GL Code Combination


I had seen in many projects during the initial instance setup the functionals used to use the data loader to insert the GL code combinations. In fact if its just 1000 or 2000 records then it may be fine. But I had seen them using the data-loader to insert 70k - 200k records, which will take at-least 2 days for them to insert. Apart from this there will be some value set values might be missing which will interrupt there data loader.

Even I had come across this situation in one of my previous project. I have been asked to insert 100k code combinations using the data loader. First I tried data loader only. It took 3 hrs to insert 3k records :( But finally I decided to write an API which will insert all these code combinations in 5-10 mins. Then I get to know this API fnd_flex_keyval.validate_segs.

This API will return a boolean value 'TRUE' or 'FALSE'. This API is there in R12 instance also. Here is the sample call to this API which I used in my code,
SELECT chart_of_accounts_id

INTO l_coa_id

FROM gl_sets_of_books

WHERE set_of_books_id = fnd_profile.VALUE ('GL_SET_OF_BKS_ID');

l_keyval_status := fnd_flex_keyval.validate_segs ('CREATE_COMBINATION', 'SQLGL', 'GL#', l_coa_id, gl_code_rec.concatenated_segments, 'V', SYSDATE, 'ALL', NULL, NULL, NULL, NULL, FALSE, FALSE, NULL, NULL,NULL );



This is just an example how I used in my code and gl_code_rec.concatenated_segments is the altual code combination needs to be inserted.

I am not sure this information is really informative. But thought of sharing.




No comments:

Post a Comment