Wednesday, July 25, 2007

Hide parameter / select option in selection screen

We can Hide parameter / select option in selection screen dynamically by manipulating screen object.

SCREEN is like an internal table with a header line. However, you do not have to declare it in your program. Go to debugging mode and then view structure of screen.

You can modify SCREEN in your ABAP program during the PBO event of a screen. Its contents override the static attributes of the screen fields for a single screen call. The only statements that you can use with SCREEN are:


LOOP AT SCREEN.
...
MODIFY SCREEN.
...
ENDLOOP.

We can hide parameter by set screen-active to 0.
Here is example of how to hide parameter in selection screen. Write it, and change click on radiobutton to hide parameter.


REPORT ZAALGAL0006.

DATA: d_ucomm LIKE sy-ucomm.

PARAMETERS: p_grpa1(10) MODIF ID A,
p_grpa2(5) MODIF ID A,
p_grpb1(2) MODIF ID B.

PARAMETERS: p_actA RADIOBUTTON GROUP rad1 USER-COMMAND ACT DEFAULT 'X',
p_actB RADIOBUTTON GROUP rad1.

AT SELECTION-SCREEN.
d_ucomm = sy-ucomm.

AT SELECTION-SCREEN OUTPUT.
LOOP AT screen.
IF p_actA = 'X'.
IF screen-group1 = 'B'.
screen-active = 0.
ENDIF.
ELSEIF p_actB = 'X'.
IF screen-group1 = 'A'.
screen-active = 0.
ENDIF.
ENDIF.
MODIFY screen.
ENDLOOP.

START-OF-SELECTION.


13 comments:

Aravindh said...

This bit really helped me... thanks a lot dude... u r a star. :)

marcel said...

Thanks a lot, helped me, too!

Proust from Munich

Anonymous said...

very clear and very good. Now where did I put the 12 sap help screens that didn't have this answer? Thanks dude.

Anonymous said...

Help a lot!!! Thanks


Obrigado!!!! from Brasil

Sushant said...

That really helped me .3 cheers

Erratic Thoughts said...

Thanks for this...
Quick, simple and point blank...

seventyros said...

For a Excellent Online Resource for SAP EP and SAP Web Dynpro ABAP, Visit Learn SAP Online

seventyros said...

Excellent Online Resource for SAP EP and SAP Web Dynpro ABAP. Visit Learn SAP Online for Free

Sap Netweaver-an Ambitious vision
Sap Netweaver Portal Implementation
Delta Links and Chanined Objects
Knowledge Management
System Administration
Delegated Administration

And Many More Topics...

Abap Community Forums said...

Check out the select statement in ABAP here
Abap Community Forums

google said...

Excellent Online Resource for SAP EP and SAP Web Dynpro ABAP. Visit Learn SAP Online for Free

How to make WDJ Component available on SAP EP
SAP Enterprise Portal Application in NWDS
SAP and Their Produstcs - SMB Customer - SAP Business One
What is SAP ?
Architecture of SAP Business One Application
Navigation in SAP Business One
SMB Portal and its Functionality
Netweaver Administrator Day to Day Work
SAP Business Intelligence
Business Partners in SAP Business One
Continuous Stock System in SAP business one

And Many Morte Topics

alex linh said...

Modify screen,dynamic screen in module programming http://saptechnicals.blogspot.com/2013/04/modify-screen-in-module-programming.html

yektek training said...

Thanks dear for sharing this nice information sravani

admin said...

Thanks for the wonderful post.

-www.abapmadeeasy.com