How to Link between RTN to Credit Memo in Payable

SELECT jat.dm_invoice_num
  FROM jai_ap_tds_invoices jat,
       ap_invoices_all aia,
       ap_invoice_distributions_all aida
 WHERE aia.invoice_id = aida.invoice_id
   AND jat.invoice_id = aia.invoice_id
   AND aida.invoice_distribution_id IN (
          SELECT aid.prepay_distribution_id
            FROM jai_ap_tds_thhold_trxs jtx, ap_invoice_distributions_all aid
           WHERE jtx.invoice_distribution_id = aid.invoice_distribution_id
             AND invoice_to_vendor_id = 516912) --- RTN Invoice ID

How to add a Concurrent Program to Responsibility (Request Group) using API

Example 1. Custom Responsibility (Request Group)

BEGIN
apps.fnd_program.add_to_group(
        PROGRAM_SHORT_NAME  => 'XXCONA_JG',
        PROGRAM_APPLICATION => 'XXILL',
        REQUEST_GROUP       => 'XXILL Request Group',
        GROUP_APPLICATION   => 'XXILL'
      );
COMMIT;
END;

Example 2. India Localization Purchasing Request Group
BEGIN
apps.fnd_program.add_to_group(
        PROGRAM_SHORT_NAME  => 'XXCONA_JG',
        PROGRAM_APPLICATION => 'XXILL',
        REQUEST_GROUP       => 'JAI_Purchasing_RG',
        GROUP_APPLICATION   => 'JA'
      );
COMMIT;
END;


Example 3. India Localization Receivables Request Group
BEGIN
apps.fnd_program.add_to_group(
        PROGRAM_SHORT_NAME  => 'XXCONA_JG',
        PROGRAM_APPLICATION => 'XXILL',
        REQUEST_GROUP       => 'JAI_Receivables_RG',
        GROUP_APPLICATION   => 'JA'
      );
COMMIT;
END;