Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8581

how to fetch data from database table in bsp abap ?

$
0
0

Hi Developer ,

 

I have developed a bsp application but in need to fetch data from database table which contain entries in it ,but i have return logic its not fetch the data base table .

 

i have developed two input fields user name and password i need to validate the user name and password from the data base table ,please guide in solve the issues.

 

example code.

the code is return in on input processing in event handler.

 

DATA:login1 type REF TO cl_htmlb_inputfield,

      password TYPE REF TO cl_htmlb_inputfield,

      button_event      type ref to cl_htmlb_event_button ,

      event TYPE REF TO cl_htmlb_event,

      fl_flag type i,

      w_msg type string,

      uname type zbsp_insert-zuname,

      zpswd type zbsp_insert-zpswd.

 

event ?= CL_HTMLB_MANAGER=>GET_EVENT( request ).

 

 

   login1 ?= CL_HTMLB_MANAGER=>GET_DATA(

                     REQUEST = runtime->server->request

                     NAME    = 'inputfield'

                     ID      = 'id_login'

                     ).

    password ?= CL_HTMLB_MANAGER=>GET_DATA(

                     REQUEST = runtime->server->request

                     NAME    = 'inputfield'

                     ID      = 'id_password'

                     ).

 

  i_login = login1->value.

  i_password = password->value.

  move i_login to wa_insert-ZUNAME.

  move i_password to wa_insert-zpswd.

  APPEND wa_insert to it_insert.

CASE event->id.

 

WHEN 'submit'.

select * from zbsp_insert into TABLE it_insert where zuname = i_login and zpswd = i_password .

if sy-subrc eq 0.

navigation->goto_page('second.htm').

ENDIF.

If i_login ne uname.

w_msg = 'Enter the vaild username'.

elseif i_password ne zpswd.

w_msg = 'Enter the vaild password'.

endif.

ENDCASE.


thanks,

ravi.


Viewing all articles
Browse latest Browse all 8581

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>