Application Development and Automation 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: 
Read only

set pf-status

Former Member
0 Likes
595

Hi,

I have a problem: When i creat a new status in my alv grid for adding new boutons, all of my standard functionality disappear (search, print, save etc.....). Why? and how can i do?

Thanks for your answer,

It's urgent

4 REPLIES 4
Read only

Former Member
0 Likes
568

u can set pf-status

by simply writing the following code:

SET PF-STATUS 'GUI'.

double click on GUI and define all the functions n keys u need.

below is the example code .

TABLES: spfli, sbook.

DATA: num TYPE i,

dat TYPE d.

START-OF-SELECTION.

num = 0.

SET PF-STATUS 'FLIGHT'.

GET spfli.

num = num + 1.

WRITE: / spfli-carrid, spfli-connid,

spfli-cityfrom, spfli-cityto.

HIDE: spfli-carrid, spfli-connid, num.

END-OF-SELECTION.

CLEAR num.

TOP-OF-PAGE.

WRITE 'List of Flights'.

ULINE.

WRITE 'CA CONN FROM TO'.

ULINE.

TOP-OF-PAGE DURING LINE-SELECTION.

CASE sy-pfkey.

WHEN 'BOOKING'.

WRITE sy-lisel.

ULINE.

WHEN 'WIND'.

WRITE: 'Booking', sbook-bookid,

/ 'Date ', sbook-fldate.

ULINE.

ENDCASE.

AT USER-COMMAND.

CASE sy-ucomm.

WHEN 'SELE'.

IF num NE 0.

SET PF-STATUS 'BOOKING'.

CLEAR dat.

SELECT * FROM sbook WHERE carrid = spfli-carrid

AND connid = spfli-connid.

IF sbook-fldate NE dat.

dat = sbook-fldate.

SKIP.

WRITE / sbook-fldate.

POSITION 16.

ELSE.

NEW-LINE.

POSITION 16.

ENDIF.

WRITE sbook-bookid.

HIDE: sbook-bookid, sbook-fldate, sbook-custtype,

sbook-smoker, sbook-luggweight, sbook-class.

ENDSELECT.

IF sy-subrc NE 0.

WRITE / 'No bookings for this flight'.

ENDIF.

num = 0.

CLEAR sbook-bookid.

ENDIF.

WHEN 'INFO'.

IF NOT sbook-bookid IS INITIAL.

SET PF-STATUS 'WIND'.

SET TITLEBAR 'BKI'.

WINDOW STARTING AT 30 5 ENDING AT 60 10.

WRITE: 'Customer type :', sbook-custtype,

/ 'Smoker :', sbook-smoker,

/ 'Luggage weight :', sbook-luggweight UNIT 'KG',

/ 'Class :', sbook-class.

ENDIF.

ENDCASE.

reward points if helpful.

Read only

Former Member
0 Likes
568

hi,

u need to copy standard toolbar into ur program..

for this.

goto SE41.

then goto copy status...

from

SAPLKKBL in program name

STANDARD_FULLSCREEN in status

To

ur program name

ur status name....

then in reuse_alv_grid_display

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

i_callback_program = gd_repid

i_callback_user_command = 'USER_COMMAND'

i_callback_pf_status_set = 'SET_STAT'

is_layout = gd_layout

it_fieldcat = fieldcatalog[]

i_save = 'X'

TABLES

t_outtab = it_ekko

EXCEPTIONS

program_error = 1

OTHERS = 2.

IF sy-subrc <> 0.

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

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

ENDIF.

FORM set_stat USING rt_extab TYPE slis_t_extab.

SET PF-STATUS 'ZSTAT' EXCLUDING rt_extab.

ENDFORM. "set_stat

here ZSTAT is my status name in which i have copied standard toolbar...

now u can add buttons here and use that in user_command.....

reward if usefull.

Read only

0 Likes
568

Thanks for all your answers

Read only

Former Member
0 Likes
568

Hi,

In function keys enter the below function codes then the respectives buttons will be in active state

ENTE

SAVE

BACK

EXIT

CANCEL

FIND

FIRST_PAGE

PREV_PAGE

NEXT_PAGE

LAST_PAGE