cancel
Showing results for 
Search instead for 
Did you mean: 

Is there any other event than onEnter in Table element of web dynpro abap

Former Member
0 Kudos

Hi Experts!

Could any one tell me is there any event rather than onEnter event in Table element of Webdynpro abap.I like to use onTab event,is it possible?

Thanks

Shibin Thoms

Accepted Solutions (0)

Answers (1)

Answers (1)

ChrisPaine
Active Contributor
0 Kudos

Hi,

no such thing as onTab event - sorry.

But the events you get are more than just onEnter!

You have multiple selection type events, sort events, filter events, etc.

Have a look:

[Table Events - SAP Help|http://help.sap.com/saphelp_nw70ehp1/helpdata/en/2d/390e422dfcde2ce10000000a1550b0/frameset.htm]

And depending on the UI elements within your table you may have other event that could get triggered....

But not onTab unfortunately!

Cheers,

Chris

Former Member
0 Kudos

Thanks Chris.

Actually the question I have been posted was wrong.This is my requirement,

Is there any other event than onEnter in InputField which I am going to use under Table element of web dynpro abap.

As I am going to calculate, say a column quantiy while entering the value in this and when I enter tab in the next column say total price, it should calculate from the quantity and automatically the total price should display.

That's why I have asked whethetr any event is there apart from onEnter or it is quite fine if there is any other option or solution for this.

Since I am new to web dynpro kindly help me out.

Thanks

Shibin Thomas

ChrisPaine
Active Contributor
0 Kudos

Hi Shibin,

unfortunately the same response - and I'm sure you can work out how to get to the properties of the input field UI element from the previous link....

No onTab event.

Chris

Former Member
0 Kudos

You can use the INput field event OnEnter inside the Table. You can set a event and use this event handler to calculate your total etc...

I have a timesheet table in my WD application and on enter we have to get the total of the time entry entered by user. Please have a look on the below code. It will help you to achieve the requirement.

DATA lo_nd_node_time TYPE REF TO if_wd_context_node.

DATA lo_el_node_time TYPE REF TO if_wd_context_element.

DATA ls_node_time TYPE wd_this->element_node_time.

DATA: lt_time TYPE wd_this->elements_node_time,

ls_time TYPE wd_this->element_node_time,

ls_time1 TYPE wd_this->element_node_time.

  • Navigate from <CONTEXT> to <NODE_TIME> via lead selection

lo_nd_node_time = wd_context->get_child_node( name = wd_this->wdctx_node_time ).

CLEAR wd_this->gt_timeloggs.

  • Get the Time Entry table data

CALL METHOD lo_nd_node_time->get_static_attributes_table

EXPORTING

from = 1

to = 8

IMPORTING

table = wd_this->gt_timeloggs.

  • Set Total working hours

IF wd_this->gt_timeloggs IS NOT INITIAL.

LOOP AT wd_this->gt_timeloggs INTO ls_time.

ls_time1-week = ls_time-week.

ls_time1-w_mon = ls_time-w_mon.

ls_time1-w_tue = ls_time-w_tue.

ls_time1-w_wed = ls_time-w_wed.

ls_time1-w_thu = ls_time-w_thu.

ls_time1-w_fri = ls_time-w_fri.

ls_time1-w_sat = ls_time-w_sat.

ls_time1-w_sun = ls_time-w_sun.

ls_time1-tot_hrs = ( ls_time-w_mon + ls_time-w_tue + ls_time-w_wed +

ls_time-w_thu + ls_time-w_fri + ls_time-w_sat + ls_time-w_sun ).

APPEND ls_time1 TO lt_time.

CLEAR: ls_time, ls_time1.

ENDLOOP.

CLEAR wd_this->gt_timeloggs.

wd_this->gt_timeloggs = lt_time.

CLEAR lt_time.

  • Set layout table

lo_nd_node_time = wd_context->get_child_node( name = wd_this->wdctx_node_time ).

lo_nd_node_time->bind_table( wd_this->gt_timeloggs ).