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: 

Pf-Status

Former Member
0 Kudos

Hi,

Can anybody give me the steps to create the Pf-status for a report.

I need to create a report and the output result i should be able to import them into an excel sheet.

Thanks in advance.

kp

6 REPLIES 6

Former Member
0 Kudos

TO create pf-status u need to use

<b>SET PF-STATUS '<NAME>'.</b>

and then double click on the <name> it takes u to the Menu painter (tcode SE41 ).. Here u can create give push buttons in application bar or assign function codes to Function Keys.

<b>Or u can directly create a pf-status in SE41 and u can use it in progaram with SET PF-STATUS statement... </b>

<b>

This is to download data into EXCel file..</b>

DATA T_SPFLI TYPE STANDARD TABLE OF SPFLI.

select *

from spfli client specified

into table t_spfli

where mandt eq '800'.

call function 'EXCEL_OLE_STANDARD_DAT'

exporting

file_name = 'D:\sai.xls'

CREATE_PIVOT = 0

DATA_SHEET_NAME = ' '

PIVOT_SHEET_NAME = ' '

PASSWORD = ' '

PASSWORD_OPTION = 0

TABLES

PIVOT_FIELD_TAB =

DATA_TAB = t_spfli

FIELDNAMES =

EXCEPTIONS

FILE_NOT_EXIST = 1

FILENAME_EXPECTED = 2

COMMUNICATION_ERROR = 3

OLE_OBJECT_METHOD_ERROR = 4

OLE_OBJECT_PROPERTY_ERROR = 5

INVALID_PIVOT_FIELDS = 6

DOWNLOAD_PROBLEM = 7

OTHERS = 8

.

if sy-subrc <> 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

endif.

REWARD if it helps u..

sai ramesh

Former Member
0 Kudos

Hi,

write:

SET PF-STATUS 'AAA'.

Double click on it.

It will take you to some other scrteen, where you have to define your Menu's on menu bar, and other buttons on Application tool bar and Function Keys etc and assign proper codes and save and Activate,

Come back and use them as per your requirement.

Regards,

Anji

0 Kudos

Hi,

thanks for the reply,

How to define these menu bar options.. do i need to hardcode them or can i take any standard one which is already existing.

if i need to hard code wht to define for excel sheet . and if i need to take the statndard one , please provide me the steps to copy the standard one.and also provide me where this standard one is exist.

hope my problem is understood.

thanks

kp

Former Member
0 Kudos

Hi,

there is a command set SET PF-STATUS pfstat. This will allow u to set the PF-Sttus in the report. And to download the data use the Func. module GUI_DOWNLOAD. Hope this answers u.

sudha

Former Member
0 Kudos

WRITE ' SET PF-STATUS 'NAME'.

Double click on it. you will get a screen ..and then define your own icons and names and assign function codes to them.

after user interacted ...catch the function code and taking case ...end case

you can write appropriate...code for the function code triggered...

if you want to import output into excel file....

use gui_download..where in file name 'C:\first\file.xls'.

use has field seperator with 'X". your file will be imported to xcel file.

Message was edited by:

Rammohan Nagam

Former Member
0 Kudos

Hello,

SET PF-STATUS...

Basic form 1

SET PF-STATUS pfstat.

Additions:

1. ... EXCLUDING f or ... EXCLUDING itab

2. ... IMMEDIATELY

3. ... OF PROGRAM progname

Effect

Sets a GUI (Graphical User Interface) status pfstat which can be up to 20 characters long. There are many of these statuses in the GUI of a program. Each one describes which functions are available and how you can select these via menus and menu bars or by pressing function keys or pushbuttons. For further information about this, refer to the Menu Painter documentation.

Each status has a name which may be up to 8 characters long.

Setting a status makes the functions contained therein selectable.

This method allows you to vary the available functions according to the current screen, list level and/or previous program flow.

The current status is stored in the system field SY-PFKEY.

A status remains valid for the duration of a transaction or until you set a new status.

Note

You can use a namespace prefix with status names.

Example

Event in program:

START-OF-SELECTION.

SET PF-STATUS 'MAIN'.

WRITE SY-PFKEY.

AT USER-COMMAND.

CASE SY-UCOMM.

WHEN 'F001'.

SET PF-STATUS '0001'.

WRITE SY-PFKEY.

...

ENDCASE.

Produces a list (contents MAIN) with a GUI framework which allows you to select functions assigned to the the status MAIN. If you choose the function code F001 (e.g. from the menu or by pressing a pushbutton), you trigger the event AT USER-COMMAND. This generates a secondary list (contents 0001) with a GUI framework which allows you to select functions assigned to the status 0001. On returning from the secondary list to the basic list the status MAIN is reactivated.

Example

PBO module:

MODULE PBO_100 OUTPUT.

SET PF-STATUS 'S001'.

ENDMODULE.

Displays the screen 100 with a GUI framework which allows you to select functions assigned to the status S001.

Note

If you want to set a status for a screen, you must do so during the PBO event. The system always searches for the status pfstat in the GUI of the main program of the current program group . (However, see also the addition OF PROGRAM progname.)

Example

PROGRAM PROGRAM1.

...

PERFORM UP1 IN PROGRAM PROGRAM2.

...

PROGRAM PROGRAM2.

...

FORM UP1.

SET PF-STATUS 'ABCD'

ENDFORM:

The status ABCD of program PROGRAM1 is activated if PROGRAM1 is the program specified in the transaction definition.

Notes

If no GUI is defined in the list processing (or it is deactivated with SET PF-STATUS SPACE), the system supplies a standard user interface.

This statement converts the contents of the field pfstat to type C. The converted value is used to search for the desired status. Since the conversion employs the standard conversion rules as for MOVE, you should use a field of type C for pfstat to avoid unwanted conversions. In this case, a field of type I with a value of 12 would give the key ' 12 '.

Addition 1

... EXCLUDING f

... EXCLUDING itab

Effect

Deactivates one or more of the status functions, so that they cannot be selected. Specify the appropriate function codes using one of the following:

a field f or a literal which contains a function code

an internal table itab which contains several function codes

This method allows you to modify the selectable functions of a status easily at runtime.

Example

TYPES: BEGIN OF TAB_TYPE,

FCODE LIKE RSMPE-FUNC,

END OF TAB_TYPE.

DATA: TAB TYPE STANDARD TABLE OF TAB_TYPE WITH

NON-UNIQUE DEFAULT KEY INITIAL SIZE 10,

WA_TAB TYPE TAB_TYPE.

CLEAR TAB.

MOVE 'DELE' TO WA_TAB-FCODE.

APPEND WA_TAB TO TAB.

MOVE 'AUSW' TO WA_TAB-FCODE.

APPEND WA_TAB TO TAB.

SET PF-STATUS 'STA3' EXCLUDING TAB.

Sets the status STA3 which renders the functions with the function codes DELE and AUSW inactive.

Addition 2

... IMMEDIATELY

Effect

List processing: The status becomes effective for the last list displayed and is not flagged for the next secondary list. In screen processing, this addition has no effect because every status becomes immediately effective anyway.

Example

Event in program:

START-OF-SELECTION.

SET PF-STATUS 'MAIN'.

WRITE SY-PFKEY.

AT USER-COMMAND.

CASE SY-UCOMM.

WHEN 'F002'.

SET PF-STATUS '0002' IMMEDIATELY.

EXIT.

...

ENDCASE.

Selecting the function F002 in the basic list (contents MAIN, status MAIN) redisplays the basic list, but this time with the status 0002.

Note

Without the addition ... IMMEDIATELY, the old status MAIN becomes active again.

Addition 3

... OF PROGRAM progname

Effect

The system does not look for the status pfstat in the GUI of the main program of the current program group, but in the program whose name is specified in the field progname.

Note

Only use this addition if the status contains no dynamic texts.

Since the system searches for the texts in the program to which the status belongs (that is, in program progname) the calling program will not be able to fill the dynamic texts. External statuses containing dynamic texts should be assigned to a functino group, and activated by a function module that both fills the dynamic text fields and sets the status.

Example

DATA PROGR LIKE SY-REPID.

...

MOVE 'TESTPROG' TO PROG.

...

SET PF-STATUS 'ABCD' OF PROGRAM PROG.

The system activates the status ABCD of program TESTPROG.

Note

You can use the OF PROGRAM addition in conjunction with the EXCLUDING itab and IMMEDIATLEY additions.

Additional help

Using GUI Statuses

REgards,

Vasanth