10-10-2010 10:15 AM
Hi Experts,
I have a requirement where in we need to provide a input parameters for a report when it is triggered from a TCODE.
When this program is executed in SE38, the input parameters should not be available. The report takes a default value which is
defined in the program.
We need use the same program when called using the TCODE, as well as from SE38.
Looking for a early response.
Thanks in advance.
Regards,
Kumar.
10-11-2010 10:05 AM
Suhas Saha,
The program willl be scheduled everyday which will take the default date.
For retriving data for a particular date i need to provide user input screen. This will be done through ZTCODE.
Regards,
Kumar.
10-10-2010 10:47 AM
You can use [Parameter Transaction|http://help.sap.com/saphelp_nw04/helpdata/en/eb/5fab44d79b11d296190000e82de14a/frameset.htm] in order to pass data to the report once called by this tcode.
Regards
Marcin
10-10-2010 1:13 PM
Use event INITIALIZATION.
And check if sy-tcode <> 'SA38' and <> 'SE38'.
Then set the value for the parameter.
Regards
Roy
Edited by: Roy Olav Johansen on Oct 10, 2010 2:14 PM
10-11-2010 6:35 AM
Thanks for your response.
But the requirement is, the parameter screen itself should not available if i trigger the code from SE38.
And the parameter screen should be available if i come through the TCODE.
Regards,
Kumar
10-11-2010 6:49 AM
Hello,
Does this fit the bill:
PARAMETERS: p_bukrs TYPE bukrs.
INITIALIZATION.
IF sy-tcode NE 'ZTEST'. "Name of the T-Code assigned to the report
MESSAGE 'Cannot use SE38 to run the report' TYPE 'E'.
ENDIF.
BR,
Suhas
10-11-2010 7:56 AM
So simply hide it if called via SE38
at selection-screen output.
if sy-tcode NE 'your_tcode'.
loop at screen.
if screen-name = 'SOME_PARAMETER'.
screen-active = 0.
modify screen.
endif.
endloop.
endif.
Regards
Marcin
10-11-2010 9:39 AM
Dear Marcin,
Thanks for ur comment.
If i do as suggested by you,
Screen parameters are inactive, this is ok, but it stops at a empty screen.
I need to press the execute button again to run the program. This is should not happen. The program should run without any manual interventions or any error message popping out if run through SE38. If i run from TCODE it should show the input parameters.
Regards,
Kumar
10-11-2010 9:46 AM
If you want to suppress this empty screen, simply create another program where you use
report z_addit_program.
submit z_original_program.
This will run the program and will not show the selection screen anymore (so even no need to hide the parameters). Then create a ZTCODE for z_original_program .
This way when you run it via se38, use Z_ADDIT_PROGRAM, and when run via ZTCODE it will run Z_ORIGINAL_PROGRAM. In first case no parameters will come at all, in the secod case entire selection screen will be shown.
Regards
Marcin
10-11-2010 9:48 AM
>
> I need to press the execute button again to run the program. This is should not happen. The program should run without any manual interventions or any error message popping out if run through SE38. If i run from TCODE it should show the input parameters.
I don't get why do you want this functionality. Do your users have authority for SE38 in Production?
10-11-2010 10:05 AM
Suhas Saha,
The program willl be scheduled everyday which will take the default date.
For retriving data for a particular date i need to provide user input screen. This will be done through ZTCODE.
Regards,
Kumar.
10-11-2010 10:14 AM
In this way I don't know how you want to schedule the ZTCODE. In my opinion you should be using same program and checking if sy-batch = 'X' so you know whether it was run in frontend or in the background.
report z_addit_program.
if sy-batch = 'X'.
submit z_original_program with parameter1 = sy-datum.
else.
submit z_original_program.
endif.
Then forbid the access to Z_ORIGINAL_PROGRAM
Regards
Marcin
10-11-2010 10:15 AM
Hello,
Create a parameter transaction and give screeb names from se93.
Thanks.
Ramya.
10-11-2010 10:24 AM
>
> The program willl be scheduled everyday which will take the default date.
In case of Background processing SELECTION-SCREEN will not be displayed so you don't have to worry about it.
For retriving data for a particular date i need to provide user input screen. This will be done through ZTCODE.
You would schedule the job on a daily basis in SM36 & for individual dates you'll access the report via the T-Code. So where does SE38 come into the picture?
@Marcin: If SY-BATCH = 'X', i don't think SELECTION-SCREEN will be available
BR,
SUhas
10-11-2010 11:03 AM