Sample :
--MDS [SCHEDULE_DESIG]
--Forecast [FORECAST_DESIG]
SET serveroutput ON;
DECLARE
xRequestId NUMBER;
vOrganizationId NUMBER := 00;
vScheduleDesignator VARCHAR2(10) := 'MDS';
BEGIN
fnd_global.apps_initialize(user_id => 00, resp_id => 00,
resp_appl_id => 00);
xRequestId := Fnd_Request.Submit_Request('MRP', 'MRCPRG', '', '', FALSE,
vOrganizationId,
vScheduleDesignator,
'SCHEDULE_DESIG', chr(0));
IF (xRequestId > 0) THEN
COMMIT;
dbms_output.put_line('Request Id : ' || xRequestId);
ELSE
dbms_output.put_line('Failed');
END IF;
END;
-- Others
SET serveroutput ON;
DECLARE
xRequestId NUMBER;
xRequestReturnStatus BOOLEAN;
xPhase VARCHAR2(40);
xStatus VARCHAR2(40);
xDevPhase VARCHAR2(40);
xDevStatus VARCHAR2(40);
xMessage VARCHAR2(2000);
vOrganizationId NUMBER := 00;
vScheduleDesignator VARCHAR2(10) := 'MDS';
BEGIN
fnd_global.apps_initialize(user_id => 00, resp_id => 00,
resp_appl_id => 00);
xRequestId := Fnd_Request.Submit_Request('MRP', 'MRCPRG', '', '', FALSE,
vOrganizationId,
vScheduleDesignator,
'SCHEDULE_DESIG', chr(0));
IF (xRequestId > 0) THEN
COMMIT;
dbms_output.put_line('Request Id : ' || xRequestId);
LOOP
xRequestReturnStatus :=fnd_concurrent.wait_for_request(request_id => xRequestId,
INTERVAL => 60, max_wait => 0,
phase => xPhase, status => xStatus,
dev_phase => xDevPhase,
dev_status => xDevStatus,
message => xMessage);
EXIT WHEN upper(xPhase) = 'COMPLETED' OR upper(xStatus) IN('CANCELLED',
'ERROR',
'TERMINATED');
END LOOP;
ELSE
dbms_output.put_line(' Failed ');
END IF;
END;
沒有留言:
張貼留言