Cancel
Showing results for 
Search instead for 
Did you mean: 

CSV2TCXML - Bulk Loader for BOM Uploads

Pioneer
Pioneer

Hi all,

 

I'm working on using CSV2TCXML and bulk loader to load some simple BOM's into my Teamcenter environment. Using the format from the Data Exchange manual, my upload is failing. Any help is much appreciated. Below are the details:

 

TC11.4 (RapidStart)

 

Here is the CSV for a single BOM line:

 

!parent_item|parent_rev|child_item|child_rev|PSOccurrence:seq_no|PSOccurrence:qty_value
000454|A|000455|A|10|1

 

I run the following command successfully to convert to TCXML: 

 

Tcperl csv2tcxml.perl BOMDataFile3.csv item=exist

 

Here's the import command:

 

tcxml_import -u=infodba -p=infodba -g=dba -bulk_load -file=e:\siemens\tcdata\csv2tcxml_perl\BOMDataFile3.csv.xml

 

Here is the error:

 

ERROR:[11072] Xml attribute [child_item = nNll2p5VPCpCRD] not found in database for [id9:PSOccurrence] element.

 

Thanks,

 

Aaron

 

 

12 REPLIES 12

Re: CSV2TCXML - Bulk Loader for BOM Uploads

Gears Phenom Gears Phenom
Gears Phenom

Hello, you do not have the Item in the database with UID=nNll2p5VPCpCRD


Did you import the Items before creating the BOM?

Highlighted

Re: CSV2TCXML - Bulk Loader for BOM Uploads

Pioneer
Pioneer

Yes, 000454 and 000455 preivously existed. I believe I created them manually. I'm not familiar with the UID. How would I determine if it exists?

 

-Aaron

Re: CSV2TCXML - Bulk Loader for BOM Uploads

Pioneer
Pioneer

I'm not sure if it matters, but we are using a subtype of Item, not Item itself. I also attempted to run this with parent_type and child_type in the csv, with identical results. 

Re: CSV2TCXML - Bulk Loader for BOM Uploads

Gears Phenom Gears Phenom
Gears Phenom

If you created them manually, then csv2tcxml will not see them, you should import Items also using csv2tcxml, then you will not have any problems.
If you create them manually, the UID will not match what csv2tcxml generates.
Perhaps there is a way to use manually created data, but I have not studied it yet.

Re: CSV2TCXML - Bulk Loader for BOM Uploads

Solution Partner Esteemed Contributor Solution Partner Esteemed Contributor
Solution Partner Esteemed Contributor
@PXHUNTER, you can validate the UID of the Item from the Rich Client using the "Print Object" view. In the Rich Client, Window > Show View > Other..., under Diagnostic select Print Object. Then select the Item and scroll to the bottom of the Print Object view to see the UID value. That value should be used in your TCXML.

For an easier way to create Items and structure look towards ps_upload (not to be confused with IPS_Upload which is a pay-for tool from Siemens PLM Services). I use this in conjunction with import_file to populate non-CAD datasets and Live Excel to populate Item/Item Revision properties. Basically, the poor man's migration method.
https://docs.plm.automation.siemens.com/tdoc/tc/11.4/help/#uid:ps_upload

I simply run:
ps_upload -u=infodba -p=infodba -g=dba -i=MyInputFile.txt

Where MyInputFile.txt:
# PSUP
#COL level item rev type name occs
#DELIMITER @
0@ 0@ A@ ACME4_DocHolder@ Customer Level@
1@ 0.1@ A@ ACME4_DocHolder@ My SYS@
1@ 0.2@ A@ ACME4_DocHolder@ My Subscriber@
1@ 0.3@ A@ ACME4_DocHolder@ My Block 1 Documents@
1@ 0.4@ A@ ACME4_DocHolder@ My Hosted Payloads@
1@ 0.5@ A@ ACME4_DocHolder@ My Launch Vehicles@
0@ 1@ A@ ACME4_DocHolder@ System Level@
1@ 1.1@ A@ ACME4_DocHolder@ System Interfaces@
1@ 1.2@ A@ ACME4_DocHolder@ System Requirements@
1@ 1.3@ A@ ACME4_DocHolder@ System Design Documents@
1@ 1.4@ A@ ACME4_DocHolder@ System Integration and Test@
1@ 1.5@ A@ ACME4_DocHolder@ System Verification@

Note: ACME4_DocHolder is my custom Item type.
Note: A space after the delimiter is intentional.
Note: Multiple assemblies are in the same file (level 0).

This will both create the Items and create the (imprecise) structure at the same time.

Randy Ellsworth, Teamcenter Architect, Applied CAx, LLC
NX 11 | SW 2016 | Creo 4 | TcUA 11.4
Evaluating: AW 3.4

Re: CSV2TCXML - Bulk Loader for BOM Uploads

Gears Phenom Gears Phenom
Gears Phenom
If they were created manually, you'll need to find the PUID's and create a PUID lookup file. CSV2TCXML has a different formula to create PUID's than when you do it via TC. It is assigning the PUID in the converted xml file per its formula and not looking it up in the database. What version of CSV2TCXML.perl are you using?

Regards,
Jamie Griffis
Jamie Griffis | PLM Solution Architect | Engineering USA

Re: CSV2TCXML - Bulk Loader for BOM Uploads

Pioneer
Pioneer

Thanks all for your help. In the current migration I'm working on, there is no issue with only using CSV2TCXML created items. I believe I've got everything working as needed for now. 

Re: CSV2TCXML - Bulk Loader for BOM Uploads

Solution Partner Experimenter Solution Partner Experimenter
Solution Partner Experimenter

I too had the same problem importing a DNC database of items from a c# created csv. The items went fine but the I tried to build structure with already existing engineering items.

It doesn't sound like this is possible...

Does the ps_upload happen to support occurrence types as that is very important to our solution and I don't see that anywhere

If not I suppose the best option would be ips_upload.

 

Thank you

Re: CSV2TCXML - Bulk Loader for BOM Uploads

Pioneer
Pioneer

@BobNisivoccia

 

As I mentioned above we ended up not needing it due to the nature of our upload. However, it is possible to create structures from a mix of new and existing items using CSV2TCXML. Jamie mentioned that you need to create a puid lookup file. Here's what the 11.4 Data Exchange documentations says about it:

 

puid_lookup_file

Specifies a lookup file containing separate lines of puid/item_id value pairs for standard key values or puid/item_id/object_type value sets for multifield key values. For example, for standard key values, the lines are formattted as:

 

puid-value|item_id-value!

puid-value|item_id-value!A

 

For multifield key values the lines are formatted as:

 

puid-value|item_id-value!object_type

puid-value|item_id-value!object_type!A

 

Instead of generating PUID values during the conversion process, the converter uses the file to obtain existing PUID values. Use this when the importing site has existing data, either created locally or previously migrated without using the converter, and you must migrate additional data that must be related to the existing data. You can generate the lookup file by running a simple SQL script to extract puid and item_id values from the Teamcenter database.

 

We liked the bulk loader method so much that we plan to set this up, enabling us to continue to use this method for bulk BOM uploads.

 

-Aaron