Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

TABLE_ENTRIES_GET_VIA_RFC and UNICODE_TYPES_NOT_CONVERTIBLE

matteo_montalto
Contributor
0 Kudos

Hi all,

from an SRM system, I need to extract a dictionary table (ASMD) from a specific backend. However, I just need two field of that table so I created a form that populates a (global) itab containing only the fields (ASNUM and ASTYP) I'm interested in.

Here's the code: please notice that I preferred to extract the entire table (which contains usually few lines) and post process it in order to take only the relevant fields (using the structure nametab which contains info about field's structure and length).

FORM get_asmd  USING    p_e_backend TYPE bbp_attr_sys .
  DATA: sel_tab TYPE bdsel_stat OCCURS 0.
  DATA: nametab TYPE bdi_mfgrp OCCURS 0 WITH HEADER LINE.
  DATA: tabentry TYPE bdi_entry OCCURS 0 WITH HEADER LINE.
  DATA: x1 TYPE i, len1 TYPE i.
  DATA: x2 TYPE i, len2 TYPE i.

  CALL FUNCTION 'TABLE_ENTRIES_GET_VIA_RFC' destination p_e_backend
   EXPORTING
*   LANGU                     = SY-LANGU
*   ONLY                      = ' '
     tabname                   = 'ASMD'
  TABLES
    sel_tab                   = sel_tab[]
    nametab                   = nametab[]
    tabentry                  = tabentry[].
  IF sy-subrc = 0.
    READ TABLE nametab WITH KEY fieldname = 'ASNUM'.
    x1 = nametab-offset.
    len1 = nametab-intlen.
    READ TABLE nametab WITH KEY fieldname = 'ASTYP'.
    x2 = nametab-offset.
    len2 = nametab-intlen.
    LOOP AT tabentry.
      CLEAR wa_asmd.
      wa_asmd-asnum = tabentry+x1(len1).
      wa_asmd-astyp = tabentry+x2(len2).
      APPEND wa_asmd to it_asmd.
    ENDLOOP.
  endif.
  endform.                    " GET_ASMD

This form dumps exacly in the RFC call with the following reason:

"An error occurred when executing a REMOTE FUNCTION CALL.

It was logged under the name "UNICODE_TYPES_NOT_CONVERTIBLE"

on the called page. " (CALL_FUNCTION_REMOTE_ERROR).

Debugging I've seen that the RFC call dumps at this point in the TABLE_ENTRIES_VIA_RFC FM:

SELECT * FROM (TABNAME) INTO TABLE TABENTRY WHERE (SEL_TAB).

where tabname = ASMD and sel_tab is an enpty table.

Has anyone an idea of the reason of this error and how to solve it? Thanks in advance.

1 REPLY 1

matteo_montalto
Contributor
0 Kudos

Solved using a workaround (using another FM, RFC_GET_TABLE_ENTRIES; this worked perfectly)