‎2008 Nov 13 4:23 PM
Hi all,
I need some of your help.
I have a dynpro where i am typing value in one of fields then i need to concatenate this value with a consecutive number and set the result in other field definied like output field, I want to make this action without press enter key. Some one knows some event to do this, that is to say, just a click ?
Thanks in advance.
Mar.
‎2008 Nov 14 8:17 AM
Hi,
as you want this without pressing enter , so try this
like if you have input field as <field1>
and the other is output field <field2>
use FM DYNP_VALUES_READ to read the contents of <field1> and then do the processing.
see the sample code:
____________________________________________________________________
data: i_dynpfields TYPE STANDARD TABLE OF dynpread, " Screen Values
wa_dynpfields LIKE LINE OF i_dynpfields,
MOVE: <pass name of field1 in caps within quotes> TO wa_dynpfields-fieldname.
APPEND wa_dynpfields TO i_dynpfields.
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
dyname = sy-cprog
dynumb = sy-dynnr
TABLES
dynpfields = i_dynpfields
EXCEPTIONS
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE 'I' NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
EXIT.
ENDIF.
READ TABLE i_dynpfields INTO wa_dynpfields INDEX 1.
**here u will get the value on screen in wa_dynpfields-fieldvalue
‎2008 Nov 13 4:31 PM
‎2008 Nov 14 8:17 AM
Hi,
as you want this without pressing enter , so try this
like if you have input field as <field1>
and the other is output field <field2>
use FM DYNP_VALUES_READ to read the contents of <field1> and then do the processing.
see the sample code:
____________________________________________________________________
data: i_dynpfields TYPE STANDARD TABLE OF dynpread, " Screen Values
wa_dynpfields LIKE LINE OF i_dynpfields,
MOVE: <pass name of field1 in caps within quotes> TO wa_dynpfields-fieldname.
APPEND wa_dynpfields TO i_dynpfields.
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
dyname = sy-cprog
dynumb = sy-dynnr
TABLES
dynpfields = i_dynpfields
EXCEPTIONS
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE 'I' NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
EXIT.
ENDIF.
READ TABLE i_dynpfields INTO wa_dynpfields INDEX 1.
**here u will get the value on screen in wa_dynpfields-fieldvalue
‎2008 Nov 14 8:37 AM
Hi Marisol,
All the solutions mentioned above are OK but they all require on basic even to be trigerred for being successfull and i.e. PAI.
Do the following:
Assign a command to your input field on the screen. (The command/ok code should be there in the attrbutes of the field on the screen).
Now when you enter any value in your input field and say you click any where on your screen outside the input field system will trigger the PAI. Now in the PAI you can write code to process the value of the input field and put that in the output field.
Regards,
Prakash Pandey
‎2008 Nov 14 9:46 AM