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

Display ABAP variable in an HTML page

Former Member
0 Likes
3,376

I am trying to display an ABAP variable in an HTML page. What is the syntax for the same? Kindly help.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,558

So this concatenation takes place in an abap variable or an html variable.

And what is the syntax going to be like??

I am trying to display an ABAP variable in an HTML page. What is the syntax for the same? Kindly help.

14 REPLIES 14
Read only

athavanraja
Active Contributor
0 Likes
2,558

which HTML page?

a BSP page ?

or

ITS generated page?

or HTML in HTML viewer control within SAPGUI?

Raja

Read only

Former Member
0 Likes
2,558

its a bsp page....

Read only

0 Likes
2,558

just put the ABAP variable like below in the layout section.

<%= abap_var %>

in future for BSP related question use BSP forum at

Regards

Raja

Read only

Former Member
0 Likes
2,558

I already tried that...Its not displaying nething...This is my syntax...

data: l_r_tmp_var type i.

l_r_tmp_var = I_VALUE.

IF I_X = 2 AND I_VALUE > 200000.

C_CELL_CONTENT = '<table><tr><td colspan=6 style="background:green;height:20px"><%= l_r_tmp_var %></td></tr></table>'.

ENDIF.

Plz tell me where I am going wrong??

Read only

0 Likes
2,558

are you sure its a BSP?

how are you presenting the c_cell_content in the page?

let me know where you have written this code? i mean from which transaction?

Read only

0 Likes
2,558

it looks to that you are writing this code in the table interface class which is used in BW webtemplate

correct me if i am wrong

Read only

0 Likes
2,558

if its webtemplate (table interface class) it has to be like below

concatenate '<table><tr><td colspan=6 style="background:green;height:20px">'

l_r_tmp_var

'</td></tr></table>' into C_CELL_CONTENT

Read only

Former Member
0 Likes
2,558

Thats exactly what im doing...modifying a class to change the properties of the table in a web template. Srry its not a BSP page....

I tried ur syntax..

concatenate '<table><tr><td colspan=6 style="background:green;height:20px">'l_r_tmp_var'</td></tr></table>' into C_CELL_CONTENT.

.It gives an error..

After "'<table><tr><td colspan=6 style="background:green;height:20px">'", there must be a space or equivalent character (":", ",", "."). (":", "

And when i remove the single quotes from the variable...it gives an error...

Unable to interpret "'<table><tr><td colspan=6

style="background:green;height:20px">l_r_tmp_var</td></tr></table>'".

Possible causes: Incorrect spelling or comma error.

Plz help...

Read only

0 Likes
2,558

copy paste the below code.

concatenate `<table><tr><td colspan=6 style="background:green;height:20px">`
l_r_tmp_var
`</td></tr></table>`
 into C_CELL_CONTENT.

Regards

Raja

Read only

Former Member
0 Likes
2,558

Ok its workin now....I changed the variable's type definition to char.

Thnx a lot.

Can u plz solve one more problem?

"<table><tr><td colspan=6 style="background:green;height:20px">l_r_tmp_var

`</td></tr></table>"

Instead of this I want a longer code....but it gives an error saying "Literals that take up more than one line are not permitted.

"

is there any soln to this problem??

Read only

0 Likes
2,558

Literals that take up more than one line are not permitted.

the above error will happend if the open quote and close quote are not in the same line

why do you want long line.

you can split it and use concatenate to concatenate into a string

Read only

Former Member
0 Likes
2,559

So this concatenation takes place in an abap variable or an html variable.

And what is the syntax going to be like??

Read only

0 Likes
2,558

concatenation in abap

concatenate `text literal 1` `text literal 2 ` abap_var1 abap_var2 into result_var .

Read only

Former Member
0 Likes
2,558

Ok... I'll try this out...thnx a lot for ur help