Skip to Content
0
Former Member
Jun 28, 2007 at 12:36 PM

Value from java script to ABAP

22 Views

Hi

Please tell me how to get value from java script to ABAP variable.Here I have a Date variable Which is the input.After the client validations I have to move this value to LV_DATE which is ABAP variable.Please see my code and help me.

<script type="text/javascript">

function checkInput()

{

var dateval = document.form1.date.value

alert(dateval);

var today = new Date();

var get_date = today.getDate();

if (get_date < 9)

{

get_date = "0"+get_date;

}

var get_month = today.getMonth()+1;

if (get_month < 9)

{

get_month = "0"+get_month;

}

var today_date = get_date"."get_month"."(today.getFullYear());

alert(today_date);

if (dateval == "" || dateval > today_date)

{

alert("please enter date less than or equal to today");

}

else

{

htmlbSL(this,2,'mybutton:Submit');

}

}

</script>

<htmlb:tray id = "t1"

title = "Sample Window"

design = "BORDERLESS"

isCollapsed = "false"

width = "75%" >

<htmlb:trayBody>

<htmlb:textView text = "Hello World!"

textColor = "RED"

design = "HEADER1"

align = "CENTER" />

<htmlb:inputField id = "date"

type = "DATE"

showHelp = "TRUE"

alignment = "CENTER"

/>

<htmlb:button id = "mybutton"

text = "Press Me"

onClientClick = "javascript:checkInput();" />

</htmlb:trayBody>

</htmlb:tray>

I am new to BSP Please tell me indetail.I also went through the previous posts but I didn't get it perfectly.

Thank You.

Regards

Giri.