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

a string with some variables in it

Former Member
0 Likes
883

Hi Friends,

I am trying to construct a string with some variables in it.

I am not getting the values of the variables

instead only the string. How must the below string look

if pa_lief and pa_bukr are variables where contain values.

ls_options-TEXT =  'LIFNR =  pa_lief AND BUKRS =  pa_bukr '.
APPEND ls_options TO lt_options.

Kindly regards

Marco

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
848

CONCATENATE 'LIFNR =' pa_lief 'AND BUKRS =' pa_bukr into ls_options-TEXT separated by ' '.

Regds,

Senthil

Hi Friends,

I am trying to construct a string with some variables in it.

I am not getting the values of the variables

instead only the string. How must the below string look

if pa_lief and pa_bukr are variables where contain values.

ls_options-TEXT =  'LIFNR =  pa_lief AND BUKRS =  pa_bukr '.
APPEND ls_options TO lt_options.

Kindly regards

Marco

5 REPLIES 5
Read only

Former Member
0 Likes
849

CONCATENATE 'LIFNR =' pa_lief 'AND BUKRS =' pa_bukr into ls_options-TEXT separated by ' '.

Regds,

Senthil

Read only

0 Likes
848

Kumar thx since this is a criteria of select statement I need both the values and the quotes.

like

ls_options-TEXT = 'WHERE LIFNR = ''0000241332'' AND BUKRS = ''0120'''.

Regards

Marco

Read only

0 Likes
848

This seems very basic. You just include the quotes when doing the concatenation, being careful of spaces.

Rob

Read only

0 Likes
848

Why do you need double quotes ".. double quotes doesnot mean anything but comment.

Concatenate should suffice your where condition.

CONCATENATE 'WHERE' 'LIFNR =' pa_lief 'AND BUKRS =' pa_bukr into ls_options-TEXT separated by ' '.

WRITE : 'WHERE', 'LIFNR =', pa_lief, 'AND BUKRS =', pa_bukr to ls_options-TEXT.

Read only

former_member186741
Active Contributor
0 Likes
848

why do you want the variable values rather than the names? The sql select can cope with the variable names.

I think Senthil's original solution is fine,

CONCATENATE 'LIFNR =' pa_lief 'AND BUKRS =' pa_bukr into ls_options-TEXT separated by ' '.