Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

DIR Long Text in PLM Web UI

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

Former Member
Former Member replied

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.

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question