Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

How to get the input value from inputfield in javascript code for BSP Application

Former Member
0 Likes
956

Hi All,

         I developed the BSP Applications using java script. I want to get the input value into abap variable from inputfield in javascript. I have written the function code for this but it was not triggered. If any one knows Please let me know ASAP.

Thanks,

Santhosh

4 REPLIES 4
Read only

venkatakrishna
Active Participant
0 Likes
648

Hi,

Try this

1. Declare Input field like this on the layout of BSP, where ZNUM is the name of your input field.

                   <input type='text' id="ZNUM" name="ZNUM"
                           size="10" maxlength="10" value="" />

2.in on inputprocessing event you can fetch its value as Below.

write case statement for the event on any button of your layout.

Eg:- submit button

on layout.

         <input name="onInputProcessing(submit)" type="submit" value=" Search " id="Search" class="cell"
         style="margin-left:35px; position: absolute" />

on oninpuprocessing

ld_event = event_id.


case ld_event .
   when 'submit'.

  number(where you will get input value)  = request->get_form_field( 'ZNUM' ).

endcase.


Regards,

Venkat

Read only

0 Likes
648

Hi Venkat,

        I know the above condition. I want the same using Java Script in BSP.

Thanks,

Santhosh

Read only

0 Likes
648

Hi ,

Check this

var w_stat;

  var w_stat_val;

      w_stat = document.getElementById('ZNUM');

      w_stat_val = w_stat.value;

Regards,

Venkat

Read only

0 Likes
648

Hi Venkat,

       Thanks for given info. How can we pass this w_stat_val in abap variable.

Thanks,
Santhosh.