根據delivery_detail_id建立交貨號

lflyingfox發表於2007-09-04

根據delivery_detail_id建立交貨號

[@more@]

SET SERVEROUTPUT ON SIZE 100000
DECLARE
p_api_version_number NUMBER;
p_commit VARCHAR2(30);
x_return_status VARCHAR2(2000);
x_msg_count NUMBER;
x_msg_data VARCHAR2(2000);
p_line_rows WSH_UTIL_CORE.ID_TAB_TYPE;
x_del_rows WSH_UTIL_CORE.ID_TAB_TYPE;

BEGIN

p_api_version_number := 1.0;
p_line_rows(1) := 439300;
p_line_rows(2) := 439301;
--p_line_rows(3) := 214179;


wsh_delivery_details_pub.autocreate_deliveries
(
p_api_version_number => p_api_version_number,
p_init_msg_list => FND_API.G_TRUE,
p_commit => FND_API.G_FALSE,
x_return_status => x_return_status,
x_msg_count => x_msg_count,
x_msg_data => x_msg_data,
p_line_rows => p_line_rows,
x_del_rows => x_del_rows

);

IF (x_return_status = WSH_UTIL_CORE.G_RET_STS_SUCCESS) THEN
COMMIT;
dbms_output.put_line('Return Status = '|| SUBSTR (x_return_status,1,255));
dbms_output.put_line('Delivery Id = '|| TO_CHAR(x_del_rows(1)));
ELSE
dbms_output.put_line('Return Status = '|| SUBSTR (x_return_status,1,255));
dbms_output.put_line('Msg Count = '|| TO_CHAR(x_msg_count));
dbms_output.put_line('Delivery detail Id = '|| TO_CHAR(p_line_rows(1)));
dbms_output.put_line('Msg Data = '|| SUBSTR (x_msg_data,1,255));

--IF x_msg_count >1 THEN
FOR I IN 1..10 LOOP
dbms_output.put_line(I||'. '|| SUBSTR (FND_MSG_PUB.Get(p_encoded => FND_API.G_FALSE ), 1, 255));
END LOOP;
--END IF;
END IF;
END;
/

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/132092/viewspace-967877/,如需轉載,請註明出處,否則將追究法律責任。

相關文章