‎2009 Nov 16 6:20 AM
Hello,
I want to change the text fields during runtime in screens.
If the label is 'EMPLOYEE'.
I want to change it to 'EMPLOYER'.
‎2009 Nov 19 11:55 AM
Hi,
Try this.
In the TOP include declare a variable of type string or c.(say w_test).
Now in the screen painter go to dictionary/program fields window(F6) and give w_test as input and click Get from program.Select the field and put it on the screen.Now go to the attribute window of the I/O field and in Program tab give output only.
Now the I/O field on the screen has been linked to the variable in your program.
Now whatever value you will assign to this variable(w_test) will be reflected on screen.
According to the condition dynamically change the values of the variable in the PBO ("employee" or"employer" in your case).
This should solve your problem.
Thanks and regards
Avinash
‎2009 Nov 16 2:28 PM
Hi,
We cannot change label directly but the same thing can be achieved in a different way. Instead of label create a I/O field
and go to Program and make it output only. it will now behave as label but the text can be changed iin the following way.
Step 1 : Declare a variable of TYPE STRING in your Program and map that i/o field(on screen) to this variable.
DATA: V_VAR1 TYPE STRING.
Now map it to from i/o field of screen.
Step 2: In the PBO of the screen write the following :
Loop AT SCREEN.
V_VAR1 = 'HII'.
ENDloop.
Thanks & Regards
Rocky kr. Agarwal
‎2009 Nov 16 3:18 PM
Hi,
In addition to Rocky's responce, You can select the screen field attribute 2D display in display tab to avoid displaying the borders for the input fields.
Thanks,
Vinod.
‎2009 Nov 18 2:29 PM
Hi,
Even if you want any other modufication you can check for more options in display tabs and you can go ahead.
Thanks & Regards
Rocky Kr. Agarawal
‎2009 Nov 19 11:02 AM
Hi ROCKY and Vinod I tried by using OUTPUT ONLY but then the field becomes invisible.
So what should be done about it?
‎2009 Nov 19 12:31 PM
Hi,
In top declare a variable .
tables: vekp.
Data: V_var1 TYPE STRING.
Go to screen layout create a textbox. Double click on it, a dialog box will appear. Click on program tab. make it output only. Now map it to the variable declared in top.
Mapping the variable:
Click on the text field. press F6. you will get a dialog box. Enter the name of the variable (V_var1) and click on get from program.
But before clicking on Get to program make sure that your top declaration is active. After clicking on Get from program select the listed variable and click on check.
Activate the screen.
In the PBO of the screen assign a value to the variable
module STATUS_0100 output.
SET PF-STATUS 'xxxxxxxx'.
SET TITLEBAR 'xxx'.
Loop AT SCREEN.
V_var1 = 'HII'.
ENDloop.
endmodule.
It will work. It has to work. Try and see. If still not working then paste the code that u have written.
Thanks & regards
Rocky
‎2009 Nov 19 12:34 PM
Hi,
I wrongly added table in top include. Please avoid that.
Thanks & Regards
Rocky
‎2009 Nov 19 12:48 PM
Hi Rocky,sgrshah,
We do not need to "loop at screen" for assigning the value to the variable and displaying it on screen.
Only V_var1 = 'HII' will work fine.
Thanks
Avinash
‎2009 Nov 19 8:43 AM
Hi, In PBO you will have to put code as follows
loop at screen
make the text fieldvisible/invisible according to the condition.
modify screen.
endloop.
Edited by: bhushankotwal on Nov 19, 2009 9:44 AM
‎2009 Nov 19 11:55 AM
Hi,
Try this.
In the TOP include declare a variable of type string or c.(say w_test).
Now in the screen painter go to dictionary/program fields window(F6) and give w_test as input and click Get from program.Select the field and put it on the screen.Now go to the attribute window of the I/O field and in Program tab give output only.
Now the I/O field on the screen has been linked to the variable in your program.
Now whatever value you will assign to this variable(w_test) will be reflected on screen.
According to the condition dynamically change the values of the variable in the PBO ("employee" or"employer" in your case).
This should solve your problem.
Thanks and regards
Avinash