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

concatenating string with a variable

Former Member
0 Likes
960

Hello,

i have used a 'select-options' in my report. I want to display the low and high option of it as a text on the top of my page, sumthing like.

write: 'ABCDEFG' + s_bldat-low + 'to' + s_bldat-high.

how do that ?

Thanks..

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
853

c'ABCDEFG' + s_bldat-low + 'to' + s_bldat-high.

concanate into string.

and write string.

5 REPLIES 5
Read only

Former Member
0 Likes
854

c'ABCDEFG' + s_bldat-low + 'to' + s_bldat-high.

concanate into string.

and write string.

Read only

Former Member
0 Likes
853

hi,

use

read table s_date index 1.

write 😕 'ABCDEFG',

s_date-low,

'to',

s_date-high.

but this will works fine only if user enters only 1 range.

if he gives more than 1 range of dates, this would not work .

so what you can do is, send this date select-option to the table where you match the dates and fetch all the dates into the internal table .

example :

if your date is for material creation date & you would like to know the dates ,

data : begin of it_ersda occurs 0,

date type sy-datum,

end of i_ersda.

select ersda

into table it_ersda

from mara

where ersda in s_date.

sort it_ersda by ersda.

*--now IT_ERSDA table will have the valid material creation dates in ascending order.

read table it_ersda index 1.

v_startdate = it_ersda-ersda.

describe table it_ersda lines v_lines.

read table it_ersda index v_lines.

v_enddate = it_ersda-ersda.

now you can use write, to print the start date and end date.

write 😕 'ABCDEFG',

v_startdate,

'to',

v_enddate.

use this statement in TOP-OF-PAGE.

regards

srikanth

Message was edited by: Srikanth Kidambi

Read only

former_member183804
Active Contributor
0 Likes
853

Hello Shehryar,

as a select-option may contain several values, the idea to display 'THE' value might not be possible at all.

If there is definitely only one value and you use list processing then you may write a header info in the at top of page list event.

Regards

Klaus

Read only

Former Member
0 Likes
853

Select-options will have multiple value but if you are sure its going to be only one. Then try following:

data: v_string(50) type c.

read table s_bldat index 1.

concatenate 'ABCDE' s_bldat-low 'to' s_bldat-high into v_string separated by space.

write: v_string.

Regards

Damasus

Read only

Former Member
0 Likes
853

Shehyar,

Try and use the below function module to print the description.

CALL FUNCTION 'SELOPT_PRINT'

EXPORTING

TEXT = TEXT-T07

TABLES

SELOPT = SO_VSTEL.