SAP ABAP Programming ABAP Selection Screen: Dynamic display screen based on user selection

Source: Internet
Author: User
In some programs we found that if the user selects one of several options (the Radio box), the appearance of the screen will be adjusted. How is this going to be achieved?   Let's take a look at the following example. PARAMETERS:P1 TYPE c RADIOBUTTON GROUP G1 User-command UC,
P2 TYPE c RADIOBUTTON GROUP G1 DEFAULT ' X '. Parameters:p_werks TYPE Werks modif ID ty1,
P_matnr TYPE matnr modif ID ty2. At Selection-screen OUTPUT.
LOOP at screen.
Case Screen-group1.
When ' TY1 '.
IF P1 is INITIAL.
screen-active = ' 0 '.
ELSE.
screen-active = ' 1 '.
ENDIF.
When ' TY2 '.
IF P2 is INITIAL.
screen-active = ' 0 '.
ELSE.
screen-active = ' 1 '.
ENDIF.
Endcase.
MODIFY screen.
Endloop. At Selection-screen.
  CLEAR Sy-ucomm.   Description of the program: (1) The program can be selected according to the user P1 or P2, the decision to display the factory or the material number on the screen, (2) Here User-command UC is the key, it on behalf of the user click on RADIOBUTTON GROUP G1 any option, Will trigger Pai, and function code is ' UC '.      in the clear sy-ucomm. You can see the value of Sy-ucomm by hitting a breakpoint here. (3) Modif ID is used to group screen elements, which is more useful and logically clear when there are more screen elements.      here the PBO (at Selection-screen OUTPUT) is based on the user's choice, decided that the different groups of screen elements are hidden or displayed. (4) similar to the Radio Button (radio box), the check box (checkbox) and list box (dropdown box) can also trigger Pai. However, the normal screen editing box is not supported, you must use a carriage return to trigger PAI.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.