Application Development and Automation 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: 
Read only

unicode : comparing uncompatible structs

Former Member
0 Likes
573

Hello everyone,

I am a new member on the site and I will post my first question on the forum.

the question is UNICODE, making the transaction UCCHECK I found a mistake in my program, the error is "have the same structure layout as" P_OC ", irrespective of the length of a"

Prog:

FORM creation_enreg_ef18 t_ef18 TABLES it_ef18 STRUCTURE

                                   poste_oc STRUCTURE it_zipsnp

                                   Expedition r_exped STRUCTURE

                                   reception r_recept STRUCTURE

                          LIKE USING date_d p_dt_deb

                                   date_f LIKE p_dt_fin

                          CHANGING STRUCTURE p_oc zreflivrek

                                   p_oc_ref STRUCTURE zreflivrek.

........

     IF IS INITIAL OR p_oc p_oc <> poste_oc. "ERROR"

       CLEAR zreflivrek.

       SELECT SINGLE * FROM zreflivrek

       WHERE werks = werks poste_oc-

       AND zzno_ordre = poste_oc-zzno_ordre.

       p_oc = zreflivrek.

     ENDIF.

do you have any ideas?

Regards

4 REPLIES 4
Read only

Former Member
0 Likes
547

Hi,

  p_oc should be of the structure zreflivrek.

CHANGING  p_oc STRUCTURE zreflivrek

Thanks

Naren

Read only

0 Likes
547

Hello,

Thank you for your answer Narendran Muthukumaran.

In the first part of the program where there are a declaration p_oc structure is already reported:

CHANGING  p_oc STRUCTURE zreflivrek

                   p_oc_ref STRUCTURE zreflivrek.

But the second structure is declared otherwise:

poste_oc STRUCTURE it_zipsnp

Do I have to change the type of poste_oc:

poste_oc STRUCTURE zreflivrek?

or I can make a comparison of the two structures without changing the type?

IF p_oc <> poste_oc.

Thank you in advance

Read only

0 Likes
547

HI,

The objective is that your actual parameters and formal structures should have the same structure.

In non unicode system before upgrade the structure might have been same a new field might may been introduced in the standard dictionary structure which is not same as the Z structure causing this mismatch.

Kindly check all the actual parameters and formal parameters in UC Check it might not always point to the exact error.

Regards,

Vasanth

Read only

0 Likes
547

Hi,

The issue you are facing is due to the structure mismatch between poste_oc and p_oc as

poste_oc is of type it_zipsnp and p_oc is of type zreflivrek.

Make sure that both the parameters have the same structure before using a comparison operator in an Unicode enabled object.

If you don't want to change the structure of them then you can compare w.r.t the fields within the structures.

Eg: p_oc-f1 <>  poste_oc-f1,

       p_oc-f2 <>  poste_oc-f2 ....