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

Assign a structure fields to a String in Unicode?

Former Member
0 Likes
585

hello,

In Non-Unicode System. We can declare :

DATA: BEGIN OF wt_tab OCCURS 0,

field1(10),

field2 TYPE MENGE,

field3(10),

END OF wt_tab.

DATA: wl_char(100) .

MOVE wt_tab1115) TO wl_char11(15).

but in Unicode , We can not do this because the first 10 chars and then number. So is there's any function that allow us to assign the corresponding fields from structure into a string of characters.

Thanks

4 REPLIES 4
Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
519

Hello,

In UC systems you cannot use offset on packed data.

Can you try:

wl_char+11(15) = wt_tab-field2.

BR,

SUhas

Read only

Former Member
0 Likes
519

Hello Suhas,

Thank you for your quick answer.

I mean here the offset in structure does not fall into a begining of a field in structure. so We can not get the field directly , This will be wrong data. The code is like

DATA: BEGIN OF wt_text occurs 0,

text(500),

end of wt_text.

DATA : BEGIN OF t_data OCCURS 0,

ebeln LIKE ekko-ebeln, " 1 - 10.

ebelp LIKE ekpo-ebelp, " 11 - 15

lifnr LIKE ekko-lifnr, " 16 - 25

bedat LIKE ekko-bedat, " 26 - 33

kdate LIKE ekko-kdate, " 34 - 41

waers LIKE ekko-waers, " 42 - 47

wkurs LIKE ekko-wkurs, "48 - 55

matnr LIKE ekpo-matnr, " 56 - 74

txz01 LIKE ekpo-txz01, " 75 - 115

matkl LIKE ekpo-matkl, " 116 - 125

pstyp LIKE ekpo-pstyp, " 126

knttp LIKE ekpo-knttp, " 127

end of wt-data.

MOVE wt_data50(70) TO wt_text-text58(69).

So here how I can replace this code in UNICODE.

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
519

Hello,

In that case i think you have to debug & check what exactly is being done in that offsetting operation.

BR,

Suhas

Read only

rainer_hbenthal
Active Contributor
0 Likes
519

Handling structures as strings was always dirty programming style. For what reason do you need that?