Thursday, October 27, 2011

Pick Release API

Your Ad Here



CREATE OR REPLACE PROCEDURE APPS.xx_om_pick_release
(x_errbuf OUT VARCHAR2,
x_retcode OUT NUMBER
)
AS
CURSOR cur_delivery_details IS
SELECT 100 delivery_id,100 Trip_id
FROM wsh_delivery_details
WHERE delivery_detail_id = 100;---Hard coded value
p_api_version_number NUMBER :=1.0;
init_msg_list VARCHAR2(200);
x_msg_details VARCHAR2(3000);
x_msg_summary VARCHAR2(3000);
p_line_rows WSH_UTIL_CORE.ID_TAB_TYPE;
x_del_rows WSH_UTIL_CORE.ID_TAB_TYPE;
l_ship_method_code VARCHAR2(100);
i NUMBER;
l_commit VARCHAR2(30);
p_delivery_id NUMBER;
p_delivery_name VARCHAR2(30);
x_trip_id VARCHAR2(30);
x_trip_name VARCHAR2(30);
fail_api EXCEPTION;
l_picked_flag VARCHAR2(10);
l_return_status VARCHAR2(1000);
l_msg_count NUMBER;
l_msg_data VARCHAR2(1000);
ln_user_id number := fnd_profile.value('USER_ID');
ln_trip_id number;
lv_trip_name varchar2(30);
x_return_status varchar2(10);
x_msg_count number;
x_msg_data varchar2(500);

BEGIN
-- FND_GLOBAL.APPS_INITIALIZE (user_id, resp_id, app_id, NULL);
-- Initialize return status
x_return_status := WSH_UTIL_CORE.G_RET_STS_SUCCESS;
i := 0;
-- FOR row_delivery_details IN cur_delivery_details
-- LOOP
dbms_output.put_line( 'Before API');
wsh_deliveries_pub.delivery_action
( p_api_version_number => 1.0,
p_init_msg_list => NULL,
x_return_status => x_return_status,
x_msg_count => x_msg_count,
x_msg_data => x_msg_data,
p_action_code => 'PICK-RELEASE',
p_delivery_id => 13486,
p_delivery_name => 13486,
-- p_asg_trip_id = 100,
x_trip_id => ln_trip_id,
x_trip_name => lv_trip_name
);
commit;
IF (x_return_status <> WSH_UTIL_CORE.G_RET_STS_SUCCESS) THEN
RAISE fail_api;
ELSE
fnd_file.put_line(fnd_file.log, 'Success: Pick release');
dbms_output.put_line( 'Success: Pick release'||' '||x_trip_id);
END IF;
-- END LOOP; --row_delivery_details

EXCEPTION
WHEN fail_api THEN
WSH_UTIL_CORE.get_messages('Y', x_msg_summary, x_msg_details, x_msg_count);

IF x_msg_count > 1 THEN
x_msg_data := x_msg_summary || x_msg_details;
ELSE
x_msg_data := x_msg_summary || x_msg_details;
END IF;

END xx_om_pick_release;
Your Ad Here

0 comments:

Post a Comment