• Order Management APIs


    1.1.1. Create Order API

    Creating a new order with 2 lines and 1 line adjustment and the adjustment belongs to the second line.
    Declare
    l_header_rec := OE_ORDER_PUB.G_MISS_HEADER_REC; -- Required attributes (e.g. Order Type and Customer)
    l_header_rec.order_type_id := 1000;
    l_header_rec.sold_to_org_id := 100;
    l_header_rec.price_list_id := 10;
    l_header_rec.freight_term_code = NULL;
    l_header_rec.operation := OE_GLOBALS.G_OPR_CREATE;
    -- FIRST LINE RECORD. Initialize record to missing
    l_line_tbl(1) := OE_ORDER_PUB.G_MISS_LINE_REC;
    l_line_tbl(1).inventory_item_id := 311;
    l_line_tbl(1).ordered_quantity := 1;
    l_line_tbl(1).operation := OE_GLOBALS.G_OPR_CREATE;
    -- SECOND LINE RECORD
    l_line_tbl(2) := OE_ORDER_PUB.G_MISS_LINE_REC;
    l_line_tbl(2)inventory_item_id := 312;
    l_line_tbl(2).ordered_quantity := 2;
    l_line_tbl(2).operation := OE_GLOBALS.G_OPR_CREATE;
    -- LINE ADJUSTMENT RECORD
    l_line_adj_tbl(1) := OE_ORDER_PUB.G_MISS_LINE_ADJ_REC;
    l_line_adj_tbl(1).discount_id := 1;
    l_line_adj_tbl(1).percent := 5;
    l_line_adj_tbl(1).operation := OE_GLOBALS.G_OPR_CREATE;
    -- Indicator that this adjustment belongs to the second line
    l_line_adj_tbl(1).line_index := 2;

    -- CALL TO PROCESS ORDER
    OE_Order_PUB.Process_Order(
    p_header_rec => l_header_rec
    p_line_tbl=> l_line_tbl
    p_line_adj_tbl=> l_line_adj_tbl
    -- OUT variables
    x_header_rec=> l_header_rec
    x_header_scredit_tbl=> l_header_scr_tbl
    x_header_adj_tbl=> l_header_adj_tbl
    x_line_tbl=> l_line_tbl
    x_line_scredit_tbl=> l_line_scredit_tbl
    x_line_adj_tbl=> l_line_adj_tbl
    ................
    x_return_status=> l_return_status
    x_msg_count=> l_msg_count
    x_msg_data=> l_msg_data);
    if l_msg_count > 0 then
    for l_index in 1..l_msg_count loop
    l_msg_data := oe_msg_pub.get(p_msg_index => l_index, p_encoded => ‘F’);
    end loop;
    end if;
    -- Check the return status
    if x_return_status = FND_API.G_RET_STS_SUCCESS then success;
    Else failure;
    end if;
    End;

    1.1.2. Create New Line

    Inserting a new line into an existing order.
    -- NEW LINE RECORD
    l_line_tbl(1) := OE_ORDER_PUB.G_MISS_LINE_REC;
    l_line_tbl(1).header_id := 1000;
    l_line_tbl(1).inventory_item_id := 311;
    l_line_tbl(1).ordered_quantity := 1;
    l_line_tbl(1).operation := OE_GLOBALS.G_OPR_CREATE;

    OE_ORDER_PUB.Process_Order(........
    p_line_tbl=> l_line_tbl
    ......);

    1.1.3. Update an existing Line 

    Updating the bill to organization and order quantity on an order line.
    -- LINE RECORD WITH THE CHANGES
    l_line_tbl(1) := OE_ORDER_PUB.G_MISS_LINE_REC.
    l_line_tbl(1).invoice_to_org_id := 322;
    l_line_tbl(1).ordered_quantity := 2;
    l_line_tbl(1).line_id := 1000;
    l_line_tbl(1).operation := OE_GLOBALS.G_OPR_UPDATE;

    OE_ORDER_PUB.Process_Order(........
    p_line_tbl=> l_line_tbl
    ........);

    1.1.4. Delete an Order

    Deleting an order.
    l_header_rec := OE_ORDER_PUB.G_MISS_HEADER_REC;
    l_header_rec.header_id:=1000;
    l_header_rec.operation := OE_GLOBALS.G_OPR_DELETE;

    OE_ORDER_PUB.Process_Order(
    p_header_rec=> l_header_rec
    ........);

    1.1.5. Apply Line Hold API

    Apply a hold to an order line due to a defective item.
    -- ACTION REQUEST RECORD
    l_request_rec.entity := OE_GLOBALS.G_ENTITY_LINE;  
    -- Indicates that it is a line level action
    l_request_rec.entity_id := 100; -- Line Id
    l_request_rec.request_name := OE_GLOBALS.G_APPLY_HOLD;
    l_request_rec.param1 := 4; --Hold ID to identify the type of hold applied. (HOLD_ID from OE_HOLD_DEFINITIONS)
    l_request_rec.param2 = ‘I’;  
    -- indicator that it is an item hold 
    l_request_rec.param3 := 3214;  -- Inv_item_Id of the item since it is an Item hold
    l_action_request_tbl := l_request_rec;

    Apply Hold action record fields and their valid values.
    request_type
    entity_code
    entity_id
    param1
    param2





    param3



    param4 
    date_param1 
    parm6-param20
    OE_GLOBALS.G_APPLY_HOLD
    OE_GLOBALS.G_ENTITY_ORDER for order or OE_
    ID of the order or line to be held
    Hold ID to identify the type of hold that should be applied. (HOLD_ID from OE_HOLD_DEFINITIONS)
    Hold entity code for the hold source to be createdviz:
    C: Customer hold source
    S: Bill To or Ship To hold source
    I: Item hold source
    O: Order hold source
    W: Warehouse Hold Source
    Hold entity ID viz:
    C, B, or S: for Org ID
    O: Header ID
    I: Inventory Item ID
    Hold comment
    Hold Until Date
    Attribute1-15 of the descriptive flexfield associated
    with the hold source record.

    1.1.6. Other APIs

    Other OM APIs available are Release Hold, Book Order and for ATO models Delink Config and Match & Reserve APIs are available.

             

                成长

           /      |     \

        学习   总结   分享

    QQ交流群:122230156

  • 相关阅读:
    tailf、tail -f、tail -F三者区别(转)
    Jackson是线程安全的吗
    SecureCRT同时向多个终端发送命令
    SecureCRT设置和Xshell一样的快速命令集(使用快捷键输入命令和密码)
    SecureCRT配色方案
    Java中判断字符串是否为数字的方法
    MySQL错误:Error Code: 1175. You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column To disable safe mode, toggle the option in Preferences -> SQL easonjim
    SecureCRT导出服务器列表或配置文件
    java.lang.NoSuchMethodException: tk.mybatis.mapper.provider.SpecialProvider.<init>()
    Badge
  • 原文地址:https://www.cnblogs.com/benio/p/1926016.html
Copyright © 2020-2023  润新知