‎2010 Apr 06 8:42 AM
Hi All,
I am creating a program with date and time as input fields for my slection. Based on this selection program will fetch
change document history of BOM.
How to handle this date and time as a selection for above scenario to run this program in background job ? We need to consider
the job failures also.
Thanks,
Vinay.
‎2010 Apr 06 8:48 AM
IT seems you want to enter current date and time in those field..
if yes.
then at initilisation event you can populate them with sy-datum and sy-uzeit
if no.
then you may need to create a Z table and get the date and time from it.
‎2010 Apr 06 8:47 AM
hi vinay,
create your program and schedule it to background mode.before scheduling it you can export the date and time fields..
data: indxkey TYPE indx-srtfd VALUE 'KEYVALUE',
l_number TYPE tbtcjob-jobcount,
l_name TYPE tbtcjob-jobname.
EXPORT i_vbap to DATABASE indx(t1) id indxkey.
CALL FUNCTION 'JOB_OPEN'
EXPORTING
jobname = l_name
IMPORTING
jobcount = l_number
EXCEPTIONS
cant_create_job = 1
invalid_job_data = 2
jobname_missing = 3
OTHERS = 4.
IF sy-subrc = 0.
SUBMIT zls_open_delivery VIA JOB l_name NUMBER l_number
AND RETURN .
IF sy-subrc = 0.
CALL FUNCTION 'JOB_CLOSE'
EXPORTING
jobcount = l_number
jobname = l_name
strtimmed = 'X'
EXCEPTIONS
cant_start_immediate = 1
invalid_startdate = 2
jobname_missing = 3
job_close_failed = 4
job_nosteps = 5
job_notex = 6
lock_failed = 7
OTHERS = 8.
ENDIF.
ENDIF.
hope this helps.
thanks
tanmaya
‎2010 Apr 06 8:48 AM
IT seems you want to enter current date and time in those field..
if yes.
then at initilisation event you can populate them with sy-datum and sy-uzeit
if no.
then you may need to create a Z table and get the date and time from it.
‎2010 Apr 06 9:15 AM
Hi Alnoor,
Thanks for your response ! I think I need to create a ztable to get the date and time.
Could you please explain me more about this point ? How to manage the variant if I need to schedule background ?
Any other inputs plz.
Regards,
Vinay.
‎2010 Apr 06 9:20 AM
Hi,
How you wan to schedule the job through progarm or manually.
If through program then answer is alreday given, if manually then you can directly execute progarm in background. Regarding variant, you can set the variant to always show current date and time also there are many manupulation possibal with date and time while creating variant.
‎2010 Apr 06 9:27 AM
hi vinay,
In case you have only date and time on your field then you don't need a variant.
in case want to go via variant you have to pass the same variable sy-datum and sy-uzeit in the variant .
--AL
‎2010 Apr 06 1:14 PM
Hi Anurag,
I want to schedule job through program not manually . Please help.
Thanks,
Vinay
‎2010 Apr 06 7:12 PM
HI,
What I guess is you are having date and time in your selection screen... Now tell what exactly wat date and time you want to put.. then we can move further
‎2010 Apr 07 6:58 AM
Hi Anurag,
I will give selection screen as plant and date and time for initial run. Then I will run the job
If job runs every 1 hour , time will increase one hour . so keep on changing.
Thanks,
Vinay
‎2010 Apr 07 12:29 PM
Hi,
what you can do is in your progarm. Initialization write P_time( variable for time you have used ) = sy-uzeit.
similarly p_date = sy-datum
‎2010 Apr 07 1:51 PM
Hi,
Create table entries in TVARVC table and get the values at runtime from the table and update the values to the same entry for the next time to execute with new values in same program.
Let me know if if is not clear.
--Naresh.
‎2010 May 04 9:37 AM
Hi Naresh,
can plz elaborate .....i am also facing the prob.....
thnks
Yerukala Setty