cancel
Showing results for 
Search instead for 
Did you mean: 

DIR Long Text in PLM Web UI

0 Kudos

Hello Gurus,

For reporting I need to retrieve the Texts in the long text field of the DIR from the PLM Webui screen.

I would like to know if there is any method that I can use to retrieve the text characters.

i am using this method


READ_TEXT


The relevant parameters are TDID = ECRI, TDOBJECT = /PLMB/ECRI and TDNAME = <ECR GUID> + INDEX for the text 001 ... 999.

Here problem is i have 6 DIR's in one ER but in that 6 DIR's 4th DIR is not having Long text, for this i am passing parameters to Function module like above with index

for the first DIR i am passing index like 2 like this all the DIR's i am incrementing the index value for the 4th record index is populating like 5 but this index i need to give for 5th record because for the 4th record there is no long text and record also not available in STXH.

one more query is 5 DIR's is in one date and 6th DIR is different date.

when i am retrieving data based on date i am getting one DIR i.e 6th one, for this how can i pass index to retrieve long text.

Kindly advice.

Venubabu divvi

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

Got the solution for my above query.

Here is the logic to retrieve Texts in the long text field of the DIR from the PLM Webui screen.

Its working fine.

DATA: lo_bo TYPE REF TO /plmb/if_spi_appl_access

lo_bo->retrieve(

     EXPORTING iv_node_name        = 'ECR_ALL_OBJECTS'  " iv_node_name

*                 iv_target_node_name = iv_node_name

               it_node_id          = <lt_node_id>

               iv_lock             = lv_lock

     IMPORTING et_node_data        = lt_node_data ).

*                 ev_failed           = lv_failed

*                 et_index_failed     = lt_index_failed ).

CREATE DATA lt_ecr_attrib_data  TYPE STANDARD TABLE OF ('/PLMI/S_ECR_ALL_OBJ_ATTR').

ASSIGN lt_ecr_attrib_data->* TO <lt_ecr_attrib>.

CREATE DATA ls_ecr_attrib_data  TYPE ('/PLMI/S_ECR_ALL_OBJ_ATTR').

ASSIGN ls_ecr_attrib_data->* TO <ls_ecr_attrib>.

LOOP AT lt_node_data INTO ls_node_data.

  CHECK <ls_ecr_attrib> IS ASSIGNED.

  IMPORT itmattr = <ls_ecr_attrib> FROM DATA BUFFER ls_node_data-ecr_attrib.

  APPEND <ls_ecr_attrib> TO <lt_ecr_attrib>.

ENDLOOP.

ls_fcat_disp-name = 'INCLUDE'.

ls_fcat_disp-type ?= cl_abap_typedescr=>describe_by_name( '/PLMB/S_ECR_OBJECTS_ALL_SP' ).

ls_fcat_disp-as_include = abap_true.

APPEND ls_fcat_disp TO lt_fcat_disp.

ls_fcat_disp-name = 'INCLUDE1'.

ls_fcat_disp-type ?= cl_abap_typedescr=>describe_by_name('/PLMI/S_ECR_ALL_OBJ_ATTR').

ls_fcat_disp-as_include = abap_true.

APPEND ls_fcat_disp TO lt_fcat_disp.

lo_fcat_struc_result ?= cl_abap_structdescr=>create( lt_fcat_disp ).

CREATE DATA lr_fact_struc_result TYPE HANDLE lo_fcat_struc_result.

ASSIGN lr_fact_struc_result->* TO  <ls_result>.

CREATE DATA lr_result LIKE STANDARD TABLE OF <ls_result>.

ASSIGN lr_result->* TO <lt_result>.

DESCRIBE TABLE lt_node_data LINES lv_lines.

DO lv_lines TIMES.

  CLEAR <ls_result>.

  lv_count_no_attrs = lv_count_no_attrs + 1.

  IF <lt_ecr_attrib> IS ASSIGNED.

    READ TABLE <lt_ecr_attrib> ASSIGNING <ls_ecr_attrib> INDEX lv_count_no_attrs.

    IF sy-subrc = 0.

      MOVE-CORRESPONDING <ls_ecr_attrib> TO <ls_result>.

    ENDIF.

  ENDIF.

  READ TABLE lt_node_data INTO ls_node_data INDEX lv_count_no_attrs.

  MOVE-CORRESPONDING ls_node_data TO <ls_result>.

  APPEND <ls_result> TO <lt_result>.

*  lv_count_no_attrs = lv_count_no_attrs + 1.

ENDDO.

FREE lo_bo.

/plmb/cl_spi_connector=>create_instance(

  EXPORTING

    iv_abbid            =     'PLM_LTX' " Application Building Block ID

  IMPORTING

    eo_connector        =     lo_bo " Application Access Interface

).

      LOOP AT <lt_result> ASSIGNING <ls_result>.

        ASSIGN COMPONENT 'OBJ_EXT_KEY' OF STRUCTURE <ls_result> TO <fs_field1>.

        IF <fs_field1> IS ASSIGNED.

          lv_gid_tmp = <fs_field1>.

        ENDIF.

        CONDENSE lv_gid_tmp.

        IF lv_gid_tmp EQ lv_gid.

          ls_node_id-text_id = 'ECRI'.

          ls_node_id-language = 'E'.

          ls_node_id-text_name = gs_final-guid.

          ASSIGN COMPONENT 'INTERNAL_ID' OF STRUCTURE <ls_result> TO <fs_pid>.

          IF <fs_pid> IS ASSIGNED.

            lv_char_id = <fs_pid>.

            CONDENSE lv_char_id.

            CONCATENATE ls_node_id-text_name sy-mandt lv_char_id INTO ls_node_id-text_name."1103'.

          ENDIF.

          gs_final-tguid = ls_node_id-text_name.

        ENDIF.

      ENDLOOP.

Answers (2)

Answers (2)

Former Member
0 Kudos

Divvu,

I had a similar requirement.  Here is the solution:

First, note that the value to pass to NAME in READ_TEXT/SAVE_TEXT is guid, client, and then index of the object link.  The index does not have leading zeroes.

The challenge is to figure out the index of the object link.  There is a method of class /PLMI/CL_ECR_BO->GET_CHANGE_ITEMS_ALL that you can call.  The export you need is ET_CHGITM_KEYS.  Index is the field INTERNAL_ID.  You'll also see there is an OBJECT_KEY.  That holds the analogue of the BOR object key that you can derive with the methods

/plmb/cl_gos_cnv_tools=>concatenate_key_to_intern

/plmi/cl_ecr_services=>gos_intern_to_ecr_intern


I've attached a class I created with a static method that when given an ECR ID (not the guid), the name from GOS of the object type, and the key of the object that is linked, gets the name, id, and object for the text.  I am still testing, so there may be bugs, but it basically works, i.e. I've used it to derive the name of an object link and added text to the ECR. 

Regards,

Albert

Former Member
0 Kudos

Are you really interested in the long texts of the linked objects on the ER, not the long texts of the objects themselves? As always with SAPscript texts you can use SELECT_TEXT to retrieve all texts for a specific ID and OBJECT pair, use '*' for NAME and LANGUAGE.

0 Kudos

thank u Sam,

I am doing the same.

How can we compare the DIR's existing in PLM WEB UI Screen and in Database table level.

suppose in table level there is 7 DIR's in WebUI level there is only 6 DIR's Existing.

How can we compare these.

I want to display in my Report with DIR's which is existing in WEBUI screen.

Kindly Advice,

Regards,

Venubabu Divvi