Execution of Macro in Background job

We have created a macro in APO DP that uses 4 characteristics and a key figure. As part of the macro we are executing a Z-function that we have created. The problem occurs when executing the macro in a background job. When the background job is executed the macro processes correctly (performs the correct calculations) for the first CVC that is processes, but it is not able to process the rest of the CVCs.
<b>ERROR: "There are no plannable characteristic combinations",</b>
The function copies data from the CVC that is being processed (source CVC) to another CVC (target CVC). The values for the target CVC to which the data has to be copied for a particular key figure are determined from the paramaters that are given to the function in the macro.
The steps followed in the function are the following:
1- Determine the relation between source and target CVC, ie, from the source CVC that is being processes in the macro, the function determines the target CVC to which the data has to be copied.
2- Call BAPI "BAPI_PBSRVAPS_GETDETAIL2" to retrieve the valuesthat are in the Planning Book for the source CVC.
3- Perform the addition of data (value retrieved from the source CVC is added to the target CVC).
4- Write value to the target CVC using BAPI "BAPI_PBSRVAPS_CHANGEKEYFIGVAL2".
When using the BAPIs the aggregation level used is the same aggregation as the one specified in the Background job used for the execution of the macro.
This macro is executed in a background job, and the copy/calculation is performed correctly for the first CVC (first CVC contained in the data selection used in the background job) processed, but then it does not do anything else for the rest of CVC's. The error message given by the log of the background job is <b>"There are no plannable characteristic combinations",</b> when in fact, the characteristic combinations do exist in the Planning Object Structure.

Hi Ian
There are not any other macros in the planning book.
In addition, if we execute the macro in interactive mode we have another error at the end of the execution (after doing all the combinations):
<b>Invalid data status</b>.
and we don't know why.
Regards

Similar Messages

  • Long time for execution for scheduled CIF background jobs

    Hi,
    we hv schedlued CIF background job to be run daily around 10.30 PST.
    there is large variation for the time required for execution of this job.
    on 26 Dec, it took approx 48000 seconds while regular average is 120 seconds only.
    today, despite past of 6000 seconds, the job is still in ACTIVE stage.
    can anyone know why such long delay for such jobs?
    how can i reduce its execution time (as one of case in a week)?
    rgds/Jay

    Hi Jay,
    A few obvious things to look for:
    1.  Multiple CIF activation jobs running at the same time
    2.  Large change in the master data, eg new plant, new Material Masters, new customers, etc etc.
    3.  Conflicts with other non CIF programs that may be going after the same data
    4.  Communication degradation between the OLTP and SCM clients
    Normally you refer such questions to someone on your Basis team, or perhaps your DBA.  They can turn on tracing tools that can track the changes in your environment that may be contributing to the changes in run time.
    Regards,
    DB49

  • Scheduling function module execution in background jobs

    Hi,
    I have requirement where in after obtaining all the required inputs from the user we will call an function module to execute it.
    The requirement is that the execution of fm shld happen in background and a log must be created showing the user whther it was successful or if it failed with the list of errors.
    Can you kindly give some input on how to schedule the execution of function module in background job and if scheduled how to create the logs to display the success or error message.
    Warm Regards,
    Naveen M

    Hi,
    Just create a simple program where you have to call this FM.
    Pass the values to FM either by declaring some internal table of selection screen and execute the program in background.
    For Message Log, you can use structurre BDCMSGCOLL
    DATA:   MESSTAB LIKE BDCMSGCOLL OCCURS 0 WITH HEADER LINE.
    After Call to FM, read from this internal table as follows
    READ TABLE MESSTAB WITH KEY MSGTYP = <Message Type>
                                            MSGNR  = <Message Number>.
    regds,
    Anil

  • Background Job execution enabled via pro-active monitoring

    Hi community,
    We're interested in CPS Redwood to help us in proactive monitoring of background jobs (Ad Hoc and Periodic) and impacts in system performance.
    The idea would be to have somehow a tool that monitor the number of available working process and system performance. When the system workload reaches a certain level, ex: 95%, this tool would intercept new jobs execution. After this, when the system workload goes down and the resources are free, the system would release all jobs to normal run again.
    Is it possible via CPS Redwood?
    Is there any other way to have something automatic like this?
    Thanks,
    Jose Antonio.

    Hi Jose,
    This is possible indeed using CPS. CPS can monitor various load metrics of your system, then adapt the scheduling logic if thresholds are exceeded.
    In your scenario, you would basically always intercept all jobs, but normally not enforce any limits so effectively that means all jobs still run immediately. If the load is too high, CPS would enforce a limit, so then jobs will be delayed until the load is lower again.
    Regards,
    Anton.

  • Restrict background jobs to immediate execution

    Hello,
    we have got a central jobmanagment and want to restrict background jobs to immediate execution.
    Of course users should be able to send processes in the background, especially when creating a list needs a lot of performance. But users should not be able to plan these jobs to a time in future or perodically.
    So, in authorization object S_BTCH_JOB I didn't find a solution - just JOB_ACTION can be restricted to "RELE", so that a user needs a release from another user. This is not what we want.
    Is there a possibility to restrict the execution in background to the Option "immediate". The options "Date/Time", "After job", "After event", "at operation mode" should not be possible.
    Regards,
    Julia

    Hello Julius,
    with searchterm "BTCOPTIONS" I can't find suitable notes or anything else, even with a search machine.
    But I found thread Restrict periodic scheduling in SM37 which describes exactly this problem.
    So I will ask in that thread again, because there haven't been any news since may.
    Regards,
    Julia

  • Reg Background job execution

    Hi gurus,
    I have a doubt in back ground job processing...We have a job which runs for very long time (archiving job). I want that job to run from Sunday morning to evening 6PM again I need to run the same job next sunday morning to evening continuing from previous week stop point.
    My question , there is a option in SM37 to STOP the job. If I stop the job and then resume back the same job, will it continue from the point where it stopped?
    Is there any way to execute the background job like above scenario. I know it can be done by 3rd party tool, but I want to do the same from R/3
    Vinodh

    Hi Vinodh,
    In later versions of SAP (from Enterprise version if iam not wrong), you can interrupt the archive job and continue later. This is not the feature of background processing, but the archiving job itself.
    Interruption is possible on basis of duration of the job and size of archive file. See the following link which details the mentioned feature; go to The Archive Development Kit and see the topic Interrupting and Continuing Archive Sessions:
    http://help.sap.com/saphelp_47x200/helpdata/en/6d/56a06a463411d189000000e8323d3a/frameset.htm
    Hope this helps to work towards the solution of your problem.
    Regards,
    Naveen

  • Background job running slow

    Hi,
    Suppose any background job is taking much more time than required so how to speed up the job without chaning the master data.
    Regards,
    Prabhat Sahay

    Hello,
    If your job is a DP job, please refer to SAP note 864950 and follow the suggestions in the note.
    Basically. there're following points:
    1)If the job is relevant to planning book/data view, make sure only needful key figures are loaded in the data view.
    2)Macros should only be executed on detailed level, except when aggregate level execution is also necessary.
    3)Try not to use navigational attributes.
    4)Make sure the consisteny of the planning area by:
       /sapapo/ts_lcm_reorg
       /sapapo/ts_lcm_cons_check
    5)If you use fixed aggregates, they may affect the performance very much.
       Try to deactivate them and run /sapapo/ts_lcm_cons_check before the job (if the job changes relevant data).
       Then activate and fill the fixed aggregates afterwards.
    Best Regards,
    Ada

  • Splitting a background job over different application servers

    I am running my program in the background and its taking long to complete. I have done some optimizations and it has greatly improved but still not running as fast as I want because its processing large amounts of data and the amount of time that I want all the data to be processed is little compared to the runtime of the program so now I want to split the background job over different application servers. Can someone tell me how do I go about doing that and example ABAP code will be greatly appreciated.
    Many thanks

    Hello, If you are interested in BANK_PP_JOBCTRL, here are some of the inputs. Its work very efficeintly, though you will have to investigate a little bit froom your end.
    With in package bank_pp_jobctrl , you will find these FM. I have mentioned the use of it as well.
    RBANK_PP_DEMO_GENERATE_DATA: To create the Business data for Parallel Processing.
    RBANK_PP_DEMO_CREATE_PACKMAN: To create Packages out of the business data.
    RBANK_PP_DEMO_START : To process data in parallel.
    RBANK_PP_DEMO_RESTART: To re-process failed records during parallel Processing.
    You will need to call above in your report program in the same sequence as shown above based on you requirement. I did used only first three.
    TO generate events you will need to execute SE38: RBANK_PP_GENERATE_APPL to create application this will create the FM with numbers as shown below.
    Events: This PPF automatically triggers various events during the execution of theStart Program. Each of this event is associated with a custom function module which contains the business logic.
    For implementing this framework, at least the below mentioned methods should be implemented .
    0205 – Create Package Templates  : This method is used to write the logic for creating packages which in turn decides the data to be processed in parallel. This function module is called in loop at the loop ends only when the exporting parameter E_FLG_NO_PACKAGE has a value ‘X’ passed back to the Parallel processing framework.
    1000 – Initialize Package :This method is the first step in processing a package. It fetches all the parameters required for the parallel processing to start. All the parameters are passed to this FM as importing parameters and it is the responsibility of this FM to save it in global parameters so that it can be utilized by Parallel processing framework.
    1100 – Selection per Range : This method is used to read data for a package. The objects selected must be buffered in global data areas of the application for later processing. The package information is stored as interval in global parameters and this information is used to select the package specific data.
    1200 – Selection for Known Object List: This method is used instead of method 1100 if it is a restart run. The objects to be processed are known already.
    1300 – Edit Objects: The processing logic to be implemented using parallel processing for the selected objects is written in this method. This function module is used to implement the business logic and
    Also, obiviously you would like to log your messages , so the framwrok provides macros to do it.
    Let me know if you need some further help as I know there is very little information provided on this.
    Regards/Ajay

  • Problems with background job

    Hi,
    I have problems when creating a job that is supposed to be run once in background. I use the common steps as described below. My problem is that the report is executed twice.
    - First it is executed synchronously when the job is created
    - Then it is executed in the normal job step as I want it to do
    I don't want it to be executed the first time because it creates data!!!
    Code:
    CALL FUNCTION 'JOB_OPEN'
         EXPORTING
              jobname  = w_jobid
         IMPORTING
              jobcount = w_jobnr
              sdlstrtdt = sy-datum
              sdlstrttm = sy-uzeit.
    SUBMIT (p_prog)
    WITH p_idocnr = p_idocno
               USER            p_user
               VIA   JOB       w_jobid
                     NUMBER  w_jobnr
                     AND       RETURN.
    CALL FUNCTION 'JOB_CLOSE'
         EXPORTING
              jobcount         = w_jobnr
              jobname          = w_jobid
              strtimmed        = 'X'
         IMPORTING
              job_was_released = w_jobrel.
    Does anyone have a clue of what I should do to prevent this?
    //  Regards  Hans

    Hi again,
    1. U are right.
    2. It will happen if we use SUBMIT.
    3. As per the help documentation,
        it will run the program in separate session,
       ( as soon as submit statement comes)
    4. and run the INITIALIZATION event.
    The VIA JOB addition also loads the program accessed in a separate internal mode when the SUBMIT statement is executed and the system performs all the steps specified before START-OF-SELECTION. This means the events LOAD-OF-PROGRAM and INITIALIZATION are triggered and selection screen processing is performed. If the selection screen is not processed in the background when VIA SELECTION-SCREEN is specified, the user of the calling program can eidit it and schedule the program accessed in the background request using the function Place in Job. If the user cancels selection screen processing, the program is not scheduled in the background job. In both cases, execution of the program executed is completed after selection screen processing and the system returns to the calling program due to the AND RETURN statement.
    regards,
    amit m.

  • 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.

  • Background job in APO does not start because of invalid user name

    Hello,
    I have a macro in a planning book and the /sapapo/cons_check program which a triggered via a background job. Now, I have problems with the start of the job:
    At the time the job was created inside SAP, an error occured. The job contains invalid values.
    The user name within the job does not exist any more.
    Now, I try to change the user name of the job (via step in sm37), but the error occured again.
    I have the possibility to create the invalid user name once again in su01.
    But I want to change the user name of the job - does somebody know how to do it?
    Thanks for your help!
    Kind regards
    Heinz

    Hello Heinz, this looks surprising.
    It's quite easy to change the user name in the SM37 job step, and we haven't faced issues with this.
    Could you check how many jobs are in either "scheduled" or in "released" status, and change steps for all of them? May be you changed the scheduled job, but the released job wasn't changed.
    Use your job name and give a search date as 1-2 years in the past, and around 1 month in the future. With this time horizon, you should most likely be able to capture all the relevant jobs having the same name that you are using.
    Now change the user name in step for all the jobs received above to be fully sure.
    One more trial could be to copy the current scheduled job to another job, modify the user name in this newly created job and then delete the old one.
    One of the above trials might possibly help you in some way, else its very tough to understand/explain your situation.
    Thanks - Pawan

  • Background Job RSPPFPROCESS Taking too long to execute.

    Hi Gurus,
    I'm working with SAP CRM 2007 - Interaction Centre
    We have configured first response date and to do by date in item category.
    If agent fails to response within the first response date or if agent fails to complete
    to close the ticket within the to do by date,An action is configured to trigger and an
    escalation email(Smart Form) is sent to agent`s manager inbox.
    We have scheduled background job for the program RSPPFPROCESS with variant in background
    to trigger this actions( It is scheduled 4 times in a day ).
    Previously this job used to take 6 hours to complete execution.
    But now its taking 12 hours to complete the execution and there is no change in the
    variant.
    Can anyone please advice me reason for this behavior.
    Kind Regards,
    Vinod

    Hi Manfred,
    We are experiencing similar performance issue when running the RSPPFPROCESS  Job. We opened a OSS message for quite some time but didn't get any useful help from SAP.
    Can you please provide more information regarding your ZRSPPFPROCESS program on identifying the crtical performance steps to resolve the performance issue? We are also thinking of archiving  the record in table PPFTTRIGG , we have over 73+ millions records in the table but there is no archiving object for PPF actions. We would like to focus on reducing the number of entries in the table PPFTTRIGG hopefully to improve the performance. Any thoughts on it?
    Thanks in advance for your kind help!
    Best Regards,
    Madeline

  • Background job executed as SAP*, need advice to change owner.

    Hi all,
    I'm facing an issue where my SAP background job currently has 2 job "SAP_CCMS_CPH_REORG" and "SAP_CCMS_CPH_HRCOLL" under the ownership of sap. I would like to move them away from SAP ID.
    I have tried to recreate the job using sm36 (and using my ID with sap_all profile) in testing environment, but it not seem to work.
    Highly appreciates any advices and/or pointers with regards to the above mention question.
    Thank you.

    Hi all,
    Thank you for the reply but I have forgotten to add a few updates.
    The issue is that I can change owner from SAP* to my ID with sap_all profile.
    But, after execution,
    Job with sap* owner ended successfully, with spool status marked as completed.
    whereas
    Job with my ID as owner ended successfully, but spool status marked as "waiting"
    error mesage:
    Description          Value
    Status:              Frontend unavailable
    Last event:
    Message:             Request on hold
    Date:                19.02.2009
    Time:                11:57:28
    Job status:          On hold
    Error class:         Delayed
    Area:                Data transfer
    Printout:            Not printed
    Apologies for the inconveniences caused.

  • How to Prevent the Executing a Program but Allow to Run as Background Job?

    Hi All,
    I have an ABAB List Program. I need to restrict this program from executing. This has to always run as a Background Job. How do I check this condition in the program?
    Thanks,
    Kishan

    Check for the system variable SY-BATCH. If this field is 'X', then allow the execution of the program. If not then exit. Do this coding in the initialization event or start of selection.
    INITIALIZATION.
    IF sy-batch IS INITIAL.
      STOP.
    ENDIF.
    Manoj

  • Error when running SWN_SELSEN as background job.

    Hello Gurus,
    I am facing a typical problem these days.
    The background job for program SWN_SELSEN is scheduled in every 5 mins. It has started to fail intermittently with the error message 'An instance of the report SWN_SELSEN is still active'. But the stange thing is that the program completes its execution in approx. 12 - 15 secs  then why this kind of error it is throwing.
    This error message should not come as the program completes itself in 12- 15 secs and it has more than 4 mins as free time.
    Please help as this kind of failure is happenning quite frequently i.e. once in nearly every three times it executes. In a day around 100 times.
    Please help.
    Thanks in advance.
    Neha

    Hello,
    I assume you've checked in SM37 to see how often it actually runs and whether perhaps two instances have been scheduled?
    Also check the log in SLG1 to see if there is any clue there.
    regards
    Rick Bakker
    Hanabi Technology

Maybe you are looking for

  • Skype number problem I need help

    I am trying to have people calling me on my Skype number but it is not working Skype people dont have a phone number or tecnical support .. some one can help me ?

  • Smart form for cutting list---Urgent

    Hi Experts, I have to create a smart form for cutting list in PP module. Selection criteria are: 1.) select all orders(AFKO-AUFNR) wiht AFVU-USR00 = 'CUT' where AFVU-AUFPL = AFKO-AUFPL 2.) Group according to material no.(AFKO-PLNBEZ) Form fields are

  • I propose a programming method for a better native GUI.

    Basically the change is that in almost all cases the compiler/gui is in complete control over the layout of a window. This means that instead of an application declaring where every window element would be, it would have a file that would declare eve

  • Semi-transparent blob appears behind text

    note behind the 'Q' and the 'B' there is a strange blob appearing? I've used this same exact text effect in dozens of clips with no weirdness and now this. Any ideas as to the cause and solution? this affectdoesn't appear in motion - only when it is

  • Service contract data conversion

    Hi, Where can I get documentation for service contraction data conversion process.I mean interface tables or api's etc. Thanks ram