10-04-2006 11:44 AM
Hi,
I wish to manually submit a Z* T-code in Background job.
When I look at Sm36 it asks for the program name, but I want a way where I can enter T-CODE and not program name.
Reason for above requirement is because the underlying Zprogram is called by 5 different Z t-codes and each T-code invokes a different selection screen. If I use program name in SM36 it uses all the selection-screen fields and not transaction specific selection-screen fields.
So I want to run the background job for a single t-code and expect its relavent selection-screen fields to be used. Is there a way or I will need to create a new Z*program for every T-code so that they can be run in background.
Any clues Gurus. Apprecaite your advise.
Many Thanks
RK
10-04-2006 11:52 AM
Hi Rajiv,
Try creating 5 separate variants for your programme and define then along with the program in SM36.
I understand only the selection-screen changes for each t-code. I assume you do not check your t-code for any further program logic after the start-of-selection.
Hope this helps.
Regards.
10-04-2006 11:51 AM
Hello Rajiv
I do not see where the problem lies if you are using the report name. For submitting the background job you have to provide your report and a variant which, I suppose, should be specific for each different selection screen.
Regards
Uwe
10-04-2006 11:52 AM
Hi Rajiv,
Try creating 5 separate variants for your programme and define then along with the program in SM36.
I understand only the selection-screen changes for each t-code. I assume you do not check your t-code for any further program logic after the start-of-selection.
Hope this helps.
Regards.
10-04-2006 12:00 PM
Hi All,
Each transaction calls a separate group of fields and some of them are mandatory.
Once I submit background job with the variant specific to a T-Code, it errors with amessage 'Fill all MANDATORY fields'.
When I analysed I saw the underlying program has 20 selection fields of whick 7 are mandatory.
When I call my Z T-code, it shows only 5 selection fields of which 2 are mandatory. So when I run my background job for this variant it points to the Zprogram and not Z Tcode and expects data in all 7 mandatory fields.
So what should I do ?
Thanks
RK
10-04-2006 12:23 PM
Unfortunately, in that case creating another Z-program is the best alternative OR another soln is to modify the Z-prg so as to remove the manditory variation from parameters and validate them at at selection-screen depending on the transaction code OR create a variant and populate dummy values to the other mandatory fields(though it depends on how do you use that fields in the pgm)
10-04-2006 2:46 PM
Hello Rajiv
You could add an additional parameter <b>p_tcode</b> that is not displayed if your report is started by one of your 5 transactions (modify SCREEN at event AT SELECTION-SCREEN OUTPUT for this parameter):
PARAMETERS:
p_tcode TYPE tcode DEFAULT syst-tcode.
Also, depending on p_tcode you define the mandatory fields for your selection-screens (SCREEN-REQUIRED = 1). Thus, omit the option OBLIGATORY at the parameters and select-options.
Now, instead of checking for syst-tcode you check for p_tcode which you can add to your variants.
Regards
Uwe
10-04-2006 12:02 PM