on 09-26-2005 9:56 PM
Hi,
I have a BSP and am using ABAP for scripting. I have a variable and I want to display the value on the webpage. What's the ABAP scripting syntax?
I tried:
<%
DATA: l_dat TYPE string.
l_dat = request->get_form_field( 'SELECTION' ).
WRITE: l_dat.
%>
I need the syntax to display l_dat.
Also, is there a ABAP scripting reference that shows syntax?
Thanks!
Hi Audrey,
it seems to me that you are new to BSP programming, so I hope you let me give you some starting advice.
Give the help on BSP a good read:
<a href="http://help.sap.com/saphelp_nw04/helpdata/en/e9/bb153aab4a0c0ee10000000a114084/frameset.htm">Business Server Pages</a>
While you can still come here for questions anytime, you might be better off doing some research on your own first.
Because even though the answers above are right and they do work, they will only confuse you, because there are many different ways to achieve the same goal - and without a proper understanding of the concepts it will be hard for you to find out by yourself which is the right way for your goal.
Therefore don't hesitate to ask, but be ready to get an overview yourself, as this will improve your understanding and answer most questions you have already.
Cheers,
Max
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI Audrey,
In the code you are using ,in layout itself,you just change your code as
<% DATA: l_dat TYPE string.
l_dat = request->get_form_field( 'SELECTION' ).
if l_dat is not initial.
%>
<htmlb:textView text = "<%= l_dat %>"
design = "EMPHASIZED" />
<%
endif.
%>
Regards,
Siddhartha
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
yes there is a way to put the things in one abap section.
but for that you have to use MVC.
since a controller class has a method write(). using that you can write to the view i.e html page.
e.g.
in do_request method of controller:
-
DATA: l_dat TYPE string,
fields type TIHTTPNVP,
wa_fields like line of fields.
CALL METHOD request->if_http_entity~get_form_fields
CHANGING
fields = fields.
loop at fields into wa_fields where name = 'SELECTION'.
l_dat = wa_fields-value.
endloop.
write( '<html><body><H1>' ).
WRITE( l_dat ).
write( '</H1></body></html>' ).
-
everything else is already mentioned.
regards,
Hemendra
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI Audrey,
You can't use
<b>write: l_dat <b> in Web Pages,the syntax to display a variable in ABAP would be
<%=l_dat%> or via using a textview as
<htmlb:textView text = "<%=l_dat %>"
id = "txt1"
design = "EMPHASIZED" />
in your layout.
If you are submitting the value on same page and want to show it then in the onInputProcessing or onrequest,depending on requirement ,you have to use
l_dat = request->get_form_field( 'txt1' )
where l_dat is a page attribute.
Hope this helps,
Regards,
Siddhartha
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Audrey,
Did you try this way
<%= I_data %>
Shailaja
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.