Home » Applications » Oracle Fusion Apps & E-Business Suite » insert line in sales order by api
insert line in sales order by api [message #569231] Tue, 23 October 2012 05:09 Go to next message
hany_marawan
Messages: 183
Registered: April 2005
Location: Cairo - Egypt
Senior Member
Hello,
I want to insert line to an existing sales order, is there any api for this?

Regards
Re: insert line in sales order by api [message #569282 is a reply to message #569231] Wed, 24 October 2012 03:16 Go to previous messageGo to next message
hany_marawan
Messages: 183
Registered: April 2005
Location: Cairo - Egypt
Senior Member
no answer until now
Re: insert line in sales order by api [message #569328 is a reply to message #569282] Wed, 24 October 2012 15:14 Go to previous messageGo to next message
Littlefoot
Messages: 19901
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
It seems that nobody (who saw your question) knows the answer. You need to realize that not many forum members are capable of answering Oracle Apps. & EBS questions so ... either be patient or, if you are in a hurry, ask for help elsewhere (for example, OTN forums).
Re: insert line in sales order by api [message #569628 is a reply to message #569231] Tue, 30 October 2012 07:50 Go to previous messageGo to next message
hany_marawan
Messages: 183
Registered: April 2005
Location: Cairo - Egypt
Senior Member
Hello,
I found the API and tried it, it's working very good.
for every one wants it, there's the code.
PROCEDURE ins_so_line

   IS

    l_api_version_number  NUMBER := 1;
    l_return_status       VARCHAR2(2000);
    l_msg_count           NUMBER;
    l_msg_data            VARCHAR2(2000);
    l_line_in_tbl         oe_order_pub.line_tbl_type;
    l_line_out_tbl        oe_order_pub.line_tbl_type;
    index_dtl             number:=1;

BEGIN

    mo_global.init('ONT');
    MO_GLOBAL.SET_POLICY_CONTEXT('S', 81);
    fnd_global.apps_initialize( 1112
                               ,50647
                               ,660);

    l_line_in_tbl(index_dtl) := OE_ORDER_PUB.G_MISS_LINE_REC;
    l_line_in_tbl(index_dtl).operation := OE_GLOBALS.G_OPR_CREATE;

    l_line_in_tbl(index_dtl).header_id:=48936;
    l_line_in_tbl(index_dtl).inventory_item_id := 3028;
    l_line_in_tbl(index_dtl).line_type_id := 1044;
    l_line_in_tbl(index_dtl).ordered_quantity := 1;
    --l_line_in_tbl(index_dtl).ship_from_org_id := 162;
    --l_line_in_tbl(index_dtl).tax_code := '0%';--'STANDARD RATE' ;

    OE_Order_PUB.Process_Line ( p_line_tbl        => l_line_in_tbl
                               ,p_org_id          => 81
                               ,p_operating_unit  => 'Al-Bardi_OU'
                               ,x_line_out_tbl    => l_line_out_tbl
                               ,x_return_status   => l_return_status
                               ,x_msg_count       => l_msg_count
                               ,x_msg_data        => l_msg_data
                              );

    commit;

    dbms_output.put_line('l_return_status: '||l_return_status);

    IF l_return_status IN ('E', 'U') THEN
        DBMS_OUTPUT.PUT_LINE('# of Errors '||l_msg_count);
        IF l_msg_count = 1 THEN
            DBMS_OUTPUT.PUT_LINE('Error '||l_msg_data);
        ELSE
            FOR i IN 1..l_msg_count LOOP
                DBMS_OUTPUT.PUT_LINE('Error '||FND_MSG_PUB.GET(i, 'F'));
            END LOOP;
        END IF;
    END IF;

END; -- Procedure


[EDITED by LF: applied [code] tags]

[Updated on: Tue, 30 October 2012 13:03] by Moderator

Report message to a moderator

Re: insert line in sales order by api [message #569654 is a reply to message #569628] Tue, 30 October 2012 13:02 Go to previous message
Littlefoot
Messages: 19901
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
I'm glad you found the answer and decided to share it with the rest of the community.

Please, be so kind and click here: it will not take more than several seconds of your time, but will significantly improve your future messages that contain program code.
Previous Topic: Implementing sourcing rules for copied requisitions in iProcurement
Next Topic: to find the profile option
Goto Forum:
  


Current Time: Fri Dec 26 20:25:55 CST 2014

Total time taken to generate the page: 0.07994 seconds