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

Help in report UI and code

Former Member
0 Likes
702

HI Experts ,

I need to create report and i need to help for GUI aspects (i want it to be looking nice ).

in the report i have 3 options (i don't know if radio button is the best way ) .

1. Read user attributes

2. create user attributes

3. create user values

if user choose to read attributes (which is defult ) the other option are should be deactivated ,

but when user choose to create he can choose one of the option or either both option ( 2,3 )

i need for that i guess 3 buttons .

what is the best why to do that from GUI aspects ,and code will help

I read lot of post on the forum but i get confused

Regards

Chris

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
676

Hi,

It is better to use check box for this, it would be better since when he clicks create , the user can select any other option,

Please see a sample program using radio buttons, change accordingly for Check box,

tables : zcust_master2.

SELECTION-SCREEN BEGIN OF BLOCK 001.
PARAMETERS: P_MRU  RADIOBUTTON GROUP SEL DEFAULT 'X' USER-COMMAND AC,
            P_PART RADIOBUTTON GROUP SEL.
    SELECT-OPTIONS P1 FOR zcust_master2-zcustid MODIF ID PRT.
    SELECT-OPTIONS G1 FOR zcust_master2-zcustname  MODIF ID MRU.
SELECTION-SCREEN END OF BLOCK 001.


AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
  IF P_MRU = 'X'.
      IF SCREEN-GROUP1 = 'PRT'.
        SCREEN-INPUT = '0'.
      ENDIF.
      IF SCREEN-GROUP1 = 'MRU'.
        SCREEN-INPUT = '1'.
      ENDIF.
  ELSEIF P_PART = 'X'.
     IF SCREEN-GROUP1 = 'MRU'.
       SCREEN-INPUT = '0'.
     ENDIF.
     IF SCREEN-GROUP1 = 'PRT'.
       SCREEN-INPUT = '1'.
     ENDIF.
  ENDIF.
  MODIFY SCREEN.
ENDLOOP.

8 REPLIES 8
Read only

Former Member
0 Likes
676

Hi,

Its better you use a check box instaed of a radio button. if you use radio button only one option can be selected at any point of time. So use checkbox.

Thanks,

HArini

Read only

0 Likes
676

HI Harini

One thing that i forget to mention is the in the screen i have 3 parameters

and when user choose option 3 (create user values ) new fields for input should apper .

Thanks Chris

Read only

Former Member
0 Likes
677

Hi,

It is better to use check box for this, it would be better since when he clicks create , the user can select any other option,

Please see a sample program using radio buttons, change accordingly for Check box,

tables : zcust_master2.

SELECTION-SCREEN BEGIN OF BLOCK 001.
PARAMETERS: P_MRU  RADIOBUTTON GROUP SEL DEFAULT 'X' USER-COMMAND AC,
            P_PART RADIOBUTTON GROUP SEL.
    SELECT-OPTIONS P1 FOR zcust_master2-zcustid MODIF ID PRT.
    SELECT-OPTIONS G1 FOR zcust_master2-zcustname  MODIF ID MRU.
SELECTION-SCREEN END OF BLOCK 001.


AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
  IF P_MRU = 'X'.
      IF SCREEN-GROUP1 = 'PRT'.
        SCREEN-INPUT = '0'.
      ENDIF.
      IF SCREEN-GROUP1 = 'MRU'.
        SCREEN-INPUT = '1'.
      ENDIF.
  ELSEIF P_PART = 'X'.
     IF SCREEN-GROUP1 = 'MRU'.
       SCREEN-INPUT = '0'.
     ENDIF.
     IF SCREEN-GROUP1 = 'PRT'.
       SCREEN-INPUT = '1'.
     ENDIF.
  ENDIF.
  MODIFY SCREEN.
ENDLOOP.

Read only

0 Likes
676

HI ,

I am working to do that but i am facing some issue.

when i create TM i want to add new fields to the screen

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-004.
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS: read RADIOBUTTON GROUP g1 USER-COMMAND u1 DEFAULT 'X'.
SELECTION-SCREEN COMMENT 3(15) text-001.
PARAMETERS  cre_zm  RADIOBUTTON GROUP g1  .
SELECTION-SCREEN COMMENT 21(30) text-002.
PARAMETERS  cre_tm  RADIOBUTTON GROUP g1.
SELECTION-SCREEN COMMENT 54(30) text-003.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN END OF BLOCK b1 .

This is the code that i add

INITIALIZATION.
  LOOP AT SCREEN.
    IF screen-group1 = 'M1'.
      screen-active = '0'.
    ENDIF.
    MODIFY SCREEN.
  ENDLOOP.

AT SELECTION-SCREEN OUTPUT.
  LOOP AT SCREEN.
    IF cre_TM = abap_true.
      IF screen-group1 = 'M1'.
        screen-active = '1'.
      ENDIF.
    ENDIF.
    MODIFY SCREEN.
  ENDLOOP.

START-OF-SELECTION.

.....

the problem is that when i choose also create ZM it the field appear ,

what i miss here?

Thnaks

Chris

Read only

0 Likes
676

H i

try to add this lines :

LOOP AT SCREEN.
    IF cr_zm = abap_true.
      IF screen-group1 = 'M1'.
        screen-active = '0'.
      ENDIF.
      MODIFY SCREEN.
    ENDIF.
  ENDLOOP.

  LOOP AT SCREEN.
    IF read = abap_true.
      IF screen-group1 = 'M1'.
        screen-active = '0'.
      ENDIF.
      MODIFY SCREEN.
    ENDIF.
  ENDLOOP.

Best Regards

Shimi Tal

Read only

Former Member
0 Likes
676

HI ,

U can craete 3 Radio button and also u use the modify screen ..

Read only

Former Member
0 Likes
676

Hello Chris,

As per my understanding ,You can proceed in the below manner:-

1.Create three check box options for the user (CH1,CH2,CH3) where CH2 AND CH3 are for

create user attributes

create user values and

CH1 is for Read user attributes and by default check one of the boxes.

Also put CH1 in one screen group and CH2 and CH3 in other group.

2.In the at selection screen output event of the report , proceed as below:-

2.1:Loop through the screen table and see if the screen-name = field name and if the checkbox(CH1) is set ,

then make the screen group contianing the other two check box as inactive .

similarly you can add the code for the other two check box i.e if any of the other two check

boxes is set then make the screen group containing the first check box as inactive .

thanks ,

M.Naveen Kumar.

Read only

Former Member
0 Likes
676

Hi Chris,

Even if u have Input parameters which should change based on the check box selected,

Use the same LOOP SCREEN, MODIFY SCREEN to get this.

For Parameters you can give user command using the syntax USER-COMMAND.

Thanks,

Arunsri