Infolinks

Friday 6 July 2012

OKC PROCESSING DEFINITIONS

OKC PROCESSING DEFINATIONS

DECLARE
    rec1 okc_pdp_pvt.pdpv_rec_type;
    rec2 okc_pdp_pvt.pdpv_rec_type;
   
  
    x_api_version                  NUMBER       :=1.0;
    p_init_msg_list                VARCHAR2(200):=null;
    x_return_status                VARCHAR2(200):=null;
    x_msg_count                    NUMBER       :=null;
    x_msg_data                     VARCHAR2(200):=null;
  
    x_user_id                       NUMBER      :=Fnd_Profile.VALUE('USER_ID');--profile value
    x_resp_id                       NUMBER      :=fnd_global.resp_id;
    x_appl_id                       NUMBER      :=fnd_global.resp_appl_id;
    x_org_id                        NUMBER      :=fnd_global.org_id;
    x_login_id                      NUMBER      :=Fnd_Profile.VALUE('LOGIN_ID');
   
    BEGIN
    rec1                                        :=null;
    rec1.id                                     :=null;
    rec1.object_version_number                  :=null;
    rec1.sfwt_flag                              :='Y';
    rec1.pdf_id                                 :=null;
    rec1.name                                   :='Test3';
    rec1.user_name                              :=null;
    rec1.data_type                              :='CHAR';
    rec1.default_value                          :=null;
    rec1.required_yn                            :='Y';
    rec1.description                            :='Creating test1';
    rec1.application_id                         :=515;
    rec1.seeded_flag                            :='N';
    rec1.created_by                             :=1318;
    rec1.creation_date                          :=sysdate;
    rec1.last_updated_by                        :=1318;
    rec1.last_update_date                       :=sysdate;
    rec1.last_update_login                      :=5500646;
    rec1.jtot_object_code                       :=null;
    rec1.NAME_COLUMN                            :=null;
    rec1.description_column                     :=null;
  
   
    fnd_global.apps_initialize(x_user_id, x_resp_id, x_appl_id,x_login_id);
    DBMS_OUTPUT.PUT_LINE('API Execution Started');
   
              FND_MSG_PUB.INITIALIZE;
   
    OKC_PDP_PVT.INSERT_ROW(
    p_api_version                  =>x_api_version
    ,p_init_msg_list               =>p_init_msg_list
    ,x_return_status               =>x_return_status
    ,x_msg_count                   => x_msg_count
    ,x_msg_data                    =>x_msg_data
    ,p_pdpv_rec                    =>rec1
    ,x_pdpv_rec                    =>rec2);
   
    COMMIT;
    IF (x_return_Status ='S')  THEN
    DBMS_OUTPUT.PUT_LINE('API Executed Successfully');
    DBMS_OUTPUT.PUT_LINE(x_return_status);
    DBMS_OUTPUT.PUT_LINE(x_msg_count);
    DBMS_OUTPUT.PUT_LINE(x_msg_data);
    ELSE
                 IF x_msg_count > 0 THEN
                FOR l_index in 1..x_msg_count LOOP
                   dbms_output.put_line(l_index || '.' || SUBSTR(fnd_msg_pub.get(p_encoded => fnd_api.g_false), 1, 255));
                END LOOP;
             END IF;
    DBMS_OUTPUT.PUT_LINE(x_return_status);
    DBMS_OUTPUT.PUT_LINE(x_msg_count);
   DBMS_OUTPUT.PUT_LINE(x_msg_data);
   DBMS_OUTPUT.PUT_LINE('API Not Executed Successfully ');
   END IF;
   EXCEPTION
   WHEN OTHERS THEN
   DBMS_OUTPUT.PUT_LINE('ERROR='||sqlerrm);
   END;

No comments:

Post a Comment