WF which user started Backgroud task

I'd like to know if there's a way of determinig which user initiated my WF BACKGROUND TASK.

Hi Josie,
Depends where the background task in the workflow is.
If the background task  is the very first step in the workflow, you could say it is the workflow initiator (the user triggering the event).
If the background task follows a dialog/decision step, then it would be the agent who completed the step. You can bind the WiActual_Agent element from the task container to a WF container element.
If the background task follows a synchronous dialog step and if the "Advance with dialog" checkbox is selected on the Control tab of the corresponding workflow step, the background task is actually executed with dialog user's id and not WF-BATCH.
Cheers,
Ramki Maley.
Please reward points if the answer is helpful.
For info on awarding points click on this link: https://www.sdn.sap.com/sdn/index.sdn?page=crp_help.htm

Similar Messages

  • Change user of Backgroud Task.

    Hi experts...
    I'm using the event "CREATED" of object "BUS1006" for send an alert e-mail...
    The sender of this email is the user that execute the task, in this case WF-BATCH....
    My issue is, that this user shouldn't be WF-BATCH, then the task should be done by the  logged user.....
    Anyone can help me??
    Best regards
    Marco

    Hi....
    i've tried but it doesn't work...
    i call this function for trigger alert..
            CALL FUNCTION 'SALERT_CREATE'
              EXPORTING
                ip_cat                 = l_category
              TABLES
                it_container           = alert_container[]
              EXCEPTIONS
                alert_category_unknown = 1
                alert_no_recipients    = 2
                alert_error_unknown    = 3
                OTHERS                 = 4.
    The sendere is the e-mail of sy-uname.....in this case WF-BATCH...i whant the sy-uname be the user logged.
    best regards
    Marco

  • Starting new task in FM

    Hi,
    I have FM 'update_table' with asynchrounous call(FM which use starting new task). This FM updates the table and commits the work.But when I try to read the datas from table I don't get the updated datas.This happens only in in real scenario.
    When I try to debug the program it works fine and I get the updated data.
    Let me know how to resolve the issue?
    thanks
    Suganya

    Hi,
    As you want to update table in the function module, are you calling this fm in UPDATE TASK?
    Here are more details about the command.
    CALL FUNCTION func IN UPDATE TASK.
    Extras:
    ... EXPORTING  p1 = f1     ... pn = fn
    ... TABLES     p1 = itab1  ... pn = itabn
    Effect
    Flags the function module func for execution in the update task. It is not executed at once, but the data passed with EXPORTING or TABLES is placed in a database table and a subsequent COMMIT WORK then causes the function module to be executed by the update task. Update function modules must be flagged as such in the Function Builder
    The return value is not set.
    Addition 1
    ... EXPORTING p1 = f1 ... pn = fn
    Effect
    Values of fields and field strings specified under EXPORTING are passed from the calling program to the function module. In the function module, the formal parameters are defined as import parameters. In the interface definition, default values must be assigned to all import parameters of the update function module.
    Addition 2
    ... TABLES p1 = itab1 ... pn = itabn
    Effect
    TABLES passes references to internal tables. All table parameters of the function module must have values.
    Note
    With update function modules, both import parameters and exceptions are ignored when the call is made.
       1. During updating processes of function modules, you may not make any calls using the language statements SUBMIT, CALL DIALOG, CALL SCREEN, CALL TRANSACTION, COMMIT WORK or ROLLBACK WORK . All other language elements that trigger a database Commit (for example, a screen change using the MESSAGE statement) also lead to a runtime error during updating.
    ashish

  • How to find out which user has the permission to execute startsap ?

    Hi All
    How do I find out which user has the permission to execute the startsap and stopsap? Do I control the permission on those script using windows standard authorization? For example: only allow certain user have the read and write permission?
    Thank you.!
    Vincent Lo

    Well to me this is really weird question..
    <b>noone un-authorized should have access to OS on your system</b>
    If this is valid you do not need to solve problems who can and who cannot start/stop SAP, because if you want to prevent some users from shutting down the SAP you have really hard job to do - there are many ways how to kill the SAP (for example killing relevant process from task manager, killing of database, messing with services etc.) - yes, this is harmful way of stopping SAP, but we are talking about attack, right? I would contact some Windows specialist to help you disable all the ways how to harm the running SAP. But still after that - there are many files that can be modified/deleted so SAP will crash after restart - you need to protect them too, etc.
    In case you take the first assumption as granted (and you really limit access to this server) you do not need to worry who can stop or start SAP - at the other hand it may be handy to be able to start/stop SAP from other users - for this you can run the stop/start script "under different user".
    But to answer the question - to me this is question just of access control (but really never tried that myself):
    <a href="http://technet2.microsoft.com/WindowsServer/en/library/c6413717-511e-42bd-bd81-82431afe4b2a1033.mspx">Permit or restrict access to a snap-in for a domain</a> (or see other related links down there on this page)
    Please award points for useful answers.
    Thanks

  • Call Function STARTING NEW TASK ----- Resource not available

    Hi All,
    I am calling a Function Module in new task using STARTING NEW TASK.
    If the resources are not available for the Dialog Process to start, for how long will SAP keep on trying to acquire the resources and in case if it fails to acquire resource, then what will happen
    Regards,
    Abhishek

    Hi,
    From memory (as it is a long time since I've done this) you can call another function module or SAP command that will tell you how many work processes are currently available before you actually then start the new task.  This can help you to avoid this issue and also stop you from eating up all available work processes on a system which will annoy all other users!
    I think this is the FM
    CALL FUNCTION 'SPBT_INITIALIZE'
      EXPORTING
        group_name     = 'parallel_generators'
      IMPORTING
        free_pbt_wps   = w_free_processes
      EXCEPTIONS
        OTHERS         = 1.
    Gareth.

  • STARTING NEW TASK

    can ny 1 give me a simple example as to WHY call function STARTING NEW TASK is used ???
    i need a very very simple example to demonstrate the concept

    hi there...
    Syntax
    CALL FUNCTION func STARTING NEW TASK task
                  DESTINATION {dest
                  parameter list
                  {PERFORMING subr}.
    Additions:
    1. ...DESTINATION IN GROUP { group |DEFAULT}
    2. ...{PERFORMING subr}|{CALLING meth} ON END OF TASK
    Effect
    Asynchronous call of a remote-capable function module specified in func using the RFC interface. You can use the addition DESTINATION to specify a single destination in dest, or to specify a group of application servers by using IN GROUP. The latter supports parallel processing of multiple function modules. The calling program is continued using the statement CALL FUNCTION, as soon as the remotely called function has been started in the target system, without having to wait for its processing to be finished. You can use PERFORMING and CALLINGto specify callback routines for copying results when the remotely called function is finished. Character-type data objects are expected for func and dest.
    If the destination has not been specified, the destination NONE is used implicitly. When the destination NONE is used, a new main session is opened for the current user session. The asynchronous RFC does not support communication with external systems or programs written in other programming languages.
    A character-type data object must be specified for task, one which contains for the remotely called function module a freely definable task ID that has a maximum eight digits. This task ID must be unique for each call, and is handed to the callback routines for identifying the function. Each task ID defines a separate RFC connection with its own context, meaning that, in the case of repeated function module calls of the same task ID, the global data of the relevant function group can be accessed, if the connection still exists.
    In dialog processing, note that the maximum number of six main sessions cannot be exceeded, else an error message is displayed.
    Addition 1
    ... DESTINATION IN GROUP {group|DEFAULT}
    Effect
    Specifying IN GROUP as a destination allows you to execute multiple function modules in parallel on a predefined group of application servers in the current SAP system.
    For group, you must specify a data object of the type RZLLI_APCL from the ABAP Dictionary, one that is either initial, or one that includes the name of an RFC server group created in transaction RZ12. When specifying DEFAULT, or if group is initial, all application servers that are currently available in the current SAP system are used as a group. Only one RFC server group may be used within a program. During the first asynchronous RFC using the addition IN GROUP, the specified RFC server group is initialized. For each asynchronous RFC where the group is specified, the most suitable application server is determined automatically, and the called function module is executed on this.
    If the function module cannot be executed on any application server, due to not enough resources being currently available, this leads to the predefined exception RESOURCE_FAILURE, to which a return value can be assigned, in addition to the remaining RFC exceptions. For this exception, the addition MESSAGE is not permitted.
    ·        The parallel processing of function modules using the addition IN GROUP makes optimum use of the resources available, and is preferred to self-programmed parallel processing with destinations that are specified explicitly.
    ·        An application server that is used as part of an RFC server group for parallel processing must have at least three dialog work processes, of which one is currently free. Other resources such as requests in the queue, number of system logons and so on, are also taken into account, and are not allowed to exceed certain limit values.
    ·        To ensure that only those application servers that have enough resources are accessed, we recommend that you work with explicitly defined RFC server groups instead of working with the addition DEFAULT.
    ·        The function modules of the function group SPBT provide service functions for parallel processing, for example, initialization of RFC server groups, determining the used destination, or temporarily removing an application server from an RFC server group.
    Addition 2
    ... {PERFORMING subr}|{CALLING meth} ON END OF TASK
    Effect
    You can use this addition to specify either a subprogram subr or, as of Release 6.20, a method meth as a callback routine, which is executed after the asynchronously called function module has finished. For subr, you have to directly specify a subprogram of the same program. For meth, you can enter the same details as for the general method call.
    The specified subprogram subr can have exactly one SING parameter of type clike only. The method meth must be public, and can have only one non-optional input parameter p_task of type clike. When the RFC interface is called, this parameter is supplied with the task ID of the remotely called function that was specified in the call in task. The results of the remote function can be received in the subprogram subr or method meth using the statement RECEIVE. In the callback routine, no statements can be executed that cause the program run to terminate or end an SAP LUW. Statements for list output are not executed.
    Prerequisite for executing a callback routine is that, after the remote function has ended, the calling program is still internally available. It is then executed the next time the work process is changed. If the program has ended, or if it is part of a call sequence in the stack, then the callback routine is not executed. The statement WAIT can be used to stop the program execution until certain or all callback routines have been executed.
    CALL FUNCTION - STARTING NEW TASK parameter_list
    Syntax
        [EXCEPTIONS exc1 = n1  exc2 = n2 ...
    Effect
    These additions are used to assign actual parameters to the formal parameters of the function module, and return values to exceptions that are not class-based. These additions have the same meaning as for the synchronous RFC. The only exception is that no values can be copied with IMPORTING and CHANGING.
    do reward if helpful

  • Starting new task inside an Update Task

    Hi guys,
    I need an expert opinion for a problem I'm facing at the moment.
    The requirement is this: I need to trigger a function module during the update task of a material document.
    This function module however should not slow down the posting of the document, so it must not be in the same LUW, but in a separate task.
    My question is: does it work to call a function module with STARTING NEW TASK inside an UPDATE TASK (for example a user exit) and if it does work, what's your opinion on it? Is if safe? Does it come with problems? According to the SAP documentation, STARTING NEW TASK does not trigger a COMMIT when it's called inside an update task.
    The alternative would be to trigger a work flow, but that's much more work.
    Any input is welcome.
    Thanks.

    Hello Janis,
    Just to reiterate this aRFC call triggers an implicit database commit. So the OP is partially correct
    Klaus Kronawetter we have 2 things which we need to consider -
    Asynchronous RFC triggers a database commit in the calling program.
    Any database commits or database rollbacks that occur within the update task cancel the update.
    Simply put, as per SAP documentation, you cannot use aRFC within an update task.
    BR,
    Suhas

  • How to find out which user has locked a particular record of a table

    Hi
    Is it possible to know - which user has locked a particular record (I know the primary key of the record) of a table
    Regards

    select     OS_USER_NAME os_user,
         PROCESS os_pid,
         ORACLE_USERNAME oracle_user,
         l.SID oracle_id,
         decode(TYPE,
              'MR', 'Media Recovery',
              'RT', 'Redo Thread',
              'UN', 'User Name',
              'TX', 'Transaction',
              'TM', 'DML',
              'UL', 'PL/SQL User Lock',
              'DX', 'Distributed Xaction',
              'CF', 'Control File',
              'IS', 'Instance State',
              'FS', 'File Set',
              'IR', 'Instance Recovery',
              'ST', 'Disk Space Transaction',
              'TS', 'Temp Segment',
              'IV', 'Library Cache Invalidation',
              'LS', 'Log Start or Switch',
              'RW', 'Row Wait',
              'SQ', 'Sequence Number',
              'TE', 'Extend Table',
              'TT', 'Temp Table', type) lock_type,
         decode(LMODE,
              0, 'None',
              1, 'Null',
              2, 'Row-S (SS)',
              3, 'Row-X (SX)',
              4, 'Share',
              5, 'S/Row-X (SSX)',
              6, 'Exclusive', lmode) lock_held,
         decode(REQUEST,
              0, 'None',
              1, 'Null',
              2, 'Row-S (SS)',
              3, 'Row-X (SX)',
              4, 'Share',
              5, 'S/Row-X (SSX)',
              6, 'Exclusive', request) lock_requested,
         decode(BLOCK,
              0, 'Not Blocking',
              1, 'Blocking',
              2, 'Global', block) status,
         OWNER,
         OBJECT_NAME
    from     v$locked_object lo,
         dba_objects do,
         v$lock l
    where      lo.OBJECT_ID = do.OBJECT_ID
    AND l.SID = lo.SESSION_ID
    hope this helps
    Zekeriya

  • Failed to run task sequence. Error occurred while starting the task sequence (0x8007000E)

    Hi there
    Patch Tuesday yesterday (10th June2014). As always we deploy new patches first to a test collection where Windows 7 updates automatically apply.
    Upon trying to rebuild any of the machines in this test collection, we were presented with the following error message:
    Failed to run task sequence.  Error occurred while starting the task sequence (0x8007000E)
    After searching about this, I found this page from Niall Brady, which explained the problem:
    http://www.niallbrady.com/2013/05/17/after-selecting-a-task-sequence-in-configuration-manager-2012-sp1-you-receive-threadtoresolveandexecutetasksequence-failed-code0x8007000e-in-smsts-log/
    So I removed some of the machines from the test Windows update collection, and as per the advice in the above link, the error was gone and those machines could be built successfully.
    So the problem is there were too many many policies downloaded (apps, packages and most of all updates) for the task sequence ram to store, hence the error.
    Now...
    ...I have a question.
    The next logical step to my mind is to patch our OS image with all missing patches, so these do not have to be downloaded at build time. Niall mentions this as one of the resolutions to this issue.
    However there seems to be some confusion over whether this would actually make a difference.
    I read through this link:
    http://social.technet.microsoft.com/Forums/en-US/7e597b44-2586-4063-b6d0-cec48a7c11c7/sccm-2012-task-sequence-failure-0x8007000e?forum=configmanagerosd
    There's seems to be no consensus on this.
    Is SCCM 2012 clever enough to - when the task sequence is first started - to download ONLY the updates (policies) it detects as NOT present in the OS image...
    or
    Will it simply try to download policies for ALL items deployed to it, whether the updates are present in the OS image or not?
    I will be disappointed if SCCM 2012 SP1 CU2 isn't clever enough to only download policies at build time for the apps, packages and updates it detects as needed.
    I'd be grateful for some clarity on this.
    Regards,
    John, Glasgow.

    Hi Jason
    Thank you for replying, I appreciate it.
    1) We currently have 15 or 16 software update groups for Office updates, dating back a month or two. The latest software update group contains all the patches in the previous software update groups plus the patches released on 10th June. Do you recommend
    deleting all but the latest software update group?
    2) I'm almost reluctant to ask this, but based on what you have advised, is it the case that when the task sequence executes, it will download policies for each update in each software update group regardless of whether it has already downloaded a policy
    for an update in a previous software update group? So in effect it's downloading policies (for updates) it has already downloaded?
    3) I'm not clear on why there would be no policy for an image; in Niall Brady's informative page on the 8007000E error, he writes the following:
    "The reason it has run of space could be due to four possibilites: too many applications, too many Windows updates, too many Task Sequence steps, too many referenced packages'.
    Can you shed some light on why there isn't a policy for an image?
    Thanks again for replying,
    John.

  • OSD - Failed to run Task Sequence. An error occurred while starting the task sequence (0x8007000E).

    Failed to run Task Sequence.
    An error occurred while starting the task sequence (0x8007000E)."
    While OSD, picks up task sequence but fails in resolving task sequence dependencies. SMSPXE identifies device is not in database (unknown).
    SMSTS.log shows
    ThreadToResolveAndExecuteTaskSequence failed. Code(0x8007000E)" in SMSTS.LOG, have seen other articles suggesting failure due to lack of storage (RAM) but this task sequence has worked in past.
    By the way, if I create a stand alone media, we are able to image the workstation. What has changed in the task sequence such that the workstation is unable to download policies due to lack of storage (RAM) on workstation. Workstation has 2 GB of RAM.

    I have found a work around for the issue, even though the computer is unknown, there were software updates targeted to the ALL SYSTEMS collection which applies to All Unknown Computers and therefore to x64 Unknown Computer and x86 Unknown Computer.
    We had a SCEP ADR applying definition updates to All Systems, we applied the ADR to a different collection, removed all the SCEP updates to All Systems and successfully re-imaged the workstation. Following article was of great help in identifying the problem
    after-selecting-a-task-sequence-in-configuration-manager-2012-sp1-you-receive-threadtoresolveandexecutetasksequence-failed-code0x8007000e-in-smsts-log
    Thanks Gerry for your assistance.

  • Call function starting new task:

    I am trying to create a program in which few database update are mentioned.
    after database updates , I am calling a function module using starting new task
    in which I want to commit database updates inside in function module.
    Problem is I want to commit only database updates if function module , not of main program. For that I tried using COMMIT WORK in function module and rollback statement after calling FM.  But it is not working.COMMIT statement in FM also commiting database updates of main program also that is not required.
    Can anybody help me in solving this problem.
    Thanks
    Ruchika

    I think this may be caused by an implicit database commit performed by the system at the moment of calling a fm with "starting new task".
    Try the following test:
    - Put "rollback work" statement inside your fm which you call "starting new task" (instead of "commit") and check if the updates performed by the code executed before the call to this fm are stored in db - inspite of the rollback. If they are (as I suppose) this means that the commit effect you observe is not due to the "commit work"  statement executed inside your fm but due to an implicit commit issued automatically at the time of calling the fm. If this is the case the solution could be placing the code which you now execute before "call function...starting new task" into a seperate fm called "in update task" - then the final commit or rollback statement in your main program should have the expected effect.
    regards

  • Call function starting new task - Issue with memory variables

    Hi All,
      From our OIL application we have a call to the core delivery update FM WS_DELIVERY_UPDATE starting new task.Before the call we are exporting a variable to memory and deep inside the FM we have an oil routine which checks the value of this variable to decide on further flow. But since the FM is called in new task the variable is not available here.
    We cannot use the SET GET parameter also as this value can be different for each session.
    Can anyone suggest how to set and get the parameter value in this flow.
    With regards,
    Usha

    Hi again,
    To check whether the FM is running in new task or not - This is what I have tried (this may not be the best way), but it works fine.
    1. The variable to check inside the called FM is SY-CPROG.
    2. This variable will have value.
    RS_TESTFRAME_CALL - If being checked from se37
    Z / Y program                - if called from the original z / y program (WITHOUT new task).
    SAPMSSY1  - if being called using NEW TASK (and no debugging)
    hope this helps.
    Regards,
    Amit Mittal.

  • ABAP Dump when calling Function Module Starting New Task

    Hi all. I have a tricky situation now, I am doing a POC on parallel processing.
    I am getting an ABAP dump on the following Call Function line which is in class lcl_steer_114numc (See below for full program):
    METHOD start.
        CALL FUNCTION 'Z_ZZCLS_STEER_114NUMC'
          STARTING NEW TASK me->id
          CALLING me->finish ON END OF TASK.
      ENDMETHOD.                    "start
    However I get the following ABAP dump:
    Short text
        Statement "CALL FUNCTION .. DESTINATION/STARTING NEW TASK/IN BACKGROUND TASK"
    The function module only contains a wait statement to simulate parallel processing. It is strange that it dumps here, because when I change the FM call to another call that has been triggered successfully from other classes, it still produces the same ABAP dump.
    The background of the Proof Of Concept is to see if I can get an event to trigger the next process that depends on the outcome of the previous process. Parallel processes are run in the start methods by calling RFC.
    <Garbled code removed>
    Moderator Message: Please post relevant portions of the code only.
    Edited by: Suhas Saha on Jul 17, 2011 1:17 PM

    Well, the thing is I did manage to run 3 other Function Modules asynchronously succeesfully prior to that function call, with the same exact function call syntax. Further more, I have tried editing it with your suggestion but I get the exact same dump.
    The complete function group can be downloaded here (slinkee file):
    https://docs.google.com/leaf?id=0B3sua1Bw4XK4ZmFhNzcwMTgtYzQ0Mi00NzQ4LTg5YTMtNDNlNWUxYTM2NTg3&hl=en_US
    The complete program can be downloaded here (slinkee file):
    https://docs.google.com/leaf?id=0B3sua1Bw4XK4YWJmNjU3ODYtODRmMy00Nzg2LThkNTUtZjNkNDRhZGQ3MTUw&hl=en_US
    The complete ST22 dump can be found here:
    https://docs.google.com/leaf?id=0B3sua1Bw4XK4ZDU1YmFkZDAtOTU5MS00ZTgwLWFlZTktNWZhMDUxMzJlZWNl&hl=en_US
    Basically I ST22 gives me the following:
    Runtime Errors         RPERF_ILLEGAL_STATEMENT
    Date and Time          17.07.2011 05:29:54
    |Short text                                                                                |
    |    Statement "CALL FUNCTION .. DESTINATION/STARTING NEW TASK/IN BACKGROUND TASK"                 |
    |What happened?                                                                                |
    |    Error in the ABAP Application Program                                                         |
    |                                                                                |
    |    The current ABAP program "Z_ZZB1_CLOSE_PERIOD_TEST2" had to be terminated                     |
    |     because it has                                                                               |
    |    come across a statement that unfortunately cannot be executed.                                |
    And it explains it here (but is not helpful / relevant at all) as I ran the program from SE38.
    |Error analysis                                                                                |
    |    There is probably an error in the program                                                     |
    |    "Z_ZZB1_CLOSE_PERIOD_TEST2".                                                                  |
    |    The program was probably called in a conversion exit                                          |
    |    or in a field exit. These are implemented by                                                  |
    |    function modules called CONVERSION_EXIT_xxxxx_INPUT/OUTPUT or                                 |
    |    USER_EXIT_xxxxx_INPUT.                                                                        |
    |    Conversion exits are triggered during screen field transports or                              |
    |    WRITE statements, field exits during field transports from the                                |
    |    screen to the ABAP/4 program.                                                                 |
    |    In this connection, the following ABAP/4 statements are not allowed:                          |
    |                                                                                |
    I hope you try to download the slinkee files and you will notice the call function I performed was no different than the other call function RFC calls that really are working.

  • Which user exit is triggered on Save of CV01N/CV02N

    I have some requirement to be triggered on the Save of a document using CV01N/CV02N.
    I found three exits in the transaction EXIT_SAPLCV110_001, EXIT_SAPLCV110_002, EXIT_SAPLCV110_003 but none of them get triggered on Save even though I have activated the enhancement.
    If someone knows which user exit gets triggered on Save of CV01N/CV02N please let me know.

    You can use BADIs.
    You can use DOCUMENT_MAIN01.
    Go to SE18. Display 'DOCUMENT_MAIN01.
    On the menu bar, Click on Implementation > Create.
    Give your own implementation name starting with Y or Z.
    There's a method called BEFORE_SAVE in this.
    It has all the data DRAW, DRAD, DRAZ etc as Changing Parameters.
    So you will be able to manipulate that data in that method.
    Activate the implementation And you are good to go.
    Reward if helpful.

  • CALL FUNCTION STARTING NEW TASK Debug

    Hi,
    How can you debug a function module which is called with an add on 'STARTING NEW TASK' ?
    Thank you.

    Hi,
    the only way i know is :
    1. Create an endless loop in the FM like:
    clear x.
    do.
    if x = 1. exit. endif.
    enddo.
    Now run the program. If you call the sm50 trx you'll see a new task : your function module. Now get the session in debug (Menu Program/Sessio -> Program -> Debugging) and change the x value to exit form the loop. Continue with the debug.
    Regards
    Andrea

Maybe you are looking for