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

BSP application

Former Member
0 Likes
527

Hi experts,

Is it possible to use IF...else... endif in bsp application,

I am passing some variables from abap to BSP application, and wish to run html codes according to variable value.

if flag = 'X'.

html codes

else.

message text.

endif.

3 REPLIES 3
Read only

Former Member
0 Likes
507

Hi,

It is possible. You can write code in Event Handler 'On Create/On Initialization/On InputProcessing

IF event->id = 'orgButton' AND event->event_type = 'click'.

DATA: data TYPE REF TO CL_HTMLB_INPUTFIELD.

data ?= CL_HTMLB_MANAGER=>GET_DATA(

request = runtime->server->request

name = 'inputField'

id = 'id1'

).

You can also write code in the 'Layout' also.

Look this:

<% if i_mara is not initial. %> <tr> <td><b>MATNR</b></td>

</tr>

<% loop at i_mara into wa_mara. %><tr>

<td> <%= wa_mara-matnr %> </td>

</tr>

<% endloop. %> <% else. %> <tr> <td><b>MATNR</b></td>

</tr>

<% endif. %>

Regards..

Edited by: Neenu Jose on Oct 22, 2008 2:04 PM

Edited by: Neenu Jose on Oct 22, 2008 2:05 PM

Edited by: Neenu Jose on Oct 22, 2008 2:07 PM

Edited by: Neenu Jose on Oct 22, 2008 2:10 PM

Read only

Former Member
0 Likes
507

U can as said above..have A LOOK

<% if flag = 'X'. %>

html codes

<% else. %>

message text.

<% endif. %>

Deepak

Read only

Former Member
0 Likes
507

it is possible using the abap code directive you can do that

<% here you can write the abapcode, syntaxt is smae  %> 
 here you write the htmlb tags or html code
<% here you can end the abapcode %>