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

Add button to program

Former Member
0 Likes
1,082

Hi

i create report(Z) and i have two button in the top of the page

F8 and layout

How can i insert new button ?

Thanks

1 ACCEPTED SOLUTION
Read only

sreekanthgo
Contributor
0 Likes
1,041

Hi,

If you want a button is the report, Please follow the below code.

include <symbol>.

write:/ sym_large_square as symbol.

Thanks,

Sreekanth

9 REPLIES 9
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
1,041

There is probably a statment like this in the program.

SET PF-STATUS 'MAIN'.

If so, double click the part where it says 'MAIN' in your statement, this will take you to the gui status, add your button here, activate, remember to handle the FCODE in the PAI, or AT USER-COMMAND event.

Regards

Rich Heilman

Read only

0 Likes
1,041

Hi

can you send me example

Thanks

Read only

0 Likes
1,041

Hi

i didn't find any SET PF-STATUS 'MAIN'

Read only

0 Likes
1,041

Are you referring to buttons in the application toolbar of the selection screen?

Regards,

Rich Heilman

Read only

sreekanthgo
Contributor
0 Likes
1,042

Hi,

If you want a button is the report, Please follow the below code.

include <symbol>.

write:/ sym_large_square as symbol.

Thanks,

Sreekanth

Read only

0 Likes
1,041

Hi Sreekanth

I want to button in the first scrren that upload

so i need to decleare it in selection

Read only

0 Likes
1,041

Ok, there is a couple ways to do it, one is to use a gui status using the SET PF-STATUS statement. I think this may not be a good idea as you will have to tied all the standard buttons again. You could simply add it directly to the selection screen. Like so.



report zrich_0001.

type-pools: icon.

selection-screen begin of block b1 with frame title text-001.
selection-screen pushbutton 10(20) check user-command check.
selection-screen end of block b1.

at selection-screen output.

* Write pushbutton text
  write icon_configuration as icon to check.
  concatenate check 'Go To SM50' into check
              separated by space.

at selection-screen .

  case sy-ucomm.
    when 'CHECK'.
      call transaction 'SM50'.
  endcase.

This is by far easier to handle.

Regards,

Rich Heilman

Read only

0 Likes
1,041

Hi,

If you want a button in the selection screen,

1) Like Rich said in your code write a statment like SET PF-STATUS 'MAIN'.

2) Double click on the MAIN in the code and you will get a popup. Enter some there.

3) IN the next screen expand Application tool bar and Write <b>Upload</b> in the first row of the first column.

4) Double click on the name after writing, choose static text.

5) Give function text as Upload and press enter.

6) Assign a function key other than F2. ( Choose F3 ). Enter.

7) Save and activate.

😎 Run your report you will get the button on the selection screen.

Thanks,

Sreekanth

*-- reward if it helps you

Read only

Former Member
0 Likes
1,041

Thanks to all