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: 

Error (Data objects in Unicode programs cannot be converted.)

0 Kudos

I need to execute the COOIS transaction (PPIO_ENTRY program) using the SUBMIT statement, then get the data into an structure and join with other table data.

First I've created the type:

TYPES:
  BEGIN OF t_1001,
    MANDT TYPE MANDT,
    AUFPL TYPE CO_AUFPL,
    APLZL TYPE CO_APLZL,
    PLNFL TYPE PLNFOLGE,
  END OF t_1001.

Then, the table to append the data and the extra DATA and FIELD-SYMBOLS:

DATA: 
  i_t001  TYPE STANDARD TABLE OF t_1001.

DATA: 
  l_selection     TYPE rsparams,
  li_selection    TYPE tt_selection,
  lr_pay_data     TYPE REF TO data.

FIELD-SYMBOLS: 
  <lt_pay_data>  TYPE ANY TABLE,
  <lt_test>      TYPE ANY,
  <l_fs_PP010>   TYPE t_1001.

After that, call the program but not showing the data just storing it:

START-OF-SELECTION.

  cl_salv_bs_runtime_info=>set(
    EXPORTING display   = abap_false
    metadata  = abap_false
    data      = abap_true ).

  SUBMIT PPIO_ENTRY
    USING SELECTION-SET 'xyz'
    AND RETURN.  

  TRY.
    cl_salv_bs_runtime_info=>get_data_ref( IMPORTING r_data = lr_pay_data ).      
    ASSIGN lr_pay_data->* TO <lt_pay_data>.
  CATCH cx_salv_bs_sc_runtime_info.
    MESSAGE `Unable to retrieve ALV data` TYPE 'E'.
  ENDTRY.

  LOOP AT <lt_pay_data> ASSIGNING <LT_TEST>.
    APPEND <LT_TEST> TO i_t001.
  ENDLOOP.

  cl_salv_bs_runtime_info=>set( 
    EXPORTING display   = abap_true
    metadata  = abap_true
    data      = abap_true ).

END-OF-SELECTION.

If i comment the PLNFL line from the t_1001 type declaration all works correctly.

But if I remove the comment crash with this info:

Data objects in Unicode programs cannot be converted.

Statement "MOVE src TO dst" requires operands "dst" and "src" to be convertible. Since this statement is in a Unicode program, the special conversion rules for Unicode programs apply. In the present case, these rules have been violated.

What it's the mistake?

4 REPLIES 4

Jeansy
Active Contributor
0 Kudos

Could you please check the format of your coding in this thread?

It's impossible to understand it in the moment.

Thank you 🙂

0 Kudos

Sorry, I've updated!

FredericGirod
Active Contributor
0 Kudos

Could you try to replace the code like this and test it ? :


  i_t001 = corresponding #( <lt_pay_data> ).
* LOOP AT <lt_pay_data> ASSIGNING <LT_TEST>.
* APPEND <LT_TEST> TO i_t001.
* ENDLOOP.

0 Kudos

It works frdric.girod ! Thank you so much!