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: 

control report program by using pushbuttons

Former Member
0 Kudos

Hi Experts,

I need to create a selection screen with text boxes, radio buttons and Push buttons. Whenever I enter some value in text box and press the PUSHBUTTON, the report should upload one file from local drive(like 😧 C: or Desktop) and need to update one custom table with those entries and it should display those entries like a normal report works.

      • PUSHBUTTONs are used to control the selection screen rathar than report. ***

Is there any way that a report program with PUSHBUTTONs will works like a normal program?

Otherwise give me some suggestions how do I proceed further...

Regards,

Ramesh.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

Please see following Code for selection screen

SELECTION-SCREEN BEGIN OF BLOCK block1 WITH FRAME

TITLE text-001.

  • Declaration of sel screen buttons

SELECTION-SCREEN BEGIN OF LINE.

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

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

SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN END OF BLOCK block1.

Do following at Start-of-selection.

If sy-ucom eq BUT1

use function Module gui_dowmload

elseif sy-ucom eq BUT2.

use function Module gui_dowmload to downlad at particular location in your Presentaion Server

endif.

Thanks & Regards.

ShreeMohan

4 REPLIES 4

Former Member
0 Kudos

Hello,

Yes you can do it.

Create a custom screen in your program(module pool). create the push button, text box in that screen.

At PBO and PAI, write your logic.

Cheers,

Balaji

former_member585865
Contributor
0 Kudos

Hi Ramesh,

have two bushbuttons in the report.

1. for Upload

2. For report display

when you select upload push button the upload details will come below then select the file and upload it.

when you select report display push button it will show the list.

have use of at-selection

just see a example code how can we control using radio button.


SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS       : p_r1 RADIOBUTTON GROUP rad
                        USER-COMMAND clk DEFAULT 'X'.            " upload Radio Button
SELECTION-SCREEN COMMENT 5(35) text-003.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN : BEGIN OF BLOCK 001 WITH FRAME TITLE text-001.
PARAMETERS: p_upl       LIKE rlgrap-filename MODIF ID a           "Upload File
                         DEFAULT 'c:\temp\parbmat.xls',
            p_werks     like t001w-werks MODIF ID a,              "Plant

PARAMETERS: p_rest      LIKE rlgrap-filename MODIF ID a           "Dwonload File Path
                         DEFAULT 'c:\temp\Success.xls'.
SELECTION-SCREEN : END OF BLOCK 001.

SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS : p_r2 RADIOBUTTON GROUP rad.
SELECTION-SCREEN COMMENT 5(35) text-004.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN : BEGIN OF BLOCK 002 WITH FRAME TITLE text-002.
PARAMETERS     : p_plant  LIKE marc-werks MODIF ID b.                "Plant
SELECT-OPTIONS : s_dat FOR  mara-ersda MODIF ID b.                  "Date on Record Created
PARAMETERS     : p_down LIKE rlgrap-filename MODIF ID b
                  DEFAULT 'c:\temp\Material Master.xls'.           "Download File Path
SELECTION-SCREEN : END OF BLOCK 002.

then you can use of at-selection screen to show or hide.

see the below example code.


T SELECTION-SCREEN OUTPUT.
*Inactive Fields depending on the radio button
  LOOP AT SCREEN.
    IF p_r1 = 'X'.
      IF screen-group1 = 'B'.
        screen-active = 0.
      ENDIF.
    ELSEIF p_r2 = 'X'.
      IF screen-group1 = 'A'.
        screen-active = 0.
      ENDIF.
    ENDIF.
    MODIFY SCREEN.
  ENDLOOP.

Edited by: suresh suresh on Jul 17, 2009 2:30 PM

Former Member
0 Kudos

Hi,

Please see following Code for selection screen

SELECTION-SCREEN BEGIN OF BLOCK block1 WITH FRAME

TITLE text-001.

  • Declaration of sel screen buttons

SELECTION-SCREEN BEGIN OF LINE.

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

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

SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN END OF BLOCK block1.

Do following at Start-of-selection.

If sy-ucom eq BUT1

use function Module gui_dowmload

elseif sy-ucom eq BUT2.

use function Module gui_dowmload to downlad at particular location in your Presentaion Server

endif.

Thanks & Regards.

ShreeMohan

Former Member
0 Kudos

used normal abap code and it works fine now