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: 

How to add a "Pushbutton" to the standard list screen

Former Member
0 Kudos

Hi All,

What are the different methods of adding a Pushbutton to the Standard List screen.

When u click on the pushbutton it should drill down to the next level or perform some action.

Please let me know if any one has any solution for that.

Thanks

Satish.

6 REPLIES 6

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

Here is a short example of how to implement a hotspot on the list display.



report zrich_0001 no standard page heading..

data: imara type table of mara with header line.
data: imarc type table of marc with header line.

select-options: s_matnr for imara-matnr.

start-of-selection.

  select * into corresponding fields of table imara
           from mara
                 where matnr in s_matnr.

  loop at imara.
    write:/ imara-matnr.
    format hotspot on.
    hide imara-matnr.
    format hotspot off.
    write: imara-matkl, imara-groes.
  endloop.


at line-selection.

      clear imarc. refresh imarc.
      select * into corresponding fields of table imarc
               from marc
                     where matnr = imara-matnr.
      loop at imarc.
        write:/ imarc-matnr, imarc-werks, imarc-dispo.
      endloop.

Regards,

Rich Heilman

Former Member
0 Kudos

if u want to drill down on a particular field then of course hotspots are your option....it is as good as double clicking on the field and you can code your processing in the AT LINE-SELECTION event.

another option is to add pushbuttons on the application toolbar. u can use the set pf-status '<yourstatus>'. once u write this...double click on the status name and there u can specify the buttons that should appear on the toolbar....assign function codes to these buttons and their click can be caught in the at user-command event...

regards,

PJ

andreas_mann3
Active Contributor
0 Kudos

Hi,

...or with icon:

DATA func LIKE tstc-tcode.
TYPE-POOLS: icon.
*
WRITE: / icon_execute_object  AS ICON  HOTSPOT ON, 'Go'.
func = 'SE11' . HIDE func.
*
AT LINE-SELECTION.
  CHECK NOT func IS INITIAL.
  CALL FUNCTION 'TH_CREATE_MODE'
       EXPORTING
            transaktion = func.

regards Andreas

Former Member
0 Kudos

Hi,

You can add a push button using SET PF-STATUS Command.

Check the below code

REPORT PRG1.

DATA NUM TYPE I value 10.

START-OF-SELECTION.

set pf-status 'VARA'.

WRITE:/1 NUM.

write:/1 'This is primary list'.

  • The button can be handled in the AT USER-COMMAND section

at user-command.

case sy-ucomm.

when 'BUT1'. " BUT1 is function code of Button pressed

write:/1 'This is secondary list'.

endcase.

Regards,

Vara

Former Member
0 Kudos

Hi,

If u want a PUSH button on the Application toool bar then it can be done as follows,

In PBO of the screen,

SET PF-STATUS 'ZSTATUS'.

...

Double click on the ZSTATUS in that in the application bar option give the function code and the name of the button.

Then

In the PAI of the screen specify teh function code name in the place of XX

MODULE user_command_9001 INPUT.

CASE sy-ucomm.

WHEN 'XX'.

perform action...

.

.

ENDCASE.

Hope this helps.

Thanks & Regards,

Judith.

0 Kudos

Hello,

I am interested in add not only one but over 29 new Pushbuttons on my own pf-status.

That's not a problem because it allows until 35 pushbuttons, but some of them have a descriptive text, and the last ones are not shown inside the screen.

Does anybody know how to create two files of pushbuttons, or a extended list of pushbuttons (as in ALV), or any other solution ?

Thank you in advance for your answers.

Jordi Pons