SELECT *
FROM (SELECT hp.party_number,
hp.party_name,
hp.status,
DECODE (NVL (hpu.party_usage_code, hp.party_type),
'ORGANIZATION', 'CUSTOMER',
NVL (hpu.party_usage_code, hp.party_type))
party_type
FROM hz_party_usg_assignments hpu, hz_parties hp
WHERE hp.party_id = hpu.party_id(+))
ORDER BY party_type
Sunday, 29 May 2016
Friday, 13 May 2016
How to send report output to printer (fnd_request.add_printer)
PROCEDURE CLC_LOT_CONT_MAT_PRG (
errbuf OUT VARCHAR2,
retcode OUT NUMBER,
--v_req_id OUT NUMBER,
--v_dev_status OUT VARCHAR2,
--v_dev_phase OUT VARCHAR2,
--v_request_status OUT BOOLEAN,
Receipt_from number,
Receipt_to number
) IS
v_req_id NUMBER;
v_dev_status VARCHAR2 (2000);
v_dev_phase VARCHAR2 (2000);
v_request_status BOOLEAN;
v_layout BOOLEAN;
--v_request_status BOOLEAN;
v_phase VARCHAR2 (2000);
v_wait_status VARCHAR2 (2000);
--v_dev_phase VARCHAR2 (2000);
--v_dev_status VARCHAR2 (2000);
v_message VARCHAR2 (2000);
lc_printer_name VARCHAR2 (200);
lc_boolean BOOLEAN;
lc_boolean1 BOOLEAN;
BEGIN
FND_FILE.PUT_LINE(FND_FILE.LOG,' Starting of CLC_LOT_CONT_MAT program');
v_req_id :=NULL;
FND_FILE.PUT_LINE(FND_FILE.LOG,' Initializing Apps');
FND_GLOBAL.Apps_Initialize(FND_GLOBAL.USER_ID, FND_GLOBAL.RESP_ID, FND_GLOBAL.RESP_APPL_ID);
Begin
select PRINTER_NAME
into lc_printer_name
from apps.WSH_REPORT_PRINTERS
where concurrent_program_ID = '214997'
and LEVEL_TYPE_ID = '10004'
and ENABLED_FLAG ='Y'
and level_value_id = FND_GLOBAL.USER_ID
and rownum =1;
Exception when others then
lc_printer_name := null;
end;
-- Set printer options
lc_boolean :=
fnd_submit.set_print_options (printer => lc_printer_name--'noprint'--'OP_HP4050_Legal'--lc_printer_name
,style => 'PDF Publisher'
,copies => 1
);
if lc_boolean then
FND_FILE.PUT_LINE(FND_FILE.LOG,'l_boolean');
end if;
--Add printer
lc_boolean1 :=
fnd_request.add_printer (printer => lc_printer_name--'noprint'--'OP_HP4050_Legal'--lc_printer_name
,copies => 1);
if lc_boolean1 then
FND_FILE.PUT_LINE(FND_FILE.LOG,'lc_boolean1');
end if;
v_layout := FND_REQUEST.ADD_LAYOUT('GEPSINV'
,'CLC_LOT_CONT_MAT'
,'en'
,'US'
,'PDF');
v_req_id:= FND_REQUEST.SUBMIT_REQUEST(
'GEPSINV',
'CLC_LOT_CONT_MAT',
'',
'',
FALSE,
Receipt_from,
Receipt_to);
commit;
FND_FILE.PUT_LINE(FND_FILE.LOG,' Submitted the CLC_LOT_CONT_MAT Program' || '-'|| v_req_id);
FND_FILE.PUT_LINE(FND_FILE.LOG,' Waiting for the CLC_LOT_CONT_MAT Program');
v_request_status:=
fnd_concurrent.wait_for_request
(request_id => v_req_id,
interval => 5,
max_wait => 600,
phase => v_phase,
status => v_wait_status,
dev_phase => v_dev_phase,
dev_status => v_dev_status,
MESSAGE => v_message);
commit;
FND_FILE.PUT_LINE(FND_FILE.LOG,' CLC_LOT_CONT_MAT Program Request Phase' || '-'|| v_dev_phase);
FND_FILE.PUT_LINE(FND_FILE.LOG,' CLC_LOT_CONT_MAT Program Request Dev status' || '-'|| v_dev_status);
FND_FILE.PUT_LINE(FND_FILE.LOG,' Ending of CLC_LOT_CONT_MAT');
EXCEPTION
WHEN OTHERS THEN
v_req_id := null;
FND_FILE.PUT_LINE(FND_FILE.LOG,' Ending of Bursting Procedure GEPS_BURSTING_PRG');
END CLC_LOT_CONT_MAT_PRG;
errbuf OUT VARCHAR2,
retcode OUT NUMBER,
--v_req_id OUT NUMBER,
--v_dev_status OUT VARCHAR2,
--v_dev_phase OUT VARCHAR2,
--v_request_status OUT BOOLEAN,
Receipt_from number,
Receipt_to number
) IS
v_req_id NUMBER;
v_dev_status VARCHAR2 (2000);
v_dev_phase VARCHAR2 (2000);
v_request_status BOOLEAN;
v_layout BOOLEAN;
--v_request_status BOOLEAN;
v_phase VARCHAR2 (2000);
v_wait_status VARCHAR2 (2000);
--v_dev_phase VARCHAR2 (2000);
--v_dev_status VARCHAR2 (2000);
v_message VARCHAR2 (2000);
lc_printer_name VARCHAR2 (200);
lc_boolean BOOLEAN;
lc_boolean1 BOOLEAN;
BEGIN
FND_FILE.PUT_LINE(FND_FILE.LOG,' Starting of CLC_LOT_CONT_MAT program');
v_req_id :=NULL;
FND_FILE.PUT_LINE(FND_FILE.LOG,' Initializing Apps');
FND_GLOBAL.Apps_Initialize(FND_GLOBAL.USER_ID, FND_GLOBAL.RESP_ID, FND_GLOBAL.RESP_APPL_ID);
Begin
select PRINTER_NAME
into lc_printer_name
from apps.WSH_REPORT_PRINTERS
where concurrent_program_ID = '214997'
and LEVEL_TYPE_ID = '10004'
and ENABLED_FLAG ='Y'
and level_value_id = FND_GLOBAL.USER_ID
and rownum =1;
Exception when others then
lc_printer_name := null;
end;
-- Set printer options
lc_boolean :=
fnd_submit.set_print_options (printer => lc_printer_name--'noprint'--'OP_HP4050_Legal'--lc_printer_name
,style => 'PDF Publisher'
,copies => 1
);
if lc_boolean then
FND_FILE.PUT_LINE(FND_FILE.LOG,'l_boolean');
end if;
--Add printer
lc_boolean1 :=
fnd_request.add_printer (printer => lc_printer_name--'noprint'--'OP_HP4050_Legal'--lc_printer_name
,copies => 1);
if lc_boolean1 then
FND_FILE.PUT_LINE(FND_FILE.LOG,'lc_boolean1');
end if;
v_layout := FND_REQUEST.ADD_LAYOUT('GEPSINV'
,'CLC_LOT_CONT_MAT'
,'en'
,'US'
,'PDF');
v_req_id:= FND_REQUEST.SUBMIT_REQUEST(
'GEPSINV',
'CLC_LOT_CONT_MAT',
'',
'',
FALSE,
Receipt_from,
Receipt_to);
commit;
FND_FILE.PUT_LINE(FND_FILE.LOG,' Submitted the CLC_LOT_CONT_MAT Program' || '-'|| v_req_id);
FND_FILE.PUT_LINE(FND_FILE.LOG,' Waiting for the CLC_LOT_CONT_MAT Program');
v_request_status:=
fnd_concurrent.wait_for_request
(request_id => v_req_id,
interval => 5,
max_wait => 600,
phase => v_phase,
status => v_wait_status,
dev_phase => v_dev_phase,
dev_status => v_dev_status,
MESSAGE => v_message);
commit;
FND_FILE.PUT_LINE(FND_FILE.LOG,' CLC_LOT_CONT_MAT Program Request Phase' || '-'|| v_dev_phase);
FND_FILE.PUT_LINE(FND_FILE.LOG,' CLC_LOT_CONT_MAT Program Request Dev status' || '-'|| v_dev_status);
FND_FILE.PUT_LINE(FND_FILE.LOG,' Ending of CLC_LOT_CONT_MAT');
EXCEPTION
WHEN OTHERS THEN
v_req_id := null;
FND_FILE.PUT_LINE(FND_FILE.LOG,' Ending of Bursting Procedure GEPS_BURSTING_PRG');
END CLC_LOT_CONT_MAT_PRG;
Subscribe to:
Posts (Atom)