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 set PF-STATUS on the selection screen of a report

Former Member
0 Kudos

Hi Experts,

I am developing a report. On the selection screen I want to set the PF-Status having 9 buttons. But first time I want to display only 4 buttons on the application toolbar. Then on user action the rest 5 buttons should be displayed.

I am unable to do so.

I want to have this functionality on the selection screen of the report urgently.

Please help me.

Useful answers will be suitably rewarded.

Thanks a lot in advance.

Regards,

Himanshu

1 ACCEPTED SOLUTION

Former Member

hi,

for push buttons on application toolbar:

In the application toolbar of the standard GUI status of the selection screen, five pushbuttons are predefined with the function codes FC01 to FC05, but are inactive by default. You can activate them during the definition of the selection screen as follows:

SELECTION-SCREEN FUNCTION KEY <i>.

The numbering <i> must be between 1 and 5. The individual function texts must be assigned to the FUNCTXT_0<i> components of structure SSCRFIELDS before the selection screen is called. You must declare this structure as an interface work area using the TABLES statement.

for user action on selection screen:

To create a pushbutton on the selection screen (similar to pushbuttons on screens), you use:

SELECTION SCREEN PUSHBUTTON [/]<pos(len)> <push>

USER-COMMAND <ucom> [MODIF ID <key>].

The [/]<pos(len)> parameters and the MODIF IF addition have the same function as for the formatting options for underlines and comments.

<push> determines the pushbutton text. For <push>, you can specify a text symbol or a field name with a maximum length of eight characters. This character field must not be declared with the DATA statement, but is generated automatically with length <len>. The field must be filled before the selection screen is called.

For <ucom>, you must specify a code of up to four characters. When the user clicks the pushbutton on the selection screen, <ucom> is entered in the UCOMM of the SSCRFIELDS interface work area. You must use the TABLES statement to declare the SSCRFIELDS structure. The contents of the SSCRFIELDS-UCOMM field can be processed during the AT SELECTION-SCREEN event

for changing standard GUI status:

The GUI status of a selection screen is generated by the system. The SET PF-STATUS statement in the PBO event of the selection screen has no effect on the standard GUI status. If you want to use your own GUI status for a selection screen or deactivate functions in the standard GUI status in exceptional cases, you can use one of the following function modules in the PBO event of the selection screen:

RS_SET_SELSCREEN_STATUS

Sets another GUI status defined in the same ABAP program, or deactivates functions of the standard GUI status.

RS_EXTERNAL_SELSCREEN_STATUS

Sets a GUI status defined in an external function group. You must use the SET PF-STATUS statement to set the status in a special function module in this function group. You must pass the name of the function module that sets the status as a parameter to the function module RS_EXTERNAL_SELSCREEN_STATUS.

11 REPLIES 11

Former Member
0 Kudos

For the first time use the SET PF-STATUS statement in INITIALIZATION event.

As you were saying, you have 9 buttons and you want to display only 4 buttons use addition EXCLUDING to remove the function codes that you want to disable initially.

Based on conditions, use event AT SELCTION-SCREEN OUTPUT to SET PF-STATUS ignoring the EXCLUDING addition.

Regards

Eswar

Former Member
0 Kudos

Hi,

Use

SELECTION-SCREEN INCLUDE PUSHBUTTON fmt name.

Refer this link

[http://help.sap.com/saphelp_nw70/helpdata/en/9f/dba81635c111d1829f0000e829fbfe/content.htm]

Former Member
0 Kudos

below code will help you

check the conditions in pai

and do the changes in pbo

i have taken buttons name as button 1 .......... so on.

reward if useful

 
data flag value 0. " global

*In PBO of screen
 data fcode type table of sy-ucomm.
  clear fcode.

if value eq 0.
  append 'button5'  to fcode.
  append 'button6' to fcode.
  append 'button7' to fcode.
  append 'button8'  to fcode.
  append 'button9' to fcode.
  append 'button4' to fcode.
    append 'ADD' to fcode.
  set pf-status '1001' excluding fcode.
else.
  set pf-status '1001' .
endif.

*in pai of screen
*if desired user action set flag = 1.
if (any condition you wanted)
 flag = 1.

Former Member
0 Kudos

use 'at selectio-screen output ' event by using this event you can do this requirement easily.

Former Member

IF U WANT BUTTONS IN MENU BAR HERE IS A PEICE OF A CODE

TYPE-POOLS: icon.

TABLES : sscrfields.

DATA : functxt TYPE smp_dyntxt.

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

PARAMETERS : P_matnr TYPE mast-matnr,

P_werks TYPE mast-werks,

P_stlan TYPE mast-stlan,

P_stlal TYPE mast-stlal.

SELECTION-SCREEN END OF BLOCK v1.

SELECTION-SCREEN: FUNCTION KEY 1,

FUNCTION KEY 2.

INITIALIZATION.

functxt-icon_id = ICON_OVERVIEW.

functxt-quickinfo = 'Item Overview'.

functxt-icon_text = 'Item'.

sscrfields-functxt_01 = functxt.

functxt-icon_id = icon_HEADER.

functxt-icon_text = ''.

functxt-quickinfo = 'BOM Header'.

sscrfields-functxt_02 = functxt.

INITIALIZATION.

CLEAR WA_HEADER.

CLEAR WA_FINAL.

REFRESH IT_HEADER.

REFRESH IT_FINAL.

AT SELECTION-SCREEN.

CASE sy-ucomm.

WHEN 'FC01'.

CALL SCREEN 1001.

WHEN 'FC02'.

CALL SCREEN 1005.

ENDCASE.

this will create two menu buttons with function code given .

do not forget to include that table and pool i have declared at topmost.

please reward if useful

keep rockin

vivek

Former Member
0 Kudos

Hi,

Use sscrfields. to keep push buttons on the selection-screen.

Former Member

hi,

for push buttons on application toolbar:

In the application toolbar of the standard GUI status of the selection screen, five pushbuttons are predefined with the function codes FC01 to FC05, but are inactive by default. You can activate them during the definition of the selection screen as follows:

SELECTION-SCREEN FUNCTION KEY <i>.

The numbering <i> must be between 1 and 5. The individual function texts must be assigned to the FUNCTXT_0<i> components of structure SSCRFIELDS before the selection screen is called. You must declare this structure as an interface work area using the TABLES statement.

for user action on selection screen:

To create a pushbutton on the selection screen (similar to pushbuttons on screens), you use:

SELECTION SCREEN PUSHBUTTON [/]<pos(len)> <push>

USER-COMMAND <ucom> [MODIF ID <key>].

The [/]<pos(len)> parameters and the MODIF IF addition have the same function as for the formatting options for underlines and comments.

<push> determines the pushbutton text. For <push>, you can specify a text symbol or a field name with a maximum length of eight characters. This character field must not be declared with the DATA statement, but is generated automatically with length <len>. The field must be filled before the selection screen is called.

For <ucom>, you must specify a code of up to four characters. When the user clicks the pushbutton on the selection screen, <ucom> is entered in the UCOMM of the SSCRFIELDS interface work area. You must use the TABLES statement to declare the SSCRFIELDS structure. The contents of the SSCRFIELDS-UCOMM field can be processed during the AT SELECTION-SCREEN event

for changing standard GUI status:

The GUI status of a selection screen is generated by the system. The SET PF-STATUS statement in the PBO event of the selection screen has no effect on the standard GUI status. If you want to use your own GUI status for a selection screen or deactivate functions in the standard GUI status in exceptional cases, you can use one of the following function modules in the PBO event of the selection screen:

RS_SET_SELSCREEN_STATUS

Sets another GUI status defined in the same ABAP program, or deactivates functions of the standard GUI status.

RS_EXTERNAL_SELSCREEN_STATUS

Sets a GUI status defined in an external function group. You must use the SET PF-STATUS statement to set the status in a special function module in this function group. You must pass the name of the function module that sets the status as a parameter to the function module RS_EXTERNAL_SELSCREEN_STATUS.

0 Kudos

Hi Priya,

Thanks a lot. Your reply was really helpful and it has solved the problem. Now I am using the Function Module RS_SELSCREEN_STATUS to set the PF-STATUS.

Thanks a ton once again.

Regards,

Himanshu

0 Kudos

Himanshu,

What is the FM internally doing, isnt it doing the same functionality as SET PF-STATUS statement and excluding Function codes??

Drill down the FM and you will find the same statement.

Regards

Eswar

0 Kudos

Hi Eswar,

I know that the function is using the same statement.

But somehow when I am using the SET PF-STATUS statement in my code EXCLUDING the function codes, it is not working.

However, if i use the FM, it works..Because what i feel internally it is not simply a SET PF-STATUS statement which is doing this. Prior to that there is some other processing also being handled by this FM.

Regards,

Himanshu

Former Member
0 Kudos

hi himanshu,

you can perform this on the basis of LSIND count,

refer to the folowing code

APPEND 5 Fcodes to I_BUTTONS TABLE

set pf-status 'MY MENU' excluding 'I_BUTTONS'.

window starting at 2 2 ending at 200 40.

if sy-lsind = 1.

do.

clear: v_chk_bx.

read line sy-index field value wa_final-vbeln chk_bx into

v_chk_bx.

if sy-subrc <> 0.

exit.

endif.

if v_chk_bx = 'X'.

perform z11_partner_pop using wa_final-vbeln.

endif.

enddo.

else.

if sy-lsind = 2.

append 'PART' to i_tab.

append 'SCHD' to i_tab.

set pf-status 'MY MENU' excluding i_tab.

do.

clear: v_chk_bx.

read line sy-index field value wa_vbep-vbeln chk_bx into

v_chk_bx.

if sy-subrc <> 0.

exit.

endif.

if v_chk_bx = 'X'.

perform z11_partner_pop_2 using wa_vbep-vbeln.

endif.

enddo.

endif.

endif.

reward if helpful

Rohan