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

Execute Report, while pressing push button

Former Member
0 Likes
3,092

Hello friends,

I have a selection-screen with some parameters or so..... now I want to place a pushbutton over this screen ( how to place a pushbutton, do I need a dynpro). when user press this pushbutton, I want to execute a report, and have to send parameters to this report?

is this possible in ABAP ?

Many thanks for your kind help....

7 REPLIES 7
Read only

Former Member
0 Likes
1,488

You can have a push button on a selectiion screen

See the sameple code,

REPORT demo_sel_screen_pushbutton.

TABLES sscrfields.

DATA flag(1) TYPE c.

SELECTION-SCREEN:

BEGIN OF SCREEN 500 AS WINDOW TITLE tit,

BEGIN OF LINE,

PUSHBUTTON 2(10) but1 USER-COMMAND cli1,

PUSHBUTTON 12(10) text-020 USER-COMMAND cli2,

END OF LINE,

BEGIN OF LINE,

PUSHBUTTON 2(10) but3 USER-COMMAND cli3,

PUSHBUTTON 12(10) text-040 USER-COMMAND cli4,

END OF LINE,

END OF SCREEN 500.

AT SELECTION-SCREEN.

MESSAGE i888(sabapdocu) WITH text-001 sscrfields-ucomm.

CASE sscrfields-ucomm.

WHEN 'CLI1'.

flag = '1'.

WHEN 'CLI2'.

flag = '2'.

WHEN 'CLI3'.

flag = '3'.

WHEN 'CLI4'.

flag = '4'.

ENDCASE.

START-OF-SELECTION.

tit = 'Four Buttons'.

but1 = 'Button 1'.

but3 = 'Button 3'.

CALL SELECTION-SCREEN 500 STARTING AT 10 10.

CASE flag.

WHEN '1'.

WRITE / 'Button 1 was clicked'.

WHEN '2'.

WRITE / 'Button 2 was clicked'.

WHEN '3'.

WRITE / 'Button 3 was clicked'.

WHEN '4'.

WRITE / 'Button 4 was clicked'.

WHEN OTHERS.

WRITE / 'No Button was clicked'.

ENDCASE.

Regards,

Ravi

Read only

0 Likes
1,488

hi,

check these demo programs...

<b>demo_sel_screen_pushbutton

demo_sel_screen_function_key.</b>

regards

vijay

Read only

Former Member
0 Likes
1,488

Hi

Yes you can in event AT SELECTION-SCREEN:

To draw a pushbutton in selection-screen:

TABLES SSCRFIELDS.

SELECTION-SCREEN PUSHBUTTON /10(20) TEXT USER-COMMAND ABCD.

INITIALIZATION.

MOVE 'My text' TO TEXT.

To manage the ok-code of pushbutto

AT SELECTION-SCREEN.

IF SSCRFIELDS-UCOMM = 'ABCD'.

SUBMIT <REPORT> WITH .... AND RETUNR.

ENDIF.

Max

Read only

Former Member
0 Likes
1,488

HI Syed,

To call a report program from another report, use

SUBMIT statement.

You can pass the values from the first report to the second report using export /import statements or with ranges addition.

Example

The program report1 has a stand-alone selection screen with the screen number 1100. In the program report2, an internal table with row type RSPARAMS and a ranges table are filled for this selection screen. These are transferred at SUBMIT together with a single condition.

Program accessed

REPORT report1.

DATA text(10) TYPE c.

SELECTION-SCREEN BEGIN OF SCREEN 1100.

SELECT-OPTIONS: selcrit1 FOR text,

selcrit2 FOR text.

SELECTION-SCREEN END OF SCREEN 1100.

...

Calling program

REPORT report2.

DATA: text(10) TYPE c,

rspar_tab TYPE TABLE OF rsparams,

rspar_line LIKE LINE OF rspar_tab,

range_tab LIKE RANGE OF text,

range_line LIKE LINE OF range_tab.

...

rspar_line-selname = 'SELCRIT1'.

rspar_line-kind = 'S'.

rspar_line-sign = 'I'.

rspar_line-option = 'EQ'.

rspar_line-low = 'ABAP'.

APPEND rspar_line TO rspar_tab.

range_line-sign = 'E'.

range_line-option = 'EQ'.

range_line-low = 'H'.

APPEND range_line TO range_tab.

range_line-sign = 'E'.

range_line-option = 'EQ'.

range_line-low = 'K'.

APPEND range_line TO range_tab.

SUBMIT report1 USING SELECTION-SCREEN '1100'

WITH SELECTION-TABLE rspar_tab

WITH selcrit2 BETWEEN 'H' AND 'K'

WITH selcrit2 IN range_tab

AND RETURN.

Regards,

Ravi

Read only

hymavathi_oruganti
Active Contributor
0 Likes
1,488

yes,

SELECTION-SCREEN PUSHBUTTON [/][pos](len) button_text

USER-COMMAND

[VISIBLE LENGTH vlen]

[MODIF ID modid]

[ldb_additions].

u declare TABLES SSCRFIELDS

AT SELECTION-SCREEN.

CASE SSCRFIELDS-UCOMM.

WHEN UCOM.

UCOM = 'ONLI'.

Read only

Former Member
0 Likes
1,488

Hi,

yes. It is better to go for DYNPRO.

Define push Button and Define USER_COMMAND for this(PUSH_OK).

In flowlogic and In PAI

if SY-UCOMM = 'PUSH_OK'.

SUBMIT 'REPROTNAME'.

ENDIF.

Su

Read only

0 Likes
1,488

Hello friends,

Thanks for your replies, and input, will get back after giving it a shot*

till then,