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

button not working

Former Member
0 Likes
1,590

Hi

Ive added a button 'SHOW' on my screen to print forms but when Im pressing on that button, nothing is being launched, anybody knows why?

I dont want to add the standard button 'Print' because I dont want the print pop up screen to appear, Thats Why Ive added another button 'SHOW' to print

heres my code

CASE SY-UCOMM.

WHEN 'SHOW'.

LOOP AT gi_all_data INTO gw_all_data.

  • Call the smarform

CALL FUNCTION g_fm_name

EXPORTING

gw_all_data = gw_all_data

user_settings = ' '

output_options = gw_options

control_parameters = gw_control.

ENDLOOP.

WHEN 'BACK'.

LEAVE SCREEN.

ENDCASE.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,563
Ive added a button 'SHOW' on my screen to print forms but when Im pressing on that button, nothing is being launched, anybody knows why?

your code below:

CASE SY-UCOMM.
WHEN 'SHOW'.
LOOP AT gi_all_data INTO gw_all_data.


Call the smarform 
CALL FUNCTION g_fm_name
EXPORTING
gw_all_data = gw_all_data
user_settings = ' '
output_options = gw_options
control_parameters = gw_control.

ENDLOOP.

WHEN 'BACK'.
LEAVE SCREEN.

ENDCASE.

Just Want to confirm CALL FUNCTION g_fm_name what is the g_fm_name in your code where you filled this value and With what FM?

Amit.

15 REPLIES 15
Read only

Former Member
0 Likes
1,563

can you specify which type of program you are using & under what event you have written the given code ?

Read only

0 Likes
1,563

ive created the button 'SHOW' in the application toolbar in SE41

then in the main program, after the selection screen, ive set SET PF-STATUS 'MAIN'.

then for printing, ive written

CASE SY-UCOMM.

WHEN 'PRINT'.

  • Call the smarform

CALL FUNCTION g_fm_name

EXPORTING

gw_all_data = gw_all_data

user_settings = ' '

output_options = gw_options

control_parameters = gw_control.

WHEN 'SHOW'.

LOOP AT gi_all_data INTO gw_all_data.

  • Call the smarform

CALL FUNCTION g_fm_name

EXPORTING

gw_all_data = gw_all_data

user_settings = ' '

output_options = gw_options

control_parameters = gw_control.

ENDLOOP.

WHEN 'BACK'.

LEAVE SCREEN.

ENDCASE.

I dont know how to manipulate screens etc so well, may be im missing something, plz help

Read only

0 Likes
1,563

write ur code under event & try.

AT SELECTION-SCREEN.

ie.


AT SELECTION-SCREEN.
CASE SY-UCOMM.
WHEN 'PRINT'.
WHEN 'SHOW'.

Read only

0 Likes
1,563

Check your PF-STATUS active or not.

Also check gi_all_data internal table is having the data or not.

Why are you calling smartform inside loop.?

WHEN 'SHOW'.
BREAK-POINT.
LOOP AT gi_all_data INTO gw_all_data.

Call the smarform 
CALL FUNCTION g_fm_name
EXPORTING
gw_all_data = gw_all_data
user_settings = ' '
output_options = gw_options
control_parameters = gw_control.

ENDLOOP.

Just keep a break point and see Button is triggering or not.

Read only

0 Likes
1,563

The problem is that the 'Back' function is working, the standard 'Print' button is working, its only the 'SHOW' button which is not a standard button, is not working.

Any idea?

Read only

Former Member
0 Likes
1,563

Hi,

Make sure whether you have given the function code for 'SHOW', then it works properly.

Regards,

Sathish Reddy.

Read only

0 Likes
1,563

Yes Ive defined the 'Show' button in SE41 and the function code name is 'SHOW'

What other checks are there?

Or Im missing some particular events?

Read only

0 Likes
1,563

in which screen you are adding the button..?

is it normal selection screen or module pool screen.

Read only

0 Likes
1,563

Euhhh, where I should check that?

I know I just went to SE41, gave the program name and a status and then added the 'Show' in the application bar

Is what I am supposed to do?

Read only

0 Likes
1,563

Do I need to create a screen for that program in SE51 as well?

Read only

0 Likes
1,563

Hello if you are setting the PF-STATUS in SE41 means you are setting it for some screen selection screen or Module pool screen or in the output screen.

you question started with Button not working..?

where is the button in your program and you are telling it is not working , where exactly you are clicking the button (SHOW).

Don't tell me the button you added in SE41.

First of all tell me what is the program you are doing ....

is it Module pool or normal Report program.

Read only

0 Likes
1,563

its a normal Report Program

after executing the selection screen, a report of accounting documents is generated, whereby each accounting document has a smartform attached to it.

Then if we click on the 'SHOW' button, all the smartforms for the accounting documents are printed one after other.

Its the first time im doing this sort of thing

what I did is I created the smartform, the report - these are working

Then I went to SE41 to create the 'SHOW' button, which i attached to the report(I guess its not rite!)

Then when I executed the report, the report is displayed but when I click on the 'SHOW' button, nothing is displayed, I even tried through debug mode but nothing is being called

thats my issue

Plz help

Read only

0 Likes
1,563
whereby each accounting document has a smartform attached to it.

Then if we click on the 'SHOW' button, all the smartforms for the accounting documents are printed one after other.

Are you calling smartform from this report?

Hope i guessing right?

pls can you confirm?

and also if possible pls confirm about FM also which i asked above reply.

thats my issue

Issue seems Still uncertain .

Amit.

Read only

Former Member
0 Likes
1,564
Ive added a button 'SHOW' on my screen to print forms but when Im pressing on that button, nothing is being launched, anybody knows why?

your code below:

CASE SY-UCOMM.
WHEN 'SHOW'.
LOOP AT gi_all_data INTO gw_all_data.


Call the smarform 
CALL FUNCTION g_fm_name
EXPORTING
gw_all_data = gw_all_data
user_settings = ' '
output_options = gw_options
control_parameters = gw_control.

ENDLOOP.

WHEN 'BACK'.
LEAVE SCREEN.

ENDCASE.

Just Want to confirm CALL FUNCTION g_fm_name what is the g_fm_name in your code where you filled this value and With what FM?

Amit.

Read only

Former Member
0 Likes
1,563

its ok now, I was missing AT USER-COMMAND statement, thats why nothing was launched