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: 

How to change length of IO field at runtime in module pool programming.

0 Kudos

Hi Experts,

I want to change the field length to 80, if the logon language is Russia(RU) in module pool programming. For other languages it should be 40.

Thanks.

4 REPLIES 4

former_member291653
Discoverer
0 Kudos

Create two input fields one with 80 and other with 40.In the PBO event of that screen

loop at screen.

if-sy-langu = ru.

screen-invisible = 1.for 40 lenghth field.

else

screen-invisible = 1 . for 80 length field

endif.

endloop.

former_member195402
Active Contributor
0 Kudos

Hi,

I think that is only possible using two different fields on the dynpro, and only one of them is visible depending on your logon language sy-langu. You can use screen-groups for that. You need a LOOP AT SCREEN in a PBO module for that.

Regards,

Klaus

former_member209120
Active Contributor
0 Kudos

Hi,

It think it is not possible for changing field length for a particular filed, you can follow as suggested by Klaus Babl.

See this link it will be helpful http://wiki.scn.sap.com/wiki/display/Snippets/Module+Pool+Notes

former_member289261
Active Contributor
0 Kudos

Hi,

You can do :

1. Use different fields and making 1 visible at a time according to the need.

2. Set the input type of text field to STRG which will allow the field to get variable length input. Then add a check module for the field in PAI of screen where you can write a code to restrict the length of the input by using STRLEN.

Logic :

     When language Russian and STRLEN > 80

          discard chars after 80 length.

     When other language and STRLEN > 40

          discard chars after 40 length.

Regards,

Ashish Rawat