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

How to remove a classification class when creating a new version or a copy of a document?

(lightbulb) Just empty the characteristic values is possible with Pref:

# Clear the value of the defined characters in the target new version of the document
# sap.plm.document.newVersion.<dtype>.charvalue.clear = Char1;Char2;Char3
 
# Clear the value of the defined characters in the target document
# plm.document.copyas.<destination_dtype>.charvalue.clear = Char1;Char2;Char3

 

Ignoring an entire class is only possible via BAdI:

New Version

BAdI: /DSCSAG/DOCUMENT_01
Methode: doc_clone_classif_before

Example code
METHOD  /dscsag/if_ex_document_01 ~doc_clone_classif_before.

* The class PLM_LEGACY must no longer exist in the DIR after a 
* document creation with template, since the PLM_LEGACAY class 
* is to be seen as documentation of the data migration.

  DELETE characteristicvalues
   WHERE classtype = '017' AND
         classname = 'PLM_LEGACY'.

  DELETE classallocations
   WHERE classtype = '017' AND
         classname = 'PLM_LEGACY'.
ENDMETHOD.

 

Copy as

BAdI: /DSCSAG/DOCUMENT_02
Methode: doc_create_from_src_before

Example code
METHOD /dscsag/if_ex_document_02~doc_create_from_src_before .

* The class PLM_LEGACY must no longer exist in the DIR after a 
* document creation with template, since the PLM_LEGACAY class 
* is to be seen as documentation of the data migration.

 DELETE characteristicvalues_new
   WHERE classtype = '017' AND
         classname = 'PLM_LEGACY'.

  DELETE classallocation_new
   WHERE classtype = '017' AND
         classname = 'PLM_LEGACY'.

ENDMETHOD.


Cloning

BAdI: /DSCSAG/ADV_ASSEMBLY

Methode: ADV_CLONE_BEFORE()

 

  • No labels

3 Comments

  1. Hello, 

    I'm trying to use your first TIP

    # sap.plm.document.newVersion.<dtype>.charvalue.clear = Char1;Char2;Char3

    but it's not working. 

    I tried to update default.txt file with 

    sap.plm.document.newVersion.DWG.charvalue.clear = SCHED_DATE;ACT_DATE;PENALTY_DOC;Z_SEND_TRASMITTAL;Z_CURRENT_TRASM_DATE;Z_STATO

    where DWG is the dtype and SCHED_DATE;ACT_DATE;PENALTY_DOC;Z_SEND_TRASMITTAL;Z_CURRENT_TRASM_DATE;Z_STATO is the list of characters.

    Can you confirm that the synthax is correct? 

    Can you confirm the ECTR version that must be installed to use that parameter?

     

    Thank you

    Massimiliano Furlanis

  2. I tried to update default.txt file with 

    You have to upload this change to backend with the function in the ECTR Admin - Menu. 

  3. It works.

    Thank you very much: this is very helpful.....I thought to use ABAP....but in this way is much easier.

     

    Massimiliano Furlanis