Buttons On Screen and List Processing

Development (ABAP Development WorkBench, ABAP/4 programming)

Moderators: Snowy, thx4allthefish, YuriT, Gothmog

Post Reply
Guest

Buttons On Screen and List Processing

Post by Guest » Wed Nov 13, 2002 5:33 am

:oops: Going to ask a really basic question because I haven't been in ABAP long.

I need to write a report on screen (just simple list processing).

Then I want the user to be able to click on a button on the tool bar and then view another on-screen list.

What is the most simple way of doing this? Sorry for asking but I am not very good with this. Do I need to create a screen in screen painter and then create a status or is there any easier way to do this within simple list processing.

Thanks.

chicco97
Posts: 11
Joined: Tue Nov 12, 2002 6:58 am

Post by chicco97 » Wed Nov 13, 2002 5:49 am

Hi, try this

TABLES SSCRFIELDS.

* The 50(30) defines the place where it appears
SELECTION-SCREEN PUSHBUTTON 50(30) NAME USER-COMMAND PRESSED.

*to write something on the button
INITIALIZATION.
MOVE 'I am a button' to NAME.

* Just to see if it works......
AT SELECTION-SCREEN.
IF SSCRFIELDS-UCOMM = 'PRESSED'.
break-point.
ENDIF.


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

Hope that helps..

:wink: Lueder

kumar
Posts: 2012
Joined: Tue Oct 22, 2002 12:51 pm
Location: Basel, Switzerland
Contact:

Post by kumar » Wed Nov 13, 2002 5:50 am

The simplest way is using

AT LINE-SELECTION.
*Whatever you want.

If the user double clicks the line, Whatever you write below the AT LINE-SELECTION will be triggred (Executed).

Try pressing F1 and reading the Doc for AT LINE-SELECTION.

KRK

Guest

Post by Guest » Wed Nov 13, 2002 6:02 am

Thanks for those tips :)

I had considered using AT LINE SELECTION but they reall need a button. The button on the selection screen is a good idea but I will loose it when I show the first report.

Basically I have my selection screen which produces a print report. THEN I want to click the button to be taken to the second print report. I guess in order to do this I will need to display the button on the toolbar.

Any more help would be much appreciated.

tandt
Posts: 136
Joined: Tue Oct 29, 2002 1:41 am

Re: Buttons On Screen and List Processing

Post by tandt » Wed Nov 13, 2002 6:10 am

Have a look at these demo programs..to get an idea
DEMO_SEL_SCREEN_PUSHBUTTON
DEMO_DYNPRO_PUSH_BUTTON

Regards
TandT

Anonymous wrote::oops: Going to ask a really basic question because I haven't been in ABAP long.

I need to write a report on screen (just simple list processing).

Then I want the user to be able to click on a button on the tool bar and then view another on-screen list.

What is the most simple way of doing this? Sorry for asking but I am not very good with this. Do I need to create a screen in screen painter and then create a status or is there any easier way to do this within simple list processing.

Thanks.

kumar
Posts: 2012
Joined: Tue Oct 22, 2002 12:51 pm
Location: Basel, Switzerland
Contact:

Post by kumar » Wed Nov 13, 2002 6:16 am

If you use

AT LINE-SELECTION.

You get a lens button on your Basic List (First Report).

However If you are not happy and for more options you can consider using

AT USER-C0MMAND.

as follows.

Code: Select all


START-OF-SELECTION.

SET PF-STATUS 'PRI'.

*Continue with your program lines.

AT USER-COMMAND.
 CASE SY-UCOMM.
  WHEN 'CREA'.
*Whatever you want.
  ENDCASE.

You can double click the SET PF-STATUS 'PRI' and create the status and assign User command CREA in the application Tool bar.

Ensure that your Back, Exit and Cancel are active in the PF STATUS.

KRK

Marina
Posts: 53
Joined: Tue Oct 22, 2002 5:24 am
Location: Russia

Post by Marina » Wed Nov 13, 2002 6:25 am

Hi!
I think you needn't a dynpro to display your report, just a usual list.
To define a button you need to create a GUI-status.
Before displaying your list write:
SET PF-STATUS 'STAT'.
Double click on 'STAT' will bring you to the menu processing. There define your buttons, assign some function codes ie 'BUT1' and 'BUT2' to them.

Then you need AT USER-COMMAND event where you will treat clicks on the buttons:

AT USER-COMMAND
CASE SY-UCOMM.
WHEN 'BUT1'.
processing1
WHEN 'BUT2'.
processing2

.....
ENDCASE.


Marina

Rich
Posts: 7116
Joined: Thu Oct 31, 2002 4:47 pm
Location: Liverpool
Contact:

Post by Rich » Wed Nov 13, 2002 6:28 am

If you want a button on the report itself, alongside each line, you can
display an icon on the report line 'AS HOTSPOT'. Select the icon from the list of displayable icons shown in program 'SHOWICON'.

When the users mouse hovers over the hotspot it changes to a finger. When they click it, the AT LINE-SELECTION event is called, where if you want you can modify the icon using MODIFY LINE before actioning the line.

Rich

Post Reply