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

Similar Messages

  • 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...

  • 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 create sales order

    Hi,
    Please help.
    I am facing error while create sales order.
    No item category available (Table T184 OR VERP  )
    Message no. V1320
    Diagnosis
    No item category could be determined for the combination OR VERP .
    System Response
    The system does not allow further processing of this item.
    Procedure
    Check the entries in table T184 by means of which item category determination is controlled.
    If you do not have the authorization to do this yourself, contact your system administrator.

    Hi,
    Check in spro whether Item categorygroup VERP is assigned to sales document type.if not assign.
    Path
    SPRO-SD-sales-sales douments-sales document item-assign item categories.

  • Error while creating sales order

    while creating sales order for a particular plant there is error coming
    NO NUMBER RANGE FOR DOC TYPE ZOS1VXBAK-AUARTSILD
    PLANTXVBAK-VKBUR.
    Intailly I have check the no series we have internal no series for all plant,the 
    number series which start 195000001, only one plant the giving the above error, rest all plant it is as applicable above series.
    kindly guide me for the same.

    Hi Sanjay
    This is regarding number ranges defining and assigning tips which you can follow as below:
    Whenever there is a new Sales Org being created, you will be required to maintain Number Ranges for Sales Documents which are allowed for your New Sales Area.
    Number Ranges can be maintained Internally by the system, however it can be maintained externally also if you customize it accordingly.
    In Standard SAP the Transaction code for Maintaiing Number ranges externally is VN01.
    Defining - The same can be reached through in IMG as : Sales & Distribution>Sales>Sales Document Header-->Define Number Ranges for Sales Documents.
    Here you provide the system a specific Number range as follows:
    Number range Key Start Number range End Number Range+Current Number
    For Example: If you want to propose the following Number Range
    *1     9000076000      9000076999      0
    The Current Number field will be kept zero as you are proposing new number range and no sales documents have been created on it , Obviously..
    *1 is a Unique Two digit Alphanumeric Key, while proposing your key, you should ensure that it should not be there in the system as existing.
    If you propose a key that is there in the system or if the Number Range (Start and End Series) is there in the system already, the system will throw a message that Interval already already exists. So choose a key that is unique, and which is not there in the system.
    Here , by making this , you are assigning a Key to a Number Range Series.
    All the symbols can be used along with numbers from 0 to 9 and Alphabets from A to Z and in any order. For example: !1, ^A, BB,Z*,M2.........
    Assigning - In Assigning, you assign the particular Sales Document to the Number Range you have already proposed as above.
    The Assigning Part is done as follows:
    The Two digit Alpha Numeric Key is maintained or Assigned to the respective Sales Document type in V0V8.
    This can also be reached in IMG by:
    Sales & Distribution>Sales>Sales Document Header-->Define Sales Document Types
    Locate the particular Sales Doc Type, and double click on it to display it configuration. Here you put the Two Digit Number key in the Field- "Number range External Assignment"
    Besides this:
    If a new Shipping Point is created then Delivery Number ranges are required to be maintained.
    Similarly,
    If a new Plant is created then Billing Number Ranges are required to be maintained.
    Regards
    Naren

  • Runtime error while creating sales order in VA01

    Dear all,
    In our develpment server(ecc 6.0),while creating sales order in VA01 for a sales area, when ever entering material number and quantity and press enter, it is giving error and taking to Runtime error long text showing syntax error in program RK2LSFOC
    application patch level for both production and development is same.
    can any one suggest the solution please

    Please note the error details
    Runtime Errors         SYNTAX_ERROR
    Date and Time          07.01.2010 17:43:06
    Short text
    Syntax error in program "RK2LSFOC ".
    What happened?
    Error in the ABAP Application Program
    The current ABAP program "SAPLKEAK" had to be terminated because it has
    come across a statement that unfortunately cannot be executed.
    The following syntax error occurred in program "RK2LSFOC " in include "RK2LSFOC
    " in
    line 128:
    "No component exists with the name "KWBRUM". ."
    The include has been created and last changed by:
    Created by: "SAP "
    Last changed by: "SAP* "
    Error in the ABAP Application Program
    The current ABAP program "SAPLKEAK" had to be terminated because it has
    come across a statement that unfortunately cannot be executed.
    What can you do?
    Please eliminate the error by performing a syntax check
    (or an extended program check) on the program "RK2LSFOC ".
    You can also perform the syntax check from the ABAP Editor.
    If the problem persists, proceed as follows:
    Note down which actions and inputs caused the error.
    To process the problem further, contact you SAP system
    administrator.
    Using Transaction ST22 for ABAP Dump Analysis, you can look
    at and manage termination messages, and you can also
    keep them for a long time.
    Error analysis
    The following syntax error was found in the program RK2LSFOC :
    "No component exists with the name "KWBRUM". ."
    |    " "

  • End of Valid Logistic Calender error while creating Sales Order

    Hi,
    While creating Sales order in VA01 the following error message comes for particular material code for a particular site only:
    24.01.2202 date comes after end of valid logistics calendar. (Please
    correct)
         Message no. 61062
    Can anyone suggest on the same.
    Regards
    Nilofer

    Hi,
    The input value given in Sales order is " Req Delivery date: 31.03.2012", but the error comes with the below date such as
    "24.01.2202 date comes after end of valid logistics calendar.(Please correct)"
    We also face one more error such as
    " Incorrect index structure for table XMVERF_POS/0000224110/000040 ".
    From where system is taking 24.01.2202 date?

  • Hi   error while creating  sales order

    hi
    i am getting 'not able to save' message while i am creating sales order.
    how should i proceed to know where is the problem???
    i tried debugging but it is taking lots of time, is there any other way i can know the reason for this error in standard code.
    there is no wrong data entry while creating sales order.
    i just want to know what are the ways to know where is the problem in the standard code.
    thanx
    rocky

    hi ,
    try too create a sales order after that check transaction code ST22 U WILL FIND AN SHORT DUMP  then check in the source code extract an pointer will be visible where the error is coming and it will also show the program name , please read the dump analysis care fully
    srinivas

  • Run time error while creating sales order in VA01

    Dear all,
    In our develpment server(ecc 6.0),while creating sales order in VA01 for a sales area, when ever entering material number and quantity and press enter, it is giving error and taking to Runtime error long text showing syntax error in program RK2LSFOC
    application patch level for both production and development is same.
    can any one suggest the solution please
    Moderator message - Cross post locked
    Edited by: Rob Burbank on Jan 7, 2010 10:03 AM

    ths

  • Error while creating sales order with ref to contract

    while creating sales order, with refernce to contract system is giving a message
    Configuration not possible for material : Reason 3 --> Help
    Message no. V1360
    and the message is as follwed can any one explain
    Diagnosis
    This may have been caused by one of the following:
    1. The configuration profile for the material allows or requires the bill of materials to be exploded during order processing. However, a plant has not been specified in the item.
    2. The configuration profile of the material allows or requires the bill of materials to be exploded during order processing, but the order quantity in the item must be greater than 0.
    3. A configuration profile has not been maintained
    or
    A configuration is not permitted for the material
    or
    4. The configuration profile of the material allows or requires the bill ofmaterials to be exploded during order processing. However, the system could not determine a date because important data is missing from the item (see incompletion log).

    Hi
    I think you have both Variant configuration and BOM.
    Pls ensure the following.
    1. BOM masterdata is maintained for the variants
    2. Variant configuration is configured correctly
    Configuration profile is created for the material
    Knowledge base object and run time version are available
    3. Maintain materials as not relevant for delivery or dont give delivery quantity as 0
    Once you are sure that these are in proper shape, you can start creating order. The problem wont come.
    Reward points if it helps you.

  • 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

  • Error while creating sales order with ref using SD_SALESDOCUMENT_CREATE

    Hi
    I am creating sales order with reference using function module SD_SALESDOCUMENT_CREATE , while creating i am getting error
    Document doesn't have document category even thougth i am passing document category in header as well as item lavel.
    In VBUK table there is no value for VGTYP.
    Can you please help me how to resolve it.
    Thanks & regards
    kiran

    Problem resolved by passing   REFDOC_CAT in the FM along with  SD_DOC_CAT.
    Thanks

  • Revenue Recognition - error while creating sales order

    Hi,
    one of my colleague is having a Problem. Its very urgent. could you guys help.
      I have used Revenue recog as"b" and Accrual start period as "a".
      We are getting the error while creating a sales order, G/L account no. not found.
      We have checked all the account assignment config but couldn't find anything.

    Hi guys,
    I have a question, we being SD consultants, do we deal with n e of the revenue issues, I am assuming we deal it to a really brief extent, but I am not familiar with the areas of doing it, so could someone please help me by letting me know the areas where we deal with those issues and how are they looked upon, any material would also be great.
    Just in case, my email is : [email protected]
    Look forward for a response
    Thanks..

  • ITEM ERROR while creating sales order

    Hi Everyone,
    I'm getting a problem while trying to create a sales order using CASHSALE (BV).
    The error is: <b>"Item 000010 does not exist"</b>.
    But while creating a sales order with other document types like OR,SO,etc... i am not getting any error.
    Do u suggest what should i do to solve this.
    Helpful answers will be awarded maximum points.
    Thanks in Advance.
    sudheer.

    Hey i got the solution for this .
    Actually This order type was not assigned to delivery blocks.
    So our SD guy has set that configuration & now its working 5ne now.
    Regards.
    Sudheer.

  • Problem while creating sales order using BAPI

    Hi all,
    i am creating a sales order from the purchase order data.
    when my client will send a PO in EDI format, my 3rd party edi tool will convert that edi formatted PO to text format. then i will upload that text formatted PO to my program then i will create a SO from those uploaded PO data using BAPI BAPI_SALESORDER_CREATEFROMDAT2.
      but,no sales order is being created.& also i am not getting any return message.by debugging also, i am not getting the error.plz suggest where i am doing mistake.below is the coding.
    DATA:
      gfilename LIKE rlgrap-filename.
    *--Internal tables
    DATA: BEGIN OF i_item OCCURS 50.    "Create Material Document Item
            INCLUDE STRUCTURE BAPISDITM .
    DATA: END OF i_item .
    DATA: BEGIN OF i_partner OCCURS 20.  "Return parameter
            INCLUDE STRUCTURE BAPIPARNR.
    DATA: END OF i_partner.
    DATA: BEGIN OF i_schedule OCCURS 20.  "Return parameter
            INCLUDE STRUCTURE BAPISCHDL .
    DATA: END OF i_schedule.
    DATA: BEGIN OF i_cond OCCURS 20.  "Return parameter
            INCLUDE STRUCTURE BAPICOND .
    DATA: END OF i_cond.
    DATA: BEGIN OF i_part OCCURS 0,     " Internal table for split data
            part(20),
          END OF i_part.
    DATA: BEGIN OF i_return OCCURS 20.  "Return parameter
            INCLUDE STRUCTURE bapiret2.
    DATA: END OF i_return.
    *-- Work areas
    DATA: BEGIN OF wa_header .       "sales Document Header Data
            INCLUDE STRUCTURE BAPISDHD1.
    DATA: END OF wa_header .
    *DATA: BEGIN OF wa_return .       "Output Structure
           INCLUDE STRUCTURE BAPIRET2.
    *DATA: END OF wa_return .
    DATA: begin of sorder.
         INCLUDE STRUCTURE BAPIVBELN.
    DATA: end of sorder.
    data:begin of t_upload,
         ebeln(10),  "PO no(seagate)
         aedat like sy-datum , "PO date
         bsart(4) , "PO type
         vdatu like sy-datum , "requested delivery date
         kunnr(10) , "customer no-sold-to-party
        kunak like vbak-kunnr, "bill-to-party
         name1_s(20), "name1 of sold-to-party
         name2_s(15), "name2 of sold-to-party
         land1_s(3), "country
         ort01_s(10),  "city
         regio_s(3), "region(state/province)
         pstlz_s(10), "postal code
         adrnr_s(10), "address
         bstkd_e(10), "end customer purchase order
         posex(6),     "end customer PO line no(item no)
         kdmat(18),     "end customer material no(part no)
         kunag(10),     "ship-to-party
         name1_c(20),   "name1 of ship-to-party
         name2_c(15),   "name2 of ship-to-party
         land1_c(3),   "country
         ort01_c(10),    "city
         regio_c(3),   "region(state/province)
         pstlz_c(10),   "postal code
         adrnr_c(10),   "address
         posnr(6), "item no(seagate PO line no)
         pstyv(4), "item category
         matnr(18), "material no(seagate 9 digit part no)
         zmeng(13), "Target quantity in sales unit
        vrkme like vbap-vrkme, "sales unit
         meins(3), "UOM
        posnr_tot like vbap-posnr,"Total no. of line items
         werks(4), "plant
        vstel like vbap-vstel, "shipping point
         empst(10), "receiving point
         shtyp(4), "shipment type
         route(6), "route
         vsbed(2), "shipping conds
        rkfkf like vbap-rkfkf, "method of billing for co/ppc orders
         zterm(4), "terms of payment key
         inco1(3), "F.O.B inco term1
         inco2(3), "F.O.B inco term2
         end of t_upload.
    Data: wa_upload like t_upload,
           i_upload like standard table of t_upload.
    Data:v_kunnr like kna1-kunnr,
          v_posnr like vbap-posnr,
          v_matnr like vbap-matnr,
          v_zmeng like vbap-zmeng,
          v_kunag like kna1-kunnr.
    *---Constants
    CONSTANTS: c_comma TYPE c VALUE ',',   " For splitting data at commas
               c_01(2) TYPE c VALUE '01',  " For movement code in Bapi
               c_b     TYPE c VALUE 'B',   " For mvt. Indicator in Bapi
               c_creat(5) TYPE c VALUE 'CREAT', " For button text
               c_clear(5) TYPE c VALUE 'CLEAR', " For clear button
               c_mvmt(4) TYPE c VALUE 'MVMT',
               c_ok(2)   TYPE c VALUE 'OK',
               c_error(5) TYPE c VALUE 'Error'.
    *--SELECTION SCREEN DESIGN--
    SELECTION-SCREEN BEGIN OF BLOCK blk1 WITH FRAME.
    PARAMETERS:     
                p_auart LIKE vbak-auart, " order type
                p_vkorg LIKE vbak-vkorg, " sales org
                p_vtweg LIKE vbak-vtweg, " dist channel
                p_spart LIKE vbak-spart, " division
                p_vkgrp LIKE vbak-vkgrp, " sales group
                p_vkbur LIKE vbak-vkbur, "sales office
                p_file(256) default 'c:/saleorder.txt'.         "File name
    SELECTION-SCREEN END OF BLOCK blk1.
    SELECTION-SCREEN PUSHBUTTON 15(10) v_create USER-COMMAND creat.
    SELECTION-SCREEN PUSHBUTTON 40(10) v_clear USER-COMMAND clear.
      INITIALIZATION -
    INITIALIZATION.
      v_create = c_creat .
      v_clear = c_clear.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
    PERFORM selectfile USING p_file.
    *--AT SELECTION_SCREEN--
    AT SELECTION-SCREEN .
      IF sy-ucomm = c_clear.
        PERFORM f_clear.
    ELSE.
       IF sy-ucomm <> c_mvmt.
    **--- Validating the input data.
         PERFORM f_check_inputs.
        ELSEif sy-ucomm = c_creat.
    *--- Validating the input data.
          PERFORM f_check_inputs.
    *-- Uploading the PO data.
          PERFORM f_PO_upload.
    *---checking the PO data
         PERFORM f_check_upload_data.
    *---create sales order from PO data
        PERFORM f_Sales_order_create.
        ENDIF.
    FORM f_PO_upload.
    gfilename = p_file.
      CALL FUNCTION 'WS_UPLOAD'
           EXPORTING
                filename                = gfilename
                filetype                = 'DAT'
           TABLES
                data_tab                = i_upload
           EXCEPTIONS
                conversion_error        = 1
                file_open_error         = 2
                file_read_error         = 3
                invalid_type            = 4
                no_batch                = 5
                unknown_error           = 6
                invalid_table_width     = 7
                gui_refuse_filetransfer = 8
                customer_error          = 9
                OTHERS                  = 10.
      IF sy-subrc <> 0.
        MESSAGE i398(00) WITH '(WS_UPLOAD)'
        ' Errors occured with exception '
         sy-subrc.
      ENDIF.
    ENDFORM.                    " f_PO_upload
    *&      Form  selectfile
          text
         -->P_P_FILE  text
    FORM selectfile CHANGING value(filename) TYPE c.
    CALL FUNCTION 'WS_FILENAME_GET'
           EXPORTING
                def_filename     = gfilename
                def_path         = 'C:\'
                mask             = ',*.txt.'
                mode             = 'O'
                title            = 'Select File Name'
           IMPORTING
                filename         = filename
           EXCEPTIONS
                inv_winsys       = 1
                no_batch         = 2
                selection_cancel = 3
                selection_error  = 4
                OTHERS           = 5.
    ENDFORM.                    " selectfile
    FORM f_Sales_order_create.
      PERFORM f_fill_header.
      PERFORM f_fill_partner.
      PERFORM f_fill_item.
      PERFORM f_call_BAPI.
    ENDFORM.                    " f_Sales_order_create
    *&      Form  f_fill_header
          text
    -->  p1        text
    <--  p2        text
    FORM f_fill_header.
    move p_auart to wa_header-doc_type.
    move p_vkorg to wa_header-sales_org.
    move p_vtweg to wa_header-distr_chan.
    move p_spart to wa_header-division.
    move p_vkgrp to wa_header-sales_grp.
    move p_vkbur to wa_header-sales_off.
    Read table i_upload into wa_upload index 1.
    move wa_upload-ebeln to wa_header-purch_no_c.
    move wa_upload-aedat to wa_header-purch_date.
    move wa_upload-bsart to wa_header-po_method.
    move wa_upload-vdatu to wa_header-req_date_h.
    move wa_upload-bstkd_e to wa_header-purch_no_s.
    *move wa_upload-route to wa_header-route.
    move wa_upload-vsbed to wa_header-ship_cond.
    move wa_upload-empst to wa_header-rec_point.
    move wa_upload-shtyp to wa_header-ship_type.
    move wa_upload-zterm to wa_header-pmnttrms.
    move wa_upload-inco1 to wa_header-incoterms1.
    move wa_upload-inco2 to wa_header-incoterms2.
    ENDFORM.                    " f_fill_header
    *&      Form  f_fill_partner
          text
    -->  p1        text
    <--  p2        text
    FORM f_fill_partner.
    if not wa_upload-kunnr is initial.
    select single kunnr from kna1 into v_kunnr
                where kunnr = wa_upload-kunnr.
    if sy-subrc <> 0.
    Message E014 with 'customer does not exist'.
    else.
    move 'AG' to i_partner-partn_role.
    move wa_upload-kunnr to i_partner-partn_numb.
    move wa_upload-land1_s to i_partner-country.
    move wa_upload-name1_s to i_partner-name.
    move wa_upload-name2_s to i_partner-name_2.
    move wa_upload-ort01_s to i_partner-city.
    move wa_upload-regio_s to i_partner-region.
    move wa_upload-pstlz_s to i_partner-postl_code.
    move wa_upload-adrnr_s to i_partner-address.
    append i_partner.
    endif.
    endif.
    if not wa_upload-kunag is initial.
    select single kunnr from kna1 into v_kunag
                where kunnr = wa_upload-kunag.
    if sy-subrc <> 0.
    Message E015 with 'end customer does not exist'.
    else.
    move 'WE' to i_partner-partn_role.
    move wa_upload-kunag to i_partner-partn_numb.
    move wa_upload-land1_c to i_partner-country.
    move wa_upload-name1_c to i_partner-name.
    move wa_upload-name2_c to i_partner-name_2.
    move wa_upload-ort01_c to i_partner-city.
    move wa_upload-regio_c to i_partner-region.
    move wa_upload-pstlz_c to i_partner-postl_code.
    move wa_upload-adrnr_c to i_partner-address.
    append i_partner.
    endif.
    endif.
    ENDFORM.                    " f_fill_partner
    *&      Form  f_fill_item
          text
    -->  p1        text
    <--  p2        text
    FORM f_fill_item.
    loop at i_upload into wa_upload.
    if not wa_upload-matnr is initial.
    select single  maramatnr msegmenge into (v_matnr, v_zmeng) from
                       mara inner join mseg on maramatnr = msegmatnr
                       where mara~matnr = wa_upload-matnr.
    if sy-subrc <> 0.
    Message E016 with 'material no does not exist'.
    elseif v_zmeng LT wa_upload-zmeng.
    Message E017 with 'order quantity is greater than the quantity present'.
      endif.
    endif.
    move wa_upload-posnr to i_item-itm_number.
    move wa_upload-pstyv to i_item-item_categ.
    move wa_upload-matnr to i_item-material.
    move wa_upload-zmeng to i_item-target_qty.
    move wa_upload-meins to i_item-target_qu.
    move wa_upload-werks to i_item-plant.
    *move wa_upload-meins to wa_vbap-meins.
    *move wa_upload-posnr_tot to wa_vbap-posnr_tot.
    move wa_upload-posex to i_item-po_itm_no.
    move wa_upload-kdmat to i_item-cust_mat22.
    move wa_upload-inco1 to i_item-incoterms1.
    move wa_upload-inco2 to i_item-incoterms2.
    move wa_upload-zterm to i_item-pmnttrms.
    move wa_upload-empst to i_item-rec_point.
    move wa_upload-shtyp to i_item-ship_type.
    move wa_upload-route to i_item-route.
    append i_item.
    PERFORM f_fill_schedule_line.
    PERFORM f_fill_conditions.
    ENDLOOP.
    ENDFORM.                    " f_fill_item
    *&      Form  f_fill_schedule_line
          text
    -->  p1        text
    <--  p2        text
    FORM f_fill_schedule_line.
    move wa_upload-matnr to i_schedule-itm_number.
    move sy-datum to i_schedule-req_date.
    move wa_upload-zmeng to i_schedule-req_qty.
    append i_schedule.
    ENDFORM.                    " f_fill_schedule_line
    *&      Form  f_fill_conditions
          text
    -->  p1        text
    <--  p2        text
    FORM f_fill_conditions.
    move wa_upload-matnr to i_cond-itm_number.
    move sy-datum to i_cond-conpricdat.
    append i_cond.
    ENDFORM.                    " f_fill_conditions
    *&      Form  f_clear
          text
    -->  p1        text
    <--  p2        text
    FORM f_clear.
    clear:p_auart,
          p_vkorg,
          p_vtweg,
          p_spart,
          p_vkgrp,
          p_vkbur.
    ENDFORM.                    " f_clear
    *&      Form  f_call_BAPI
          text
    -->  p1        text
    <--  p2        text
    FORM f_call_BAPI.
    clear:i_item,i_partner,i_schedule.
    CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'
      EXPORTING
      SALESDOCUMENTIN               =
        ORDER_HEADER_IN               = wa_header
      ORDER_HEADER_INX              =
      SENDER                        =
      BINARY_RELATIONSHIPTYPE       =
      INT_NUMBER_ASSIGNMENT         =
      BEHAVE_WHEN_ERROR             =
      LOGIC_SWITCH                  =
      TESTRUN                       =
      CONVERT                       = ' '
    IMPORTING
       SALESDOCUMENT                  = sorder
      TABLES
      RETURN                        =
       ORDER_ITEMS_IN                 = i_item
      ORDER_ITEMS_INX               =
        ORDER_PARTNERS                = i_partner
       ORDER_SCHEDULES_IN             = i_schedule
      ORDER_SCHEDULES_INX           =
      ORDER_CONDITIONS_IN            = i_cond.
      ORDER_CFGS_REF                =
      ORDER_CFGS_INST               =
      ORDER_CFGS_PART_OF            =
      ORDER_CFGS_VALUE              =
      ORDER_CFGS_BLOB               =
      ORDER_CFGS_VK                 =
      ORDER_CFGS_REFINST            =
      ORDER_CCARD                   =
      ORDER_TEXT                    =
      ORDER_KEYS                    =
      EXTENSIONIN                   =
      PARTNERADDRESSES              =
    if not ( sorder-vbeln is initial ).
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
    write: /'Order number:', sorder.
    else.
    loop at i_return.
    write: / i_return-id, i_return-number, i_return-message(80).
    endloop.
    *write: /'Error'.
    endif.
    *loop at i_return.
    *write: / i_return-id, i_return-number, i_return-message(80).
    *endloop.
    ENDFORM.                    " f_call_BAPI

    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

Maybe you are looking for

  • RFC calls with SAP JCO and IBM resource adapter for SAP - basic tuning

    Hi experts, we are working on a java portal connected to a backend system SAP by calling RFCs. On our first integration tests, it appears to be quite slow fetching data from SAP by calling the remote functions from the custom portal. We are using SAP

  • Language+Region

    Hi there, I bought a Lumia 620 in Dubai, I told the lady in charge that I live in the Netherlands and she assured me that I could use it in The Netherlands, a little naive, of course can I use in the Netherlands but I can't use it with the Dutch lang

  • Please help! Why are other people on my Network?

    So, today I noticed that there were two other users in my Network "folder". I can't get rid of them or even open them, because I'm not authorized. Which is more than a little disconcerting. So what does this mean? Am I getting worked up over nothing?

  • Can't upload photos to facebook from phone. Out of no where!!!!

    I was posting pictures to facebook with no problems and then about a month ago I tried to upload a photo from my BB Curve after loging on to facebook and facebook told me that "your browser does not support photo uploads"  Can someone help please!!!!

  • Exporting Captivate into Flash

    Hi, When I export my Captivate file to Flash MX 2004, the file has nothing in it. What am I doing wrong? Judy