INV-MO-INV_MO_ADMIN_PUB-Is There Any Public API To Cancel Move Orders? (Doc ID 1925418.1)

43 篇文章 6 订阅
11 篇文章 0 订阅

摘自:Document Display (oracle.com)

Is There Any Public API To Cancel Move Orders? (Answer: Yes) (Doc ID 1925418.1)

In this Document

Goal
Solution
API Example
References

APPLIES TO:

Oracle Inventory Management - Version 11.5.9 and later
Information in this document applies to any platform.

GOAL

Is there any public API to cancel move orders which are not processed yet?
 

SOLUTION


The Move Order Admin API (INV_MO_ADMIN_PUB) provides the public procedures to Cancel, Close or Purge orders and order lines.

For lines:

  • Cancel_Line
  • Close_Line

For orders:

  • Cancel_Order
  • Close_Order
  • Purge_Order

API Example

Here is an example of closing lines. The benefit of closing lines is that it will also clear the allocations (pending transactions in MTL_MATERIAL_TRANSACTIONS_TEMP).

The script uses values like user id, responsibility id, and move order line id. To find the values, you can use these SQL scripts:

-- a) You can confirm user id with this query:
select user_id, user_name from fnd_user where user_id = &UserID;

-- b) You can select a responsibility id with SQL like this -- This looks for the the inventory responsibility:
  SELECT responsibility_id
  FROM   FND_RESPONSIBILITY
  WHERE  responsibility_key = 'ORACLE_INVENTORY';

-- c) Confirm the application id (401) with this query:
  SELECT application_id
  FROM   FND_APPLICATION
  WHERE  application_short_name = 'INV';

-- d) Confirm move order line id:
select a.line_id, a.header_id, b.request_number
from mtl_txn_request_lines a, mtl_txn_request_headers b
where a.header_id = b.header_id
and a.line_id = &YourLineID
and b.request_number = '&YourMoveOrder';

2. Here is an example of using the API:


-- SQL SCRIPT : Close Move Order Line and Remove Pending Record

set serveroutput on;
DECLARE
   l_status    VARCHAR2(1);
   l_msg_count NUMBER;
   l_msg_data  VARCHAR2(240);
   l_error_message_list      error_handler.error_tbl_type;

BEGIN
   DBMS_OUTPUT.put_line('Starting');
   fnd_global.APPS_INITIALIZE(
              &UserID,                                   -- User ID: You can use the ame user id that created Move order (MO). Replace with yours from query a)
              &Responsibility,                           -- Responsibility ID: This is my inventory responsibility. Replace with yours from query b)
              401);

   INV_MO_ADMIN_PUB.Close_Line
     (
p_api_version         => 1.0
      , p_line_Id             => &LineID   -- Confirm line id with SQL d)
      , x_msg_count           => l_msg_count
      , x_msg_data            => l_msg_data
      , x_return_status       => l_status
      );

  IF l_status = fnd_api.g_ret_sts_success THEN
     DBMS_OUTPUT.put_line('ok');
  ELSE
      DBMS_OUTPUT.put_line('Error.');

      DBMS_OUTPUT.PUT_LINE('Error Message :'||l_msg_data);

       Error_Handler.Get_Message_List (x_message_list => l_error_message_list);

for i in 1..l_error_message_list.COUNT LOOP
         dbms_output.put_line('Entity Id    : '||l_error_message_list(i).entity_id);
         dbms_output.put_line('Index        : '||l_error_message_list(i).entity_index);
         dbms_output.put_line('Message Type : '||l_error_message_list(i).message_type);
         dbms_output.put_line('Mesg         : '||SUBSTR(l_error_message_list(i).message_text,1,500));
         dbms_output.put_line('-------------------------------------------------------------------');
       end loop;

   END IF;
  -- commit;
  DBMS_OUTPUT.put_line('Finishing');
 
end;
/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值