Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Batch job in a report program

Former Member
0 Likes
2,736

Hi Abappers,

I have a peculiar scenario.

My report has 2 PERFORMS lets say

PERFORM1:

PERFORM2:

I have a DATE criterion in PERFORM 1.

Based on that date only I have to execute my PERFORM2.

Ex: The Date consideration is Suspension of a Contract Date: which is 01/12/2010.(dd/mm/yyyy)

Now based on the this date I have to execute the 2nd PERFORM.

I mean I have to create a Sales Order on this date only.

To summarize,Execution of a program in a future date whose date is dynamic in nature

Can i achieve this using a BATCH JOB.

Please tell me how to schedule a BATCH JOB for a future date.

Can i call a BATCH JOB froma REPORT.

Please your inputs shall be of great help to me in solving my problem.

Thanks and Regards

Srikanth.P

6 REPLIES 6
Read only

Former Member
0 Likes
1,440

Hi,

You can call the FM for scheduling backgorund job i.e JOB_OPEN and pass the value of the dynamically generated date to the parameter SDLSTRTDT of the function moduel

regards,

Sakshi

Read only

0 Likes
1,440

Hi Jain,

If I am passing the Date in the FM then How should I schedule my batch job while creating it in SM36.

Waiting for your response.

Thanks and Regards

Srikanth.P

Read only

0 Likes
1,440

Hi Jain,

If I am passing the Date in the FM then How should I schedule my batch job while creating it in SM36.

Waiting for your response.

Thanks and Regards

Srikanth.P

Read only

0 Likes
1,440

Hi,

There are 2 ways of scheduling jobs either in SM36 or programmatically in your report.

since you have to pass the date value dynamically depending on perform1.

Schedule job in your report using the FM and you dont need to schedule it in SM36

Read only

0 Likes
1,440

Hi Sakshi,

In that case of using the FM

g_date is sy-datum.

g_time is sy-uzeit.

CALL FUNCTION 'JOB_OPEN'
  EXPORTING
*   DELANFREP              = ' '
*   JOBGROUP               = ' '
    JOBNAME                = 'Z_BATCHJOB_TRGT'
    SDLSTRTDT              = g_date
   SDLSTRTTM               = g_time.
*   JOBCLASS               =
* IMPORTING
*   JOBCOUNT               =
* CHANGING
*   RET                    =
* EXCEPTIONS
*   CANT_CREATE_JOB        = 1
*   INVALID_JOB_DATA       = 2
*   JOBNAME_MISSING        = 3
*   OTHERS                 = 4
          .
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.

In the above case how would the Job name get mapped to the Report. / Or / How can we assign the Job Name to the Report.

There is no scope of giving the Report name in the FM.

Can you please elucidate.(EXP parameters)

By the way Thanks for your quick response.

Thanks and Regards

Srikanth

Read only

0 Likes
1,440

Hi,

check the below links.

[;