‎2008 Aug 26 12:17 PM
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.
‎2008 Aug 26 2:08 PM
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.
‎2008 Aug 26 12:39 PM
can you specify which type of program you are using & under what event you have written the given code ?
‎2008 Aug 26 12:50 PM
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
‎2008 Aug 26 1:02 PM
write ur code under event & try.
AT SELECTION-SCREEN.
ie.
AT SELECTION-SCREEN.
CASE SY-UCOMM.
WHEN 'PRINT'.
WHEN 'SHOW'.
‎2008 Aug 26 1:03 PM
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.
‎2008 Aug 26 1:08 PM
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?
‎2008 Aug 26 1:22 PM
Hi,
Make sure whether you have given the function code for 'SHOW', then it works properly.
Regards,
Sathish Reddy.
‎2008 Aug 26 1:31 PM
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?
‎2008 Aug 26 1:43 PM
in which screen you are adding the button..?
is it normal selection screen or module pool screen.
‎2008 Aug 26 1:48 PM
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?
‎2008 Aug 26 1:51 PM
Do I need to create a screen for that program in SE51 as well?
‎2008 Aug 26 1:59 PM
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.
‎2008 Aug 26 2:09 PM
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
‎2008 Aug 26 2:31 PM
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 issueIssue seems Still uncertain .
Amit.
‎2008 Aug 26 2:08 PM
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.
‎2008 Aug 26 2:39 PM
its ok now, I was missing AT USER-COMMAND statement, thats why nothing was launched