Creating neat, collapsible sub-screens for cleaner design

Creating neat, collapsible sub-screens for cleaner design

Many times when we design a screen, we end up putting a lot of things on just that one screen. Collapsible sub-screens are great in that they prevent clutter while not missing out on displaying important data.

For example, consider wanting to display the following:
+ ABC
XYZ

Here ABC is some contents with a button to collapse and expand. Below it is some other contents XYZ.

Logic:
We call a Screen 0100.

Screen 100 has two Sub screen areas sub1 and sub2.
Sub1 has ABC and sub2 has XYZ.

PBO makes call to both the subscreens. The trick is that the Screen No Sub1 calls is dynamic. It either calls 101 or 201, based on if the subscreen 1 is expanded or collapsed.

-->Screen 101 has a button with icon collapse. Its functional code is "EXPCO'. Next to it, it has the contents ABC. (This represents the expanded mode).

-->Screen 201 has a button with icon EXPAND. Its functional code is also "EXPCO'. As it is in the collapsed mode, the contents ABC is not displayed.

On the functional code of 100 for the button EXPCO, we toggle the subscreen number to be called.

REPORT  Z_PP_EXPANDER.

data:
  gv_screen type sy-DYNNR value '0101',
  ok_code   type sy-ucomm.

call screen 0100.


* SCreen 0100

PROCESS BEFORE OUTPUT.
* MODULE STATUS_0100.

  CALL SUBSCREEN sub1 INCLUDING sy-repid gv_screen.

  CALL SUBSCREEN sub2 INCLUDING sy-repid '0300'.

*
PROCESS AFTER INPUT.
 MODULE USER_COMMAND_0100.


module USER_COMMAND_0100 input.

  data:

    Requires Free Membership to View

    When you register, you will start receiving targeted emails from my award-winning team of editorial writers. Our goal is to keep you informed on the hottest topics and biggest challenges faced by SAP professionals today.

    Hannah Smalltree, Editorial Director

    By submitting your registration information to SearchSAP.com you agree to receive email communications from TechTarget and TechTarget partners. We encourage you to read our Privacy Policy which contains important disclosures about how we collect and use your registration and other information. If you reside outside of the United States, by submitting this registration information you consent to having your personal data transferred to and processed in the United States. Your use of SearchSAP.com is governed by our Terms of Use. You may contact us at webmaster@TechTarget.com.

lv_okcode type sy-ucomm. lv_okcode = ok_code. clear ok_code. if lv_okcode = 'EXPCO'. if gv_screen = '0101'. gv_screen = '0201'. else. gv_screen = '0101'. endif. endif. endmodule. " USER_COMMAND_0100 INPUT Now define the other subscreens 101, 201 and 300.

This was first published in May 2006

Disclaimer: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.