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: 

Loop at screen

Former Member
0 Kudos

Hi All.

I have two radio buttons and one push button. I want to perform two operations like condense and shift. I have passed value in i/p field and If i press condense radio button it has to show 'condense' on a push button. If i press that push button, it has to show output in o/p field. when I press shift radio button the text on the push button has to change dynamically as 'shift'. How can i perform this operation. can you plz help me out?

1 ACCEPTED SOLUTION

prasanth_kasturi
Active Contributor
0 Kudos

firstly create a GLOBAL variable VAR in the below way

DATA : VAR LIKE smp_dyntxt VALUE 'CONDENSE'.

IN PBO

-


> create a status.

-


> Put the button on the application tool bar

-


> Give the FCT code for the button and press enter

-


> In the pop up choose DYNAMIC TEXT .

-


> you get another pop up select PROGRAM FIELD radio button.

-


> you will get a list of your fields in the program and you select the field VAR.

IN THE PAI

if radio butons are R1 and R2 write the code as follows



WHEN R1 = 'X'.

VAR = 'CONDENSE'.

WHEN R2 = 'X'.

VAR = 'SHIFT'.

and when you change the radio buttons text will change automatically.

NOTE : dont forget to give SY-UCOMM for your radio button group in the screen painter

regards

prasanth

6 REPLIES 6

Former Member
0 Kudos

Hi Sharuk,

When I understand your question correctly, you don't need a LOOP AT SCREEN.

Do simply this at your field output:

CASE 'X". 
  WHEN <condense period>. 
     write: / 'Condense', <o/field>. 
  WHEN <Shift period>. 
     write: / 'Shift', <o/field>. 
ENDCASE.

For LOOP AT SCREEN you have to declare MODIF ID in your parameter list. The MODIF ID can be used in the event AT SELECTION-SCREEN {INPUT|OUTPUT}. Using this technique you can achieve a dynamic Input-Screen.

Hope this helps,

Heinz

prasanth_kasturi
Active Contributor
0 Kudos

firstly create a GLOBAL variable VAR in the below way

DATA : VAR LIKE smp_dyntxt VALUE 'CONDENSE'.

IN PBO

-


> create a status.

-


> Put the button on the application tool bar

-


> Give the FCT code for the button and press enter

-


> In the pop up choose DYNAMIC TEXT .

-


> you get another pop up select PROGRAM FIELD radio button.

-


> you will get a list of your fields in the program and you select the field VAR.

IN THE PAI

if radio butons are R1 and R2 write the code as follows



WHEN R1 = 'X'.

VAR = 'CONDENSE'.

WHEN R2 = 'X'.

VAR = 'SHIFT'.

and when you change the radio buttons text will change automatically.

NOTE : dont forget to give SY-UCOMM for your radio button group in the screen painter

regards

prasanth

Former Member
0 Kudos

Hi Sharuk,

According to me Loop at screen is not required here.

Your problem can be solved in this manner:

suppose screen number 0100 and two global variable l_buttonname and l_input.

In PAI you have to code like this:


if R1 EQ 'X'.
 l_buttonname = "Condense".
 l_input = inputfieldvalue.
call screen 0100.
else.
 l_buttonname = "Shift".
 l_input = inputfieldvalue.
call screen 0100.
endif.

In PBO you have to code like this:


button-text = l_buttonname.

You can code your output conditions in PAI and directly transfer the data as global variable.

Hope this will solve your problem.

Regards,

Brajvir

Edited by: Brajvir Singh on Sep 15, 2008 12:53 PM

Former Member
0 Kudos

HI,

When creating application toolbar buttons in SE41 you get a option for text --- static or dynamic

select the dynamic text and provide the variable name.

Declare this variable in your mpp main program and set the text of your requirement based on the condition.

That will be reflected on your application tool bar buttons

regards

padma

Former Member
0 Kudos

firstly create a GLOBAL variable VAR in the below way

DATA : VAR LIKE smp_dyntxt VALUE 'CONDENSE'.

IN PBO

create a status.

Put the button on the application tool bar

-


> Give the FCT code for the button and press enter

-


> In the pop up choose DYNAMIC TEXT .

-


> you get another pop up select PROGRAM FIELD radio button.

-


> you will get a list of your fields in the program and you select the field VAR.

IN THE PAI

if radio butons are R1 and R2 write the code as follows

BOTH RADIO BUTTON SHOULD BE DEFIN TOGATHER

PROVIDE FUNC CODE TO UR RADIO BUTTON IT WILL SAME FOR BOTH (TEST2).

CASE OK_CODE.

WHEN

'TEST2'.

IF R1 = 'X'.

VAR = 'CONDENSE'.

ELSE.

VAR = 'SHIFT'.

ENDIF.

ENDCASE.

REGARDS

ANIL

Former Member
0 Kudos

HI,

YOu create a application toolbar buttons in SE41 you get a option for text --- static or dynamic

select the dynamic text and provide the variable name.

you give this variable as ZNAME.

you also create a pushbutton in screen ,let its FCODE is ENT.

Declare this variable in your mpp main program as

data:zname like smp_dyntxt

and set the text of your requirement based on the condition.

NOW in PAI.

you write as...

case sy-ucomm.

when 'ENT'.

if RADIO1 = 'X'.

zname-text = 'CONDENSE'.

endif.

if RADIO2 = 'X'.

zname-text = 'SHIFT'.

endif.

endcase.

Edited by: swati gupta on Sep 23, 2008 6:19 AM