Oracle EBS INV 删除保留

Oracle EBS INV 删除保留

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

59

60

61

62

63

64

65

66

67

68

69

70

71

DECLARE

p_rsv apps.inv_reservation_global.mtl_reservation_rec_type;

p_dummy_sn apps.inv_reservation_global.serial_number_tbl_type;

l_msg_count NUMBER;

l_msg_data VARCHAR2 (240);

l_status VARCHAR2 (1);

l_index_out NUMBER;

v_reserv_id NUMBER;

l_err_status VARCHAR2(50);

l_err_mesg VARCHAR2 (2000);

-- User Variables: Update for your environment ~~!

L_RESP_APPL_ID NUMBER := 401; --FND_PROFILE.VALUE ('RESP_APPL_ID');

L_RESP_ID NUMBER := 56229; --FND_PROFILE.VALUE ('RESP_ID');

L_USER_ID NUMBER := 1068; --FND_PROFILE.VALUE ('USER_ID');

-- Item/Organization Variables

l_organization_id NUMBER := &YourOrgID;

l_YourItem VARCHAR2(100) := '&YourPartNumber';

-- Find 1 reservation for your item

CURSOR c_reserve IS

SELECT DISTINCT reservation_id

FROM apps.mtl_reservations_all_v

WHERE inventory_item_id in (SELECT inventory_item_id FROM apps.mtl_system_items_b where ORGANIZATION_ID = l_organization_id and segment1 = l_YourItem)

AND organization_id = l_organization_id --p_organization_id;

and rownum < 2;

BEGIN

fnd_global.APPS_INITIALIZE ( user_id => L_USER_ID, resp_id => L_RESP_ID, resp_appl_id => L_RESP_APPL_ID);

FOR R_RESERVE IN C_RESERVE LOOP

dbms_output.PUT_LINE('Reservation ID : '||R_RESERVE.reservation_id);

p_rsv.reservation_id := R_RESERVE.reservation_id;

APPS.inv_reservation_pub.delete_reservation (

p_api_version_number => 1.0,

p_init_msg_lst => fnd_api.g_false,

p_rsv_rec => p_rsv,

p_serial_number => p_dummy_sn,

-- p_validation_flag => fnd_api.g_true,

x_return_status => l_status,

x_msg_count => l_msg_count,

x_msg_data => l_msg_data

);

dbms_output.PUT_LINE('Reservation API : '||l_status);

IF l_status <> 'S' THEN

     FND_MSG_PUB.GET (P_msg_index => l_msg_count,

     P_data => l_msg_data,

     P_encoded => 'F',

     p_msg_index_out => l_index_out);

     L_ERR_STATUS := 'E';

     L_ERR_MESG := 'Delete Allocations API failed ' || RTRIM (l_msg_data);

     dbms_output.PUT_LINE('API failed '||L_ERR_MESG);

ELSE

     L_ERR_STATUS := 'S';

     L_ERR_MESG := NULL;

     dbms_output.PUT_LINE('API success '||L_ERR_MESG);

END IF;

END LOOP;

END;

/

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值