Page tree
Skip to end of metadata
Go to start of metadata

Attribute transfer to SAP

Physical properties and configuration specific properties can be transferred to SAP by SAP Engineering Control Center Interface to SOLIDWORKS.

For physical properties, the following customizing need to be added to the attributes-to-sap.xml:

attributes-to-sap.xml
<section name="SLWMDL" description="Model mapping from SOLIDWORKS 3D to SAP">
    <MA field="NET_WEIGHT">
      <APPL_ATTRIBUTE name="$(variant)-PP-Weight" />
    </MA>
    <MA field="UNIT_OF_WT">
      <APPL_ATTRIBUTE name="$(variant)-PP-WeightUnit" />
    </MA>
</section>

 

In the same way, the customizing for configuration specific properties is done.

For example to transfer the configuration specific property “SLW_MATERIAL” to SAP only the prefix “$(variant)-“ must be added to the property name in the attributes-to-sap.xml.

 

attributes-to-sap.xml
<MA field="BASIC_MATL_NEW">
      <APPL_ATTRIBUTE name="$(variant)-SLW_Material" />
</MA>

Attribute transfer from SAP

 

To transfer attributes from SAP to SOLIDWORKS the attribute name must be built like this: $(variant:<VARIANT_EXTERNAL_ID>)-<PROPERTY_NAME>

To send properties with such names from ECTR to SOLIDWORKS it is necessary to implement the BAdI /DSCSAG/ENH_DOC~DOC_GET_ATTRIBS_AFTER of Enhancement-Spot /DSCSAG/PLM_DOCUMENT. In this BAdI the properties can be selected from SAP and the property names can be built like mentioned above.

The following code block shows a snippet which sends the material number of the material linked to the CAD Variant (SOLIDWORKS configuration) to the configuration specific property “MATNR”:

Implementation of /DSCSAG/ENH_DOC~DOC_GET_ATTRIBS_AFTER
DATA: ls_requested_var_data TYPE cdesk_srv_s_requested_var_data,
      lt_generic_doc_key    TYPE TABLE OF cdesk_srv_s_var_gen_doc_key,
      ls_generic_doc_key    LIKE LINE OF lt_generic_doc_key,
      lt_variant_data       TYPE TABLE OF cdesk_srv_s_variant,
      lt_var_mat_link       TYPE TABLE OF cdesk_srv_s_var_mat_link,
      ls_customerattributes LIKE LINE OF ct_customerattributes.

      FIELD-SYMBOLS: <ls_variant_data> LIKE LINE OF lt_variant_data,
                     <ls_var_mat_link> LIKE LINE OF lt_var_mat_link.

      ls_requested_var_data-variant = abap_true.
      ls_requested_var_data-var_mat_link = abap_true.
      ls_generic_doc_key-gen_doc_type = is_documentkey-documenttype.
      ls_generic_doc_key-gen_doc_number = is_documentkey-documentnumber.
      ls_generic_doc_key-gen_doc_version = is_documentkey-documentversion.
      ls_generic_doc_key-gen_doc_part = is_documentkey-documentpart.
      INSERT ls_generic_doc_key INTO TABLE lt_generic_doc_key.

      CALL FUNCTION 'CDESK_SRV_GET_VARIANT'
        EXPORTING
          is_requested_var_data = ls_requested_var_data
        TABLES
*         IT_VARIANT_GUID       =
          it_generic_doc_key    = lt_generic_doc_key
*         IT_VARIANT_DOC_KEY    =
          et_variant_data       = lt_variant_data
          et_var_mat_link       = lt_var_mat_link
*         ET_MESSAGE            =
*         ET_RUNTIME            =
        .

      LOOP AT lt_var_mat_link ASSIGNING <ls_var_mat_link>.
        READ TABLE lt_variant_data ASSIGNING <ls_variant_data> WITH KEY variant_guid = <ls_var_mat_link>-variant_guid.
        IF sy-subrc = 0.
          CLEAR: ls_customerattributes.
          CONCATENATE '$(variant:' <ls_variant_data>-variant_external_id ')-MATNR' INTO ls_customerattributes-name.

          CALL FUNCTION 'CONVERSION_EXIT_MATN1_OUTPUT'
            EXPORTING
              input  = <ls_var_mat_link>-matnr
            IMPORTING
              output = ls_customerattributes-value.

          INSERT ls_customerattributes INTO TABLE ct_customerattributes.
        ENDIF.
      ENDLOOP.
    ENDIF.

Now the material number will be transferred to the configuration specific property MATNR in SOLIDWORKS.

  • No labels