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: 

set text for Input/Output field in Dynpro dynamically

joan_ayala
Participant
0 Kudos

Hi,

if I do LOOP AT screen, and I stop in the Input/Output field where I want to show a text,

I cannot find a property like TEXT or VALUE where I can put my text.

How should I assign the text to my Input/Output field ?

thanks !!!

1 ACCEPTED SOLUTION

Former Member
0 Kudos

DATA: Field-name(29) TYPE c.

LOOP AT SCREEN.

IF screen-name = 'Field-name'.

Field-name = 'ABC'.

ENDIF.

MODIFY SCREEN.

ENDLOOP.

Edited by: Shivani Singhal on May 21, 2010 3:04 PM

7 REPLIES 7

Former Member
0 Kudos

Hi

You must create a global variable in the program where you screen (Dynpro) is defined.

The name and type of the variable must exactly match the name/type of the Input/Output field on your screen (Dynpro).

Then you can assign the value to the variable in the PBO module of your screen.

0 Kudos

which is the type of the Input/Output field ?

I guess it is a standard type.

Former Member
0 Kudos

DATA: Field-name(29) TYPE c.

LOOP AT SCREEN.

IF screen-name = 'Field-name'.

Field-name = 'ABC'.

ENDIF.

MODIFY SCREEN.

ENDLOOP.

Edited by: Shivani Singhal on May 21, 2010 3:04 PM

0 Kudos

it doesn't work. Maybe because it is an Input/Output field and should be another UI Element ?

0 Kudos

If that is an Input/Output field, you should be able to display the value directly.

For example: If on the screen, there is Input/Output field as IO_TEXT.

And a similar variable is defined in your ABAP program. Then if you assign a value (say IO_TEXT = 'Material No."), then it should display it on the screen.

Are you trying to display I/O field as label?

- Saurabh

0 Kudos

no, I did exactly what you did, but no text is appearing on the I/O field

0 Kudos

Strange.

I tried it just now and I was able to get the text on the screen.

Here's what I did.

PROGRAM YTESTSAB.

DATA: IO_TEST TYPE STRING.

&----


*& Module STATUS_9001 OUTPUT

&----


  • text

----


module STATUS_9001 output.

  • SET PF-STATUS 'xxxxxxxx'.

  • SET TITLEBAR 'xxx'.

CLEAR: io_test.

io_test = 'Material'.

endmodule. " STATUS_9001 OUTPUT