‎2007 Dec 13 12:15 PM
Hi friends,
I have created a variant for job scheduling, i wants to use one field value in the
program when background job running from that variant. Please help me to get that value in background.
Thanks in Advance,
SB.
‎2007 Dec 13 12:52 PM
Hi Perez,
Thanks for very useful answer.
Seems this FM RS_VARIANT_CONTENTS works out, please tell me how to get
this returns table field values of particular select options. Exapmle Number.
Thanks,
SB.
‎2007 Dec 13 12:21 PM
not sure what exactly u need , check if this helps.
sy-batch = 'X' for back ground running , variant = sy-slset
if sy-batch EQ 'X' and sy-SLSET EQ 'Variant_name'.
<do some operations here>
endif.
‎2007 Dec 13 12:26 PM
Hi sreejith,
I am creating a variant for some Number field for my BG job,
i want to do some operation in at selection-screen output using this
number value from variant. My question is how to get this value ?
Thanks,
SB.
‎2007 Dec 13 12:36 PM
Hi ,
It seems as if u need to run the BG job using some varaint .
So first u need to save a varian with some Name say XYZ .
Now in ur code at the selection-screen ouput even do the code
AT SELECTION-SCREEN output .
If sy-batch = 'X' and sy-selset = 'XYZ.'.
Perform ABC.
ENDIF .
FORM ABC .
**Your functionality*
ENDFORM.
‎2007 Dec 13 12:25 PM
Hi syed,
goto SE38->program->execute->background.
A screen will displayed in that give your progam name and variant then click the button execute immediatly or schedule what ever you want.
Plz Reward if useful answer,
Mahi.
‎2007 Dec 13 12:28 PM
Hi Syed,
Hi
first Save the variant for that program and use in Job scheduling
Create a Variant for the Program and
Schedule JOB in background:
Go to SM36 create a Job
enter Program and Variant for that program in STEP..
click on Start Condition
Click on DATE and TIME enter date scheduled Start and END times
click on Period Values
Click on HOURLY/WEEKLY etc
CLick on RESTRICTIONS also to use further criteria.
so your job will be scheduled and run as per your requirement.
and in SM37 Transaction check the status of that JOB
Check this link for scheduling jobs..
http://help.sap.com/saphelp_nw2004s/helpdata/en/c4/3a7f87505211d189550000e829fbbd/content.htm
<b>Kindly reward points if you found the reply helpful.<b>
Cheers,
Chaitanya.
‎2007 Dec 13 12:40 PM
Hi Syed,
to get values from variant use this FM
RS_VARIANT_CONTENTS
You've to pass Program name and variant to this FM.
then FM returns table. by reading this table you can get values of particular select options.
‎2007 Dec 13 12:52 PM
Hi Perez,
Thanks for very useful answer.
Seems this FM RS_VARIANT_CONTENTS works out, please tell me how to get
this returns table field values of particular select options. Exapmle Number.
Thanks,
SB.
‎2007 Dec 13 1:06 PM
Hi syed,
check this code..
REPORT ztest18.
TABLES : marc.
SELECT-OPTIONS: s_matnr FOR marc-matnr.
DATA : itab LIKE rsparams OCCURS 0 WITH HEADER LINE.
CALL FUNCTION 'RS_VARIANT_CONTENTS'
EXPORTING
report = 'ZTEST18' "Report name
variant = 'TEST' "variant name
TABLES
valutab = itab "output table
EXCEPTIONS
variant_non_existent = 1
variant_obsolete = 2
OTHERS = 3.
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
LOOP AT itab.
WRITE :/ itab-selname, itab-low, itab-high.
ENDLOOP.