Hi everybody,
I am using IFS v9 and I need to print a particular delivery note via pl/sql.
I have tried the following code (which I am not sure will work)
set SERVEROUTPUT ON
DECLARE
conf_attr_ VARCHAR2(4000);
ordrsp_site_ VARCHAR2(5);
change_online_ VARCHAR2(4000);
media_code_ VARCHAR2(40);
report_attr_ VARCHAR2(2000);
parameter_attr_ VARCHAR2(2000);
attr_ VARCHAR2(200);
printer_id_ VARCHAR2(100);
result_key_ NUMBER;
print_job_id_ NUMBER;
delnote_no_ VARCHAR2(15);
count_ NUMBER := 0;
BEGIN
IFSAPP.Client_SYS.Clear_Attr(report_attr_);
IFSAPP.Client_SYS.Clear_Attr(parameter_attr_);
IFSAPP.Client_SYS.Add_To_Attr('REPORT_ID', 'SHIPMENT_DELIVERY_NOTE_REP', report_attr_);
IFSAPP.Client_SYS.Add_To_Attr('DELNOTE_NO', 200, parameter_attr_);
printer_id_ := IFSAPP.Printer_Connection_API.Get_Default_Printer('IFSAPP', 'SHIPMENT_DELIVERY_NOTE_REP');
DBMS_OUTPUT.PUT_LINE('printer_id : ' || printer_id_ );
IFSAPP.Client_SYS.Clear_Attr(attr_);
IFSAPP.Client_SYS.Add_To_Attr('PRINTER_ID', printer_id_, attr_);
IFSAPP.Print_Job_API.New(print_job_id_, attr_);
IFSAPP.Archive_API.New_Instance(result_key_, report_attr_, parameter_attr_);
DBMS_OUTPUT.PUT_LINE('RESULT_KEY : ' || result_key_ );
IFSAPP.Client_SYS.Clear_Attr(attr_);
IFSAPP.Client_SYS.Add_To_Attr('PRINT_JOB_ID', print_job_id_, attr_);
IFSAPP.Client_SYS.Add_To_Attr('RESULT_KEY', result_key_, attr_);
IFSAPP.Client_SYS.Add_To_Attr('OPTIONS', 'COPIES(1)', attr_);
IFSAPP.Print_Job_Contents_API.New_Instance(attr_);
IF (print_job_id_ IS NOT NULL) THEN
IFSAPP.Print_Job_API.Print(print_job_id_);
END IF;
END;
and I get the following error.
ORA-20111: UserAllowedSite.RECNOTEXIST: Site is not allowed for User TBO
What should I do to solve it ?
Thank you for your help.