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 make Collapsible scrren thru Report Program

Former Member
0 Kudos

Hi Experts,

I have a report program, In the selection screen i have 15 check box. But the requirement is we need 5 + 5 + 5 in a collapsible format.

If the user clicks the left corner it should open the 5 check box.

Anyone having the knowledge of this kindly share the logic so its easy for me to build the same.

Thanx in advance.

Mohana

1 ACCEPTED SOLUTION

former_member196079
Active Contributor
0 Kudos

Hi mohana

You must use the MODIF ID statement at the declaration of checkbox, and after use this form for example


FORM at_selection_screen .
    LOOP AT SCREEN.
      IF screen-group1 = 'SC1'.
        screen-input = 0.
      ENDIF.
ENDFORM.

where SC1 is the MODIF ID selected....

Best regads

Marco

11 REPLIES 11

Former Member
0 Kudos

Hi,

From the trnsaction BIBS.

Purpose

Collapsible areas are used to hide or expand a group of fields. This can be used when you have small screen space and there is a large number of fields to display.

Do's

Collapsible areas should be used to hide the detail level information and not the headers.

Beside the Collapse/Expand button, display a short text explaining what is hidden in the collapsible areas.

Every time the transaction is launched, display the area that was expanded during the last session.

Don'ts

Don't have too many collapsible areas in the screen.

Tips

Collapsible area is not really a control but a technique using subscreens by which you expand or collapse a screen area.

Hope it helps.

Sujay

former_member196079
Active Contributor
0 Kudos

Hi mohana

You must use the MODIF ID statement at the declaration of checkbox, and after use this form for example


FORM at_selection_screen .
    LOOP AT SCREEN.
      IF screen-group1 = 'SC1'.
        screen-input = 0.
      ENDIF.
ENDFORM.

where SC1 is the MODIF ID selected....

Best regads

Marco

0 Kudos

Hi,

Thanx for your reply, but can you pls explain me under which event can i add this logic? Bze i added this logic under 'AT SELECTION-SCREEN OUTPUT'. Its saying an error with 'Statement is not accessible'.


AT SELECTION-SCREEN OUTPUT.
 

FORM at_selection_screen .
    LOOP AT SCREEN.
      IF screen-group1 = 'SOP'.
        screen-input = 0.
      ENDIF.
      endloop.
ENDFORM. 

Kindly guide me.

Mohana

0 Kudos

Hi

after the 'AT SELECTION SCREEN' you must do the perform


AT SELECTION-SCREEN OUTPUT.
  PERFORM at_selection_screen.

best regards

Marco

0 Kudos

Hi,

Thanx for your reply, i did the logic that you explanned, But am not getting any changes in my selection screen. If you dont mind can you give a small program for this?

Thanx in advance.

Mohana

0 Kudos

Hi

just an example..


REPORT  ztest.

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-003.
*           Order Documents
PARAMETERS: rb_view RADIOBUTTON GROUP gr1 DEFAULT 'X' USER-COMMAND ucomm,
            rb_ins  RADIOBUTTON GROUP gr1.

SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-001.

SELECTION-SCREEN END OF BLOCK b2.

SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-002.

PARAMETERS:  pagente TYPE zzagente MATCHCODE OBJECT zagent_get MODIF ID sc1,
             pdat_in TYPE crmt_posting_date MODIF ID sc1 DEFAULT sy-datum,
             pdat_fin TYPE crmt_posting_date MODIF ID sc1,
             pbud_om TYPE crmt_net_value_cum MODIF ID sc1,
             p_datl TYPE crmt_posting_date MODIF ID sc3,
             p_last TYPE crmt_net_value_cum MODIF ID sc3.

SELECTION-SCREEN END OF BLOCK b3.

SELECTION-SCREEN END OF BLOCK b1.

AT SELECTION-SCREEN OUTPUT.
  PERFORM at_selection_screen.
*&---------------------------------------------------------------------*
*&      Form  AT_SELECTION_SCREEN
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  -->  p1        text
*  <--  p2        text
*----------------------------------------------------------------------*
form AT_SELECTION_SCREEN .
 IF rb_view = 'X'.
    LOOP AT SCREEN.
      IF screen-group1 = 'SC1'.
        screen-input = 0.
        MODIFY SCREEN.
      ENDIF.
      IF screen-group1 = 'SC3'.
        screen-input = 0.
        MODIFY SCREEN.
      ENDIF.
    ENDLOOP.
  ELSEIF rb_ins = 'X'.
    LOOP AT SCREEN.
      IF screen-group1 = 'SC2'.
        screen-input = 0.
        MODIFY SCREEN.
      ENDIF.
      IF screen-group1 = 'SC3'.
        screen-input = 0.
        MODIFY SCREEN.
      ENDIF.
    ENDLOOP.
  ENDIF.
endform.                    " AT_SELECTION_SCREEN

best regards

Marco

0 Kudos

Hi,

Thanx for your details example, Thanx for your interest. But my problem is, User dont want any Radiobutton or any Check box option to open the hided area. He need just a + button in the right side of the screen.

otherwise in transaction BIBS its having one collasible mode like that he need.

Can you pls guide me how to achive this?

Mohana

0 Kudos

Hi try this...

The code is for the radio button, but if you use this code with a button it will work for your issue.

use

screen-INVISIBLE = '1'.

istead of screen-input = 0.


REPORT  ztest.

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-003.
*           Order Documents
PARAMETERS: rb_view RADIOBUTTON GROUP gr1 DEFAULT 'X' USER-COMMAND ucomm,
            rb_ins  RADIOBUTTON GROUP gr1.

SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-001.

SELECTION-SCREEN END OF BLOCK b2.

SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-002.

PARAMETERS:  pagente TYPE zzagente MATCHCODE OBJECT zagent_get MODIF ID sc1,
             pdat_in TYPE crmt_posting_date MODIF ID sc1 DEFAULT sy-datum,
             pdat_fin TYPE crmt_posting_date MODIF ID sc1,
             pbud_om TYPE crmt_net_value_cum MODIF ID sc1,
             p_datl TYPE crmt_posting_date MODIF ID sc3,
             p_last TYPE crmt_net_value_cum MODIF ID sc3.

SELECTION-SCREEN END OF BLOCK b3.

SELECTION-SCREEN END OF BLOCK b1.

AT SELECTION-SCREEN OUTPUT.
  PERFORM at_selection_screen.
*&---------------------------------------------------------------------*
*&      Form  AT_SELECTION_SCREEN
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  -->  p1        text
*  <--  p2        text
*----------------------------------------------------------------------*
form AT_SELECTION_SCREEN .
 IF rb_view = 'X'.
    LOOP AT SCREEN.
      IF screen-group1 = 'SC1'.
        screen-input = 0.
        screen-INVISIBLE = '1'.
        MODIFY SCREEN.
      ENDIF.
      IF screen-group1 = 'SC3'.
        screen-input = 0.
        MODIFY SCREEN.
      ENDIF.
    ENDLOOP.
  ELSEIF rb_ins = 'X'.
    LOOP AT SCREEN.
      IF screen-group1 = 'SC2'.
        screen-input = 0.

        MODIFY SCREEN.
      ENDIF.
      IF screen-group1 = 'SC3'.
        screen-input = 0.

        MODIFY SCREEN.
      ENDIF.
    ENDLOOP.
  ENDIF.
endform.                    " AT_SELECTION_SCREEN

Edited by: Menegazzo Marco on Sep 7, 2010 10:41 AM

0 Kudos

Hi,

In your reply you are mentioned that if i create a button it will solve my problem like that. But am not aware how to create a button in Report program?

Can you guide me regarding this?


The code is for the radio button, but if you use this code with a button it will work for your issue.
use 
screen-INVISIBLE = '1'. 
istead of screen-input = 0.

Mohana

0 Kudos

Hi

Check this code


REPORT  ztest.
TABLES sscrfields.
*pushbutton
data hide type char1 value 1.
SELECTION-SCREEN:
  BEGIN OF SCREEN 500 AS WINDOW TITLE title,
    PUSHBUTTON 2(10)  but1 USER-COMMAND cli1,
  END OF SCREEN 500.
SELECTION-SCREEN INCLUDE PUSHBUTTON 2(10) but1 USER-COMMAND   cli1.



SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-001.

SELECTION-SCREEN END OF BLOCK b2.

SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-002.

PARAMETERS:  pdat_in TYPE crmt_posting_date MODIF ID sc1 DEFAULT sy-datum,
             pdat_fin TYPE crmt_posting_date MODIF ID sc1,
             pbud_om TYPE crmt_net_value_cum MODIF ID sc1.

SELECTION-SCREEN END OF BLOCK b3.



AT SELECTION-SCREEN OUTPUT.
  PERFORM at_selection_screen.

AT SELECTION-SCREEN.
  CASE sscrfields.
    WHEN 'CLI1'.
      IF hide = 1.
        hide = 0.
      ELSE.
        hide = 1.
      ENDIF.
  ENDCASE.

*&---------------------------------------------------------------------*
*&      Form  AT_SELECTION_SCREEN
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  -->  p1        text
*  <--  p2        text
*----------------------------------------------------------------------*

FORM at_selection_screen .
  IF hide = '1'.
    LOOP AT SCREEN.
      IF screen-group1 = 'SC1'.
        screen-input = 0.
        screen-invisible = 1.
        MODIFY SCREEN.
      ENDIF.
    ENDLOOP.
  ELSEIF hide = '0'.
    LOOP AT SCREEN.
      IF screen-group1 = 'SC1'.
        screen-input = 0.
        screen-invisible = 0.
        MODIFY SCREEN.
      ENDIF.
    ENDLOOP.
  ENDIF.
ENDFORM.                    " AT_SELECTION_SCREEN

best regards

Marco

jayesh_gupta
Active Participant
0 Kudos

Hi,

You may do this if you define a normal screen and use it as a selection screen for your report.

1. Create a screen (say 100) in your program.

2. Add a subscreen area 'SUB1' to the screen 100.

3. Create two subscreens 201 and 202.

4. Add 5 checkboxes in subscreen 201 layout and keep subscreen 202 layout empty.

5. Add a button on top left in each subscreen 201 and 202. Assume the Function codes for the two buttons are F201 and F202, respectively.

6. Put the following code in screen 100:

PROCESS BEFORE OUTPUT.
 MODULE STATUS_0100.
 
CALL SUBSCREEN SUB1 INCLUDING SY-REPID GV_DYNNR.      "gv_dynnr is a variable for screen no.


PROCESS AFTER INPUT.

  CALL SUBSCREEN SUB1.

MODULE USER_COMMAND_0100.

6. Put the following code in this module USER_COMMAND_0100:

Case sy-ucomm.
when 'F201'.
     gv_dynnr = '0202' 
when 'F202'.
      gv_dynnr = '0201'
endcase.

Thanks & Regards,

Jayesh