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

SELECTION-SCREEN problem

Former Member
0 Likes
1,013

[Background:]

(1)There are two parameters in a radio button group.

One is P_SCREEN,it means display report on screen

and another is P_FILE,it means output report into a file.

(2)There is a parameter P_NTFILE, use it to indicate output file path.

[Target:]

(1)After the selection-screen built,

If the P_FILE is checked,P_NTFILE should be enable.

If the P_SCREEN is checked,P_NTFILE should be disable.

[Code:]

*----


  • Parameter in Block2

*----


SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME.

SELECTION-SCREEN BEGIN OF LINE.

PARAMETERS: P_SCREEN RADIOBUTTON GROUP R1. " Screen output

SELECTION-SCREEN COMMENT 04(21) TEXT-001.

SELECTION-SCREEN POSITION 32.

PARAMETERS: P_FILE RADIOBUTTON GROUP R1. " NTFILE output

SELECTION-SCREEN COMMENT 35(17) TEXT-002.

SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN END OF BLOCK B2.

*----


  • Parameter in Block3

*----


SELECTION-SCREEN BEGIN OF BLOCK B3 WITH FRAME.

PARAMETERS: P_NTFILE(45) TYPE C LOWER CASE OBLIGATORY MODIF ID SC1.

  • P_PCFILE LIKE RLGRAP-FILENAME OBLIGATORY.

SELECTION-SCREEN END OF BLOCK B3.

&----


*& AT SELECTION-SCREE

&----


AT SELECTION-SCREEN.

IF P_SCREEN = 'X'.

FLAG = 0.

ENDIF.

IF P_FILE = 'X'.

FLAG = 1.

ENDIF.

&----


*& AT SELECTION-SCREE ON <FIELD>

&----


AT SELECTION-SCREEN ON RADIOBUTTON GROUP R1.

IF P_SCREEN = 'X'.

LOOP AT SCREEN.

IF SCREEN-GROUP1 = 'SC1'.

SCREEN-INPUT = FLAG.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ENDIF.

IF P_FILE = 'X'.

LOOP AT SCREEN.

IF SCREEN-GROUP1 = 'SC1'.

SCREEN-INPUT = FLAG.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ENDIF.

[Problem:]

P_NTFILE can not refresh between enable and disable status.

Anyone can help me?

8 REPLIES 8
Read only

Former Member
0 Likes
982

Hi,

In the AT SELECTION-SCREEN OUTPUT, U can use the function DYNP_VALUES_READ to get the value of P_FILE and P_SCREEN.

Then in the AT SELECTION-SCREEN OUTPUT event,

u can do the following:

LOOP AT SCREEN.

IF SCREEN-NAME = P_NTFILE and P_SCREEN = 'X'.

SCREEN-ACTIVE = 1.

MODIFY SCREEN.

ELSEIF SCREEN-NAME = P_NTFILE and P_FILE = 'X'.

SCREEN-ACTIVE = 0.

MODIFY SCREEN.

ENDIF.

The screen processing is always done in PBO and not in PAI.

AT SELECTION SCREEN ON P_SCREEN is a PAI event.

Another way is assign Function codes to ur radiobuttons using the follwoing:

PARAMETERS :

P_FILE RADIOBUTTON GROUP G1 USER-COMMAND 'FL',

P_SCREEN RADIOBUTTON GROUP G1 USER-COMMAND 'SC'.

CASE SY-UCOMM.

WHEN 'FL'.

Flag = 'F'.

WHEN 'SC'.

Flag = 'S'.

AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.

IF SCREEN-NAME = P_NTFILE and Flag = 'S'.

SCREEN-ACTIVE = 1.

MODIFY SCREEN.

ELSEIF SCREEN-NAME = P_NTFILE and Flag = 'F'.

SCREEN-ACTIVE = 0.

MODIFY SCREEN.

ENDIF.

Regards,

Himanshu.

Message was edited by:

Himanshu Aggarwal

Read only

Former Member
0 Likes
982

Put the loot at screen in 'AT SELECTION-SCREEN OUTPUT' event.

Refer the following code:

*---------------------------------------------------------------------
* AT SELECTION-SCREEN OUTPUT
*---------------------------------------------------------------------
AT SELECTION-SCREEN OUTPUT.

  LOOP AT SCREEN.
    IF p_sess = 'X'.
      IF screen-group1 = 'CTU'.
        screen-active = 0.
      ENDIF.
    ELSEIF p_ctu = 'X'.
      IF screen-group1 = 'SES'.
        screen-active = 0.
      ENDIF.
    ENDIF.
    MODIFY SCREEN.
  ENDLOOP.

Read only

Former Member
0 Likes
982

Move code from AT SELECTION-SCREEN ON RADIOBUTTON GROUP R1.

TO

AT SELECTION-SCREEN OUTPUT.

&----


*& AT SELECTION-SCREE ON <FIELD>

&----


AT SELECTION-SCREEN OUTPUT

IF P_SCREEN = 'X'.

LOOP AT SCREEN.

IF SCREEN-GROUP1 = 'SC1'.

SCREEN-INPUT = FLAG.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ENDIF.

IF P_FILE = 'X'.

LOOP AT SCREEN.

IF SCREEN-GROUP1 = 'SC1'.

SCREEN-INPUT = FLAG.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ENDIF.

You can probably set flag at the ON RADIOBUTTON EVENT

Hope this helps

Read only

Former Member
0 Likes
982

HI,

check this code this code disables and enable the particular parameter on relevant radio buttton checked.

just copy and paste and check you will understand the logic..

PARAMETERS: P_SCREEN RADIOBUTTON GROUP rad1 USER-COMMAND a DEFAULT 'X'.

PARAMETERS: P_NTFILE RADIOBUTTON GROUP rad1.

PARAMETERS : P_FILE (100) TYPE c MODIF ID mo1."

  • At selection Screen Output Event

AT SELECTION-SCREEN OUTPUT.

IF P_SCREEN EQ 'X'.

LOOP AT SCREEN.

IF screen-group1 = 'MO1'.

screen-input = 1.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ELSE.

LOOP AT SCREEN.

IF screen-group1 = 'MO1'.

screen-input = 0.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ENDIF.

rewards if useful

regards,

nazeer

Read only

Former Member
0 Likes
982

sorry i am not enough clear whether yo want to refresh the value or mode of display? if it is mode of display then

SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME.

SELECTION-SCREEN BEGIN OF LINE.

PARAMETERS: P_SCREEN RADIOBUTTON GROUP R1 USER-COMMAND ucom. " Screen output

SELECTION-SCREEN COMMENT 04(21) TEXT-001.

SELECTION-SCREEN POSITION 32.

PARAMETERS: P_FILE RADIOBUTTON GROUP R1. " NTFILE output

SELECTION-SCREEN COMMENT 35(17) TEXT-002.

SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN END OF BLOCK B2.

*----


  • Parameter in Block3

*----


SELECTION-SCREEN BEGIN OF BLOCK B3 WITH FRAME.

PARAMETERS: P_NTFILE(45) TYPE C LOWER CASE OBLIGATORY MODIF ID SC1.

  • P_PCFILE LIKE RLGRAP-FILENAME OBLIGATORY.

SELECTION-SCREEN END OF BLOCK B3.

&----


*& AT SELECTION-SCREE ON <FIELD>

&----


AT SELECTION-SCREEN ON RADIOBUTTON GROUP R1.

IF P_SCREEN = 'X'.

LOOP AT SCREEN.

IF SCREEN-GROUP1 = 'SC1'.

SCREEN-INPUT = '0'.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ENDIF.

IF P_FILE = 'X'.

LOOP AT SCREEN.

IF SCREEN-GROUP1 = 'SC1'.

SCREEN-INPUT = '1'.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ENDIF.

it will solve the problem if you want to refresh the value then just use clear : p_ntfile.

regards

shiba dutta

Read only

Former Member
0 Likes
982

&----


*& Report Z_JAGANOBJECT *

*& *

&----


*& *

*& *

&----


REPORT Z_JAGANOBJECT line-count 0(1) .

Tables sscrfields.

*--


parameters--


SELECTION-SCREEN BEGIN OF BLOCK RB1 WITH FRAME TITLE new.

selection-screen :skip 2.

PARAMETERS : cmp_name(10) type c,

imp_code(5) type n,

exp_cmp(10) TYPE c,

Exp_mtrl(10) TYPE c.

  • ------------------------radi button---------------------

SELECTION-SCREEN BEGIN OF BLOCK RB WITH FRAME TITLE text.

selection-screen: skip 1.

PARAMETERS : Import RADIOBUTTON GROUP RB user-command usr,

Export RADIOBUTTON GROUP RB DEFAULT 'X'.

SELECTION-SCREEN END OF BLOCK RB.

SELECTION-SCREEN END OF BLOCK RB1.

*--


push button--


SELECTION-SCREEN PUSHBUTTON /40(20) SAVE USER-COMMAND STORE.

DATA : FLAG TYPE I.

*--


internal tables--


data : begin of itab occurs 0,

cmp_name(10) type c,

imp_code(5) type n,

end of itab.

data : begin of itab1 occurs 0,

exp_cmp(10) TYPE c,

Exp_mtrl(10) TYPE c,

end of itab1.

*--


initalisaton--


.

INITIALIZATION.

save = 'store'.

text = ' Type '.

new = ' Import- Export details'.

*--


selection screen--


.

AT SELECTION-SCREEN.

case SSCRFIELDS-ucomm.

when 'STORE'.

FLAG = '1'.

if import = 'X'.

itab-cmp_name = cmp_name.

itab-imp_code = imp_code.

append itab.

clear itab.

endif.

if export = 'X'.

itab1-exp_cmp = exp_cmp.

itab1-Exp_mtrl = Exp_mtrl.

append itab1.

clear itab1.

endif.

ENDcase.

*--


selection screen output--


.

AT SELECTION-SCREEN OUTPUT.

IF export = 'X'.

LOOP AT SCREEN.

IF SCREEN-NAME = 'CMP_NAME' OR SCREEN-NAME = 'IMP_CODE'.

SCREEN-INPUT = '0'.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

elseIF import = 'X'.

LOOP AT SCREEN.

IF SCREEN-NAME = 'EXP_CMP' OR SCREEN-NAME = 'EXP_MTRL'.

SCREEN-INPUT = '0'.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ENDIF.

end-of-selection.

LOOP AT ITAB.

WRITE : /10 itab-cmp_name, 30 itab-imp_code.

ENDLOOP.

LOOP AT ITAB1.

WRITE : /10 itab1-exp_cmp,50 itab1-exp_mtrl.

ENDLOOP.

hope its useful,

reward points if its useful

regards

vijay

Read only

Former Member
0 Likes
982

This case referred to Type 1 program.

I made several exams,but I failed.

So, I wonder whetherType 1 could support PAI event.

Read only

0 Likes
982

Hi Mic,

It will not support.

Regards,

Atish