Releasing Order Holds in Multi Org Env. with oe_holds_pub.release_hold

Hi All,
I am fairly new to Oracle Apps. My program needs me to create a custom order hold using oe_holds_pub.apply_holds. This piece is working fine.
Now i need to release the holds using oe_holds_pub.release_hold. I have 2 instances of Oracle, and my code is working on the one that is not multi org. However, it fails - and doesn't provide any error message- on the instance which is multi org.
I have tried setting user and responsibility ids using MO_GLOBAL.initialize_apps, but even this didn't bring about any change.
Any ideas please? I have been struggling with this for weeks... :(
Code:
PROCEDURE manage_line_hold_XXX (p_line_id IN NUMBER,
p_action IN VARCHAR2,
p_status OUT VARCHAR2,
p_msg OUT VARCHAR2) IS
v_hold_id NUMBER;
v_loop_count NUMBER := 0;
v_apply_hold_comment VARCHAR2(32000);
v_order_tbl oe_holds_pvt.order_tbl_type;
v_x_return_status VARCHAR2(2000) := NULL;
v_x_msg_count NUMBER := NULL;
v_x_msg_data VARCHAR2(2000) := NULL;
v_err_mesg VARCHAR2(2000) := NULL;
v_err_num NUMBER := 0;
v_err_cnt NUMBER := 0;
v_err_index NUMBER := 0;
v_out_err_mesg VARCHAR2(32000) := NULL;
v_header_id oe_order_lines_all.header_id%TYPE;
v_org_id oe_order_lines_all.org_id%TYPE;
v_user_id number;
v_responsibility_id number;
v_application_id number;
e_data_error EXCEPTION;
BEGIN
IF p_action NOT IN ('APPLY_LINE_HOLD','RELEASE_LINE_HOLD') THEN
p_msg := 'XXX.manage_line_hold: invalid p_action passed. Must be APPLY_LINE_HOLD or RELEASE_LINE_HOLD';
RAISE e_data_error;
END IF;
BEGIN
--Get hold name from metadata
SELECT hold_id
INTO v_hold_id
FROM oe_hold_definitions
WHERE name = 'HOLD_NAME'
EXCEPTION
WHEN NO_DATA_FOUND THEN
p_msg := 'XXX.manage_line_hold: Hold: ' || 'HOLD_NAME' || ' either not setup in XXX metadata or not found';
RAISE e_data_error;
WHEN OTHERS THEN
p_msg := 'XXX.manage_line_hold: Unknown error occurred finding hold: ' || SQLERRM || ' ' ||DBMS_UTILITY.FORMAT_ERROR_BACKTRACE;
RAISE e_data_error;
END;
BEGIN
--Get header_id,org_id
SELECT header_id, org_id
INTO v_header_id, v_org_id
FROM oe_order_lines_all
WHERE line_id = p_line_id;
EXCEPTION
WHEN NO_DATA_FOUND THEN
p_status := 'ERROR';
p_msg := 'XXX.manage_line_hold: line_id: ' || p_line_id || ' is invalid';
RAISE e_data_error;
WHEN OTHERS THEN
p_status := 'ERROR';
p_msg := 'XXX.manage_line_hold: Unknown error occurred finding header_id: ' || SQLERRM || ' ' ||DBMS_UTILITY.FORMAT_ERROR_BACKTRACE;
RAISE e_data_error;
END;
v_order_tbl(1).header_id := v_header_id;
v_order_tbl(1).line_id := p_line_id;
--get user_id
BEGIN
SELECT user_id
INTO v_user_id
FROM fnd_user
WHERE user_name = 'USER_NAME';
--dbms_output.put_line('user_id;' || g_om_user_id);
EXCEPTION WHEN OTHERS THEN
p_msg := 'Error getting user_id: '|| SQLERRM;
--RAISE e_data_error;
END;
--getting responsibility_id
BEGIN
SELECT responsibility_id
INTO v_responsibility_id
FROM fnd_responsibility_tl
WHERE responsibility_name = 'RESPONSIBILITY_NAME';
--dbms_output.put_line('resp_id;' || g_om_responsibility_id);
EXCEPTION WHEN OTHERS THEN
p_msg := 'Error getting responsibility_id: '|| SQLERRM;
--RAISE e_data_error;
END;
--getting application_id
BEGIN
SELECT application_id
INTO v_application_id
FROM fnd_application_vl
WHERE application_short_name = 'APPLICATION_NAME';
EXCEPTION WHEN OTHERS THEN
p_msg := 'Error getting application_id: '|| SQLERRM;
--RAISE e_data_error;
END;
MO_GLOBAL_INITIALIZE(v_org_id
,v_user_id
,v_responsibility_id
,v_application_id
,p_status
,p_msg);
--dbms_output.put_line('p status: ' || p_status);
IF p_action = 'APPLY_LINE_HOLD' THEN
oe_holds_pub.apply_holds
(p_api_version => 1.0,
p_init_msg_list => FND_API.G_TRUE,
p_commit => FND_API.G_FALSE,
p_validation_level => FND_API.G_VALID_LEVEL_FULL,
p_order_tbl => v_order_tbl,
p_hold_id => v_hold_id,
p_hold_until_date => NULL,
p_hold_comment => 'COMMENT',
p_check_authorization_flag => NULL,
x_return_status => v_x_return_status,
x_msg_count => v_x_msg_count,
x_msg_data => v_x_msg_data);
ELSIF p_action = 'RELEASE_LINE_HOLD' THEN
oe_holds_pub.release_holds
(p_api_version => 1.0,
p_init_msg_list => FND_API.G_TRUE,
p_commit => FND_API.G_FALSE,
p_validation_level => FND_API.G_VALID_LEVEL_FULL,
p_order_tbl => v_order_tbl,
p_hold_id => v_hold_id,
p_release_reason_code => 'REASON',
p_release_comment => 'COMMENT',
p_check_authorization_flag => NULL,
x_return_status => v_x_return_status,
x_msg_count => v_x_msg_count,
x_msg_data => v_x_msg_data);
END IF;
--API Error Handling
IF v_x_return_status <> fnd_api.g_ret_sts_success THEN
v_err_cnt := fnd_msg_pub.count_msg;
IF NVL(v_x_msg_count, 0) > 0 THEN
FOR i IN 1 .. v_x_msg_count LOOP
fnd_msg_pub.get(p_msg_index => i,
p_encoded => fnd_api.g_false,
p_data => v_err_mesg,
p_msg_index_out => v_err_index);
IF v_err_mesg IS NOT NULL THEN
v_out_err_mesg := v_out_err_mesg ||REPLACE(v_err_mesg, CHR(0), ' ') || CHR(10);
END IF;
v_err_num := v_err_num + 1;
END LOOP;
END IF;
p_status := 'ERROR';
p_msg := 'API Error in oe_holds_pub for p_action='||p_action||' v_header_id='||v_header_id||' p_line_id:'||p_line_id||'. API Error Message: '||v_out_err_mesg;
ELSE
p_status := 'SUCCESS';
END IF;
EXCEPTION
WHEN e_data_error THEN
p_status := 'ERROR';
WHEN OTHERS THEN
p_status := 'ERROR';
p_msg := 'Unknown error in XXX.manage_line_hold: line_id, ' || p_line_id ||', with hold_id, ' || v_hold_id || ', on header_id, ' || v_header_id || '. ERROR:' || SQLERRM || ' ' ||DBMS_UTILITY.FORMAT_ERROR_BACKTRACE;
END manage_line_hold_XXX;

Not sure whether works in 11.5.8 version..but can you try this ...
l_action_rec.operation_code = OE_Globals.G_RELEASE_HOLD;
     l_action_request_rec.param1 := 1341;-- l_action_rec.hold_id;
     l_action_request_rec.param2 := 'I'; --nvl(l_action_rec.hold_type_code,'O');
     l_action_request_rec.param3 := 32903577;-- nvl(l_action_rec.hold_type_id,
                         --l_action_request_rec.entity_id);
     l_action_request_rec.param4 :=&your_reason;-- l_action_rec.release_reason_code;
     l_action_request_rec.param5 := -&Your_comments; --l_action_rec.comments;
l_action_request_tbl(1) := l_action_request_rec;
Thanks
Nagamohan

Similar Messages

  • Preventing Item On Hand reservation in a configure to order environment for multi org same OU environment

    I have a scenario in a configure to order environment where I want to automatically creating flow schedules based on sales order demand. I have two orgs in same OU.
    1. How to setup sales order line to generate flow schedules in the manufacturing org and then ship the finished goods from the shipping org. I believe this can be done from sourcing rules to populate Warehouse field in sales order line with the shipping org and create Flow schedule in another manufacturing org. Please advise ?
    2. Once flow schedule is completed I want to prevent the reservation of Finished good on hand against Sales order so that the On hand could be transferred to shipping org and shipped. Please advise ?
    Thanks for your inputs.
    Best,
    Rajesh

    Pl do not post duplicates - Preventing Item On Hand reservation in a configure to order environment for multi org same OU environment

  • Contract release orders only allowed for sche.agreements with dep.condition

    hi frnds,
    i got this error msg while i try to create a scheduling agreement with ref. to contracts
    help me out...
    thanks in advance....

    Hi
    Check whether you have used contract or Contract release order.
    Also check the allowed document types for the scheduling agreement.
    Thanks/Karthik

  • Best practice multi-org, MW, SOA, Siebel authen with static or dynamic url

    All,
    My client integration lead had a question about the current best practices for multi-org structures with MW, SOA and Siebel. Internally the client contact is being pressured to get dynamic urls for authentication (for each area and new addition…currently exposed web services include Acct, Payment, Contact, etc… currently 60-70 services). However, he would like to stay with his current process for web service integration and just add pos id, user id, org id, etc. in the message string that is passed.
    Please let me know what you think and why so I can pass this information along.

    Hi even we too struck up with the same kind of issue.Please let me know if you got any solution for this.Your help is highly Appreciated.
    Thanks,
    Ravi Kasu.
    [email protected]

  • Order Entry -Price Lists - Multi-Org Installation - Security

    Oracle Order Entry Technical Forum
    Hi,
    Ours is a multi_org installation in ver 11.0.3. We have 7 organizations. Each organizations has its own Price lists. Each organisation does not want other organizations to view their price lists. As any responsibility who has access to price lists can view all the price lists on the system Can somebody guide me how to achieve the above?
    null

    Oracle Order Entry is Multi-Org enabled. Can't you define responsibilities for each operating unit, and then link each responsibility to an operating unit using the profile option MO: Operating Unit (I believe this is the correct profile option. If not, there is one that you can use to perform this funtion.)
    Once you do this, I believe that you can then effectively define a price list for each operating unit. Also, users will only be able to view and/or modify their own price lists.
    Please let me know what the real solution is if this doesn't help.
    Regards,
    Roger

  • Create PO(release order) from contract

    Hi,
       I have created a contract using me31k with one item,then I creted a relese order PO with same item.when I enter another item in my relase order PO which is not there in the my contract,here system allow me  to add item  and save without any problem.Why system does not stop this? If it is standard behaviour,then how to prevent ?.
    For this issue,can some body throw some light on this issue,please?
    With Regards,
    Jaheer

    Hi,
       The release order means the PO item created with reference to the contract item. There can be multiple items in the PO in which some items can be with reference to contract - these items eventually becomes the release orders and other items can be without reference to contract.
       In short, you can add multiple items in PO where some items can be with reference to contract item and some are not. This is standard behavior.
    Regards,
    AKPT

  • ESYU: R12 - Order Management를 위한 Multi Org Access Control(MOAC) setup 방법

    Purpose
    Oracle Order Management - Version: 12.0 to 12.0
    Information in this document applies to any platform.
    R12의 Order Management에 대핸 Multi Org Access Control(MOAC) setup 방법에 대해 알아본다.
    Solution
    일반적인 MOAC Setup:
    1. HRMS에서 Security Profile을 정의:
    a. HRMS Management responsibility 선택
    b. HRMS Manager> Security> Profile로 이동
    c. Security Profile이 정의되어 있는지 확인 (OM responsibility 혹은 Site level로)
    d. 만일 아직 setup 되어져 있지 않다면 Operating Units를 입력
    e. 저장
    Note: 만일 위 d step과 같이 새로운 security profile을 생성하였다면 concurrent program 'Security List Maintenance'를 꼭 실행해야 한다.
    그렇지 않으면 multiple operating units가 OM forms의 LOV에 나타나지 않을 것이다.
    이 program은 multi-org access를 validating 하기 위해 사용하는 table에 data를 생성한다.
    Navigation: HRMS Management> HRMS Manager> Processes & Reports> Submit Process & Report> Security List Maintenance
    2. MO Profile Options setup:
    a. MO: Security Profile - 이 profile setting은 MOAC functionality를 활성화 한다.
    b. MO: Default Operating Unit - 이 Operating Unit는 OM forms과 report에서 default가 될 것이며, 이를 clear 하거나 변경하기 위해 LOV를 사용할 수 있다.
    Keep the MO profiles in sync:
    MO: Security Profile은 site와 responsibility level로 setting 할 수 있다.
    MO: Default Operating Unit은 site, responsibility, user level로 setting 할 수 있다.
    Application이 원하는대로 동작되지 않는것을 발견하면 이 profile options의 setting 값을 확인한다.
    3. OM setup:
    R12 upgrade 시 OM Profile에서 migrate 된 새로운 OM System Parameters를 확인:
    Order Management Super User> Setup> System Parameters> Values
    (See <<NOTE 393646.1>>-R12 Readiness Cheat Sheet: Migrated OM Profile Options)
    4. Form에서 hidden field 'Operatin Unit'를 활성화시키고 default folder로 저장:
    Sales Order and Order Organizer forms
    Quick Sales order and Organizer forms
    Sales Agreement forms
    Pricing and Availability form
    Other forms
    Note: Sales Order form에서 hidden field 'Operating Unit'를 'Show' 하기 전에 fotm안에 이 field를 위한 공간을 만들어 놓아야 한다.
    예를 들면 Customer Number field를 짧게 하거나 Operating Unit field로 이 field를 덮어씌울수 있다.
    Reference
    Note 393634.1

    Hi Larry,
    Have you considered adding the exec apps.mo_global.set_policy_context call to your connection's start-up script?
    Tools -> Preferences -> Database -> Filename for connection startup scriptNot the most flexible approach, so I'm not sure if it is appropriate for your application, but just a thought. You might create distinct connection names with different start-up scripts for each org_id.
    Regards,
    Gary
    SQL Developer Team

  • Multi Org in Release 12

    As like in 11i, do we need to run multi org in Release 12.
    If no needed, if it comes with default in release 12, what MO:operating unit will it take.

    Multi-org conversion is not needed in R12.
    Default operating unit defined by
    MO:Default Operating unit is used to define operating unit at responsibility/user level.
    For complete details on R12 Multi org ,refer to metalink id: 420787.1 --Oracle Applications Multiple Organizations Access Control for Custom Code
    Regards,
    alit
    www.alsuminfotech.com

  • Releasing Credit Hold in Order Management

    Hi,
    Is there a report that can tell me who has the authority to release credit hold on an order? If there is no such report, where in Order Management / Receivables can you check this?
    We are on 11.5.9.
    Thanks in advance
    A/A

    Thanks for your response. Actually, I dont need the report. I just wanted to see who in our system can release an order if it is placed on hold. I do see a 'Credit Check Failure'
    hold defined in the system with Authorization Action as "Apply Hold' and no responsibility assigned. I dont see anything regarding releasing a hold. The problem is that in our system anyone can release credit check hold on any order. I wanted to see if I could restrict it to a user or a responsibility.

  • Creation of Release order with reference to Contract

    Dear experts,
    We are doing upgradation from 4.6B to ECC6. During testing ,while creating release order with reference to contract,(Contract was created with Account assignment category-K and item category-D),cost center is copied from contract in purchase order in account assignment tab of item details,
    but when i save it window is poping up(account assignment service line item 10-small window) asking to enter cost center again. Even if i enter the same cost center in that window,cost center field,again it is asking same window is poping up for entering cost center.
    Can any body please tell me inspite of cost center is copied,why this window is coming ,please suggest.This problem is not there in 4.6B version
    Advance thanks,
    Regards,
    Dayanand

    Please check to OXK1, and compare it to both system.Or check the config guide in IMGMM-Purchasingacc.assigment--Set subscreen for acc assingment (coding) block.

  • Release order with reference to Contract.

    Hello all
    Client is using the quantity contract & against that Release order are created ,after changing the contract price, new release order will pick up new price from contract,
    Now the requirement is Old release order(GRN & INVOICE NOT DONE) price should get change as per new contract price. how this will be achieve ( Configuration or z Development)
    Kindly suggest (SAP version is 4.7)
    Also what is Automatic Document adjustment  & how it works?  whether above scenario is possible with automatic document adjustment.
    Thanks & Regards
    Rajesh

    Hi
    Price always come from Purchasing inforecord to the contract release order not from the contract.
    If the contract price is updated thru info update indicator in contract then you will get the latest price from inforecord to contract release order.
    For your old release order if you want to adopt the latest price based on the date then change the price date category as 5-GR date in Purchasing inforecord as well as Contract. If the field is open in PO then you change there also.
    Now if you do the GR the price will be picked based on the GR date from the Purchasing inforecrd condition
    Hope it helps
    Thanks/Karthik

  • ECC Report showing Outline Agreements WITH related Release Orders

    Does anyone know of a report in ECC which will display all Outline Agreements together with all the Related Release Orders associated with each Agreement Number?
    I have trawled through hundreds of SAP transaction codes and cannot find something that will give this information - I can use ME3N of course, but ideally my Users want to be able to search on ALL Outline Agreements and see the associated release orders
    If anyone is able to help it would save me a headache!
    Many thanks
    Jane

    You can get Goods Movement from MSEG Tables. Why do you need Goods Movement in Sales Flow?
    While Creating Every Document in SAP R/3, we will put reference Document and Item.
    While Creating Sales Document, Customer PO is reference Document.
    For Delivery, we can create againest Sales Document or Invoice etc.
    For Invoice, either Delivery or Sales Document.
    Pull all the Data Sales, Delivery, Billing and Shipping with Reference Documents into ODS.
    You need to create a Infoset on these ODS.
    Let me know if you still have any Questions.
    Nagesh Ganisetti.
    Assign points if it helps.

  • Release Order with ref to Contract

    Dears,
    Where we can find the release order No. which were created with reference to contrac.? 
    Thanks,

    Dear,
    Try these whether fulfill your requirements or not. Check ME3M, ME3L, ME3N.
    Consider the selection parameters, scope of list and dynamic selections availabel at header and item level. Try with these.
    By selecting line and pressing F7 shows the particular line release documentation details.
    Regards,
    Syed Hussain.

  • Authorized Partners for Release Orders with customer hierarchy

    Hello everyone,
          I have created a value contract with order type WK1, in the order type WK1 configuration, choose rule B  for check partner auth. field, namely we want to use
    customer hierarchy to detemine the sold-to-party for the follow-up release order. Also I have created the customer hierarchy with hierarchy type A. There are
    four levels under this hierarchy, it contains four customer nodes and four customers. Every customer is belong to a customer node. The partner determination
    for the customer hierarchy have alredy done, I can see the customer hierarchy "1D" at the partner tab of header in the contract, but when I release the sales
    order against  the contract, input a low-level customer number, still got the message "partner X is not authorized to release from contracts.".
         I want to know if I missed some settings in order type configuration or the copy control from WK1 to OR. If this scenario need integrate with  CRM system?  I
    have found some related information, just list below:
        Partners in the hierarchy (Rule B)
    If the partner who wants to release against the contract is the sold-to party of the contract or at a lower level in customer hierarchy to the sold-to party in the contract, the system accepts the partner as the sold-to party for the release order.
    If rule B is defined for the contract type, you can search for authorized partners for a release order using the contract number. Equally, you can search for the relevant contract for a release order using the partner number. In this case, the partner authorization rule is irrelevant.
    Prerequisites
    If you wish to use group hierarchies other than pricing hierarchies to determine authorized partners, you must have created a hierarchy category and a hierarchy:
    To create the hierarchy category, go to Customizing for CRM under Master Data --> Business Partner-->  Business Partner Group Hierarchy. 
    To create the group hierarchy, go to the SAP Easy Access Menu and choose Master Data --> Business Partners --> Maintain Group Hierarchy.
    Note that you can only create group hierarchies in the SAP GUI and not in the People-Centric user interface.
    You must have activated the necessary settings for the sales contract and the release order in the IMG for CRM. For more information, see Transactions ---> Settings for Contracts -->Define Settings for Authorized Partners.
      Thanks!

    Hi,
    In transcation VTAA at item level have your own cory requirment code which will calcullate net value of the doc, hope this works out
    regards
    sriky

  • Customer Master with Multi-Org

    We are implementing 11i with multi-org. We have been trying to determine at what level the customer master (and others such as item master) files reside within the multi-org levels. Specifically, does the customer master lie in the set of books level, or at the operating unit level, or the legal entity level, or some other level?
    null

    Hi Jay,
    Your last sentence is very interesting, have you customized to secure Customer Header by OU ?
    Was it a heavy customisation ? Did it impact many forms ?
    Because this would have to be effective in all screens bringing customer info (Telesales, Teleservice, Sales Online, AR, OM, ...).
    Thank you for your help,
    Christelle
    Hi Robert.
    We run 57 SOBs and OUs. Customer Header is above SOB and OU level. It is shared bu all OUs and SOBs.
    Customer Address and entities below (site use etc) are OU level.
    FYI it is possible to customize to secure Customer Header by OU (org_id).
    Cheers.

Maybe you are looking for