on 10-03-2008 1:33 PM
hi,
plz tel me how to get the values of set of inputfields into ITAB.
suppose in BSP page there are three input fields like ...
StudetnID
NAME
PLACE
After Entering the details when i click save button it has to be store in dbtable.
Plz help me.. i am new to BSP....
Regards,
shankar.
It will not update directly, you need to code for that.
After entering the data to the input fields, then trigger some action. in the event processing you capture the data what ever entered using the form_fields and then update the data to the DB using some function or BAPI. if it is custom table , then you can try with Modify or update
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
thanks for ur reply.But i am unable to get wat to do in ONINPUTPROCESSING event.
I know we have to create an events.
and for one input filed is..
DATA: studentno TYPE REF TO CL_HTMLB_INPUTFIELD.
studentno?= CL_HTMLB_MANAGER=>GET_DATA( request = runtime->server->request
name = 'inputfield'
id = 'IP_STUID' ).
suppose there are more fields like 10 to 15 fields at that time wat we have to do.
plz can u provide littile bit of example code.
Regards,
Shankar.
you can do this also..
data: fields type TIHTTPNVP.
request->get_form_fields(
CHANGING
fields = fields
).
"read the fields for the field what ever you want with the id.
" name is the id of the input field.
"read all the input fields value using loop or read.
read table fields into wa_fields with name = 'ip1'.
if sy-subrc eq 0.
"capture the value using wa_fields-value.
endif.
Hi Shankar,
Try like this...
DATA: event type ref to cl_htmlb_event.
DATA: ip_fields type TIHTTPNVP,
wa_fields type ihttpnvp.
event = cl_htmlb_manager=>get_event( runtime->server->request ).
if event->id = 'btn'.
request->get_form_fields( changing fields = ip_fields ).
"for stud_id
READ TABLE ip_fields INTO wa_fields WITH KEY name = 'ip1'.
IF sy-subrc = 0.
MOVE: wa_fields-value TO i_id.
ENDIF.
"for name
READ TABLE ip_fields INTO wa_fields WITH KEY name = 'ip2'.
IF sy-subrc = 0.
MOVE: wa_fields-value TO i_name.
ENDIF.
"for place
READ TABLE ip_fields INTO wa_fields WITH KEY name = 'ip3'.
IF sy-subrc = 0.
MOVE: wa_fields-value TO i_place.
ENDIF.
endif.
In layout
<htmlb:inputField id = 'ip1' value = '<%=i_id %>'/>
<htmlb:inputField id = 'ip2' value = '<%=i_name %>'/>
<htmlb:inputField id = 'ip3' value = '<%=i_place %>'/>
Give all the values with in double quote which are all written in single quote
Regards,
Sri
User | Count |
---|---|
86 | |
10 | |
9 | |
9 | |
9 | |
6 | |
6 | |
5 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.