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

string

Former Member
0 Likes
709

dear gurus,

DATA : v_string TYPE string.

DATA:BEGIN OF itab OCCURS 0,

matnr LIKE mara-matnr,

meins LIKE mara-meins,

mhdhb LIKE mara-mhdhb,

END OF itab.

CONCATENATE itab-matnr v_maktx itab-meins itab-mhdhb

INTO v_string SEPARATED BY '|'.

here when i am compling it shows an erro like this

"ITAB-MHDHB" must be a character data object (data type C, N, D, T or

STRING). field string).

thanx in advance

senthil

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
682

Hi,

You have to move the mhdhb to a character and then do the concatenate..

Example..

DATA: V_CHAR(4).

DATA : v_string TYPE string.

DATA:BEGIN OF itab OCCURS 0,

matnr LIKE mara-matnr,

meins LIKE mara-meins,

mhdhb LIKE mara-mhdhb,

END OF itab.

V_CHAR = ITAB-MHDHB.

CONCATENATE itab-matnr v_maktx itab-meins V_CHAR

INTO v_string SEPARATED BY '|'.

Thanks,

Naren

4 REPLIES 4
Read only

Former Member
0 Likes
683

Hi,

You have to move the mhdhb to a character and then do the concatenate..

Example..

DATA: V_CHAR(4).

DATA : v_string TYPE string.

DATA:BEGIN OF itab OCCURS 0,

matnr LIKE mara-matnr,

meins LIKE mara-meins,

mhdhb LIKE mara-mhdhb,

END OF itab.

V_CHAR = ITAB-MHDHB.

CONCATENATE itab-matnr v_maktx itab-meins V_CHAR

INTO v_string SEPARATED BY '|'.

Thanks,

Naren

Read only

jayanthi_jayaraman
Active Contributor
0 Likes
682

Hi,

data v1(2000).

data v_mhdhb(30).

v_mhdhb = itab-mhdhb.

CONCATENATE itab-matnr v_maktx itab-meins v_mhdhb

INTO v1 SEPARATED BY '|'.

v_string = v1.

Message was edited by:

Jayanthi Jayaraman

Read only

Former Member
0 Likes
682

Hi,

Before concatenating it store the value in character field.

Rgds,

Prakash

Read only

Former Member
0 Likes
682

Here field itab-mhdhb is a DEC type and length is 4 so u can not do a concatenate operation on such kind of field.

Change defintiion of ur itab as follows -

DATA:BEGIN OF itab OCCURS 0,

matnr LIKE mara-matnr,

meins LIKE mara-meins,

mhdhb(4) type n,

END OF itab.

reward points if helpfull

amit