Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

how to get ip field values to itab?

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.

replied

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

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question