‎2007 Oct 11 9:11 PM
Hi,
I have following code , can anyone find what will be error in this.
report zars.
data: begin of struc,
f1 type i value 1,
f2(8) type c value 'test',
end of struc,
container(1000) type c.
class cl_abap_container_utilities definition load.
call method cl_abap_container_utilities=>fill_container_c
exporting
im_value = struc
importing
ex_container = container
exceptions
illegal_parameter_type = 1
others = 2.
write : container.
After this write statement here container is showing the following value
###test ###############################################################
Any one give suggestion how to get the correct values in the container
I think correct values will be
1 test
a®s.
‎2007 Oct 11 9:19 PM
Hi,
Please try this.
data: begin of struc,
f1 type c value 1, "Change here with type c
f2(8) type c value 'test',
end of struc,
container(1000) type c.
...
Regards,
Ferry Lianto
‎2007 Oct 11 9:41 PM
Hi,
I donot want to change field to character. This is my scenario i have internal table that numeric, character, quan fields i need to move this internal table header to a character field.
I am in Unicode system. so i could not able to do move to container.
And also i donot want to move field by field.
if this class only work with character fields, then what is usage of this class? Any info
a®
‎2007 Oct 11 9:50 PM
Hi,
Check the code below:
data : begin of struc,
<b> f1(1) type n value '1',</b> f2(4) type c value 'test',
end of struc,
container(6) type c.
u can also make the field F1 type D.
class cl_abap_container_utilities definition load.
call method cl_abap_container_utilities=>fill_container_c
exporting
im_value = struc
importing
ex_container = container
exceptions
illegal_parameter_type = 1
others = 2.
write : container.
Regards
Kannaiah
‎2007 Oct 11 9:55 PM
Kannaiah,
Here i have given only example for two or three fields. In my scenario i have 125 fields with NUMC CHAR DEC, DATS INT1 ...............
a®
‎2007 Oct 11 9:20 PM
is it due to F1 is type i ??
because container is of type C
regards.
ilesh 24x7
‎2007 Oct 11 9:21 PM
I think it will show only character fields, if you change f1 from type i to type c or type n, it will show both f1 and f2.
‎2007 Oct 11 9:26 PM
Hi,
Check the code below:
data : begin of struc,
f1(2) type C value '1C',
f2(4) type c value 'test',
end of struc,
container(6) type c.
class cl_abap_container_utilities definition load.
call method cl_abap_container_utilities=>fill_container_c
exporting
im_value = struc
importing
ex_container = container
exceptions
illegal_parameter_type = 1
others = 2.
write : container.
Regards
Kannaiah
‎2007 Oct 11 9:57 PM
try to use type N or P and D and avoid use of I ...
if you can
Regards
ilesh 24x7
‎2007 Oct 12 12:34 AM
‎2007 Oct 12 2:39 PM
‎2007 Oct 12 9:33 PM
Hi a®s
Can you please tell me ? How you solved the problem.
I am eager to know the solution ...
Thanks in advance.
Raj