API to create Bank information in Oracle R12

/* This is API to create Bank information in Oracle R12 
*/


DECLARE
    xx_output          VARCHAR2 (1500);
    xx_msg_dummy       VARCHAR2 (1500);
    xx_return_status   VARCHAR2 (1500);
    xx_msg_data        VARCHAR2 (1500);

    xx_bank_id         NUMBER;
    xx_msg_count       NUMBER;
    xx_extbank_rec     apps.iby_ext_bankacct_pub.extbank_rec_type;
    xx_response_rec    apps.iby_fndcpt_common_pub.result_rec_type;
BEGIN
    xx_return_status := '';
    xx_msg_count := '';
    xx_msg_data := '';

    xx_extbank_rec.bank_name := 'Bank Name';
    xx_extbank_rec.bank_number := 'TEST123';
    xx_extbank_rec.country_code := 'PS';

    apps.fnd_msg_pub.delete_msg (NULL);
    apps.fnd_msg_pub.initialize ();


    iby_ext_bankacct_pub.create_ext_bank (
        p_api_version     => 1.0,
        p_init_msg_list   => fnd_api.g_true,
        p_ext_bank_rec    => xx_extbank_rec,
        /* Return Values ypu can use*/
        x_bank_id         => xx_bank_id,
        x_return_status   => xx_return_status,
        x_msg_count       => xx_msg_count,
        x_msg_data        => xx_msg_data,
        x_response        => xx_response_rec);

    xx_output := ' ';

    IF (xx_return_status <> 'S')
    THEN
        FOR i IN 1 .. xx_msg_count
        LOOP
            apps.fnd_msg_pub.get (i,
                                  apps.fnd_api.g_false,
                                  xx_msg_data,
                                  xx_msg_dummy);

             xx_output :=xx_output || (TO_CHAR (i) || ': ' || SUBSTR (xx_msg_data, 1, 250));
        END LOOP;

         DBMS_OUTPUT.put_line ('Error in Creating Bank: ');
    ELSE     
     DBMS_OUTPUT.put_line (' Success !!');
    END IF;

   --- COMMIT;
EXCEPTION
    WHEN OTHERS
    THEN
        ROLLBACK;
        DBMS_OUTPUT.put_line ('Error: ' || SQLERRM);
END;
/

No comments

2015@Bahaa Barghouti. Powered by Blogger.