Beruflich Dokumente
Kultur Dokumente
I'm going to add the customer depending additional check logic to ECR saving.
For this purpose, I try to add the program to Class Interface:/PLMI/CL_ECR_BO~CHECK_BEFORE_SAVE by
enhance function.
I understood a method to output the message to WebUI at ECR saving.
But I do not understand a method to get the basic information of the business objects that are linked to ECR.
Best Regards,
Seiichiro Otsuka
Tags: plm7.02, ecr, check_before_save
Re: The method to get the basic information of the business objects that are linked to ECR from /PLMI/
CL_ECR_BO~CHECK_BEFORE_SAVE Feb 17, 2015 11:50 AM
Hello Seiichiro ,
Here the some API which will come handy for you .
For adding the custom logic for ECR on saving , use the enhancement spot /PLMB/ES_SPI ,
BADI : /PLMB/EX_SPI_TRANSACTION
So you have the ECR ID and attributes which shall solve ur case . If you still some more attributes , you can
get the details as you know the ECR ID .
Thanks ,
Abhishek.
<IT_INTERNAL_KEY_INTID>
<IT_ECR_ATTRIB>
Best Regards,
Seiichiro Otsuka
If you see the code in the class /PLMI/CL_ECR_CHGITM_FED_ON. See the underlined piece of code below .
Get Otype details for Object ID
APPEND /plmi/if_ecr_chg_itm~mv_otype_name TO lt_otype_name.
CALL METHOD /plmi/cl_ecr_cust=>get_otype_cust
EXPORTING
it_otype_name = lt_otype_name
IMPORTING
et_otype_cust = lt_otype_cust.
* create local ECR attribute table
READ TABLE lt_otype_cust INTO ls_otype_cust INDEX 1.
* collect all object id which is not initial
LOOP AT it_internal_key_intid ASSIGNING <ls_internal_key_intid>
WHERE internal_key IS NOT INITIAL.
lv_index = sy-tabix.
* get ECR attrib
READ TABLE it_ecr_attrib ASSIGNING <ls_ecr_attrib> INDEX lv_index.
IF sy-subrc = 0.
* get field name of change relevance
lo_struct_descr ?= cl_abap_structdescr=>describe_by_data( <ls_ecr_attrib> ).
lt_fields = lo_struct_descr->get_ddic_field_list( p_including_substructres = abap_true ).
IMPORTING
ev_gos_internal_key = ls_internal_key-internal_key
et_messages
= lt_msg_cnv.
* when conversion fails, update message and goto next key
IF lt_msg_cnv IS NOT INITIAL.
LOOP AT lt_msg_cnv ASSIGNING <ls_msg_cnv>.
MOVE-CORRESPONDING <ls_msg_cnv> TO ls_message.
ls_message-msg_index = lv_index.
APPEND ls_message TO et_message.
ENDLOOP.
CONTINUE.
ENDIF.
* update local tables
APPEND ls_internal_key TO lt_internal_key.
* update mapping table
ls_mapping-gos_internal_key = ls_internal_key-internal_key.
ls_mapping-ecr_internal_key = <ls_internal_key_intid>-internal_key. ( here , you get the ecr internal
key )
ls_mapping-src_node_id
= lv_index.
APPEND ls_mapping TO lt_mapping.
ENDLOOP.
Itself you will be able to find the internal key . You can just copy it from the method ( /PLMI/
IF_ECR_CHG_ITM~VALIDATE_ECR_ATTRIB ) of class ( /PLMI/CL_ECR_CHGITM_FED_ON) and use this
to get the ECR internal key . Once you have the ECR internal key , you can get all the information you want .
I am adding the snap shot to help you out which I have set during debugging .
Best Regards,
Seiichiro Otsuka