cancel
Showing results for 
Search instead for 
Did you mean: 

Error : The type of the database table and work area (or internal table) are not Unicode convertible

vieet
Explorer
0 Kudos
226

Hi, Gurus,
I am updating custom table usng modify and facing the error of The type of the database table and work area (or internal table) "LS_ZMATVALIDITEM" are not Unicode convertible. convertible.
I have tried everthing from my end and could not able to fix this error .
The following is the image of the custom table with data types which I have created

vieet_0-1730733435240.png

 once the user make changes on the grid  and when clicked on the below highlighted icon the database table would get updated.

vieet_1-1730733675747.png

the following is the image of the internal table in debugging mode

vieet_2-1730733893843.png

The following things I have tried to fix the issue :

1. Earlier I was using only inline declaration ; to fix this issue I have created internal table with types.

2. Tried to create custom data element with custom domain with 8 characters. But when FLTP is DATA type is used by default it is taking only 16 characters.

3.For the type declaration which I have created as mentioned in point 1, I have changed data type for the fields to fltp. But it is saying fltp is unknown.

vieet_3-1730734304169.png

All the 3 things which I have tried did not resolved the error.  Kindly help me with fixing the issue.

The following is the code ::   when I uncomment the line no 197 the error occurs.

 

 

SET PF-STATUS 'ZMATEXP'.

* SET TITLEBAR 'test3000'.
   IF r2 = 'X'.
    IF p_pf IS INITIAL.
      MESSAGE 'Please enter inspection lot' TYPE 'S' DISPLAY LIKE 'E'.
      EXIT.
    ENDIF.
  ENDIF.
  "SOC 1/11/2024 pasha
  SELECT prueflos,
         matnr,
         plnnr
    FROM zmatvalhead INTO TABLE (lt_zmatvalhead) WHERE prueflos = @p_pf.
    if sy-subrc ne 0.
      SELECT prueflos,
         matnr,
         plnnr
    FROM qals INTO TABLE _zmatvalhead WHERE prueflos = @p_pf.
        endif.


  IF lt_zmatvalhead IS NOT INITIAL.

    SELECT prueflos,
            matnr,
            plnnr,
            zversion,
            pmethode,
            verwmerkm,
            kurztext,
            masseinhsw,
            toleranzob,
            toleranzun,
            comments1,
            comments2
      FROM zmatvaliditem INTO TABLE _zmatvaliditem FOR ALL ENTRIES IN _zmatvalhead    WHERE prueflos = _zmatvalhead-prueflos AND
                                                                  plnnr    = _zmatvalhead-plnnr.

    IF sy-subrc NE 0.

      SELECT a~prueflos,
             a~matnr,
             a~plnnr,
             b~pmethode,
             b~verwmerkm,
             b~kurztext,
             b~masseinhsw,
             b~toleranzob,
             b~toleranzun
             FROM qals AS a INNER JOIN plmk AS b
             ON
                a~plnnr    = b~plnnr
        INTO TABLE (lt_zmatvaliditem1)
          WHERE a~prueflos = @p_pf.

    ENDIF.

  DATA: c(99) TYPE i.
  c = c + 1.
  IF lt_zmatvaliditem1 IS NOT INITIAL.
    lt_zmatvaliditem =  CORRESPONDING #( lt_zmatvaliditem1 ).
    LOOP AT lt_zmatvaliditem INTO DATA(lw_zmatvaliditem).
      lw_zmatvaliditem-zversion = c.
      modify lt_zmatvaliditem from lw_zmatvaliditem TRANSPORTING zversion.
    ENDLOOP.
   endif.

  ENDIF.


    DATA : lt_fieldcat TYPE  slis_t_fieldcat_alv,
           wa_fieldcat TYPE slis_fieldcat_alv,
           wa_layout   TYPE slis_layout_alv.

    wa_layout-colwidth_optimize = 'X'.
    wa_layout-zebra = 'X'.

 wa_fieldcat = VALUE #( fieldname = 'MANDT'   tabname ='ZMATVALIDITEM' col_pos = '1' outputlen = '12'   edit = ' ' reptext_ddic = 'MANDT' no_out = 'X'  ).
    APPEND wa_fieldcat TO lt_fieldcat.
    CLEAR wa_fieldcat.

    wa_fieldcat = VALUE #( fieldname = 'PRUEFLOS'   tabname ='ZMATVALIDITEM' col_pos = '1' outputlen = '12'   edit = ' ' reptext_ddic = 'Insp.lot.no'  ).
    APPEND wa_fieldcat TO lt_fieldcat.
    CLEAR wa_fieldcat.

    wa_fieldcat = VALUE #( fieldname = 'MATNR'      tabname ='ZMATVALIDITEM'  col_pos = '2' outputlen = '12'   edit = ' ' reptext_ddic = 'Material'  ).
    APPEND wa_fieldcat TO lt_fieldcat.
    CLEAR wa_fieldcat.

    wa_fieldcat = VALUE #( fieldname = 'PLNNR'      tabname ='ZMATVALIDITEM'  col_pos = '3' outputlen = '12'   edit = ' ' reptext_ddic = 'Group'  ) .
    APPEND wa_fieldcat TO lt_fieldcat.
    CLEAR wa_fieldcat.

    wa_fieldcat = VALUE #( fieldname = 'ZVERSION'   tabname ='ZMATVALIDITEM'  col_pos = '4' outputlen = '12'   edit = ' ' reptext_ddic = 'Version'  ) .
    APPEND wa_fieldcat TO lt_fieldcat.
    CLEAR wa_fieldcat.

    wa_fieldcat = VALUE #( fieldname = 'PMETHODE'   tabname ='ZMATVALIDITEM'  col_pos = '5' outputlen = '12'   edit = ' ' reptext_ddic = 'Insp. Method'  ) .
    APPEND wa_fieldcat TO lt_fieldcat.
    CLEAR wa_fieldcat.

    wa_fieldcat = VALUE #( fieldname = 'VERWMERKM'  tabname ='ZMATVALIDITEM'  col_pos = '6' outputlen = '12'   edit = ' ' reptext_ddic = 'Insp.Charac'  ) .
    APPEND wa_fieldcat TO lt_fieldcat.
    CLEAR wa_fieldcat.

    wa_fieldcat = VALUE #( fieldname = 'KURZTEXT'   tabname ='ZMATVALIDITEM'  col_pos = '7' outputlen = '12'   edit = 'X' reptext_ddic = 'Insp.Char.Text'  ) .
    APPEND wa_fieldcat TO lt_fieldcat.
    CLEAR wa_fieldcat.

    wa_fieldcat = VALUE #( fieldname = 'MASSEINHSW' tabname ='ZMATVALIDITEM'  col_pos = '8' outputlen = '12'   edit = ' ' reptext_ddic = 'UOM'  ) .
    APPEND wa_fieldcat TO lt_fieldcat.
    CLEAR wa_fieldcat.

    wa_fieldcat = VALUE #( fieldname = 'TOLERANZOB' tabname ='ZMATVALIDITEM'  col_pos = '9' outputlen = '12'   edit = 'X'  reptext_ddic = 'Upper Limit'  ) .
    APPEND wa_fieldcat TO lt_fieldcat.
    CLEAR wa_fieldcat.

    wa_fieldcat = VALUE #( fieldname = 'TOLERANZUN' tabname ='ZMATVALIDITEM'  col_pos = '10' outputlen = '12'   edit = 'X' reptext_ddic = 'Lower Limit'  ) .
    APPEND wa_fieldcat TO lt_fieldcat.
    CLEAR wa_fieldcat.

    wa_fieldcat = VALUE #( fieldname = 'COMMENTS1'  tabname ='ZMATVALIDITEM'  col_pos ='11' outputlen = '12'   edit = ' ' reptext_ddic = 'comments1'  ) .
    APPEND wa_fieldcat TO lt_fieldcat.
    CLEAR wa_fieldcat.

    wa_fieldcat = VALUE #( fieldname = 'COMMENTS2'  tabname ='ZMATVALIDITEM'  col_pos = '12' outputlen = '12'   edit = ' ' reptext_ddic = 'comments2'  ).
    APPEND wa_fieldcat TO lt_fieldcat.

data : lv_title type LVC_TITLE value 'Material QA  Parameters update'.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
      EXPORTING
*       I_INTERFACE_CHECK  = ' '
*       I_BYPASSING_BUFFER = ' '
*       I_BUFFER_ACTIVE    = ' '
        i_callback_program = SY-REPID
       I_CALLBACK_PF_STATUS_SET          = 'SET_PF_STATUS'
       I_CALLBACK_USER_COMMAND           = 'ZUSER'
*       I_CALLBACK_TOP_OF_PAGE            = ' '
*       I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
*       I_CALLBACK_HTML_END_OF_LIST       = ' '
*       I_STRUCTURE_NAME   =
*       I_BACKGROUND_ID    = ' '
*       I_GRID_TITLE       =
*       I_GRID_SETTINGS    =
*       IS_LAYOUT          =
        it_fieldcat        = lt_fieldcat
*       IT_EXCLUDING       =
*       IT_SPECIAL_GROUPS  =
*       IT_SORT            =
*       IT_FILTER          =
*       IS_SEL_HIDE        =
*       I_DEFAULT          = 'X'
*       I_SAVE             = ' '
*       IS_VARIANT         =
*       IT_EVENTS          =
*       IT_EVENT_EXIT      =
*       IS_PRINT           =
*       IS_REPREP_ID       =
*       I_SCREEN_START_COLUMN             = 0
*       I_SCREEN_START_LINE               = 0
*       I_SCREEN_END_COLUMN               = 0
*       I_SCREEN_END_LINE  = 0
*       I_HTML_HEIGHT_TOP  = 0
*       I_HTML_HEIGHT_END  = 0
*       IT_ALV_GRAPHICS    =
*       IT_HYPERLINK       =
*       IT_ADD_FIELDCAT    =
*       IT_EXCEPT_QINFO    =
*       IR_SALV_FULLSCREEN_ADAPTER        =
*       O_PREVIOUS_SRAL_HANDLER           =
*       IMPORTING
*       E_EXIT_CAUSED_BY_CALLER           =
*       ES_EXIT_CAUSED_BY_USER            =
      TABLES
        t_outtab           = lt_zmatvaliditem
      EXCEPTIONS
        program_error      = 1
        OTHERS             = 2.
    IF sy-subrc <> 0.
* Implement suitable error handling here
    ENDIF.


ENDMODULE.

FORM SET_PF_STATUS USING rt_extab TYPE slis_t_extab.
  SET PF-STATUS 'ZMATEXP'.
*  SET TITLEBAR 'baap ek number'.
ENDFORM.
FORM ZUSER  USING r_ucomm LIKE sy-ucomm
                                   rs_selfield TYPE slis_selfield.
  BREAK-POINT.
   loop at lt_zmatvaliditem into ls_zmatvaliditem.

*
*     modify zmatvaliditem from ls_zmatvaliditem.
     endloop.


  ENDFORM.

 

 

View Entire Topic
Sandra_Rossi
Active Contributor

The type "FLTP" is the predefined DDIC type name corresponding to the ABAP type "F" (so, use TOLERANZOB TYPE F). In your system, there is no DDIC object named FLTP (in mine, there's one which is CHAR 20, completely unrelated to the predefined DDIC type FLTP).

You are trying to mix the types of screen variables and the type of the database table, which you made different for some reason. Just don't mix them. Distinguish them by using explicit names like lt_alv_zmatvaliditem and ls_alv_zmatvaliditem for ALV, while using ls_zmatvaliditem for the database table zmatvaliditem.