Error while trying to create sales order using oe_order_pub.process_order

Hi All,
I am trying to create a sales order using oe_order_pub.process_order api..
The Procedure i had written is as follows.
CREATE OR REPLACE PROCEDURE TEST_PROC
AS
x_return_status VARCHAR2(250);
x_msg_count NUMBER;
x_msg_data VARCHAR2(250);
F varchar2(2000);
--out parameters
x_header_rec OE_Order_PUB.Header_Rec_Type;
x_header_val_rec OE_Order_PUB.Header_Val_Rec_Type;
x_Header_Adj_tbl OE_Order_PUB.Header_Adj_Tbl_Type;
x_Header_Adj_val_tbl OE_Order_PUB.Header_Adj_Val_Tbl_Type;
x_Header_price_Att_tbl OE_Order_PUB.Header_Price_Att_Tbl_Type;
x_Header_Adj_Att_tbl OE_Order_PUB.Header_Adj_Att_Tbl_Type;
x_Header_Adj_Assoc_tbl OE_Order_PUB.Header_Adj_Assoc_Tbl_Type;
x_Header_Scredit_tbl OE_Order_PUB.Header_Scredit_Tbl_Type;
x_Header_Scredit_val_tbl OE_Order_PUB.Header_Scredit_Val_Tbl_Type;
x_line_tbl OE_Order_PUB.Line_Tbl_Type;
x_line_val_tbl OE_Order_PUB.Line_Val_Tbl_Type;
x_Line_Adj_tbl OE_Order_PUB.Line_Adj_Tbl_Type;
x_Line_Adj_val_tbl OE_Order_PUB.Line_Adj_Val_Tbl_Type;
x_Line_price_Att_tbl OE_Order_PUB.Line_Price_Att_Tbl_Type;
x_Line_Adj_Att_tbl OE_Order_PUB.Line_Adj_Att_Tbl_Type;
x_Line_Adj_Assoc_tbl OE_Order_PUB.Line_Adj_Assoc_Tbl_Type;
x_Line_Scredit_tbl OE_Order_PUB.Line_Scredit_Tbl_Type;
x_Line_Scredit_val_tbl OE_Order_PUB.Line_Scredit_Val_Tbl_Type;
x_Lot_Serial_tbl OE_Order_PUB.Lot_Serial_Tbl_Type;
x_Lot_Serial_val_tbl OE_Order_PUB.Lot_Serial_Val_Tbl_Type;
x_action_request_tbl OE_Order_PUB.Request_Tbl_Type;
--in parameters
l_header_rec OE_Order_PUB.Header_Rec_Type;
t_line_tbl OE_ORDER_PUB.Line_Tbl_Type;
BEGIN
apps.mo_global.set_org_context(204,null,'ONT');
l_header_rec := OE_ORDER_PUB.G_MISS_HEADER_REC;
l_header_rec.ORG_ID := 204;
l_header_rec.ORDER_TYPE_ID := 1437;
l_header_rec.SOLD_TO_ORG_ID := 1290;
l_header_rec.SHIP_TO_ORG_ID:=1425;
l_header_rec.INVOICE_TO_ORG_ID:=1424;
l_header_rec.PRICE_LIST_ID := 1000;
l_header_rec.salesrep_id := 1006;
l_header_rec.ORDER_CATEGORY_CODE := 'MIXED';
l_header_rec.VERSION_NUMBER := 0;
l_header_rec.OPEN_FLAG := 'Y';
l_header_rec.BOOKED_FLAG := 'Y';
l_header_rec.PRICING_DATE := sysdate;
l_header_rec.TRANSACTIONAL_CURR_CODE := 'USD';
l_header_rec.created_by := FND_GLOBAL.USER_ID;
l_header_rec.creation_date := sysdate;
l_header_rec.LAST_UPDATED_BY := FND_GLOBAL.USER_ID;
l_header_rec.LAST_UPDATE_DATE := sysdate;
l_header_rec.attribute1 := '250';
l_header_rec.operation := 'CREATE';
t_line_tbl(1) := OE_ORDER_PUB.G_MISS_LINE_REC; ---check
t_line_tbl(1).inventory_item_id := 193742;
t_line_tbl(1).ordered_quantity := 1;
t_line_tbl(1).operation := 'CREATE';
oe_debug_pub.initialize;
--oe_debug_pub.SetDebugLevel(1);
OE_MSG_PUB.INITIALIZE();
OE_Order_PUB.Process_Order
( -- p_org_id => 204,
--p_operating_unit => 'ONT',
p_api_version_number => 1.0,
p_init_msg_list => FND_API.G_TRUE,
p_return_values => FND_API.G_TRUE,
p_action_commit => FND_API.G_TRUE,
x_return_status => x_return_status,
x_msg_count => x_msg_count,
x_msg_data => x_msg_data,
p_header_rec => l_header_rec,
p_old_header_rec => OE_Order_PUB.G_MISS_HEADER_REC,
p_header_val_rec => OE_Order_PUB.G_MISS_HEADER_VAL_REC,
p_old_header_val_rec => OE_Order_PUB.G_MISS_HEADER_VAL_REC,
p_Header_Adj_tbl => OE_Order_PUB.G_MISS_HEADER_ADJ_TBL,
p_old_Header_Adj_tbl => OE_Order_PUB.G_MISS_HEADER_ADJ_TBL,
p_Header_Adj_val_tbl => OE_Order_PUB.G_MISS_HEADER_ADJ_VAL_TBL,
p_old_Header_Adj_val_tbl => OE_Order_PUB.G_MISS_HEADER_ADJ_VAL_TBL,
p_Header_price_Att_tbl => OE_Order_PUB.G_MISS_HEADER_PRICE_ATT_TBL,
p_old_Header_Price_Att_tbl => OE_Order_PUB.G_MISS_HEADER_PRICE_ATT_TBL,
p_Header_Adj_Att_tbl => OE_Order_PUB.G_MISS_HEADER_ADJ_ATT_TBL,
p_old_Header_Adj_Att_tbl => OE_Order_PUB.G_MISS_HEADER_ADJ_ATT_TBL,
p_Header_Adj_Assoc_tbl => OE_Order_PUB.G_MISS_HEADER_ADJ_ASSOC_TBL,
p_old_Header_Adj_Assoc_tbl => OE_Order_PUB.G_MISS_HEADER_ADJ_ASSOC_TBL,
p_Header_Scredit_tbl => OE_Order_PUB.G_MISS_HEADER_SCREDIT_TBL,
p_old_Header_Scredit_tbl => OE_Order_PUB.G_MISS_HEADER_SCREDIT_TBL,
p_Header_Scredit_val_tbl => OE_Order_PUB.G_MISS_HEADER_SCREDIT_VAL_TBL,
p_old_Header_Scredit_val_tbl => OE_Order_PUB.G_MISS_HEADER_SCREDIT_VAL_TBL,
p_line_tbl => t_line_tbl,
p_old_line_tbl => OE_Order_PUB.G_MISS_LINE_TBL,
p_line_val_tbl => OE_Order_PUB.G_MISS_LINE_VAL_TBL,
p_old_line_val_tbl => OE_Order_PUB.G_MISS_LINE_VAL_TBL,
p_Line_Adj_tbl => OE_Order_PUB.G_MISS_LINE_ADJ_TBL,
p_old_Line_Adj_tbl => OE_Order_PUB.G_MISS_LINE_ADJ_TBL,
p_Line_Adj_val_tbl => OE_Order_PUB.G_MISS_LINE_ADJ_VAL_TBL,
p_old_Line_Adj_val_tbl => OE_Order_PUB.G_MISS_LINE_ADJ_VAL_TBL,
p_Line_price_Att_tbl => OE_Order_PUB.G_MISS_LINE_PRICE_ATT_TBL,
p_old_Line_Price_Att_tbl => OE_Order_PUB.G_MISS_LINE_PRICE_ATT_TBL,
p_Line_Adj_Att_tbl => OE_Order_PUB.G_MISS_LINE_ADJ_ATT_TBL,
p_old_Line_Adj_Att_tbl => OE_Order_PUB.G_MISS_LINE_ADJ_ATT_TBL,
p_Line_Adj_Assoc_tbl => OE_Order_PUB.G_MISS_LINE_ADJ_ASSOC_TBL,
p_old_Line_Adj_Assoc_tbl => OE_Order_PUB.G_MISS_LINE_ADJ_ASSOC_TBL,
p_Line_Scredit_tbl => OE_Order_PUB.G_MISS_LINE_SCREDIT_TBL,
p_old_Line_Scredit_tbl => OE_Order_PUB.G_MISS_LINE_SCREDIT_TBL,
p_Line_Scredit_val_tbl => OE_Order_PUB.G_MISS_LINE_SCREDIT_VAL_TBL,
p_old_Line_Scredit_val_tbl => OE_Order_PUB.G_MISS_LINE_SCREDIT_VAL_TBL,
p_Lot_Serial_tbl => OE_Order_PUB.G_MISS_LOT_SERIAL_TBL,
p_old_Lot_Serial_tbl => OE_Order_PUB.G_MISS_LOT_SERIAL_TBL,
p_Lot_Serial_val_tbl => OE_Order_PUB.G_MISS_LOT_SERIAL_VAL_TBL,
p_old_Lot_Serial_val_tbl => OE_Order_PUB.G_MISS_LOT_SERIAL_VAL_TBL,
p_action_request_tbl => OE_Order_PUB.G_MISS_REQUEST_TBL,
x_header_rec => x_header_rec,
x_header_val_rec => x_header_val_rec,
x_Header_Adj_tbl => x_Header_Adj_tbl,
x_Header_Adj_val_tbl => x_Header_Adj_val_tbl,
x_Header_price_Att_tbl => x_Header_price_Att_tbl,
x_Header_Adj_Att_tbl => x_Header_Adj_Att_tbl,
x_Header_Adj_Assoc_tbl => x_Header_Adj_Assoc_tbl,
x_Header_Scredit_tbl => x_Header_Scredit_tbl,
x_Header_Scredit_val_tbl => x_Header_Scredit_val_tbl,
x_line_tbl => x_line_tbl,
x_line_val_tbl => x_line_val_tbl,
x_Line_Adj_tbl => x_Line_Adj_tbl,
x_Line_Adj_val_tbl => x_Line_Adj_val_tbl,
x_Line_price_Att_tbl => x_Line_price_Att_tbl,
x_Line_Adj_Att_tbl => x_Line_Adj_Att_tbl,
x_Line_Adj_Assoc_tbl => x_Line_Adj_Assoc_tbl,
x_Line_Scredit_tbl => x_Line_Scredit_tbl,
x_Line_Scredit_val_tbl => x_Line_Scredit_val_tbl,
x_Lot_Serial_tbl => x_Lot_Serial_tbl,
x_Lot_Serial_val_tbl => x_Lot_Serial_val_tbl,
x_action_request_tbl => x_action_request_tbl,
--For bug 3390458
p_rtrim_data => 'N',
p_validate_desc_flex => 'Y' -- bug4343612
COMMIT;
if x_msg_count > 0 then
for l_index in 1..x_msg_count loop
x_msg_data := oe_msg_pub.get(p_msg_index => l_index, p_encoded => F);
PRINT('x_msg_data: '||x_msg_data);
end loop;
end if;
-- Check the return status
if x_return_status = FND_API.G_RET_STS_SUCCESS then
PRINT('success');
else
PRINT('failure');
end if;
PRINT('x_return_status: '||x_return_status);
PRINT('x_msg_count: '||x_msg_count);
PRINT('x_msg_data: '||x_msg_data);
PRINT('x_header_val_rec: '||x_header_val_rec.accounting_rule);
PRINT('x_header_rec header_id: ' ||x_header_rec.header_id);
PRINT('x_header_rec order_number: ' ||x_header_rec.order_number);
PRINT('x_header_rec ship_to_org_id: ' ||x_header_rec.ship_to_org_id);
PRINT('x_header_rec payment_term_id: ' ||x_header_rec.payment_term_id);
PRINT('x_header_rec order_source_id: ' ||x_header_rec.order_source_id);
PRINT('x_header_rec order_type_id: ' ||x_header_rec.order_type_id);
PRINT('x_header_rec price_list_id: ' ||x_header_rec.price_list_id);
PRINT('x_header_rec invoicing_rule_id: ' ||x_header_rec.invoicing_rule_id);
PRINT('x_header_rec accounting_rule_id: ' ||x_header_rec.accounting_rule_id);
PRINT('x_header_rec org_id: ' ||x_header_rec.org_id);
PRINT('x_header_rec sold_to_org_id: ' ||x_header_rec.sold_to_org_id);
PRINT('x_header_rec invoice_to_org_id: ' ||x_header_rec.invoice_to_org_id);
PRINT('x_header_rec salesrep_id: ' ||x_header_rec.salesrep_id);
PRINT('x_header_rec invoice_to_org_id: ' ||x_header_rec.invoice_to_org_id);
PRINT('x_header_rec operation: ' ||x_header_rec.operation);
PRINT('x_header_rec transactional_curr_code: ' ||x_header_rec.transactional_curr_code);
PRINT('x_header_rec orig_sys_document_ref: ' ||x_header_rec.orig_sys_document_ref);
PRINT('x_header_rec request_date: ' ||x_header_rec.request_date);
PRINT('x_header_rec conversion_rate_date: ' ||x_header_rec.conversion_rate_date);
PRINT('x_header_rec last_update_date: ' ||x_header_rec.last_update_date);
PRINT('x_header_rec ordered_date: ' ||x_header_rec.ordered_date);
PRINT('x_header_rec creation_date: ' ||x_header_rec.creation_date);
PRINT('x_header_rec created_by: ' ||x_header_rec.created_by);
END;
It is throwing the following Error.
SQL> exec TEST_PROC;
x_msg_data: ORA-01403: no data found in Package OE_ORDER_WF_UTIL Procedure
Create_HdrWorkItem
x_msg_data: User-Defined Exception in Package OE_ORDER_WF_UTIL Procedure
Start_HdrProcess
failure
x_return_status: U
x_msg_count: 2
x_msg_data: User-Defined Exception in Package OE_ORDER_WF_UTIL Procedure
Start_HdrProcess
x_header_val_rec: Immediate
x_header_rec header_id: 156408
x_header_rec order_number: 64097
x_header_rec ship_to_org_id: 1425
x_header_rec payment_term_id: 4
x_header_rec order_source_id: 0
x_header_rec order_type_id: 1437
x_header_rec price_list_id: 1000
x_header_rec invoicing_rule_id: -2
x_header_rec accounting_rule_id: 1
x_header_rec org_id: 204
x_header_rec sold_to_org_id: 1290
x_header_rec invoice_to_org_id: 1424
x_header_rec salesrep_id: 1006
x_header_rec invoice_to_org_id: 1424
x_header_rec operation: CREATE
x_header_rec transactional_curr_code: USD
x_header_rec orig_sys_document_ref: OE_ORDER_HEADERS_ALL156408
x_header_rec request_date: 02-APR-09
x_header_rec conversion_rate_date:
x_header_rec last_update_date: 02-APR-09
x_header_rec ordered_date: 02-APR-09
x_header_rec creation_date: 02-APR-09
x_header_rec created_by: 13615
Any help on this would be appreciated.
I am using R12..

Hi Nagamohan,
Thanks for the reply..It was Vision Instance that i was working on..
There was some problem in setups. I had run the same script on other instance and it is working.
Before signing off i have one more doubt...
The script which i used is creating a sales order with booked_flag='Y' but flow_status_code is still 'ENTERED'
how can i change it to 'BOOKED' using API...
Thanks for the help...

Similar Messages

  • Error While Creating Sales Order Using OE_ORDER_PUB.PROCESS_ORDER

    Hi All,
    I am trying to create a sales order using oe_order_pub.process_order api..
    The Procedure i had written is as follows.
    CREATE OR REPLACE PROCEDURE TEST_PROC
    AS
    x_return_status VARCHAR2(250);
    x_msg_count NUMBER;
    x_msg_data VARCHAR2(250);
    F varchar2(2000);
    --out parameters
    x_header_rec OE_Order_PUB.Header_Rec_Type;
    x_header_val_rec OE_Order_PUB.Header_Val_Rec_Type;
    x_Header_Adj_tbl OE_Order_PUB.Header_Adj_Tbl_Type;
    x_Header_Adj_val_tbl OE_Order_PUB.Header_Adj_Val_Tbl_Type;
    x_Header_price_Att_tbl OE_Order_PUB.Header_Price_Att_Tbl_Type;
    x_Header_Adj_Att_tbl OE_Order_PUB.Header_Adj_Att_Tbl_Type;
    x_Header_Adj_Assoc_tbl OE_Order_PUB.Header_Adj_Assoc_Tbl_Type;
    x_Header_Scredit_tbl OE_Order_PUB.Header_Scredit_Tbl_Type;
    x_Header_Scredit_val_tbl OE_Order_PUB.Header_Scredit_Val_Tbl_Type;
    x_line_tbl OE_Order_PUB.Line_Tbl_Type;
    x_line_val_tbl OE_Order_PUB.Line_Val_Tbl_Type;
    x_Line_Adj_tbl OE_Order_PUB.Line_Adj_Tbl_Type;
    x_Line_Adj_val_tbl OE_Order_PUB.Line_Adj_Val_Tbl_Type;
    x_Line_price_Att_tbl OE_Order_PUB.Line_Price_Att_Tbl_Type;
    x_Line_Adj_Att_tbl OE_Order_PUB.Line_Adj_Att_Tbl_Type;
    x_Line_Adj_Assoc_tbl OE_Order_PUB.Line_Adj_Assoc_Tbl_Type;
    x_Line_Scredit_tbl OE_Order_PUB.Line_Scredit_Tbl_Type;
    x_Line_Scredit_val_tbl OE_Order_PUB.Line_Scredit_Val_Tbl_Type;
    x_Lot_Serial_tbl OE_Order_PUB.Lot_Serial_Tbl_Type;
    x_Lot_Serial_val_tbl OE_Order_PUB.Lot_Serial_Val_Tbl_Type;
    x_action_request_tbl OE_Order_PUB.Request_Tbl_Type;
    --in parameters
    l_header_rec OE_Order_PUB.Header_Rec_Type;
    t_line_tbl OE_ORDER_PUB.Line_Tbl_Type;
    BEGIN
    apps.mo_global.set_org_context(204,null,'ONT');
    l_header_rec := OE_ORDER_PUB.G_MISS_HEADER_REC;
    l_header_rec.ORG_ID := 204;
    l_header_rec.ORDER_TYPE_ID := 1437;
    l_header_rec.SOLD_TO_ORG_ID := 1290;
    l_header_rec.SHIP_TO_ORG_ID:=1425;
    l_header_rec.INVOICE_TO_ORG_ID:=1424;
    l_header_rec.PRICE_LIST_ID := 1000;
    l_header_rec.salesrep_id := 1006;
    l_header_rec.ORDER_CATEGORY_CODE := 'MIXED';
    l_header_rec.VERSION_NUMBER := 0;
    l_header_rec.OPEN_FLAG := 'Y';
    l_header_rec.BOOKED_FLAG := 'Y';
    l_header_rec.PRICING_DATE := sysdate;
    l_header_rec.TRANSACTIONAL_CURR_CODE := 'USD';
    l_header_rec.created_by := FND_GLOBAL.USER_ID;
    l_header_rec.creation_date := sysdate;
    l_header_rec.LAST_UPDATED_BY := FND_GLOBAL.USER_ID;
    l_header_rec.LAST_UPDATE_DATE := sysdate;
    l_header_rec.attribute1 := '250';
    l_header_rec.operation := 'CREATE';
    t_line_tbl(1) := OE_ORDER_PUB.G_MISS_LINE_REC; ---check
    t_line_tbl(1).inventory_item_id := 193742;
    t_line_tbl(1).ordered_quantity := 1;
    t_line_tbl(1).operation := 'CREATE';
    oe_debug_pub.initialize;
    --oe_debug_pub.SetDebugLevel(1);
    OE_MSG_PUB.INITIALIZE();
    OE_Order_PUB.Process_Order
    ( -- p_org_id =>          204,
    --p_operating_unit                =>          'ONT',
    p_api_version_number =>          1.0,
    p_init_msg_list =>          FND_API.G_TRUE,
    p_return_values =>          FND_API.G_TRUE,
    p_action_commit =>          FND_API.G_TRUE,
    x_return_status =>          x_return_status,
    x_msg_count =>          x_msg_count,
    x_msg_data =>          x_msg_data,
    p_header_rec =>          l_header_rec,
    p_old_header_rec =>          OE_Order_PUB.G_MISS_HEADER_REC,
    p_header_val_rec =>          OE_Order_PUB.G_MISS_HEADER_VAL_REC,
    p_old_header_val_rec =>          OE_Order_PUB.G_MISS_HEADER_VAL_REC,
    p_Header_Adj_tbl =>          OE_Order_PUB.G_MISS_HEADER_ADJ_TBL,
    p_old_Header_Adj_tbl =>          OE_Order_PUB.G_MISS_HEADER_ADJ_TBL,
    p_Header_Adj_val_tbl =>          OE_Order_PUB.G_MISS_HEADER_ADJ_VAL_TBL,
    p_old_Header_Adj_val_tbl =>          OE_Order_PUB.G_MISS_HEADER_ADJ_VAL_TBL,
    p_Header_price_Att_tbl =>          OE_Order_PUB.G_MISS_HEADER_PRICE_ATT_TBL,
    p_old_Header_Price_Att_tbl =>          OE_Order_PUB.G_MISS_HEADER_PRICE_ATT_TBL,
    p_Header_Adj_Att_tbl =>          OE_Order_PUB.G_MISS_HEADER_ADJ_ATT_TBL,
    p_old_Header_Adj_Att_tbl =>          OE_Order_PUB.G_MISS_HEADER_ADJ_ATT_TBL,
    p_Header_Adj_Assoc_tbl =>          OE_Order_PUB.G_MISS_HEADER_ADJ_ASSOC_TBL,
    p_old_Header_Adj_Assoc_tbl =>          OE_Order_PUB.G_MISS_HEADER_ADJ_ASSOC_TBL,
    p_Header_Scredit_tbl =>          OE_Order_PUB.G_MISS_HEADER_SCREDIT_TBL,
    p_old_Header_Scredit_tbl =>          OE_Order_PUB.G_MISS_HEADER_SCREDIT_TBL,
    p_Header_Scredit_val_tbl =>          OE_Order_PUB.G_MISS_HEADER_SCREDIT_VAL_TBL,
    p_old_Header_Scredit_val_tbl =>          OE_Order_PUB.G_MISS_HEADER_SCREDIT_VAL_TBL,
    p_line_tbl =>          t_line_tbl,
    p_old_line_tbl =>          OE_Order_PUB.G_MISS_LINE_TBL,
    p_line_val_tbl =>          OE_Order_PUB.G_MISS_LINE_VAL_TBL,
    p_old_line_val_tbl =>          OE_Order_PUB.G_MISS_LINE_VAL_TBL,
    p_Line_Adj_tbl =>          OE_Order_PUB.G_MISS_LINE_ADJ_TBL,
    p_old_Line_Adj_tbl =>          OE_Order_PUB.G_MISS_LINE_ADJ_TBL,
    p_Line_Adj_val_tbl =>          OE_Order_PUB.G_MISS_LINE_ADJ_VAL_TBL,
    p_old_Line_Adj_val_tbl =>          OE_Order_PUB.G_MISS_LINE_ADJ_VAL_TBL,
    p_Line_price_Att_tbl =>          OE_Order_PUB.G_MISS_LINE_PRICE_ATT_TBL,
    p_old_Line_Price_Att_tbl =>          OE_Order_PUB.G_MISS_LINE_PRICE_ATT_TBL,
    p_Line_Adj_Att_tbl =>          OE_Order_PUB.G_MISS_LINE_ADJ_ATT_TBL,
    p_old_Line_Adj_Att_tbl =>          OE_Order_PUB.G_MISS_LINE_ADJ_ATT_TBL,
    p_Line_Adj_Assoc_tbl =>          OE_Order_PUB.G_MISS_LINE_ADJ_ASSOC_TBL,
    p_old_Line_Adj_Assoc_tbl =>          OE_Order_PUB.G_MISS_LINE_ADJ_ASSOC_TBL,
    p_Line_Scredit_tbl =>          OE_Order_PUB.G_MISS_LINE_SCREDIT_TBL,
    p_old_Line_Scredit_tbl =>          OE_Order_PUB.G_MISS_LINE_SCREDIT_TBL,
    p_Line_Scredit_val_tbl =>          OE_Order_PUB.G_MISS_LINE_SCREDIT_VAL_TBL,
    p_old_Line_Scredit_val_tbl =>          OE_Order_PUB.G_MISS_LINE_SCREDIT_VAL_TBL,
    p_Lot_Serial_tbl =>          OE_Order_PUB.G_MISS_LOT_SERIAL_TBL,
    p_old_Lot_Serial_tbl =>          OE_Order_PUB.G_MISS_LOT_SERIAL_TBL,
    p_Lot_Serial_val_tbl =>          OE_Order_PUB.G_MISS_LOT_SERIAL_VAL_TBL,
    p_old_Lot_Serial_val_tbl =>          OE_Order_PUB.G_MISS_LOT_SERIAL_VAL_TBL,
    p_action_request_tbl     =>          OE_Order_PUB.G_MISS_REQUEST_TBL,
    x_header_rec =>          x_header_rec,
    x_header_val_rec =>          x_header_val_rec,
    x_Header_Adj_tbl =>          x_Header_Adj_tbl,
    x_Header_Adj_val_tbl =>          x_Header_Adj_val_tbl,
    x_Header_price_Att_tbl =>          x_Header_price_Att_tbl,
    x_Header_Adj_Att_tbl =>          x_Header_Adj_Att_tbl,
    x_Header_Adj_Assoc_tbl =>          x_Header_Adj_Assoc_tbl,
    x_Header_Scredit_tbl =>          x_Header_Scredit_tbl,
    x_Header_Scredit_val_tbl =>          x_Header_Scredit_val_tbl,
    x_line_tbl =>          x_line_tbl,
    x_line_val_tbl =>          x_line_val_tbl,
    x_Line_Adj_tbl =>          x_Line_Adj_tbl,
    x_Line_Adj_val_tbl =>          x_Line_Adj_val_tbl,
    x_Line_price_Att_tbl =>          x_Line_price_Att_tbl,
    x_Line_Adj_Att_tbl =>          x_Line_Adj_Att_tbl,
    x_Line_Adj_Assoc_tbl =>          x_Line_Adj_Assoc_tbl,
    x_Line_Scredit_tbl =>          x_Line_Scredit_tbl,
    x_Line_Scredit_val_tbl =>          x_Line_Scredit_val_tbl,
    x_Lot_Serial_tbl =>          x_Lot_Serial_tbl,
    x_Lot_Serial_val_tbl =>          x_Lot_Serial_val_tbl,
    x_action_request_tbl     =>          x_action_request_tbl,
    --For bug 3390458
    p_rtrim_data => 'N',
    p_validate_desc_flex => 'Y' -- bug4343612
    COMMIT;
    if x_msg_count > 0 then
    for l_index in 1..x_msg_count loop
    x_msg_data := oe_msg_pub.get(p_msg_index => l_index, p_encoded => F);
    PRINT('x_msg_data: '||x_msg_data);
    end loop;
    end if;
    -- Check the return status
    if x_return_status = FND_API.G_RET_STS_SUCCESS then
    PRINT('success');
    else
    PRINT('failure');
    end if;
    PRINT('x_return_status: '||x_return_status);
    PRINT('x_msg_count: '||x_msg_count);
    PRINT('x_msg_data: '||x_msg_data);
    PRINT('x_header_val_rec: '||x_header_val_rec.accounting_rule);
    PRINT('x_header_rec header_id: ' ||x_header_rec.header_id);
    PRINT('x_header_rec order_number: ' ||x_header_rec.order_number);
    PRINT('x_header_rec ship_to_org_id: ' ||x_header_rec.ship_to_org_id);
    PRINT('x_header_rec payment_term_id: ' ||x_header_rec.payment_term_id);
    PRINT('x_header_rec order_source_id: ' ||x_header_rec.order_source_id);
    PRINT('x_header_rec order_type_id: ' ||x_header_rec.order_type_id);
    PRINT('x_header_rec price_list_id: ' ||x_header_rec.price_list_id);
    PRINT('x_header_rec invoicing_rule_id: ' ||x_header_rec.invoicing_rule_id);
    PRINT('x_header_rec accounting_rule_id: ' ||x_header_rec.accounting_rule_id);
    PRINT('x_header_rec org_id: ' ||x_header_rec.org_id);
    PRINT('x_header_rec sold_to_org_id: ' ||x_header_rec.sold_to_org_id);
    PRINT('x_header_rec invoice_to_org_id: ' ||x_header_rec.invoice_to_org_id);
    PRINT('x_header_rec salesrep_id: ' ||x_header_rec.salesrep_id);
    PRINT('x_header_rec invoice_to_org_id: ' ||x_header_rec.invoice_to_org_id);
    PRINT('x_header_rec operation: ' ||x_header_rec.operation);
    PRINT('x_header_rec transactional_curr_code: ' ||x_header_rec.transactional_curr_code);
    PRINT('x_header_rec orig_sys_document_ref: ' ||x_header_rec.orig_sys_document_ref);
    PRINT('x_header_rec request_date: ' ||x_header_rec.request_date);
    PRINT('x_header_rec conversion_rate_date: ' ||x_header_rec.conversion_rate_date);
    PRINT('x_header_rec last_update_date: ' ||x_header_rec.last_update_date);
    PRINT('x_header_rec ordered_date: ' ||x_header_rec.ordered_date);
    PRINT('x_header_rec creation_date: ' ||x_header_rec.creation_date);
    PRINT('x_header_rec created_by: ' ||x_header_rec.created_by);
    END;
    It is throwing the following Error.
    SQL> exec TEST_PROC;
    x_msg_data: ORA-01403: no data found in Package OE_ORDER_WF_UTIL Procedure
    Create_HdrWorkItem
    x_msg_data: User-Defined Exception in Package OE_ORDER_WF_UTIL Procedure
    Start_HdrProcess
    failure
    x_return_status: U
    x_msg_count: 2
    x_msg_data: User-Defined Exception in Package OE_ORDER_WF_UTIL Procedure
    Start_HdrProcess
    x_header_val_rec: Immediate
    x_header_rec header_id: 156408
    x_header_rec order_number: 64097
    x_header_rec ship_to_org_id: 1425
    x_header_rec payment_term_id: 4
    x_header_rec order_source_id: 0
    x_header_rec order_type_id: 1437
    x_header_rec price_list_id: 1000
    x_header_rec invoicing_rule_id: -2
    x_header_rec accounting_rule_id: 1
    x_header_rec org_id: 204
    x_header_rec sold_to_org_id: 1290
    x_header_rec invoice_to_org_id: 1424
    x_header_rec salesrep_id: 1006
    x_header_rec invoice_to_org_id: 1424
    x_header_rec operation: CREATE
    x_header_rec transactional_curr_code: USD
    x_header_rec orig_sys_document_ref: OE_ORDER_HEADERS_ALL156408
    x_header_rec request_date: 02-APR-09
    x_header_rec conversion_rate_date:
    x_header_rec last_update_date: 02-APR-09
    x_header_rec ordered_date: 02-APR-09
    x_header_rec creation_date: 02-APR-09
    x_header_rec created_by: 13615
    Any help on this would be appreciated.
    I am using R12..

    Pl see if MOS Doc 117313.1 (Booking Order from Order Capture Errors at OE_ORDER_WF_UTIL) can help
    HTH
    Srini

  • Issue while trying to create Sales Order from Inbound Idoc ORDER05

    Hi All,
    I am trying to create a sales order through an Inbound idoc ORDERS05 created out of a Purchase order. The header pricing conditions from the Purchase orders gets populated in E1EDK05 segment and this needs to go to the Sales order header conditions while trying to create the Sales order.
    But when the fields are getting incorrectly mapped to the Sales order. Issue  being, the segment E1EDK05-BETRG contains the condition value. But this fields gets populated to the KOMV-KWERT (condition value) screen field on the Sales order header conditions. But this should have got mapped to field KOMV-KBETR (Rate). If I look at the Purchase order, E1EDK05-BETRG is the field getting fetched from field KOMV-KBETR on the Purchase order. So this should have correspondingly got mapped to KOMV-KBETR on the Sales order as well.
    This looks like a standard behavior. But if any of you have encountered this issue before please let me know if any Correction instructions are available for the same. If this some issue in Pricing conditions configuration, do let me know.

    Hi Paaavan
    You can set a break-point include "FV45PFAP_VBAP_BEARBEITEN_VORBE" that is called by both the SAP Standard and BAPI where the data is prepared and checked in the internal table XVBAP. Compare both SAP standard VA01 and your 'Z' program for what may be different in XVBAP.
    I think the problem my be with regards to the business_object number that is hardcoded in the standard function module. It has given me issues before and hence I tend to use the function module  SD_SALESDOCUMENT_CREATE to create sales documents with.
    Regards,
    Marius

  • Getting error while trying to create a document using oracle web ADI resp.

    Hi All,
    When I am trying to create a document using Oracle Web ADI Responsibility and using "Ben Ri Process Bnf" integrator, it is showing me error
    "The following error has occurred
    Exception Name: oracle.apps.bne.exception.BneParameterException - No parameter list definition at parameter list id 800:PER_RI_JPG_PARAM_LIS
    Log File Bookmark: 868035"
    Can anybody tell me the cause of this error?
    Thanks.

    Please see the solution in (The Descriptive Flexfield With Application Name Receivables (AR) and Name Party Site Information (HZ_PARTY_SITES) Is Not Frozen [ID 743262.1]).
    Thanks,
    Hussein

  • Iam geting exception when trying to creat sales order using bapi in BSP pro

    hi,
        I am using BAPI 'BAPI_SALESORDER_CREATEFROMDAT2'
    to creat a sales order in BSP program it giving the exception
    An exception with the type CX_SY_DYN_CALL_ILLEGAL_TYPE occurred, but was neither handled locally, nor declared in a RAISING clause
    Exception Class: CX_SY_DYN_CALL_ILLEGAL_TYPE
    Error Id: 
    Program: CL_O2AXZG4R3LD7CRXUAEKYMRHCDL8CP
    Include: CL_O2AXZG4R3LD7CRXUAEKYMRHCDL8CM007
    Line: 78 
    Long Text
    please help me in solving this  exception

    Hi,
    Are you getting dump?
    I agree with sudhakar. Usually this exception is raised when function is called without proper parameters.
    Please check types of all the parameters you are passing.

  • How to create sales order using BAPI.

    Hi all,
    I am trying to create sales order using standard BAPI
    "BAPI_SALESORDER_CREATEFROMDAT2". But, even I had entered all mandatory fields, I am unable to create sales order sucessfully.
    I had gone through the documentaion of this BAPI and entered these fields.
    These are the mandatory fields that which I had tried to create,
    ORDER_HEADER_IN :
    DOC_TYPE Sales document type
    SALES_ORG Sales organization
    DISTR_CHAN Distribution channel
    DIVISION Division
    ORDER_PARTNERS..:
    PARTN_ROLE Partner role, SP sold-to party
    PARTN_NUMB Customer number
    ORDER_ITEMS_IN..:
    MATERIAL Material number
    Do we have anymore fields to give as inputs? I am getting this error message as below :
    Msg: Personal number 00007176 does not exit.
    But, I am not giving any personal number manually. This personal number was having connection with partner role field,
    I had reffered this from the VBPA (Sales Document: Partner Table). Now, please suggest me how to solve this?
    Can anyone tell me how to solve this problem and create sales order sucessfully.
    Thanks in advance,
    Surender Batlanki.

    hi surendra ,
    chech with below code.
    REPORT z_bapi_salesorder_create.
    Parameters
    Sales document type
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(20) v_text FOR FIELD p_auart.
    PARAMETERS: p_auart TYPE auart OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    Sales organization
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(20) v_text1 FOR FIELD p_vkorg.
    PARAMETERS: p_vkorg TYPE vkorg OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    Distribution channel
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(20) v_text2 FOR FIELD p_vtweg.
    PARAMETERS: p_vtweg TYPE vtweg OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    Division.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(20) v_text3 FOR FIELD p_spart.
    PARAMETERS: p_spart TYPE spart OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    SKIP 1.
    Sold-to
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(20) v_text4 FOR FIELD p_sold.
    PARAMETERS: p_sold  TYPE kunnr OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    Ship-to
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(20) v_text5 FOR FIELD p_ship.
    PARAMETERS: p_ship  TYPE kunnr OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    SKIP 1.
    Material
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(20) v_text6 FOR FIELD p_matnr.
    PARAMETERS: p_matnr TYPE matnr   OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    Quantity.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(20) v_text7 FOR FIELD p_menge.
    PARAMETERS: p_menge TYPE kwmeng  OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    Plant
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(20) v_text9 FOR FIELD p_plant.
    PARAMETERS: p_plant TYPE werks_d OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    Data declarations.
    DATA: v_vbeln            LIKE vbak-vbeln.
    DATA: header             LIKE bapisdhead1.
    DATA: headerx            LIKE bapisdhead1x.
    DATA: item               LIKE bapisditem  OCCURS 0 WITH HEADER LINE.
    DATA: itemx              LIKE bapisditemx OCCURS 0 WITH HEADER LINE.
    DATA: partner            LIKE bapipartnr  OCCURS 0 WITH HEADER LINE.
    DATA: return             LIKE bapiret2    OCCURS 0 WITH HEADER LINE.
    DATA: lt_schedules_inx   TYPE STANDARD TABLE OF bapischdlx
                             WITH HEADER LINE.
    DATA: lt_schedules_in    TYPE STANDARD TABLE OF bapischdl
                             WITH HEADER LINE.
    Initialization.
    INITIALIZATION.
    v_text   = 'Order type'.
    v_text1  = 'Sales Org'.
    v_text2  = 'Distribution channel'.
    v_text3  = 'Division'.
    v_text4  = 'Sold-to'.
    v_text5  = 'Ship-to'.
    v_text6  = 'Material'.
    v_text7  = 'Quantity'.
    v_text9  = 'Plant'.
    Start-of-selection.
    START-OF-SELECTION.
    Header data
    Sales document type
      header-doc_type = p_auart.
      headerx-doc_type = 'X'.
    Sales organization
      header-sales_org = p_vkorg.
      headerx-sales_org = 'X'.
    Distribution channel
      header-distr_chan  = p_vtweg.
      headerx-distr_chan = 'X'.
    Division
      header-division = p_spart.
      headerx-division = 'X'.
      headerx-updateflag = 'I'.
    Partner data
    Sold to
      partner-partn_role = 'AG'.
      partner-partn_numb = p_sold.
      APPEND partner.
    Ship to
      partner-partn_role = 'WE'.
      partner-partn_numb = p_ship.
      APPEND partner.
    ITEM DATA
      itemx-updateflag = 'I'.
    Line item number.
      item-itm_number = '000010'.
      itemx-itm_number = 'X'.
    Material
      item-material = p_matnr.
      itemx-material = 'X'.
    Plant
      item-plant    = p_plant.
      itemx-plant   = 'X'.
    Quantity
      item-target_qty = p_menge.
      itemx-target_qty = 'X'.
      APPEND item.
      APPEND itemx.
      Fill schedule lines
      lt_schedules_in-itm_number = '000010'.
      lt_schedules_in-sched_line = '0001'.
      lt_schedules_in-req_qty    = p_menge.
      APPEND lt_schedules_in.
      Fill schedule line flags
      lt_schedules_inx-itm_number  = '000010'.
      lt_schedules_inx-sched_line  = '0001'.
      lt_schedules_inx-updateflag  = 'X'.
      lt_schedules_inx-req_qty     = 'X'.
      APPEND lt_schedules_inx.
    Call the BAPI to create the sales order.
      CALL FUNCTION 'BAPI_SALESDOCU_CREATEFROMDATA1'
           EXPORTING
                sales_header_in     = header
                sales_header_inx    = headerx
           IMPORTING
                salesdocument_ex    = v_vbeln
           TABLES
                return              = return
                sales_items_in      = item
                sales_items_inx     = itemx
                sales_schedules_in  = lt_schedules_in
                sales_schedules_inx = lt_schedules_inx
                sales_partners      = partner.
    Check the return table.
      LOOP AT return WHERE type = 'E' OR type = 'A'.
        EXIT.
      ENDLOOP.
      IF sy-subrc = 0.
        WRITE: / 'Error in creating document'.
      ELSE.
    Commit the work.
        COMMIT WORK AND WAIT.
        WRITE: / 'Document ', v_vbeln, ' created'.
      ENDIF.
    let us know if you have any qauistions.
    ~linganna

  • TO CREATE SALES ORDER USING BAPI PROBLEM

    I am trying to create Sales Order using bapi function, this is giving me error as mentioned below
    *Please enter SHIP-TO-PARTY OR SOLD TO PARTY
    *SALES DOCUMENT WAS NOT CHANGED.
    it does not GIVE ME THE SALES DOCUMENT NO .
    The BAPI I am using is BAPI_SALESORDER_CREATEFROMDAT2.
    Would someone know which parameters I have to papulate,or have any other suggestion
    THE INTERNAL TABLES I AM PASSING TO BAPI FUNCTION ARE
    DATA:  IT_BAPI_HEADER LIKE BAPISDHD1.
    DATA:     IT_BAPI_SOLD_TO_PARTY LIKE BAPIPARNR occurs 0 with header line.
    DATA:  SO_NO LIKE BAPIVBELN-VBELN.
    DATA:  IT_BAPI_ITEMS_IN LIKE BAPISDITM occurs 0 with header line.
    DATA: IT_BAPI_RETURN LIKE BAPIRET2 occurs 0 with header line.
    IS THERE ANYTHING ELSE TO POPULATE OTHER THAN THIS STRUCTURES
    HEADER
          Sales-Document type:      
    *     Sales-Organization
    *     Distrubution-Channel: 
    *     Division          
    PARTNER
            Partner Function     
         Customer Number      
    ITEM DETAIL
             Material Number      
    how to accomplish my task?

    Nandan,
    Please go through the documentation of the BAPI. It gives you details of what needs to be filled in in which structure/parmater. Also, read the documentation associated with each structure, that will tell what to fill.
    It is really hard to explain it in simple terms as to what are required. But, you need the header, items and partners at the minimum. Also, with some of these structures there are also 'X' structures(like ORDER_ITEMS_INX for ORDER_ITEMS_IN) which should also be filled based on what fields you filled in the original structure. For example, if you filled 'MATERIAL' field on the ORDER_ITEMS_IN structure, you should also fill in the same field on the ORDER_ITEMS_INX structure with an 'X' in it.
    All this is well documented in the BAPI.
    Srinivas

  • How to create sales order using bapi( test purpose)

    Hi all,
           while i was creating sales order using the BAPI_SALESORDER_CREATEFROMDAT1 it is giving some error,
    version 0 is not defined for the fiscal year ****.
    I have given the fallowing parameters as input
    ORDER_HEADER_IN
         DOC_TYPE     OR
                    SALES_ORG  1000
         DISTR_CHAN  10
                    DIVISION         00
    ORDER_PATNERS
         PARTN_ROLE     SP
         PARTN_NUMB     1000
    ORDER_ITEMSIN
         MATERIAL     M-13
    I need to create sample sales order . Please help me how to create sales order with an example( for test purpose).
    Regards
    Deviprasad.

    Hi Prasad,
    Try using BAPI_SALESORDER_CREATEFROMDAT2.
    While creating sales order using FM: BAPI_SALESORDER_CREATEFROMDAT2, please make sure ORDER_ITEMS_IN, ORDER_ITEMS_INX, ORDER_SCHEDULES_IN, ORDER_SCHEDULES_INX.
    Pricing Conditions will not be mandatory to create a sales order via BAPI.
    As you were saying, you can create a sales order but not with items. Do populate the internal tables that i have specified above.
    Also try to pass the item number internally, this will help you in identifying the schedule lines.
    Regards,
    Priyanka.

  • PS Project description when creating sales order using BAPI

    I am trying to create sales orders using BAPI_SALESORDER_CREATE_FROMDAT2.
    Because of the material configuration in table TCN61 the material will trigger a project creation in the project system.
    Now, in order to create a project, we must provide the project description.
    I would like to ask you if anyone knows how to pass the project description in one of the BAPI parameters.
    Thank you for your help.

    Thank you Sreedhar for the answer.
    I tried the CAMPAIGN field but did not work...
    In fact, I am not able to find a field, in any of the of the tables, that could hold the project description (PROJ-POST1).
    An entry is created in PROJ table when we manually create a sales order for materials specified in table TCN61.
    Thanks.

  • How to Create RMA Based on Sales order using OE_ORDER_PUB api

    Hi,
    Can any one pls help me how to create a RMA based on the sales order using oe_order_pub.process_order APi.
    Thanks.

    Creating RMA is very similar to creating an Order. You need to make sure you're passing the correct order_type, line_type which'll be setup as 'RETURN' (or 'MIXED') category in transaction type definition.
    For the API to automatically create a reference on your RMA lines to the original Order lines, you need to pass the following
    l_line_tbl (l_line_tbl.COUNT).return_reason_code := 'RETURN'; -- Mandatory for RMA
    l_line_tbl (l_line_tbl.COUNT).reference_line_id := v_ref_line_id; -- Original order line_id
    l_line_tbl (l_line_tbl.COUNT).reference_header_id := v_ref_header_id; -- Original order header_id
    l_line_tbl (l_line_tbl.COUNT).return_context := 'ORDER';
    l_line_tbl (l_line_tbl.COUNT).return_attribute1 := v_ref_header_id; -- Original order header_id
    l_line_tbl (l_line_tbl.COUNT).return_attribute2 := v_ref_line_id; -- Original order line_id
    Once the RMA gets created, query the order and navigate to Lines>Returns tab. You can see the original order number and line number.
    Thanks
    Gopal

  • Error while creating sales order using SD_SALESDOCUMENT_CREATE

    Hello All,
    We are using to  SD_SALESDOCUMENT_CREATE function module to create sales order it is working fine for single material.
    When we try to create sales order with multiple matearials we ended up with the following errors
    SALES_HEADER_IN has been processed successfully
    000000
    VBAKKOM
    Internal error in communication between configuration and sales doc.CONFIGURATION_PROCESSING
    000000
    CONFIGURATION_PROCESSING
    Error in SALES_ITEM_IN 000010
    000000
    VBAPKOM
    Internal error in communication between configuration and sales doc.CONFIGURATION_PROCESSING
    000000
    CONFIGURATION_PROCESSING
    Error in SALES_ITEM_IN 000020
    000000
    VBAPKOM
    SALES_ITEM_IN has been processed successfully
    000000
    VBAPKOM
    Could any one help me out to resolve this issue.
    Thanks in advance....
    Cheers,
    Harsha

    Hello,
    Looking at BAPI errors. It looks like you are trying to create sales order with variant configuration.
    Check Below SAP Note.
    900380 - Configurable items in the SD process (idocs & bapis)
    Regards,
    Sameer

  • Error while trying to create tree using same EMP how to tutorial

    Hi,
    I get the following error while trying to create a sample tree similar to the one
    posted in the how-tos web page.
    The final query that creates the tree is also as follows
    The Current Query shown in my apex window and the one on the howtos tutorial is as follows
    select "EMPNO" id,
    "MGR" pid,
    "ENAME" name,
    null link,
    null a1,
    null a2
    from "RJOSEEMPCLUB"."EMP"
    where DEPTNO = 1
    The error is as follows
    ORA-06502: PL/SQL: numeric or value error: character to number conversion error
    Debug:
    1: begin
    2: wwv_flow_wiz_confirm.create_tree (
    3: p_flow_id => :FB_FLOW_ID,
    4: p_region_template => replace(:F4000_P112_REGION_TEMPLATE,'%'||'null%',null),
    5: p_start_option => :F4000_P112_START_OPTION,
    6: p_owner => :F4000_P112_OWNER,
    7: p_table_name => :F4000_P112_TABLE,
    8: p_id => :F4000_P112_ID,
    9: p_pid => :F4000_P112_PID,
    10: p_name => :F4000_P112_NAME,
    11: p_link_option => :F4000_P112_LINK_OPTION,
    12: p_link_page_id => :F4000_P112_LINK_PAGE_ID,
    13: p_link_item => :F4000_P112_LINK_ITEM,
    14: p_where => :F4000_P112_WHERE,
    15: p_order_by => :F4000_P112_ORDER_BY,
    16: p_page_id => :F4000_P112_PAGE_ID,
    17: p_page_name => :F4000_P112_PAGE_NAME,
    18: p_tab_set => :F4000_P112_TAB_SET,
    19: p_tab_text => :F4000_P112_TAB_TEXT,
    20: p_region_name => :F4000_P112_REGION_NAME,
    21: p_tree_name => :F4000_P112_TREE_NAME,
    22: p_tree_type => :F4000_P112_TREE_TYPE,
    23: p_max_levels => :F4000_P112_MAX_LEVELS);
    24: end;

    Hi Kart,
    If you have the sample EMP table, the DEPTNO values are 10, 20 or 30.
    Did you specify a root value for the tree?
    Regards
    Andy

  • Setting user specific contract data while creating sales order using BAPI

    Hi all,
    I am creating sales order using BAPI - BAPI_SALESORDER_CREATEFROMDAT2.
    Now my problem is that there is no structure for contract data (i.e. VEDA), system automatically set contract data using customization values.
    I am doing some validations on cotract data in MV45AFZZ which fails, because these validations are performed on standard values, user specific values r not set.
    How to handle this issue, your small clue may help a lot.
    Regards,
    S@meer

    HI
      Pricing will be carried basing on the pricing
    procedure.
    Case1: Prices will be carried out automatically if
    necessary condition records are maintained for the
    condition type.
      For this you can go to Sales Order-> Item Conditions
    In the screen you can click on command button Analysis,
    which gives you the list of condition types associated
    to the pricing procedure. By clicking on the condition
    type you can know the action that has taken place.
    Case2: Manually forcing prices for Items.
      To do this, you have to populate ORDER_CONDITIONS_IN &
    ORDER_CONDITIONS_INX. Also note to identify the item
    numbers, you manually pass the item number for each item
    in the sales order, use the same item number for
    populating conditions.
      Parameters required:
    ORDER_CONDITIONS_IN:
      ITM_NUMBER, COND_TYPE, COND_VALUE, CURRENCY
    ORDER_CONDITIONS_INX:
      ITM_NUMBER, COND_TYPE, UPDATEFLAG, COND_VALUE,CURRENCY.
       Hope the above info helps you. Do revert back if you
    need more info.
    Kind Regards
    Eswar

  • Creating sales order using bapi

    while creating sales order using bapi serial no is added in dat but its not saving.
    plz reply

    Hi
    See tha sample code for sales order creation
    SALES ORDER INPUT CREATION.
    PARAMETERS: p_auart TYPE auart OBLIGATORY.
    PARAMETERS: p_vkorg TYPE vkorg OBLIGATORY.
    PARAMETERS: p_vtweg TYPE vtweg OBLIGATORY.
    PARAMETERS: p_spart TYPE vtweg OBLIGATORY.
    PARAMETERS: p_sold TYPE kunnr OBLIGATORY.
    PARAMETERS: p_ship TYPE kunnr OBLIGATORY.
    *ITEM
    PARAMETERS: p_matnr TYPE matnr OBLIGATORY.
    PARAMETERS: p_menge TYPE kwmeng OBLIGATORY.
    PARAMETERS: p_plant TYPE werks_d OBLIGATORY.
    PARAMETERS: p_itcat TYPE pstyv OBLIGATORY.
    DATA DECLARATIONS.
    DATA: v_vbeln LIKE vbak-vbeln.
    DATA: header LIKE bapisdhead1.
    DATA: headerx LIKE bapisdhead1x.
    DATA: item LIKE bapisditem OCCURS 0 WITH HEADER LINE.
    DATA: itemx LIKE bapisditemx OCCURS 0 WITH HEADER LINE.
    DATA: partner LIKE bapipartnr OCCURS 0 WITH HEADER LINE.
    DATA: return LIKE bapiret2 OCCURS 0 WITH HEADER LINE.
    DATA: lt_schedules_inx TYPE STANDARD TABLE OF bapischdlx
    WITH HEADER LINE.
    DATA: lt_schedules_in TYPE STANDARD TABLE OF bapischdl
    WITH HEADER LINE.
    HEADER DATA
    header-doc_type = p_auart.
    headerx-doc_type = 'X'.
    header-sales_org = p_vkorg.
    headerx-sales_org = 'X'.
    header-distr_chan = p_vtweg.
    headerx-distr_chan = 'X'.
    header-division = p_spart.
    headerx-division = 'X'.
    headerx-updateflag = 'I'.
    PARTNER DATA
    partner-partn_role = 'AG'.
    partner-partn_numb = p_sold.
    APPEND partner.
    partner-partn_role = 'WE'.
    partner-partn_numb = p_ship.
    APPEND partner.
    ITEM DATA
    itemx-updateflag = 'I'.
    item-itm_number = '000010'.
    itemx-itm_number = 'X'.
    item-material = p_matnr.
    itemx-material = 'X'.
    item-plant = p_plant.
    itemx-plant = 'X'.
    item-target_qty = p_menge.
    itemx-target_qty = 'X'.
    item-target_qu = 'EA'.
    itemx-target_qu = 'X'.
    item-item_categ = p_itcat.
    itemx-item_categ = 'X'.
    APPEND item.
    APPEND itemx.
    Fill schedule lines
    lt_schedules_in-itm_number = '000010'.
    lt_schedules_in-sched_line = '0001'.
    lt_schedules_in-req_qty = p_menge.
    APPEND lt_schedules_in.
    Fill schedule line flags
    lt_schedules_inx-itm_number = '000010'.
    lt_schedules_inx-sched_line = '0001'.
    lt_schedules_inx-updateflag = 'X'.
    lt_schedules_inx-req_qty = 'X'.
    APPEND lt_schedules_inx.
    Call the BAPI
    CALL FUNCTION 'BAPI_SALESDOCU_CREATEFROMDATA1'
    EXPORTING
    sales_header_in = header
    sales_header_inx = headerx
    IMPORTING
    salesdocument_ex = v_vbeln
    TABLES
    return = return
    sales_items_in = item
    sales_items_inx = itemx
    sales_schedules_in = lt_schedules_in
    sales_schedules_inx = lt_schedules_inx
    sales_partners = partner.
    Check the return table.
    LOOP AT return WHERE type = 'E' OR type = 'A'.
    EXIT.
    ENDLOOP.
    IF sy-subrc = 0.
    WRITE: / 'Error in creating document'.
    ELSE.
    COMMIT WORK AND WAIT.
    WRITE: / 'Document ', v_vbeln, ' created'.
    ENDIF.
    after that check in the table VBAP whether serial number is cretaed or not
    Reward points if useful
    Regards
    Anji

  • Error in BAPI_SALESORDER_CREATEFROMDAT2 to create sales order

    Hi all,
    I'm trying to create a sales order using bapi_salesorder_createfromdat2. I have given the import parameters as per the documentation. But i'm getting the following error messages from the return parameter
    number       message
      233           SALES_HEADER_IN has been processed successfully
      233           SALES_ITEM_IN has been processed succesfully
      555          The sales document is not yet complete: Edit
      311           Standard Order 73 has been saved
    I gave the partner role (SP)  and partner number in ORDERS_PARTNERS. But i din get any message regarding its processing.
    Pls can anyone guide me to create sales order using this bapi.
    Thanks & Regards,
    Revathi.

    Hi
         I Think there problem in passing data to function module some important data is missing
        run the functional in se37 and pass the data and see the result  i have created sale order by passing the value below
    header-doc_type = 'ZS4'.   
        header-sales_org    = wa_temp1-vkorg.  
        header-purch_no     = wa_temp1-bstnk.
        header-distr_chan   = wa_temp1-vtweg.
        header-division     = wa_temp1-spart.
        header-purch_no_s   = wa_temp1-bstnk.   
        wa_partner-partn_role = 'AG'.
        wa_partner-partn_numb = wa_temp1-kunnr.
        APPEND wa_partner TO it_partner.
        wa_partner-partn_role = 'WE'.
        wa_partner-partn_numb = wa_temp1-kunnr.
        APPEND wa_partner TO it_partner.
        CLEAR: wa_partner.
          wa_item-material   = wa_temp2-matnr.
          wa_item-plant      = wa_temp2-werks.
          wa_item-req_qty    = wa_temp2-fkimg.
          wa_item-target_qty = wa_temp2-fkimg.
           APPEND wa_item TO it_item.
    with regards
    Nilesh

Maybe you are looking for