Error in Background Job Processing.

Dear All,
         I am using a background job for processing the outbound delivery.
         In the user exit in delivery program I am checking for the combination of
         ship to party, Material & Batch of outbound delivery in a ztable. If the combination exists in
         Ztable I do not want to save & ignore this delivery creation and continue with the next
         delivery order creation thru the batch job.
         However I need to give an error / warning message for the delivery orders
         which are not created so I am giving the error message as success message
         in  the below format :-
          IF L_RETURN-TYPE = 'E'.
            MESSAGE S000(Z64_I) WITH L_RETURN-MESSAGE_V1
                                     L_RETURN-MESSAGE_V2
                                     L_RETURN-MESSAGE_V3
                                     L_RETURN-MESSAGE_V4
                                     DISPLAY LIKE 'E'.
            PERFORM FOLGE_GLEICHSETZEN(SAPLV00F).
            FCODE = 'ENT1'.
            SET SCREEN SYST-DYNNR.
            LEAVE SCREEN.
          ENDIF.
        But my job is finished as soon as the above message is encountered and the
        rest of the outbound deliveries are not created.
        However if I execute the progarm in foreground the execution is working fine.
        Could you please let me know what do I need to code / do corrections to make
        the program run successfully in background.
Thanks & Regards
Jitendra Gujarathi

Hello,
Check system log and also check work process trace, to know the error.
I feel that it could be Authorization issue, you don't have sufficient authorization to do.
Hope this helps.
Regards
venkata
Edited by: venkata emandi on Sep 12, 2011 8:13 AM

Similar Messages

  • Error in background job for program RSGET_SMSY error message No active job

    Hello!
    I would like to set up the Change Request Management functionality in SAP Solution Manager.
    The only red warning by executing Test-button in Tcode “SOLAR_ADMIN_PROJECT” is:
    <b>Error in background job for program RSGET_SMSY error message No active job found</b>
    Can someone please tell me how to solve this problem?
    (tcodes, technical steps)
    Thank you very much!
    regards
    Thom

    Thank you very much!
    Can you also help me with the warning "Errors occurred during synchronization of the system landscape" in tcode SOLAR_PROJECT_ADMIN" --> System landscape --> Change requests --> "Refresh"?
    The second issue I cannot see any projects in Tcode "/TMWFLOW/CMSCONF"
    according to the SPRO-step "Set Project Assignment of Requests as Mandatory"
    Thank you!
    regards

  • Background Job processing

    After writing a report, I used this Function Module “LIST_TO_ASCI” to copy my report to an internal table (DOWNTAB) because I’ll use that internal table to download a text file on the server using dataset.
    Here is my code:
    FORM DL_REP_SERVER.
       DATA: ABAP_LIST LIKE ABAPLIST OCCURS 1,
            MV_FILE2 LIKE RLGRAP-FILENAME.
      DATA: BEGIN OF DOWNTAB OCCURS 1,
              LINE(150),
            END   OF DOWNTAB.
      CLEAR: MV_FILE2.
      MV_FILE2 = ‘J:/Downloads/Report.txt’.
      CALL FUNCTION 'LIST_TO_ASCI'
           EXPORTING
                LIST_INDEX         = SY-LSIND
           TABLES
                LISTASCI           = DOWNTAB
                LISTOBJECT         = ABAP_LIST
           EXCEPTIONS
                LIST_INDEX_INVALID = 1
                OTHERS             = 2. 
      OPEN DATASET MV_FILE2 FOR OUTPUT IN TEXT MODE.
      IF SY-SUBRC <> 0.
        IF SY-SUBRC = 8.
          MESSAGE E037 WITH 'File could not be opened'.
        ELSE.
          MESSAGE E037 WITH 'Error occurs in downloading the file'.
        ENDIF.
      ENDIF.
      LOOP AT DOWNTAB.
        TRANSFER DOWNTAB TO MV_FILE2.
      ENDLOOP.
      CLOSE DATASET MV_FILE2.
    ENDFORM.                    " DL_REP_SERVER
    My big problem is this, when I’m running my program ordinarily (not as background job), I’m getting all the pages downloaded correctly but when I run it as background job (using SM36), I’m only getting the last page of my report being downloaded. Definitely, I can’t debug it because it’s in background. I can’t figure out why. Hope that I stated my problem clearly. Any help would be greatly appreciated. Thanks.

    You can debug batch jobs by going to 'SM37', type in 'JDBG' in the
    command line ( no '/' ), put the cursor on the job and press enter - will
    take you to the job in debug mode.
    You can do this only after the job has finished execution. This will simulate the exact background scenario with the same selection screen values as used in the job also sy-batch will set to 'X'.
    So type in the transaction code 'JDBG' and place your cursor on the job after It has finished. It will take you to a SAP program in debug mode. Step through this program which is about 10 lines, after this your program will be executed in the debug mode.
    Steps
    1. Create variant called BACKGROUND for program to be debugged.
    2. Execute ZDEBUGBG (pgm code below) in background for immediate processing.
    3. Execute transaction SM50.
    4. Select process that runs ZDEBUGBG.
    5. Goto 'Program/Session' 'Program' 'Debugging'.
    A se80 debug session will open.
    6. Change variable W_EXIT to 'E'.
    7. Step thru (F6) until ZWBTEST comes up.
    1. Go to Transaction SM66 and find your work porocess.
    Select the line work process is on and click on the Debugging button.
    If this is a custom program, you can put a wait statement in the code to buy yourself sometime.
    2. Go to Transaction SM50. From the tool bar "Program/session"->Program->Debugging.
    goto SM37 and from Program menu(not sure.. try other menu's)
    -->Catchjob . it will goto the active job in debugging mode.

  • Error in background job for VT04 - RV56TRGN

    Hello!
    The selection criteria is fine - we want every shipping point to be used to create every variant. We also have TPPs mirroring the plant codes. The job log sepects some deliveries which are good and tries to process them - the endlogue is it found X no. of deliveries, processed them but did not write the shipment to the data base. Digging further, it shows the error - <u>the system cound not determine the TPP for the plant in the delivery line item.</u>
    When I look at the variant, it doesn't talk of the TPP at all - only the shipping point and all the other criteria mainly associated with the deliveries and their statuses. I am wondering how the system knows which TPP to use for each shipping point when no TPP is assiged in the variant? Is this a default configuration I am missing? Or something else? Appreciate any leads...
    Thanks a lot.

    PS: In addition to creating the shipments, we also need to make their status to 'complete' in the background job as it is a purely non value added activity for us but we need the shipments for the cost documents. Any ideas how I can go about that?
    Thanks.

  • Continue background job processing.

    Hi All,
    How to handle the system error
    MESSAGE E328 WITH MATNR  RAISING CONVERSION_NOT_FOUND thrown by FM MATERIAL_UNIT_CONVERSION so that the background job continue processing.
    Thanks and Regards,
    Ashik K.

    Hi,
    I just now checked with this FM and worked with these two options:
    1. Runtime error type 'E' will stop the program if we COMMENT the EXCEPTIONS while calling FM
    * EXCEPTIONS
    *   CONVERSION_NOT_FOUND         = 1
    *   INPUT_INVALID                = 2
    *   MATERIAL_NOT_FOUND           = 3
    *   MEINH_NOT_FOUND              = 4
    *   MEINS_MISSING                = 5
    *   NO_MEINH                     = 6
    *   OUTPUT_INVALID               = 7
    *   OVERFLOW                     = 8
    *   OTHERS                       = 9
    2. Runtime error type 'E' (which stops the program) will not come in this case
    EXCEPTIONS
       CONVERSION_NOT_FOUND         = 1
       INPUT_INVALID                = 2
       MATERIAL_NOT_FOUND           = 3
       MEINH_NOT_FOUND              = 4
       MEINS_MISSING                = 5
       NO_MEINH                     = 6
       OUTPUT_INVALID               = 7
       OVERFLOW                     = 8
       OTHERS                       = 9
    Hope this helps.
    Regards,
    Amit Mittal.

  • Background Job Processing Spool Retention period

    Hi ,
    In my program i am calling another ABAP program and sumitting the same as a background job(using Job_Submit,Close etc.)
    In this case i can view the Spool generated by the called program(using sm37).
    But this spool exists for a very less period in the system.Is it possible to specify a retention period,as 90 days in my case.?
    Pls Help !!!
    Answers will be rewarded.
    Regards,
    Rohan

    hi Roahn,
    You must set print parameters before the printing process starts.
    When printing lists after creating them, the system uses the print format specified in the print parameters to split the completed list and fit it onto the print pages, truncating it if necessary.
    When printing lists while creating them, the system uses the print format to actually format the list in the program.
    Print parameters are set either interactively by the user or from within the program.
    For each print process, the spool system needs a complete and consistent set of print parameters. In ABAP, the structure PRI_PARAMS (ABAP Dictionary) represent a set of print parameters.
    When passing the print parameters interactively, the system displays a dialog box after starting the report, on which the user has to enter the most important print parameters.
    It's shown below which input field of the Print List Output dialog window conform to which PRI_PARAMS component.
    Input field----
    Retention period
    Component-------PEXPI
    Meaning----
    Number of days for which the system holds the spool request before deleting it. (Default value: 8).

  • Spool error for background job

    Hi All,
    I have scheduled one job in sap for a report.I have made a distribution list via tcode SO01.
    I have given this distribution list to the SPOOL RECEPIENT section in SM 36.
    The job is running successfully but is giving the following error and not sending emails to the distribution list.
    The error is :-
    "Spool list of step 1 could not be sent due to error 7".
    Does anybody has any idea about this error?
    Please help its a production issue.
    Thanks in advance
    Vivekanand Meghmala

    Look at SAP note : 760838
    Symptom
    Background job spool lists are not sent.
    Other terms
    RSBTCRTE, RSPO_SPOOLJOB_TO_OFFICE, SO_DOCUMENT_SEND_API1
    Reason and Prerequisites
    1. The jobs in question have recipient references in table TBTCO but these have no equivalent in the Business Object Repository.
    2. An error occurs when sending in the spool or in the Sapconnect layer.
    Solution
    This note does not provide a direct solution to the problem but it does provide a source code enhancement that you can use to create more trace information about the cause of the error. When you copy and execute a job with spool list recipients, trace messages are output when errors occur.
    After implementing the correction instructions, use transaction SE91 to create the following message:
    Message class: BT
    Number: 347
    Text: Spool list of step &1 could not be sent due to error &2.
    In detail, the error numbers mean:
    1 = Spool request does not exist (or no longer exists)
    2 = Spool request does not contain any data
    3 = Empty page area selected
    4 = No authorization to send the request
    5 = Access to the spool request is not possible
    6 = Read error in the Temse layer
    7 = Spool request could not be sent (sending problem)
    8 = Incorrect request type
    9 = Other

  • Background Jobs - Process Chains

    Hello,
    I want to schedule a background job for a process chain so that it triggers the process type and start executing...
    Can anyone please let me know how i can do it?

    HI,
    The background control options are available to directly schedule the start process. You can start the process chain immediately (when activating the process chain), at a specified time, or after a particular event. When you activate the process chain the start process is scheduled in the background, as defined in your selections.
    If there are not sufficient options available, you can trigger the start of the process chain using API. You can use the SAP NetWeaver Scheduling Framework to start the chain and to have more extensive scheduling options.
    You can also trigger the start of a process chain using a metachain. A metachain is a process chain, for which you determine this start condition, that is fixed to another process chain. The process chain is started directly by this metachain.
    Tarak

  • RSCRMBW_REPORT Background Jobs & Process Chain

    Hello Everyone,
    I have a program in a process chain that runs a query through rscrmbw_report. The program is the first step in the chain, followed by a DTP. When we have previously ran this program in our production box, we found that the we did not get all of the data from the query. We believe the fault is with the DTP running asynchronous to the background jobs of RSCRMBW_REPORT- In SM37, we believe we have found jobs from the report positioned before and after the DTP job.
    I've made some slight changes and on a small volume of data (~1000), the chain works with no issue. However, I am concerned with dealing with a large number of records (~1,000,000+). As of now, I'm not sure I believe the analysis of the background jobs because there are still jobs that appear before and after the DTP, but the data is consistant between the destination of the DTP and the query.
    Any advice on how to ensure those jobs run before my DTP? I've tried using commit work and wait, which I believe works because the DB should be open while the query jobs are running and I believe that the statement will wait for those jobs to finish before proceeding out of the code and to the DTP.
    Thanks & Regards,
    Christian

    HI,
    The background control options are available to directly schedule the start process. You can start the process chain immediately (when activating the process chain), at a specified time, or after a particular event. When you activate the process chain the start process is scheduled in the background, as defined in your selections.
    If there are not sufficient options available, you can trigger the start of the process chain using API. You can use the SAP NetWeaver Scheduling Framework to start the chain and to have more extensive scheduling options.
    You can also trigger the start of a process chain using a metachain. A metachain is a process chain, for which you determine this start condition, that is fixed to another process chain. The process chain is started directly by this metachain.
    Tarak

  • How to cancel the background job processing in ABAP programming?

    Hi,
    I have a requirement where i need to cancel the job depending on some constraint. My code is something like this:
    Select some data from the table.
    if sy-subrc = 0.
    Do nothing.
    Else
    Cancel the job
    call function 'BP_JOB_ABORT'
      exporting
       jobcount                         = number
        jobname                          = name
    EXCEPTIONS
       CHECKING_OF_JOB_HAS_FAILED       = 1
       JOB_ABORT_HAS_FAILED             = 2
       JOB_DOES_NOT_EXIST               = 3
       JOB_IS_NOT_ACTIVE                = 4
       NO_ABORT_PRIVILEGE_GIVEN         = 5
       OTHERS                           = 6
    The above code is cancelling the job but it is throwing an exception called CX_SY_DYN_CALL_PARAM_MISSING because i dint pass job count. How can we find the job count of next job that is going to run? Or How to handle the exception which it is throwing. Even if i try to handle that exception something like this:
    TRY
    call function 'BP_JOB_ABORT'
      exporting
       jobcount                         = number
        jobname                          = name
    EXCEPTIONS
       CHECKING_OF_JOB_HAS_FAILED       = 1
       JOB_ABORT_HAS_FAILED             = 2
       JOB_DOES_NOT_EXIST               = 3
       JOB_IS_NOT_ACTIVE                = 4
       NO_ABORT_PRIVILEGE_GIVEN         = 5
       OTHERS                           = 6
    RAISE EXCEPTION TYPE CX_SY_DYN_CALL_PARAM_MISSING.
    CATCH
    CX_SY_DYN_CALL_PARAM_MISSING.
    ENDTRY.
    It avoids the exception but it doesnt cancel the job.  I even tried with function modules like JOB_OPEN
    JOB_SUBMIT,BP_JOB_SELECT,BP_JOB_ABORT and tried to build some logic using status overview table (TBTCO) and TBTCP (Jobstep overview table).
    Can someone suggest me the right way to write this program ?
    Thanks in advance.
    Rashmi

    Hi,
    Problem is solved.
    Create an background job with 2 steps. The first step in the background job calls the program ZBACKJOB_STEP1.  In the variant we have a wrong material number
    If the material number is not found in Mara, the next step in the job should not get executed and the job should get cancelled..
    In the above posts i had asked how do I get the job count of the job that is currently triggering the program at the runtimeu2026..If u see the below code uu2019ll get to know.. We have to use the standard structure TBTCM which captures the properties/characteristics of the job.
    REPORT ZBACKJOB_STEP1.
    TABLES: MARA,TBTCM.
    PARAMETERS : MATNR TYPE MATNR.
    START-OF-SELECTION.
      SELECT SINGLE * FROM MARA WHERE MATNR = MATNR.
      IF SY-SUBRC IS INITIAL.
        WRITE / : 'This is the material selected on the selection-screen' , MARA-MATNR.
    ELSE.
            CALL FUNCTION 'GET_JOB_RUNTIME_INFO'
          IMPORTING
            EVENTID                                    = TBTCM-EVENTID
            EVENTPARM                             = TBTCM-EVENTPARM
            EXTERNAL_PROGRAM_ACTIVE = TBTCM-XPGACTIVE
            JOBCOUNT                                = TBTCM-JOBCOUNT
            JOBNAME                                  = TBTCM-JOBNAME
            STEPCOUNT                              = TBTCM-STEPCOUNT
          EXCEPTIONS
            NO_RUNTIME_INFO                    = 1
            OTHERS                                     = 2.
        IF SY-SUBRC = 0.
          CALL FUNCTION 'BP_JOB_ABORT'
            EXPORTING
              JOBCOUNT                                     = TBTCM-JOBCOUNT
              JOBNAME                                       = TBTCM-JOBNAME
            EXCEPTIONS
              CHECKING_OF_JOB_HAS_FAILED  = 1
              JOB_ABORT_HAS_FAILED              = 2
              JOB_DOES_NOT_EXIST                   = 3
              JOB_IS_NOT_ACTIVE                      = 4
              NO_ABORT_PRIVILEGE_GIVEN       = 5
              OTHERS                                         = 6.
          IF SY-SUBRC <> 0.
          ENDIF.
        ENDIF.
      ENDIF.
    Regards,
    Rashmi

  • Background Job Processing/Spool List Recipient

    When setting up a report to run as a background job and setting it up to e-mail the results via the Spool List Recipient button, it always sends the results in htm format. Is there a way it can be e-mailed in Excel?

    hi swapna.
    in scot it is not configured as excel how to do it.to get an attachment in excel format
    thanks in advance

  • Error in background job scheduling in Solman 7.0

    Hi Experts,
    I am working with Solman 7.0 configuration. In the IMG node for Scheduling background jobs (Solution manager-> General Settings), while following the documentation to schedule the jobs, I am facing issues with the following jobs:
    1. *SEND_SYSTEM_RELATIONSHIP_TO_SUPPORT *
    This job got cancelled on immediate scheduling, however has been scheduled for next day. What could be the reason by which it got cancelled?
    2. AI_SDK_FILL_FILE_TYPE_TABLE
    I cant find a job of this name in the system (while all other jobs are already available in the system by default). But, there is a program with the same name. Should I schedule the same in SM36?
    Regards,
    Arun.

    Hi,
    Yes schedule a job with program AI_SDK_FILL_FILE_TYPE_TABLE. Hope this solves your problem.
    Feel free to revert back.
    --Ragu

  • Error in background job of downloading data to  PC

    Hi Gurus,
       I hv created a report for downloading data to PC using
    GUI_DOWNLOAD FM when scheduling  job in background
    job is getting canceled...................
    give me some solution....

    thnaks friend.i hv used DATASET as u said...............
    But I M getting dump
    FILE IS NOT OPEN
    this is my code
    TYPES:BEGIN OF T_MARD,
            MATNR LIKE MARD-MATNR,
            WERKS LIKE MARD-WERKS,
            LGORT LIKE MARD-LGORT,
            LABST LIKE MARD-LABST,
            MAKTX LIKE MAKT-MAKTX,
         END OF T_MARD.
    ***********WORK AREAS**********
    DATA: WA_MARD TYPE T_MARD,
          WA_MARD1 TYPE T_MARD.
    DATA:BEGIN OF IT_MARD1 OCCURS 0,
            MATNR(18),
            WERKS(4),
            LGORT(4),
            LABST(13),
            MAKTX(40),
         END OF IT_MARD1.
    TYPES : BEGIN OF TY_BAT,
              LINE(100) TYPE C,
            END OF TY_BAT.
    *********INTERNAL TABLES*******
    DATA:IT_MARD TYPE STANDARD TABLE OF T_MARD INITIAL SIZE 0 WITH HEADER LINE .
    types: BEGIN OF ITAB1,
                FIELD(100),
          END   OF ITAB1.
    DATA : IT_BAT TYPE TABLE OF TY_BAT,
           WA_BAT TYPE TY_BAT,
           wa_itab1 type itab1.
    data : it_tab type table of ALSMEX_TABLINE with header line.
    *DATA: FILENAME1 TYPE STRING valu.
    *DATA: FILENAME1(500).
    DATA: FILENAME1 TYPE RLGRAP-FILENAME .
    LOOP AT IT_MARD1.
          CONCATENATE IT_MARD1-MATNR IT_MARD1-LABST IT_MARD1-MAKTX
                      INTO wa_ITAB1    SEPARATED BY ' '.
          APPEND wa_itab1 to IT_tab.
          CLEAR wa_ITAB1.
        CLEAR WA_MARD.
      ENDLOOP.
      CONCATENATE 'D:\STOCKINH\'  SY-DATUM '.TXT' INTO FILENAME1.
    open dataset filename1 for output in binary mode." ENCODING DEFAULT.
    IF sy-subrc = 0.
    EXIT.
    ENDIF.
    LOOP AT it_tab into wa_itab1.
    TRANSFER wa_itab1 TO filename1.
    CLEAR wa_itab1.
    ENDLOOP.
    close dataset filename1.
      MESSAGE S001(38) WITH 'Files Generated'.
      WA_BAT = 'ftp -s:d:\ftp\ftp_upload.txt'.
      APPEND WA_BAT TO IT_BAT.
      CLEAR FILENAME1.
       FILENAME1 = 'D:\STOCKINH\ftp_upload.BAT'.
    open dataset filename1 for output in binary mode." ENCODING DEFAULT.
    IF sy-subrc = 0.
    EXIT.
    ENDIF.
    LOOP AT it_bat INTO wa_bat.
    TRANSFER wa_bat TO filename1.
    CLEAR wa_bat.
    ENDLOOP.
    close dataset filename1.
      CLEAR:  IT_BAT.
      REFRESH IT_BAT.
      WA_BAT-LINE = 'open 10.100.103.199'.
      APPEND WA_BAT TO IT_BAT.
      CLEAR WA_BAT.
      WA_BAT-LINE = 'epossync'.
      APPEND WA_BAT TO IT_BAT.
      CLEAR WA_BAT.
      WA_BAT-LINE = 'sync@1234'.
      APPEND WA_BAT TO IT_BAT.
      CLEAR WA_BAT.
      WA_BAT-LINE = 'lcd D:\STOCKINH\20080201.TXT'.
      APPEND WA_BAT TO IT_BAT.
      CLEAR WA_BAT.
      WA_BAT-LINE = 'cd /home/epossync/AMIT'.
      APPEND WA_BAT TO IT_BAT.
      CLEAR WA_BAT.
      WA_BAT-LINE = 'binary'.
      APPEND WA_BAT TO IT_BAT.
      CLEAR WA_BAT.
      WA_BAT-LINE = 'hash'.
      APPEND WA_BAT TO IT_BAT.
      CLEAR WA_BAT.
      WA_BAT-LINE = 'put D:\STOCKINH\20080201.txt'.
      APPEND WA_BAT TO IT_BAT.
      CLEAR WA_BAT.
      WA_BAT-LINE = ' '.
      APPEND WA_BAT TO IT_BAT.
      CLEAR WA_BAT.
      WA_BAT-LINE = 'bye'.
      APPEND WA_BAT TO IT_BAT.
      CLEAR WA_BAT.
    CLEAR FILENAME1.
    FILENAME1 = 'D:\STOCKINH\ftp_upload.txt'.
    open dataset filename1 for output in binary mode." ENCODING DEFAULT.
    IF sy-subrc  = 0.
    EXIT.
    ENDIF.
    LOOP AT it_bat INTO wa_bat.
    TRANSFER wa_bat TO filename1.
    CLEAR wa_bat.
    ENDLOOP.
    close dataset filename1.

  • JOB_CLOSE and Background Job Process a FM

    HI Guys,
    I have my code like this:
    data: jobname like tbtcjob-jobname value
                                 'TESTJOB'.
    data: jobcount like tbtcjob-jobcount,
          host like msxxlist-host.
    data: begin of starttime.
            include structure tbtcstrt.
    data: end of starttime.
    data: starttimeimmediate like btch0000-char1.
    Job open
      call function 'JOB_OPEN'
           exporting
                delanfrep        = ' '
                jobgroup         = ' '
                jobname          = jobname
                sdlstrtdt        = sy-datum
                sdlstrttm        = sy-uzeit
           importing
                jobcount         = jobcount
           exceptions
                cant_create_job  = 01
                invalid_job_data = 02
                jobname_missing  = 03.
      if sy-subrc ne 0.
                                           "error processing
      endif.
    data: lv_weekday type WEEK_DAY.
    CALL FUNCTION 'DATE_TO_DAY'
      EXPORTING
        DATE          = sy-datum
    IMPORTING
       WEEKDAY       = lv_weekday.
    Close job
      starttime-sdlstrtdt = sy-datum.
      starttime-sdlstrttm = SY-UZEIT.
      call function 'JOB_CLOSE'
           exporting
                event_id             = starttime-eventid
                event_param          = starttime-eventparm
                event_periodic       = starttime-periodic
                jobcount             = jobcount
                jobname              = jobname
                laststrtdt           = starttime-laststrtdt
                laststrttm           = starttime-laststrttm
                prddays              = 1
                prdhours             = 0
                prdmins              = 0
                prdmonths            = 0
                prdweeks             = 0
                sdlstrtdt            = starttime-sdlstrtdt
                sdlstrttm            = starttime-sdlstrttm
                strtimmed = 'X'                  "starttimeimmediate
               targetsystem         = host
           exceptions
                cant_start_immediate = 01
                invalid_startdate    = 02
                jobname_missing      = 03
                job_close_failed     = 04
                job_nosteps          = 05
                job_notex            = 06
                lock_failed          = 07
                others               = 99.
      if sy-subrc eq 0.
                                           "error processing
      endif.
    This is the Program I want the Batch Job to Execute a BAPI Function Module in the Place of DATE_TO_DAY function module. Is it Possible ??????
    And also I get an error at the JOB_CLOSE Function Module with SY-SUBRC = 5.
    Can anyone know why this is happening and what should be done to overcome this.
    Thanks & Regards,
    YJR.

    Hi Ravi,
    The below code which has an EXPORT and IMPORT commands
    The IMPORT does'nt work in Background.
    Do I need to do anything else.
    REPORT  ZTEST_LM22.
    DATA: LV_NAME(10) TYPE C.
    LV_NAME = 'HELLO'.
    export lv_name to memory id 'ZNAM'.
    submit ztest_lm22_a.
    REPORT  ZTEST_LM22_A.
    DATA: GV_JOBNAME  TYPE BTCJOB VALUE 'TEST_UNPACK',
          GV_JOBCOUNT TYPE BTCJOBCNT.
    data: lv_date type SYDATUM,
          lv_time type SYUZEIT.
    lv_date = SY-datum.
    lv_time = sy-uzeit.
    CALL FUNCTION 'JOB_OPEN'
      EXPORTING
        JOBNAME          = GV_JOBNAME
        SDLSTRTDT        = lv_date
        SDLSTRTTM        = lv_time
      IMPORTING
        JOBCOUNT         = GV_JOBCOUNT
      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.
    SUBMIT ztest_lm22_b AND RETURN
                                   VIA JOB GV_JOBNAME
                                   NUMBER GV_JOBCOUNT.
    CALL FUNCTION 'JOB_CLOSE'
      EXPORTING
        JOBCOUNT             = GV_JOBCOUNT
        JOBNAME              = GV_JOBNAME
        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
        INVALID_TARGET       = 8
        OTHERS               = 9.
    IF SY-SUBRC <> 0.
      MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    REPORT  ZTEST_LM22_B.
    DATA: LV_NAME(10) TYPE C,
          GV_NAME(10) TYPE C.
    IMPORT LV_NAME = GV_NAME FROM MEMORY ID 'ZNAM'.
    WRITE: GV_NAME.
    If you see in SM37 the Spool does'nt have this value.
    Could you just run a quick test and see what else should be done...
    Thanks & Regards,
    YJR.

  • COM routine error in Background job.

    Hello All,
    During background process of a job, we found a "Error for COM routine using application program (return code 40.301)" for a CVC. It caused a backgroung job to fail.
    Could you please throw light, why this error comes only for this CVC ( as had the same instance before for the same CVC ) & how to fix it ?
    Reagrds
    Rahul Chitte

    HI Rahul,
    COM routine errors are generally related to LC errors. There are a number of possible causes for it, the CVC was created when a macro was running or it was deleted from MPOS but not from LC etc etc.,
    Solution to this is go /n/sapapo/msdp_admin --> Go to your planning area --> Double Click --> Look for Extras in Menu --> Go to Consistency check and do a time series consistency check.
    Remember to click Check for Live Cache Anchor and leave 'Repair' unselected.
    This will return what is the error. Once you see the error, you can go back and select the 'Repair' Also and then execute again. This should resolve the problem.
    Hope this is helpful.
    Thanks
    Mani Suresh

Maybe you are looking for

  • How to call "long text" of master inspection characteristic in ALV

    Dear All, we have created customized QM report in ALV which shows Result, Valuation and Short text for each MIC against each inspection lot. Can we call long text also in the ALV. Please guide how to call it in ALV?

  • Lost Home Screen Icons

    Afew moments after switching on my phone for first use, I think I strayed to the advanced options section and clicked something there which made the phone reboot and now I can't see any icons in the homescreen. The menu Key does not respond

  • Where to find diagnostics-console-extension.jar(WLDF) file

    Hi All, I am doing Load balancing / fail over testing using DB RAC11g and weblogic 9.2MP3, so I would like to know how many requests are going to each node in the RAC data base. For this I would like configure the diagnostics-console-extension.jar to

  • How To hide the ESS Worksets in Portal?

    Dear Friends I have the following doubt. In the role of Employee Self-Service We have the following Work sets: Employee Search | Personal Information | | Benefits and Payment | | Travel and Expenses | Career and Job Purchasing |      Work Environment

  • Launch an attachment from SWF embedded in PDF

    Goal: To launch a PDF attachment from the embedded SWF (in PDF). Scenario: I have created a PDF with a SWF embedded in it and I have few attachments also in the same PDF. Now based on some user input I want to open one of the attachment in the PDF. Q