Sunteți pe pagina 1din 3

We have created a table called xxoando_iproc_item_load.

This is the table schema create table xxoando_iproc_item_load( category_name varchar2(500), item_number varchar2(25), item_description varchar2(240), supplier varchar2(240), supplier_site varchar2(100), price number, uom varchar2(30), currency varchar2(4), long_description varchar2(2000), lead_time number ); users will create an excel sheet to load into this table using TOAD. It is expec ted that the columns in the excel sheet should match the table columns in order. That is to say our excel sheet will have category_name as the first column, item _number as the second one, item_description as the third e.t.c The are two ways to do item loading. If the supplier name and supplier site do n ot exist in iprocurement, a new item is created. If however they both exist, then the item is updated. When doing an update there fore, we can choose to leave certain columns in our excel sheet blank. So for example if we want to update only the price of the item, we can add only the supplier name , supplier_site and price columns in our excel sheet and leave the other columns e mpty. Please remember that the rule still applies, the columns must be in exactly the same order as in the database column. The onl y difference will be that most of them will be blank since we are only updating one or two columns. Now, say we're done uploading into our staging table, we now run our concurrent program, Oando iProcurement Item Loader. In case any modifications need to be made in the future this is a PL/SQL concurr ent program and the procedure is XXOANDO_IPROC_LOAD. As at the time of writing, this is the code for this concurrent program. CREATE OR REPLACE PROCEDURE XXOANDO_IPROC_LOAD(errbuff out varchar2, retcode out varchar2) IS cursor c_item is select * from xxoando_iproc_item_load; v_item c_item%ROWTYPE; -- others -- v_array to hold name/value type item_va is varray(9) of varchar2(500); type item_value_va is varray(9) of varchar2(500); v_item_attr item_va; v_item_val item_value_va; BEGIN dbms_output.put_line(null); fnd_file.put_line(fnd_file.output, '<?xml version="1.0"?>'); fnd_file.put_line(fnd_file.output, '<CATALOG xml:lang="EN-US">'); fnd_file.put_line(fnd_file.output, '<ADMIN>'); fnd_file.put_line(fnd_file.output, '<NAME>Oando Plc</NAME>'); fnd_file.put_line(fnd_file.output, '<INFORMATION>'); fnd_file.put_line(fnd_file.output, '<DATE>' to_char(sysdate, 'DD-MON-RRRR')

'</DATE>'); fnd_file.put_line(fnd_file.output, '<SOURCE>IT OANDO</SOURCE>'); fnd_file.put_line(fnd_file.output, '</INFORMATION>'); fnd_file.put_line(fnd_file.output, '</ADMIN>'); fnd_file.put_line(fnd_file.output, '<DATA>'); open c_item; loop fetch c_item into v_item; exit when c_item%NOTFOUND; fnd_file.put_line(fnd_file.output, '<ITEM ACTION="SYNC">'); fnd_file.put_line(fnd_file.output, '<OWNER>'); fnd_file.put_line(fnd_file.output, '<NAME>' v_item.category_name '</NAME> '); fnd_file.put_line(fnd_file.output, '</OWNER>'); -- load the v_array v_item_attr := item_va('SUPPLIER', 'SUPPLIER_PART_NUM', 'DESCRIPTION', 'PRICE', 'UOM', 'CURRENCY', 'LONG_DESCRIPTION', 'LEAD_TIME', 'PICTURE', 'THUMBNAIL_IMAGE '); v_item_val := item_value_va(trim(v_item.supplier), trim(v_item.item_number), t rim(v_item.item_description), round(v_item.price,2), trim(v_item.uom), trim(v_it em.currency), trim(v_item.long_description), trim(v_item.lead_time), 'http://10.10.9.28:8080/iprocurement/' trim(v_item.item_number) '-L.jpg', 'http://10.10.9.28:8080/iprocurement/' trim(v_item.item_number) '-S.jpg' ); for i in v_item_attr.first..v_item_attr.last loop -- only load items with values if nvl(v_item_val(i), null) is not null then fnd_file.put_line(fnd_file.output, '<NAMEVALUE>'); fnd_file.put_line(fnd_file.output, '<NAME>' v_item_attr(i) '</NAME>'); fnd_file.put_line(fnd_file.output, '<VALUE>' v_item_val(i) '</VALUE>'); fnd_file.put_line(fnd_file.output, '</NAMEVALUE>'); end if; end loop; fnd_file.put_line(fnd_file.output, '</ITEM>'); end loop; close c_item; fnd_file.put_line(fnd_file.output, '</DATA>'); fnd_file.put_line(fnd_file.output, '</CATALOG>'); fnd_file.close; END XXOANDO_IPROC_LOAD; / After this program is done, we click on "View Output" in internet explorer. Then click on File -> Save The file name can be item_load, and we should save as type XML. Now we're almost done. We now go into the " Internet Procurement Catalog Administration" responsibility . Click on the "Load Data and Schema" link on the right, it will open up to disp lay another smaller link. The link is "Manage Loading". Click on it. In the new screen, we see a button that says "Upload items". Click it. Click on the "Browse" button and find the xml file we have just saved. Then sele ct it. Click "Continue"

On the next screen, set "Negotiated Prices" to No. Don't select the option to apply category mapping. select "No, use the values fr om the file" Then click "Upload" This will come up with a new job that has a status of Pending. We can click on t he Go button continuosly to see what the program is up to. Note that Job column in this list contains the request_id, which is the same as in fnd_concurrent_requests. That's it. when it's done we can view the item to see if the changes have been a pplied. Loading Images ============= We are using a naming convention for the item images. These are itemnumber-L.jpg and itemnumber-S.jpg. So, itemnumber-L is the larger image and -S is the thumbnail image. For every item we load, we need to put up the images files in the apache server folder. The apache folder is located on server05 (ask network admins about this) The folder name is C:\apache\apache\iprocurement That is all.

S-ar putea să vă placă și