‎2009 May 15 11:56 AM
Hi,
I am getting a unicode error in callling a subroutine.
data : BEGIN OF ITAB OCCURS 0.
INCLUDE STRUCTURE KOMP.
data: flag type c,
chk_flg type c.
DATA: END OF ITAB.
Fetch data in Itab.
Perform value_check tables ITAB.
Form value_check tables p_itab1 structure komp.
Some processing
Endform.
The unicode error I am getting is ITAB and line type p_itab1 are incompatible.
I think it is due to 2 extra fields in ITAB. Kindly proposed a soloution without affecting the functionality of program.
Regards,
Rajneesh
‎2009 May 15 12:05 PM
hi
give it this way....
Form value_check tables p_itab1 like itab.
.....
endform.Regards,
Siddarth
‎2009 May 15 12:05 PM
hi
give it this way....
Form value_check tables p_itab1 like itab.
.....
endform.Regards,
Siddarth
‎2009 May 15 12:07 PM
HI,
Either make the tables as global and use them directly instead of passing.
In Unicode the table structure should be same with reference type.
OR
Form value_check tables p_itab1 structure itab.
Endform.
‎2009 May 15 12:11 PM
Try this
DATA : BEGIN OF itab OCCURS 0.
INCLUDE STRUCTURE komp.
DATA: flag TYPE c,
chk_flg TYPE c.
DATA: END OF itab.
PERFORM value_check TABLES itab.
&----
FORM value_check TABLES p_itab1 STRUCTURE itab.
ENDFORM. "value_check
‎2009 May 15 12:25 PM
Hello Rajneesh
TABLES parameters are obsolete for both function module interfaces and FORM interfaces. If the itab data are not changed within the FORM routine then forward it as USING parameter otherwise as CHANGING parameter.
TYPES BEGIN OF ty_s_record.
INCLUDE TYPE komp.
TYPES: flag type c.
TYPES: chk_flg type c.
TYPES: END OF ty_s_record.
TYPES: ty_t_itab TYPE STANDARD TABLE OF ty_s_itab
WITH DEFAULT KEY.
DATA:
lt_itab TYPE ty_t_itab.
...
PERFORM values_check USING lt_itab.
PERFORM values_check CHANGING lt_itab.
FORM values_check USING VALUES(ut_itab) TYPE ty_t_itab.
...
ENDFORM.
FORM values_check CHANGING ct_itab TYPE ty_t_itab.
...
ENDFORM.
Regards
Uwe
‎2009 May 18 8:47 PM
Hello Rajneesh,
you are right the 2 types are not compatible. Define the structure type and table type first and you will get rid of this issue.
types:
begin of TY_STRUCT.
include type OLD_STRUCT.
types:
FLAG type c length 1,
end of TY_STRUCT.
types:
TY_TABLE type standard table of TY_STRUCT with default key.
data:
MY_STRUCT type TY_STRUCT,
MY_TABLE type TY_TABLE.
Whereever possible avoid forms. Their runtime behaviour is inferior compared to methods. Even without OO Design a program using static methods will be a benefit.
Best Regards
Klaus