Application Development 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: 

Move a string to a varaible declared as type ref to Data

Former Member
0 Kudos

Hi ,

I have a standard method , having a parameter defined as type ref to data.

The requirement is to concatenate two strings and move the result to this parameter.

Please suggest a solution.

Regards

Arun

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Arun,

Following is a sample code..

DATA:

ABC TYPE REF TO DATA,

TEMP1 TYPE STRING,

TEMP2 TYPE STRING.

FIELD-SYMBOLS: <FS> TYPE ANY.

TEMP1 = 'First String'.

TEMP2 = 'Second String'.

CONCATENATE TEMP1 TEMP2 INTO TEMP2.

GET REFERENCE OF TEMP2 INTO ABC.

Hope it helps...

Regards,

Komal.

3 REPLIES 3

former_member188685
Active Contributor
0 Kudos

hi arun,

concatenate the tow strings and then assign it to the variable via field symbol.

regards

vijay

Former Member
0 Kudos

Hi Arun,

Following is a sample code..

DATA:

ABC TYPE REF TO DATA,

TEMP1 TYPE STRING,

TEMP2 TYPE STRING.

FIELD-SYMBOLS: <FS> TYPE ANY.

TEMP1 = 'First String'.

TEMP2 = 'Second String'.

CONCATENATE TEMP1 TEMP2 INTO TEMP2.

GET REFERENCE OF TEMP2 INTO ABC.

Hope it helps...

Regards,

Komal.

Former Member
0 Kudos

Hi,

here is a sample

DATA T TYPE STRING VALUE `test1`.

DATA Q TYPE STRING VALUE `test2`.

DATA E TYPE REF TO DATA.

CREATE DATA E TYPE STRING.

FIELD-SYMBOLS <FS> TYPE ANY.

PERFORM CONCATE USING T Q CHANGING E.

ASSIGN E->* TO <FS>.

WRITE <FS>.

FORM CONCATE

USING T TYPE STRING Q TYPE STRING

CHANGING E TYPE REF TO DATA.

DATA EX TYPE STRING.

FIELD-SYMBOLS <FST> TYPE ANY.

ASSIGN E->* TO <FST>.

///CONCATE STRINGS TO EX.

<FST> = EX.

ENDFORM. "concate

regards

austin