Skip to Content

Map an original filename as the DIR number in Import without using file properties.

Dec 19, 2017 at 01:07 AM


avatar image

I want to derive the filename and map to the document number field in the import dialog without the requirement of creating, mapping and entering a custom file property? Is there an attribute that is usable by the import that maps the original filename?

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Gerhard Himmelsbach
Dec 21, 2017 at 10:45 AM

Hi Neal,

I'm not sure, if I completely got your question. I'm also assuming you are talking about SAP ECTR.

Do you want to:

  1. use the filename as DIR number (external numbering)
  2. rename the file to the new DIR number (e.g. file box.prt gets renamed to 12345678.prt
  3. map the filename into an attribute in the DIR

Is your goal to preserve the filename?

Maybe you can also add a screenshot.



Show 5 Share
10 |10000 characters needed characters left characters exceeded

I recently found the article for preset values to the import on demand dialog:

I am using SAP ECTR with SolidWorks Integration. Can I set an attribute to read the filename without using a custom property definition in SolidWorks.

For instance, out of the box the import on demand dialog uses the filename for the description without having to define a custom property in the native file. Is that attribute available for use in the attributes-to-sap definition.

I have built my current attribute-to-sap with the line that retrieves the DIR Number "_DOCNUMBER" for the import from the file property "NUMBER". In the file properties in Solidworks I have set the value of the NUMBER property to $PRP:"SW-File Name". How can I replace the APPL_ATTRIBUTE name="NUMBER" with a value to give just the filename without having the custom property defined.

<APPL_ATTRIBUTE name="_DOCNUMBER">                                               
<APPL_ATTRIBUTE name="NUMBER"/>                               

In ECTR, when using the import tool in the Solidworks application the filename is automatically mapped to the description field in the import dialog. I want to map it to the Document Number field instead. I do not want to have to rely upon an application attribute.

Can I map this in the Attributes-to-SAP.xml ?

<APPL_ATTRIBUTE name="_DOCNUMBER">                                               
???  <what tag and = "name/> ??? application filename without extension                             

Hi Neal,

please try:

In attributes-to-sap.xml

<section name="EXAMPLE" include_section="" description="create only">





Then change in the corresponding dtype.xml

<document_create ... attribute_section=”EXAMPLE” ...>

Hope this helps.



Hello Neal,

small correction:

<section name="EXAMPLE" include_section="" description="create only"><br>  <APPL_ATTRIBUTE name="_DOCNUMBER"><br>    <APPL_ATTRIBUTE name="NAME_OF_THE_ATTRIBUTE_WITH_FILENAME"/><br>  </APPL_ATTRIBUTE><br></section>

(the underscore is important)

ECTR itself doesn't provide extra attributes, the CAD Integration has to provide some attribute with the value of the filename.
You have to ask the provider of the CAD Integration if there is a such attribute and what it's name is.

With kind Regards,

Thank you for your answers. I was hoping there was some method to capture the filename without the use of a custom property. I wanted to avoid the overhead of having to create a property in legacy files that have been stored offline. I will contact the vendor and share any positive developments.

Information for others that may read this thread...

In my case, I use the following xml to capture the value in the NUMBER property in Solidworks. The value is case sensitive and we have many groups working together an so I have included multiple values and use the first non empty value for the mapping.

In Solidworks itself, the property is written as $PRP:"SW-File Name" this is an environmental variable the evaluates as the filename.

For groups of multiple files, I use the SolidWorks Task Scheduler>Custom Properties Update utility to apply the $PRP:"SW-File Name" value to all files in a folder.

<section name="SLWMDE" description="Model mapping from SOLIDWORKS 3D to SAP">   
				<APPL_ATTRIBUTE name="Number"/>
				<APPL_ATTRIBUTE name="number"/>