Thursday, November 7, 2013

Auto-create Deliveries API



CREATE OR REPLACE PROCEDURE create_deliveries (
   p_delivery_detail_ids   IN     wsh_util_core.id_tab_type,
   x_delivery_id              OUT NUMBER,
   x_return_status            OUT VARCHAR2,
   x_error_message            OUT VARCHAR2)
IS
   v_api_version_number   NUMBER := 1;
   v_init_msg_list        VARCHAR2 (30);
   v_commit               VARCHAR2 (30);
   v_msg_count            NUMBER;
   v_msg_data             VARCHAR2 (2000);
   v_msg_summary          VARCHAR2 (3000);
   v_msg_details          VARCHAR2 (3000);
   v_line_rows            wsh_util_core.id_tab_type;
   v_del_rows             wsh_util_core.id_tab_type;
BEGIN
   --Delivery_detail_ids
   DBMS_OUTPUT.put_line ('in create_deliveries--------');
   v_line_rows := p_delivery_detail_ids;
   --Autocreate Deliveries
   wsh_delivery_details_pub.autocreate_deliveries (
      p_api_version_number   => v_api_version_number,
      p_init_msg_list        => v_init_msg_list,
      p_commit               => v_commit,
      x_return_status        => x_return_status,
      x_msg_count            => v_msg_count,
      x_msg_data             => v_msg_data,
      p_line_rows            => v_line_rows,
      x_del_rows             => v_del_rows);
   DBMS_OUTPUT.put_line (
      'Auto create deliveries x_return_status  : ' || x_return_status);

   IF (x_return_status <> fnd_api.g_ret_sts_success)
   THEN
      wsh_util_core.get_messages ('Y',
                                  v_msg_summary,
                                  v_msg_details,
                                  v_msg_count);

      IF v_msg_count > 1
      THEN
         v_msg_data := v_msg_summary || v_msg_details;
      ELSE
         v_msg_data := v_msg_summary;
      END IF;

      x_error_message := v_msg_data;
      x_return_status := 'E';
      DBMS_OUTPUT.put_line (
            'After call to wsh_delivery_details_pub.autocreate_deliveries: Error message v_msg_data '
         || v_msg_data);
   ELSE
      DBMS_OUTPUT.put_line ('Delivery_id=' || v_del_rows (1));
      x_delivery_id := v_del_rows (1);
      x_return_status := 'S';
   END IF;
EXCEPTION
   WHEN OTHERS
   THEN
      x_return_status := 'E';
      x_error_message := SQLCODE || ':' || SQLERRM;
      DBMS_OUTPUT.put_line ('Error :' || x_error_message);
      RETURN;
END;

3 comments:

  1. It becomes rummage for people to find reliable and best transportation organizations.
    this website

    ReplyDelete
  2. Many such companies that deal with auto transportation may not do door-to-door delivery unlike this company and hence, you have got one more reason to stick to this company for the safe delivery of the vehicle.car shipping

    ReplyDelete
  3. International auto shipping is a long, rigorous process. Hence, you must try to contact legit companies as much as possible. Choose a company that will be able to take care of your properties.Recommended Site

    ReplyDelete

Note: Only a member of this blog may post a comment.