Thursday, 3 February 2022

How to create a Custom Lookup Code and Lookup Values in AR_LOOKUPS table from backend using API

Requirement: There is a lookup in fnd lookups table, business wants that lookup to be modified by them, adding lookup values, modifying and disabling them.

Instead of giving the FND_LOOKUPS function, we want to give them the AR Lookups function for them to modify the lookup values.


Below is the Anonymous block, we have written to get the values from FND Lookups table to AR Lookups table.


DECLARE

   ln_rowid    VARCHAR2 (1000);

   ln_rowid1   VARCHAR2 (1000);

BEGIN

  

   fnd_lookup_types_pkg.insert_row (x_rowid                    => ln_rowid,

                                    x_lookup_type              => 'XX_PO_BOXES',

                                    x_security_group_id        => 0,

                                    x_view_application_id      => 222,

                                    x_application_id           => 222,

                                    x_customization_level      => 'U',

                                    x_meaning                  => 'Lookup for PO Boxes',

                                    x_description              => 'Lookup for PO Boxes',

                                    x_creation_date            => SYSDATE,

                                    x_created_by               => 0,

                                    x_last_update_date         => SYSDATE,

                                    x_last_updated_by          => 0,

                                    x_last_update_login        => -1

                                   );

                                     

            COMMIT;

  

   for i in (select lookup_code,

start_date_active,

end_date_active,

tag,

meaning,

description

from fnd_lookup_values_vl 

where lookup_type = 'XX_PO_BOXES'


)

loop

   fnd_lookup_values_pkg.insert_row (x_rowid                    => ln_rowid1,

                                     x_lookup_type              => 'XX_PO_BOXES',

                                     x_security_group_id        => 0,

                                     x_view_application_id      => 222,

                                     x_lookup_code              => i.lookup_code,

                                     x_tag                      => i.tag,

                                     x_attribute_category       => NULL,

                                     x_attribute1               => NULL,

                                     x_attribute2               => NULL,

                                     x_attribute3               => NULL,

                                     x_attribute4               => NULL,

                                     x_enabled_flag             => 'Y',

                                     x_start_date_active        => i.start_date_active,

                                     x_end_date_active          => i.end_date_active,

                                     x_territory_code           => NULL,

                                     x_attribute5               => NULL,

                                     x_attribute6               => NULL,

                                     x_attribute7               => NULL,

                                     x_attribute8               => NULL,

                                     x_attribute9               => NULL,

                                     x_attribute10              => NULL,

                                     x_attribute11              => NULL,

                                     x_attribute12              => NULL,

                                     x_attribute13              => NULL,

                                     x_attribute14              => NULL,

                                     x_attribute15              => NULL,

                                     x_meaning                  => i.meaning,

                                     x_description              => i.description,

                                     x_creation_date            => SYSDATE,

                                     x_created_by               => 0,

                                     x_last_update_date         => SYSDATE,

                                     x_last_updated_by          => 0,

                                     x_last_update_login        => -1

                                    );

    COMMIT;

end loop;

EXCEPTION WHEN NO_DATA_FOUND THEN

dbms_output.put_line('No Data Found');

WHEN OTHERS THEN

NULL;


END;

/


No comments:

Post a Comment

Uploading PO Attachments from EBS to FTP Server

 create or replace PROCEDURE xx_upload_po_attachment(errbuff out varchar2, retcode out number)  IS CURSOR cur_new_attmt IS    select ponumbe...