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

uni code conversion problem

Former Member
0 Likes
1,170

hi experts,

pls check the follwing code and give me a solution.

REPORT zchandan.

TABLES: zchandan.

data: zc type zchandan.

select-options: emp_id for zc-zempid,

emp_nm for zc-zempnm.

data : itab2 like table of zchandan with header line.

data: itab1 like itab2.

itab2-zempid = emp_id.

itab2-zempnm = emp_nm.

append itab2.

move-corresponding itab2 to

itab1.

write : / itab2-zempid , itab2-zempnm.

write : / itab1-zempid , itab1-zempnm.

insert zchandan from table itab2.

i am getting error as follows:

"ITAB2-ZEMPID" and "EMP_ID" are not mutually convertible in a Unicode

pls reply me quickly

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,144

Hi..

Lets make some changes to the code and check:

REPORT zchandan.
TABLES: zchandan.

data: zc type zchandan-zempid. "First Change.
select-options: emp_id for zc,
emp_nm for zc-zempnm.

data : itab2 type standard table of zchandan with header line. "Second Change.

data: itab1 like. itab2.


itab2-zempid = emp_id.
itab2-zempnm = emp_nm.
append itab2.

Please make the changes and revert back.

Regards,

Vishwa.

11 REPLIES 11
Read only

Former Member
0 Likes
1,144

Hi,

emp_id is a select-options.

use like this..

zitab2-empid = emp_id-low.

or define emp_id as a parameters.

Rgds,

Read only

Former Member
0 Likes
1,145

Hi..

Lets make some changes to the code and check:

REPORT zchandan.
TABLES: zchandan.

data: zc type zchandan-zempid. "First Change.
select-options: emp_id for zc,
emp_nm for zc-zempnm.

data : itab2 type standard table of zchandan with header line. "Second Change.

data: itab1 like. itab2.


itab2-zempid = emp_id.
itab2-zempnm = emp_nm.
append itab2.

Please make the changes and revert back.

Regards,

Vishwa.

Read only

0 Likes
1,144

>

> itab2-zempid = emp_id.

> itab2-zempnm = emp_nm.

> Regards,

>

> Vishwa.

Still SELECT-OPTIONS. So that won't work.

Read only

0 Likes
1,144

It should work. Just checked..maybe you would also like to check in ur system first...

I think the declarations...should be same...

Vishwa.

Read only

0 Likes
1,144

>

> It should work. Just checked..maybe you would also like to check in ur system first...

>

> I think the declarations...should be same...

>

> Vishwa.

So you guys work on the same system as you checked with custom table ZCHANDAN?

Read only

0 Likes
1,144

OK. I never said I checked the very same code. I said just checked, that means..a code similar to that.... Is that clear?

Read only

0 Likes
1,144

Clear enough. But still i'm not convinced it will work.

Last time i checked, a select-options always has the structure of SIGN/OPTION/LOW/HIGH

And with the assignment of FIELD1 = SELECT-OPTIONS (as you suggest) will force all values into that field.

So should you enter the value 10 in your select-options, the data will look like 'IEQ10'. And that's what you're passing to the single field.

But hey... just trying to help.

Good luck!

Read only

0 Likes
1,144

OK. Maen!!!! I am sorry...I just checked the syntax part. Sorry If I was rude.

You are absolutely right....It should be like this:

itab2-zempid = emp_id-low.
itab2-zempnm = emp_nm.

Regards,

Vishwa.

Read only

Former Member
0 Likes
1,144

Hi suresh,

try this code

REPORT zchandan.

TABLES: zchandan.

data: zc type zchandan.

select-options: emp_id for zc-zempid,

emp_nm for zc-zempnm.

data : itab2 like table of zchandan with header line.

data: itab1 like itab2.

field-symbols : <fs1> type any.

assign emp_id to <fs1>.

move <fs1> to itab2-zempid.

field-symbols : <fs2> type any.

assign emp_nm to <fs2>.

move <fs2> to itab2-zempnm.

move-corresponding itab2 to

itab1.

write : / itab2-zempid , itab2-zempnm.

write : / itab1-zempid , itab1-zempnm.

insert zchandan from table itab2.

Read only

0 Likes
1,144

>

>

> field-symbols : <fs1> type any.

> assign emp_id to <fs1>.

> move <fs1> to itab2-zempid.

>

> field-symbols : <fs2> type any.

> assign emp_nm to <fs2>.

> move <fs2> to itab2-zempnm.

Still SELECT-OPTIONS!!!!!! Even this won't work unless you start using LOW or HIGH of the select-options!!!

A select-options has the following fields:

LOW

HIGH

SIGN

OPTION

LOW and HIGH holds the values you enter in the selection screen.

Doing itab2-zempid = emp_id means you putting the all values to ZEMPID, e.g. IEQ10000.

Read only

Former Member
0 Likes
1,144

If you don't want to change the code go to the properties of the report and change the option Ctr. unicode active (is a checkbox).