Ver Mensaje Individual
  #4  
Viejo 10/02/09, 15:09:30
jramos_torres jramos_torres is offline
Junior Member
 
Fecha de Ingreso: dic 2008
Mensajes: 8
Lanzar Un Programa En Job O Background

Espero esto te sirva o te de una idea como minimo.
Las siguientes funciones se realizan una tras otra,asi debe ser.Los comentarios que vez en la funcion JOB_SUBMIT se lo puedes quitar. la parte del submit que no tiene comentarios la hice por que necesitaba mandarle
una tabla al programa de fondo esa parte la puedes comentarizar y la del
comentario activarla si asi conviene a tu programa.



Form Ejecuta_Job_Fondo.
*
Call Function 'JOB_OPEN'
Exporting
JobName = 'ZDME0047'
Importing
jobcount = Tbtcjob-Jobcount
Exceptions
Others = 0.
**
* Call Function 'JOB_SUBMIT'
* Exporting
* authcknam = Sy-Uname
* Jobcount = Tbtcjob-jobcount
* Jobname = 'ZDME0047'
* Report = 'ZDME0047'
** Variant = ''
* Exceptions
* Bad_Priparams = 1
* Bad_Xpgflags = 2
* Invalid_Jobdata = 3
* Jobname_Missing = 4
* Job_Notex = 5
* Job_Submit_Failed = 6
* Lock_Failed = 7
* Program_Missing = 8
* Prog_Abap_And_Extpg_Set = 9.
*
Submit ZDME0047 With p_Oferta In R_Ofertas To Sap-Spool
Spool Parameters Print_parameters
WithOut Spool Dynpro
Via Job 'ZDME0047' Number Tbtcjob-Jobcount
User Sy-Uname
And Return.


*
Call Function 'JOB_CLOSE'
Exporting
Jobcount = tbtcjob-jobcount
jobname = 'ZDME0047'
strtimmed = 'X'
Exceptions
Cant_Start_Immediate = 1
Invalid_StarDate = 2
Jobname_Missing = 3
Job_Close_Failed = 4
Job_Nosteps = 5
Job_notex = 6
Lock_Failed = 7
Invalid_Target = 8.
*
EndForm.
Responder Con Cita