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

Moving data to string

Former Member
0 Likes
2,672

Hello friends,

how can i move an inernal table in to a string.

for this i m declaring a string table.

data : string type s occurs 0.

loop at internal table.

move internal_table_structure to string.

endloop.

but in my case the internal table data contains decimal(h) type data type

nd it says that type h can not be moved or the data is

it is not mutually convertable in unicode program

please people help me with this

maximum reward point guaranteed

8 REPLIES 8
Read only

Former Member
0 Likes
1,521

Hi Summet,

Do like this,

data: str type string.

loop at itab

concatenate itab str into str.

endloop.

Reward if useful!

Read only

0 Likes
1,521

hello dear,

it still says the srting can not be converted to the type of table.

Read only

Former Member
0 Likes
1,521

Hi Sumeet,

Are you passing itab or itab-<fieldname>?

Pass fieldname.

Sorry my mistake.

Read only

Former Member
0 Likes
1,521

Hi,

here a short example:

TABLES: MARA.

*

DATA: BEGIN OF ITAB OCCURS 0,

MATNR LIKE MARA-MATNR,

MATKL LIKE MARA-MATKL,

END OF ITAB.

*

DATA: STRG TYPE STRING.

*

SELECT MATNR MATKL FROM MARA INTO TABLE ITAB UP TO 10 ROWS.

*

LOOP AT ITAB. WRITE: / ITAB-MATNR, ITAB-MATKL. ENDLOOP.

*

LOOP AT ITAB.

CONCATENATE STRG ITAB INTO STRG.

ENDLOOP.

*

WRITE: / STRG(100).

*

Regards, Dieter

Read only

0 Likes
1,521

hello friends,

thanx for the solution given

i will try these and will reply in sometime

Read only

0 Likes
1,521

hello dieter,

with your solution i m getting a message 'gs_item_contract' (my structure) must be a character type data object (C,N,D,T or string)

i am using menge field which has a data type of Quan

Read only

0 Likes
1,521

Hi,

it's only a warning.

Look at this:

TABLES: MARA.

*

DATA: BEGIN OF ITAB OCCURS 0,

MATNR LIKE MARA-MATNR,

MATKL LIKE MARA-MATKL,

BRGEW LIKE MARA-BRGEW,

END OF ITAB.

*

DATA: BRGEW LIKE MARA-BRGEW.

DATA: IDX LIKE SY-INDEX.

DATA: STRG TYPE STRING.

*

SELECT MATNR MATKL BRGEW FROM MARA INTO TABLE ITAB UP TO 10 ROWS.

*

LOOP AT ITAB. WRITE: / ITAB-MATNR, ITAB-MATKL, ITAB-BRGEW. ENDLOOP.

*

LOOP AT ITAB.

CONCATENATE STRG ITAB INTO STRG.

ENDLOOP.

*

DO 10 TIMES.

IDX = SY-INDEX * 27 + ( ( sy-index - 1 ) * 7 ).

WRITE STRG+IDX(7) TO BRGEW.

WRITE: / BRGEW.

ENDDO.

*

the Quan-Field will be stored correct.

Regards, Dieter

Read only

Former Member
0 Likes
1,521

hi,

try like this

declare a character variables for float values as

data: flchar type c.

flchar = floatvalue.

and declare internal table for string [strtab]

loop at <internal table>

move itab to strtab.

endloop.

or

move itab[] to strtab[].

if helpful reward some points.

with regards,

Suresh.A