Application Development 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: 

Input field event

former_member188005
Contributor
0 Kudos
1,281

Hi All,

I have a requriement where in I have to populate the input field on the screen based on the input in the other filed.

Example:

I have to input fields on the screen F1 and F2.

If the user enters "123" in F1 then 456 should be populated in F2 with out any button pressed.

Is there any event in ABAP for Input fields where in we can trigger our code based on some input from keyboard without doing/pressing any button.(Such as" if field value " or Field empty etc)

Kindly suggest how to proceed futher with this type of requriement.

Thanks in advance for all the suggestions and solution.

Regards..

Shakeel

5 REPLIES 5

former_member188685
Active Contributor
0 Kudos
191

Event: AT SELECTION-SCREEN ON <FIELDNAME>.

after inut, press enter then it will be filled automatically

REPORT ZTEST.
data: lt_dr like dynpread occurs 0 with header line.

 parameters: f1 type char10,
             f2 type char10.

 at selection-screen on  f1.
 lt_dr-fieldname = 'F1'.
  append lt_dr.

  call function 'DYNP_VALUES_READ'
       exporting
            dyname               = sy-repid
            dynumb               = '1000'
       tables
            dynpfields           = lt_dr
       exceptions
            invalid_abapworkarea = 1
            invalid_dynprofield  = 2
            invalid_dynproname   = 3
            invalid_dynpronummer = 4
            invalid_request      = 5
            no_fielddescription  = 6
            invalid_parameter    = 7
            undefind_error       = 8
            double_conversion    = 9
            others               = 10.
  if sy-subrc eq 0.
   read table lt_dr index q.
   if lt_dr-fieldvalue = '123'.
   f2 = '123434'.
   endif.
  endif.

0 Kudos
191

Vijay,

Thanks for the reply.

The fields are not selection screen fields, they are screen fields which I have created for Module pool program.

Kindly let me know any screen field events are there for my requriement which is similar to the selection screen fields events.

Regards..

Shakeel

Edited by: Shakeel on Aug 2, 2008 10:58 AM

0 Kudos
191

In that case , you have to go for Flow ligic Event PAI.

In PAI

Flow logic..

FIELD F1 MODULE MODULE_NAME.

Module logic.

MODULE MODULE_NAME ......

IF F1 = '123'.

F2 = '456'.

ENDIF.

ENDMODULE.

0 Kudos
191

Vijay,

Thanks for the reply.

I totally agree with you that we have to write the logic in PAI.

But the PAI is triggered when the user presses some key/button.

My requriement is without pressing the key/button event should triggered in ABAP.

When the user inputs some data in Field then some event has to be triggered with out any action from user except inputing the data in the field.

Regards...

Shakeel

former_member181995
Active Contributor
0 Kudos
191

Shakeel,

Should be in PAI ,

put a logic with like that read the screen field with codition if field1 is not initial than modify field2 else nothing.

if F1-field1 ne initial."this if F1 screen field
F2-field2 = F1-field1.
modify F2-field2.
endif.

Amit.