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

Dialog programming

Former Member
0 Likes
440

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.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
419

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

4 REPLIES 4
Read only

Former Member
0 Likes
419

You could do that with a module chain.

Read only

Former Member
0 Likes
420

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

Read only

Former Member
0 Likes
419

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

Read only

Former Member
0 Likes
419

I too have a similar problem!!!