Saturday 19 January 2013

anonymous block for customer location


---------------********anonymous block for customer location*****---------------------

declare
p_location_rec HZ_LOCATION_V2PUB.LOCATION_REC_TYPE;
x_location_id number;
x_return_status VARCHAR2 (2000);
x_msg_count     NUMBER;
x_msg_data      VARCHAR2 (2000);
 begin
 p_location_rec.country           := 'US';
  p_location_rec.address1          := 'Shivaji nagr';
  p_location_rec.address2          := 'Bhalerao ';
  p_location_rec.city              :='Pune';
  p_location_rec.postal_code       := 411033;
  p_location_rec.state             := 'MH';
  p_location_rec.created_by_module := 'HZ_CPUI';
  hz_location_v2pub.create_location( 'T',
  p_location_rec,
  x_location_id,
  x_return_status,
  x_msg_count,
  x_msg_data); IF  x_return_status ='S'THEN
    COMMIT;
    DBMS_OUTPUT.PUT_LINE('Creation of Customer location is Successful ');
    DBMS_OUTPUT.PUT_LINE('Output information ....');  
    dbms_output.put_line('Cust location Id           = '||TO_CHAR(x_location_id));
    dbms_output.put_line('Return Status Of Api    = '||x_return_status);
    dbms_output.put_line('No of err msgs          = '||x_msg_count);
    dbms_output.put_line('err information          = '||x_msg_data);
ELSE
    DBMS_OUTPUT.put_line ('Creation of Customer location got failed:'||x_msg_data);
    ROLLBACK;
    FOR i IN 1 .. x_msg_count
    LOOP
      x_msg_data := fnd_msg_pub.get( p_msg_index => i, p_encoded => 'F');
      dbms_output.put_line( i|| ') '|| x_msg_data);
    END LOOP;
END IF;
DBMS_OUTPUT.PUT_LINE('Completion of API');
end;
/

 

No comments:

Post a Comment