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

Display pushbutton on the report

Former Member
0 Likes
2,032

Hi all,

My requirement is to prepare a report and pushbutton on the it. After clicking on pushbutton a new transaction should open. I am not able to display the pushbutton on the report.

Please tell me the solution for this problem,if anyone knows.

Thank you in advance.

Aparna.

Hi all,

My requirement is to prepare a report and pushbutton on the it. After clicking on pushbutton a new transaction should open. I am not able to display the pushbutton on the report.

Please tell me the solution for this problem,if anyone knows.

Thank you in advance.

Aparna.

7 REPLIES 7
Read only

Former Member
0 Likes
1,276

Hi Aparna,

you want the push button on the selection-screen? or the tool bar?

or on the tool bar of the output list?

pls let us know the requirement. we will be able to track it correctly...

thx

pavan

Read only

0 Likes
1,276

I need to display report using selection screen. And after that I need 1 pushbutton on final report clicking on which we should navigate to another transaction.

I want pushbutton neither on selection screen nor on toolbar.

Thanks & regards,

Aparna.

Read only

Former Member
0 Likes
1,276

Hi,

you can create the pushbutton in application toolbar using SET PF-STATUS.

and give the functionality for that as CALL TRANSACTION xxx.

or,

you can create the push button in selection-screen.

regards,

pankaj singh

Read only

Former Member
0 Likes
1,276

Hi Aparna,

The following code demonstrates how to add user defined push buttons to a standard report selection screen.

Push buttons are used to trigger user functions with in the program to make them interactive with the user.

The example below shows how buttons can allow you to dynamically alter a selection screen depending on

which button is pressed. But they can be used for many other applications from displaying a window to

calling other reports.

&----


*& Report ZSSCRBUTTON *

*& *

&----


*& Adds buttons to selection screen. *

*& Demonstrates alteration of selection screen layout depending on *

*& which button is pressed. *

&----


REPORT zsscrbutton NO STANDARD PAGE HEADING.

TABLES: t030, skat, sscrfields.

SELECTION-SCREEN BEGIN OF BLOCK block1 WITH FRAME

TITLE text-001.

SELECT-OPTIONS: p_ktopl FOR t030-ktopl,

p_komok FOR t030-komok,

p_ktosl FOR t030-ktosl.

SELECTION-SCREEN SKIP.

*SELECTION-SCREEN FUNCTION KEY 1. "Adds button to application toolbar

  • Declaration of sel screen buttons

SELECTION-SCREEN BEGIN OF LINE.

SELECTION-SCREEN PUSHBUTTON (20) w_button USER-COMMAND BUT1.

SELECTION-SCREEN PUSHBUTTON (25) w_but2 USER-COMMAND BUT2.

SELECTION-SCREEN END OF LINE.

SELECT-OPTIONS: p_konts FOR t030-konts,

p_bklas FOR t030-bklas.

PARAMETER: gd_ucomm like sy-ucomm default 'BUT1' no-display.

SELECTION-SCREEN END OF BLOCK block1.

TYPES: BEGIN OF t_t030,

ktopl TYPE t030-ktopl,

konts TYPE t030-konts,

txt20 TYPE skat-txt20,

bklas TYPE t030-bklas,

bkbez TYPE t025t-bkbez,

END OF t_t030.

DATA: it_t030 TYPE STANDARD TABLE OF t_t030 INITIAL SIZE 0,

wa_t030 TYPE t_t030.

DATA: gd_repsize TYPE i VALUE '83'.

************************************************************************

*INITIALIZATION.

INITIALIZATION.

  • Add displayed text string to buttons

w_button = 'GL account selection'.

w_but2 = 'Valuation class selection'.

************************************************************************

*AT SELECTION-SCREEN.

AT SELECTION-SCREEN.

  • Check if buttons have been

if sscrfields-ucomm eq 'BUT1'.

gd_ucomm = 'BUT1'.

clear: p_BKLAS.

refresh: p_BKLAS.

elseif sscrfields-ucomm eq 'BUT2'.

clear: p_KONTS.

refresh: p_KONTS.

gd_ucomm = 'BUT2'.

endif.

************************************************************************

*AT SELECTION-SCREEN OUTPUT.

AT SELECTION-SCREEN OUTPUT.

if gd_ucomm eq 'BUT1'.

loop at screen.

if screen-name CS 'P_KONTS'.

screen-active = 1.

elseif screen-name CS 'P_BKLAS'.

screen-active = 0.

endif.

modify screen.

endloop.

elseif gd_ucomm eq 'BUT2'.

loop at screen.

if screen-name CS 'P_KONTS'.

screen-active = 0.

elseif screen-name CS 'P_BKLAS'.

screen-active = 1.

endif.

modify screen.

endloop.

endif.

Hope this helps.

Reward if helpful.

Regards,

Sipra

Read only

Former Member
0 Likes
1,276

GO TO SE41 AND CREATE YOUR PF-STATUS OR WRITE

SET PF-STATUS 'ZSPD'. AND DBL CLICK ON ZSPD IT WILL GO TO SE41 DIRECTLY.

THERE IN APPLICATION TOOL BAR AREA GIVE THE FUNCTION CODE AND PUSHBUTTON TEXT AND ACTIVATE THE STATUS.

NOW HANDLE YOUR CODE IN AT USER-COMMAND EVENT

HERE

CASE SY-UCOMM.

WHEN 'NEXT'. " NEXT IS THE FN CODE FOR YOUR PUSH BUTTON

CALL TRANSACTION .....

ENDCASE.

REGARDS

SHIBA DUTTA

Read only

Former Member
0 Likes
1,276

hi

in that sense, in the end-of-selection, before you use the WRITE statement, you have to define a pf-status and add a push button.

check for SY-UCOMM, if it is equal to the user-command of your push button, you can CALL TRANSACTION.

thx

pavan

Read only

Former Member
0 Likes
1,276

Hi,

You can create push button either in selection screen or in tool bar but not in list screen.

Thanks,

Madhuri