45:
46: l_debug number := NVL(FND_PROFILE.VALUE('INV_DEBUG_TRACE'),0);
47: BEGIN
48: -- Initialize API return status to success
49: x_return_status := FND_API.G_RET_STS_SUCCESS;
50:
51: -- Get profile values for output directory
52: -- and output file prefix
53: FND_PROFILE.GET('WMS_LABEL_OUTPUT_DIRECTORY', l_output_dir);
54: IF (l_output_dir IS NULL) OR (trim(l_output_dir) = '') THEN
55: IF (l_debug = 1) THEN
56: trace(' WMS_LABEL_OUTPUT_DIRECTORY is null, can not write XML file ');
57: END IF;
58: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
59: END IF;
60: FND_PROFILE.GET('WMS_LABEL_FILE_PREFIX', l_output_file_prefix);
61: IF (l_debug = 1) THEN
62: trace(' Profile value obtained, dir='||l_output_dir ||', prefix='|| l_output_file_prefix);
104: trace('ERROR CODE = ' || SQLCODE);
105: trace('ERROR MESSAGE = ' || SQLERRM);
106: END IF;
107: utl_file.fclose(l_file_handler);
108: x_return_status := FND_API.G_RET_STS_ERROR;
109: x_msg_data := SQLERRM;
110: WHEN fnd_api.g_exc_error THEN
111: IF (l_debug = 1) THEN
112: trace(' Expected Error In '|| G_PKG_NAME||'.write_xml');
106: END IF;
107: utl_file.fclose(l_file_handler);
108: x_return_status := FND_API.G_RET_STS_ERROR;
109: x_msg_data := SQLERRM;
110: WHEN fnd_api.g_exc_error THEN
111: IF (l_debug = 1) THEN
112: trace(' Expected Error In '|| G_PKG_NAME||'.write_xml');
113: trace('ERROR CODE = ' || SQLCODE);
114: trace('ERROR MESSAGE = ' || SQLERRM);
113: trace('ERROR CODE = ' || SQLCODE);
114: trace('ERROR MESSAGE = ' || SQLERRM);
115: END IF;
116: utl_file.fclose(l_file_handler);
117: x_return_status := FND_API.G_RET_STS_ERROR;
118: x_msg_data := SQLERRM;
119: WHEN fnd_api.g_exc_unexpected_error THEN
120: IF (l_debug = 1) THEN
121: trace(' Unexpected Error In '|| G_PKG_NAME||'.write_xml');
115: END IF;
116: utl_file.fclose(l_file_handler);
117: x_return_status := FND_API.G_RET_STS_ERROR;
118: x_msg_data := SQLERRM;
119: WHEN fnd_api.g_exc_unexpected_error THEN
120: IF (l_debug = 1) THEN
121: trace(' Unexpected Error In '|| G_PKG_NAME||'.write_xml');
122: trace('ERROR CODE = ' || SQLCODE);
123: trace('ERROR MESSAGE = ' || SQLERRM);
122: trace('ERROR CODE = ' || SQLCODE);
123: trace('ERROR MESSAGE = ' || SQLERRM);
124: END IF;
125: utl_file.fclose(l_file_handler);
126: x_return_status := FND_API.G_RET_STS_ERROR;
127: x_msg_data := SQLERRM;
128: WHEN others THEN
129: IF (l_debug = 1) THEN
130: trace(' Other Error In '|| G_PKG_NAME||'.write_xml');
131: trace('ERROR CODE = ' || SQLCODE);
132: trace('ERROR MESSAGE = ' || SQLERRM);
133: END IF;
134: utl_file.fclose(l_file_handler);
135: x_return_status := FND_API.G_RET_STS_ERROR;
136: x_msg_data := SQLERRM;
137: END WRITE_XML;
138:
139: PROCEDURE GET_REQUEST_STATUS
184: --End of fix for 5004303
185:
186: BEGIN
187: -- Initialize API return status to success
188: x_return_status := FND_API.G_RET_STS_SUCCESS;
189:
190: -- Search for the occurrent of _PRINTERNAME in the p_xml_content
191: -- from the end, until found a PRINTERNAME which is not null
192: l_printer_name := null;
219: trace('Printer name is null, can not process');
220: END IF;
221: fnd_message.set_name('WSH','WSH_PRINTER_NAME_REQUIRED'); --Printer name is required
222: x_return_msg := fnd_message.get();
223: raise fnd_api.G_EXC_ERROR;
224: END IF;
225:
226: IF l_debug = 1 THEN
227: trace('Found PRINTER NAME as '||l_printer_name);
239: END IF;
240: fnd_message.set_name('INV','INV_NO_IP_PORT'); -- Invalid Printer, can not find IP address and port number
241: fnd_message.set_token('PRINTER',l_printer_name); -- Invalid Printer, can not find IP address and port number
242: x_return_msg := fnd_message.get();
243: raise fnd_api.G_EXC_ERROR;
244: WHEN others THEN
245: IF l_debug = 1 THEN
246: trace('Other error when getting IP address and port number for printer '||l_printer_name);
247: END IF;
244: WHEN others THEN
245: IF l_debug = 1 THEN
246: trace('Other error when getting IP address and port number for printer '||l_printer_name);
247: END IF;
248: raise fnd_api.G_EXC_UNEXPECTED_ERROR;
249: END;
250: IF l_debug = 1 THEN
251: trace('IP address:'||l_ip_address||', Port number:'||l_port_number);
252: trace('Calling SEND_XML_TCPIP ');
277: END IF;
278:
279: IF l_return = -1 THEN
280: x_return_msg := l_return_msg;
281: raise fnd_api.G_EXC_ERROR;
282: END IF;
283:
284: x_printer_status := l_printer_status;
285:
283:
284: x_printer_status := l_printer_status;
285:
286: EXCEPTION
287: WHEN fnd_api.G_EXC_ERROR THEN
288: IF l_debug = 1 THEN
289: trace('Expected Error in SYNC_PRINT_TCPIP');
290: trace('ERROR Code ='||SQLCODE);
291: trace('ERROR Message='||SQLERRM);
289: trace('Expected Error in SYNC_PRINT_TCPIP');
290: trace('ERROR Code ='||SQLCODE);
291: trace('ERROR Message='||SQLERRM);
292: END IF;
293: x_return_status := fnd_api.G_RET_STS_ERROR;
294: WHEN fnd_api.G_EXC_UNEXPECTED_ERROR THEN
295: IF l_debug = 1 THEN
296: trace('Unexpected Error in SYNC_PRINT_TCPIP');
297: trace('ERROR Code ='||SQLCODE);
290: trace('ERROR Code ='||SQLCODE);
291: trace('ERROR Message='||SQLERRM);
292: END IF;
293: x_return_status := fnd_api.G_RET_STS_ERROR;
294: WHEN fnd_api.G_EXC_UNEXPECTED_ERROR THEN
295: IF l_debug = 1 THEN
296: trace('Unexpected Error in SYNC_PRINT_TCPIP');
297: trace('ERROR Code ='||SQLCODE);
298: trace('ERROR Message='||SQLERRM);
296: trace('Unexpected Error in SYNC_PRINT_TCPIP');
297: trace('ERROR Code ='||SQLCODE);
298: trace('ERROR Message='||SQLERRM);
299: END IF;
300: x_return_status := fnd_api.G_RET_STS_UNEXP_ERROR;
301: WHEN others THEN
302: IF l_debug = 1 THEN
303: trace('Other Error in SYNC_PRINT_TCPIP');
304: trace('ERROR Code ='||SQLCODE);
303: trace('Other Error in SYNC_PRINT_TCPIP');
304: trace('ERROR Code ='||SQLCODE);
305: trace('ERROR Message='||SQLERRM);
306: END IF;
307: x_return_status := fnd_api.G_RET_STS_UNEXP_ERROR;
308: END SYNC_PRINT_TCPIP;
309:
310: /*
311: * Method for sending a string to a TCP-IP address. Used to send the