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

Reg : Reading run time value on an input field generated (Dynamic Document)

Former Member
0 Likes
1,491

Hello ,

I am using the cl_dd_input_element class for creating my input elements dynamically on a container ,

how i can i read value entered on that during runtime on click of any other button other than enter.

Best Regards,

Vinutha

11 REPLIES 11
Read only

Kiran_Valluru
Active Contributor
0 Likes
1,248

Hi,

Check this docu: http://help.sap.com/saphelp_470/helpdata/en/b6/ab3ac003ac11d4a73f0000e83dd863/content.htm

value Contains the Entered Input Value..

hope this helps u.,

Thanks & Regards,

Kiran

Read only

0 Likes
1,248

Hello Kiran,

Yeah this will have a value if i go to that u element and click on enter on it , on any other event on pai i cannot able to get the values entered,

for example if i have created 5 input elements dynamically i have to press enter on all the input fields to trigger my handler

i want to read the entered values on the screen on trigger of PAI on the screen

Best regards,

Vinutha

Read only

0 Likes
1,248

Hi,

I think you can manually trigger event entered in your PAI,

Let say when u press button , in Your PAI trigger the evens entered of cl_dd_input_element .

hope this helps u.,

Thanks & Regards,

Kiran

Read only

0 Likes
1,248

Hello,

I cannot set the focus on the input element as set_focus is obsolete and hence i cannot trigger an enter event at runtime and hence it is not capturing any value it is initial during runtime

Best Regards,

Vinutha

Read only

0 Likes
1,248

Hi,

To me Kiran is right. The attribute Value of the class cl_dd_input_element has the value of the input field captured in all the events(irrespective of the handler event set for that input field). For example take a look at the demo program DD_ADD_FORM_INPUT, in which the values of the input fields INPUT1 and INPUT2 are captured inside all the even handler methods(you can use input1->value in the debugger to see the value captured).

Hope this solved your problem.

Br,

Srikanth

Read only

0 Likes
1,248

Hai,

I know how to trigger PAI from the events of ALV or other classes,,,but how to trigger those events from PAI????

Best regards,

rama

Read only

martin_jonsson
Participant
0 Likes
1,248

Hello.

I'm facing the exact same problem. If you find a solution, could you let me know?

Cheers

Martin

Read only

Former Member
0 Likes
1,248

Hai,

Using the Events of the Class CL_DD_INPUT_ELEMENT you can do this:

set handler obj_event_handler->input_on_enter for input_element.

Now, define n implement this method in your class:

input_on_enter FOR EVENT entered OF cl_dd_input_element

IMPORTING sender.

Now, sender will help you fetch the value and the name of the input element.

Sender->Name: Name of the input element

Sender->Value: latest value entered in the input element.

Best regards,

rama

Read only

Former Member
0 Likes
1,248

hmmm..didnt read your post completely...it looks like we need to perform an Event like Enter or F1 to get the value...i too got struck here..i am also having problem in refreshing the display of this input element.

Best regards,

rama

Read only

Former Member
0 Likes
1,248

Hi,

Also, If you want to be able to read new value from your control before the PAI is finished, you have to dispatch the event yourself with the method cl_gui_cfw=>dispatch.

Kr,

m.

added: didn't read properly...sorry, this won't help for screen commands...

Edited by: Manu D'Haeyer on Oct 4, 2011 10:58 PM

Read only

0 Likes
1,248

Hey!

If the sender of your event is in the same form_area as your input element you can loop through it's table of elements and get your wanted values:


    data: curr_object  type ref to object,
          curr_element type ref to cl_dd_form_element,
          curr_iel     type ref to cl_dd_input_element,
          curr_fa      type ref to cl_dd_form_area,
          wele         type ref to cl_dd_input_element,
          wanted_v  type sdydo_value.

  try.
    curr_iel ?= sender.
    curr_fa = curr_iel->formarea.
    loop at curr_fa->table_of_elements into curr_object.
          curr_element ?= curr_object.
          case curr_element->name.
            when 'WANTED_ELEMENT'.
               wele ?= curr_element.
               wanted_v = wele->value.
          endcase.

    endloop.
  catch cx_sy_move_cast_error.
      "not the expected type
  endtry.