03-22-2007 7:53 AM
I have following problem:
data: c_field(1000) type c.
tables: mara.
select * from mara......
Move mara to c-field. --> without Unicode no problem, with Unicode: error.
Methods cl_abap_container_utilities=>fill_container_c is moving mara into c_field without error, but in c_field all packed fields are marked as "#####" in debugging. When I use read_container_c into mara, all packed fields are correct again. So I can use these methods WITHIN a program. But when I (for example) want to write a record to a dataset and in the record ist a c_field, the next program, that works with this dataset receives the packed fields in c_field with "#####" when it doesn't use the read_container_c.
Do you know another method to store a structure in a container-field (c_field) in unicode?
Regards.
Dino
03-22-2007 8:00 AM
Hi Wilhelm,
Instead of reading <b>whole Structure</b>, it better to read individual field,By using <b>CONCATENATE</b> operator you
store in it in one character field.
Always the whole Field string is treated as Character variable and also depending on the fields present in the
field string it appears as '#######'.
Hope you got it.
If you any queries regarding this, you are welcome.
Reward,if helpful.
Regards,
V.Raghavender.
03-22-2007 12:43 PM
Hi V.Raghavender.
Thanks for your answer. My problem is, that in the mentioned dataset there are some keyfields to identify the following record and then the whole record ist stored in a c(4000)-field. And the stored record can be totally different (for example mara, marc, mard, maktx.....). Only with the keyfields (e.g. one field named "tablename" you can identify, in which structure (mara, marc, mard, maktx) you have to put the c(4000)-field. In a non-unicode-system ist was working:
Program A:
tablename = 'MARA' (marc, mard)
c-4000 = mara (marc,mard....) --> error in Unicode
Program B:
if tablename = 'MARA'
mara = c-4000 --> error in Unicode
endif
ALL fields of mara, marc, mard.....are needed in program B.
03-22-2007 3:39 PM
Hi William, are both programs in SAP, in which case why do you want to transfer the data to the operating system?
03-22-2007 4:15 PM
In Unicode enviornment you need to use
class cl_abap_char_utilities definition load.
cl_abap_char_utilities=>horizontal_tab.
for converting hex to char.
aRs
03-22-2007 4:53 PM
Hi ,
This may help you
data:
begin of L_LINE,
TEXT1(10) type c,
MARK1(1) type c
value CL_ABAP_CHAR_UTILITIES=>MINCHAR,
TEXT2(10) type c,
MARK2(1) type c
value CL_ABAP_CHAR_UTILITIES=>MINCHAR,
TEXT3(10) type c,
MARK3(1) type c
value CL_ABAP_CHAR_UTILITIES=>MINCHAR,
BLANK(100) type c,
end of L_LINE,
HEX0(1) type c,
CRLF(2) type c.
HEX0 = CL_ABAP_CHAR_UTILITIES=>MINCHAR.
CRLF = CL_ABAP_CHAR_UTILITIES=>CR_LF.
L_LINE-TEXT1 = 'SYSTEM: '.
L_LINE-TEXT2 = 'USER: '.
L_LINE-TEXT3 = 'CLIENT: '.
replace: HEX0 with SY-SYSID into L_LINE,
HEX0 with SY-UNAME into L_LINE,
HEX0 with SY-MANDT into L_LINE.
condense L_LINE.
concatenate L_LINE CRLF into L_LINE.
*Further processing of L_LINE.
Note: This example, which was found in a similar fashion in a real application, is unnecessarily complicated and certainly not an example of a good programming style. The following is an example of a much clearer solution:
class CL_ABAP_CHAR_UTILITIES definition load.
data: L_LINE(133) type c.
concatenate 'SYSTEM: ' SY-SYSID
'USER: ' SY-UNAME
'CLIENT: ' SY-MANDT
CL_ABAP_CHAR_UTILITIES=>CR_LF into L_LINE.
thanks
venki
03-23-2007 12:58 PM
Hi alltogether.
Thanks for your answers. It seems, that the class cl_abap_container_utilities with its methods ist the correct solution for my problem.
Class cl_abap_character_utilities only transforms hex-values into c-fields, for example low-value, high-value, carriage-return....this was not my problem.
Bye for now.
W.
06-14-2007 7:11 AM
02-06-2012 3:43 PM
HI Wilhelm Boegner ,
I am also facing the same problem ,can you please provide me the information regarding how you solved the issue.
regards
sandeep
09-01-2009 3:07 AM
Hi experts.
I'm sorry to interrupt you.
My name soo Il Kim from South Korea.
I showed below your question on SDN forum board.
but I had same problem. I think that you already solved this problem .
Please Can you notice me how can you solve this problem?
-
I have following problem:
data: c_field(1000) type c.
tables: mara.
select * from mara......
Move mara to c-field. --> without Unicode no problem, with Unicode: error.
Methods cl_abap_container_utilities=>fill_container_c is moving mara into c_field without error, but in c_field all packed fields are marked as "#####" in debugging. When I use read_container_c into mara, all packed fields are correct again. So I can use these methods WITHIN a program. But when I (for example) want to write a record to a dataset and in the record ist a c_field, the next program, that works with this dataset receives the packed fields in c_field with "#####" when it doesn't use the read_container_c.
Do you know another method to store a structure in a container-field (c_field) in unicode?
Regards.
Dino
-
My program.
-
DATA: buffer(30000) OCCURS 10 WITH HEADER LINE.
DATA : st_table TYPE REF TO data,
tb_table TYPE REF TO data,
FIELD-SYMBOLS : <wa_table> TYPE ANY,
<it_table> TYPE STANDARD TABLE,
<wa_table2> TYPE ANY.
CREATE DATA : tb_table TYPE TABLE OF (query_table), "Object Create.
st_table TYPE (query_table).
ASSIGN : tb_table->* TO <it_table>, "INTERNAL TABLE.
st_table->* TO <wa_table>. "WORK AREA.
SELECT * FROM (query_table)
INTO CORRESPONDING FIELDS OF TABLE <it_table> WHERE (options).
LOOP AT <it_table> INTO <wa_table>.
CLEAR buffer.
CALL METHOD cl_abap_container_utilities=>fill_container_c
EXPORTING
im_value = <wa_table>
IMPORTING
ex_container = buffer
EXCEPTIONS
illegal_parameter_type = 1
OTHERS = 2.
APPEND buffer.
endloop.
-
I also fiound "#####" in buffer.
Please help me.
Have a nice day.
Thanks.
08-24-2010 4:11 AM
Hi Wilhelm Boegner ,
Can you please tell me how did you solve this issue. I am working on BAPI_OUTB_DELIVERY_CREATE_SLS and
need to use the Extension structure. I am facing the same problem. Would appreciate your reply.
With Regards,
Shiva.