cancel
Showing results for 
Search instead for 
Did you mean: 

how to get ip field values to itab?

former_member182426
Active Contributor
0 Kudos

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.

Accepted Solutions (1)

Accepted Solutions (1)

former_member188685
Active Contributor
0 Kudos

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

former_member182426
Active Contributor
0 Kudos

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.

former_member188685
Active Contributor
0 Kudos

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.

Former Member
0 Kudos

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

Answers (0)