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

Similar Messages

  • How to call RFC with  STARTING NEW TASK...performing my_form... in a class?

    Hello,
    I created a test report for parallel processing and this works perfectly fine but when I try to build this into a class I somehow cannot create the receiving form inside the method of the class...
    method test.
            CALL FUNCTION 'ZZCR_PARALLEL' STARTING NEW TASK lv_index DESTINATION IN GROUP DEFAULT
              PERFORMING transfo_result ON END OF TASK
              EXPORTING
                input_xstring = lx_clause_text.
    endmethod.
    I tried to place the form before the endmethod but this doesn't work and afterwards is also not an option.
    Is ABP OO not supporting parallel processing?
    Thanks and regards,
    Christoph

    Hello Christo ,
                         I am also trying to use the same in OO context . Just in he early stages of collecting information.If you could just tell what you found out in the document it could be opf immense help.
    Comradely,
    K.Sibi

  • Problem in Call function .. starting new task

    Hi,
    I want to execute a dialog program in background. I am trying to use call function starting new task.
    I am facing some syntax issue. Can any one guide me how to use call function starting new task. The function module is RFC FM. Do we need to define task some where before use please guide.
    Thanks in advance. A sample program will be gr8.

    Hi,
    Incase you want to call a RFC FM in background you can call ity like this.
         call function 'Y_L_TO_CREATE_HUPAST' in background task
                 exporting
              venum   = y_v_venum
              backg   = 'X'
               buser   = y_lv_uname
              langu   = sy-langu
              objky   = y_lv_objky
              printer = y_lv_printer.
    Here Y_L_TO_CREATE_HUPAST is a RFC FM.
    Regards,
    Ankur Parab

  • Call Function'BAPI_USER_CHANGE' starting new task 'TEST'

    Hi All,
    I have problem with starting new task statement, I am using one FM after that am using starting new task 'TEST'
    statement but its not working in one system its working fine in other systems, Please help me who this works.
    Thanks in Advance.
    Eg: Call Function'BAPI_USER_CHANGE' starting new task 'TEST'
    Regar

    Thanks Lqueiroz  ,
    Now again i am getting a DUMP by saying ,
    "An error occurred when executing a REMOTE FUNCTION CALL.
    It was logged under the name "At least one entry could not be "
    on the called page."
    so what can be the reason for this
    call function 'ZRFC_PER_DIEM' starting new task lc_taskid performing subr on end of task
            exporting
              h_guid      = it_header_guid_n
              request_obj = lt_requested_objects_n.
          wait up to '1' seconds.
          read table gt_scl into ls_scl index 1.
          p_transaction_per_diem =  ls_scl-value.
          read table gt_scl into ls_scl index 2.
          transaction_currency_code = ls_scl-value.
      form subr   using task_id type clike.
      data: p_transaction_per_diem  type  char13,
            transaction_currency_code type  char3.
      receive results from function 'ZRFC_PER_DIEM'
                               tables
                                value = gt_scl.
    So basically i am getting dumo when receive statenment is running , by giving above dump.
    Regards
    PG

  • CALL FUNCTION func STARTING NEW TASK task

    hi,
    i developed rfc to extract data and send to xi
    as my interface is Async
    as per soem documents it was mentioned the syntax
    CALL FUNCTION func STARTING NEW TASK task
    wat is the task ? in the syntax
    and how do i use it
    jeff

    Hi suresh,
    this is the code of  RFC. if i execute without RFCDESTINATION it executes successfully. when i use RFC DESTINATION it shows error
    call to messaging system failed: com.sap.aii.af.ra.ms.api.DeliveryException
    i created RFC destination using TCP/IP and registered program. same parameters i am mentioning in XI.
    FUNCTION z_bank_reconciliation.
    ""Local interface:
    *"  IMPORTING
    *"     VALUE(COMP_CODE) TYPE  BUKRS
    *"     VALUE(HOUSE_BANK) TYPE  HBKID
    *"     VALUE(ACCOUNT_ID) TYPE  HKTID
    *"  TABLES
    *"      CHQDETAILS STRUCTURE  ZPAYR
      DATA: itab LIKE payr OCCURS 0 WITH HEADER LINE.
      DATA: jtab LIKE payr OCCURS 0 WITH HEADER LINE.
      DATA: it_bank LIKE zbankrecon OCCURS 0 WITH HEADER LINE.
      DATA: it_bank1 LIKE zpayr OCCURS 0 WITH HEADER LINE.
      TYPES :  BEGIN OF ty_bseg ,
                 bukrs LIKE bseg-bukrs,
                 hbkid LIKE bseg-hbkid,
                 belnr LIKE bseg-belnr,
                 zlsch LIKE bseg-zlsch,
                 kostl LIKE bseg-kostl,
                 hkont LIKE bseg-hkont,
                 bzdat LIKE bseg-bzdat,
             END OF ty_bseg.
      TYPES : BEGIN OF ty_t012 ,
                  bukrs  LIKE t012-bukrs,
                  bankl  LIKE t012-bankl,
                  bankn  LIKE t012k-bankn,
             END OF ty_t012.
      TABLES : payr, t012, t012k, bseg.
      DATA : itpayr LIKE zpayr OCCURS 0 WITH HEADER LINE,
             itt012 TYPE STANDARD TABLE OF ty_t012,
             itbseg TYPE STANDARD TABLE OF ty_bseg,
             wa_itt012 TYPE  ty_t012,
             wa_itbseg TYPE  ty_bseg,
             total TYPE n.
      SELECT * FROM zbankrecon INTO TABLE it_bank
                       FOR ALL ENTRIES IN itab
                       WHERE chequeno EQ itab-chect.
      SELECT  abukrs abankl b~bankn
                  INTO CORRESPONDING FIELDS OF TABLE
                  itt012 FROM t012 AS a
          INNER JOIN t012k  AS b ON bbukrs = abukrs AND b~hbkid =
    house_bank AND b~hktid = account_id
                WHERE abukrs = comp_code AND ahbkid = house_bank.
      DELETE ADJACENT DUPLICATES FROM itt012.
      SELECT  zbukr  hbkid hktid vblnr gjahr zaldt checf chect  znme1 rwbtr
      waers zaldt zbnkl FROM payr INTO CORRESPONDING FIELDS OF TABLE itpayr
        WHERE  ( zbukr = comp_code AND hbkid = house_bank ) AND hktid =
        account_id.
    SELECT bukrs hbkid belnr zlsch kostl hkont bzdat  FROM bseg INTO TABLE
    itbseg
      WHERE bukrs = comp_code AND hbkid = house_bank.
      SORT  itt012 BY bankl.
      SORT itbseg BY belnr.
      READ TABLE itt012 INTO wa_itt012 INDEX 1.
      LOOP AT itpayr.
        read table itbseg into wa_itbseg with key bukrs = itpayr-zbukr
    hbkid =  itpayr-hbkid.
        if sy-subrc = 0.
          itpayr-kostl = wa_itbseg-kostl.
          itpayr-hkont = wa_itbseg-hkont.
         itpayr-bldat = wa_itbseg-bzdat.
          itpayr-zlsch = wa_itbseg-zlsch.
        endif.
        itpayr-zbnkl = wa_itt012-bankl.
        itpayr-zbnkn = wa_itt012-bankn.
        MODIFY itpayr.
        APPEND itpayr TO chqdetails.
      ENDLOOP.
      LOOP AT chqdetails.
        READ TABLE it_bank WITH KEY chequeno = chqdetails-chect.
        IF sy-subrc NE 0.
          MOVE chqdetails TO it_bank1.
          APPEND it_bank1.
          CLEAR it_bank1.
        ENDIF.
      ENDLOOP.
      REFRESH chqdetails.
      chqdetails[] = it_bank1[].
      LOOP AT it_bank1.
        MOVE : it_bank1-chect TO zbankrecon-chequeno,
        sy-datum TO zbankrecon-check_date,
        sy-uzeit TO zbankrecon-check_time.
        INSERT zbankrecon.
        CLEAR zbankrecon.
      ENDLOOP.
    ENDFUNCTION.

  • CALL FUNCTION  WITH STARTING NEW TASK

    Hi All,
    i'm call a function module through
    CALL FUNCTION 'Y_WIN'  DESTINATION 'rfc_destination' then it's give right result but when i want to call with starting new task then
    CALL FUNCTION 'Y_WIN'  STARTING NEW TASK 'INFO' DESTINATION 'rfc_destination'
    it does nt provide me any data. i have check in debugger call fm is wkging fine so pls clear me why i'm nt geeting result.
    pls give ur suggestions,
    Anuj

    Did you use the PERFORMING <form> ON END OF TASK to get the results back; like in the following sample
              CALL FUNCTION 'SAPWL_STATREC_READ_FILE'
                   STARTING NEW TASK taskname
                   DESTINATION list-name
                   PERFORMING read_outtab ON END OF TASK
                   EXPORTING
                        read_start_date   = s_date
                        read_start_time   = '000000'
                        read_end_date     = s_date
                        read_end_time     = '235959'
                   EXCEPTIONS " failure when calling RFC
                        communication_failure = 1 MESSAGE msg_text
                        system_failure        = 2 MESSAGE msg_text
                        RESOURCE_FAILURE      = 3.
    and
    FORM read_outtab USING taskname.
    * Receive results back
      RECEIVE RESULTS FROM FUNCTION 'SAPWL_STATREC_READ_FILE'
        TABLES
          v2_normal_records = outtab
        EXCEPTIONS " from the called FM
          nodata    = 1.
    Regards

  • Use of CALL FUNCTION - STARTING NEW TASK parameter_list.

    SELECT strt_code
                 city_code
                 commu_code
                 regiogroup
          INTO TABLE gt_adrstreet1
          FROM adrstreet
          FOR ALL ENTRIES IN gt_street_district
          WHERE strt_code EQ gt_street_district-strt_code.
    To optimize the performance of teh above query I am planning to use call function CALL FUNCTION - STARTING NEW TASK .....
    by spliting the above internal table gt_street_district into two internal tables and use the value of each internal table into two different queries and these queries will be put in call function - start new task ....so that these queries are run in different workprocess and thus improve the performance of the program.
    Can you please let me know if this would be a good option and also how to implement the same.
    Thanks.....

    >To optimize the performance of teh above query I am planning to use call function CALL FUNCTION - STARTING NEW TASK .....
    nonsense! You should not try parallel processing for a non-optimized SELECT statement.
    Better add the first key field of the WHERE condition as said above and check
    + whether the driver table is empfty
    + and whether there are duplicated entries
    ... And it is also a good idea to really use the SINGLE RECORD BUFFER, therefore you must write
    field-symbol:  <fs>  type ...
    LOOP AT gt_street_district ASSIGNING <fs>
       SELECT *
                    INTO TABLE gt_adrstreet1
                    FROM adrstreet
                    WHERE counrty =
                     AND       strt_code = <fs>-strt_code.
    ENDLOOP.
    Then it will be extremely fast!

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

    Hi to all,
    this post is ideally the continious of my previous post
    "how to attach custom code after invoice create/modification".
    Here the problem.
    In the BADI of the invoice document i call a custom function module (F1) with the addition "in update task". This to ensure that the code inside is executed only if the commit is triggrered.
    In this function module, i call another custom function module (F2), with the addition "starting new task".
    This function module (F2) contains a batch that waits 10 seconds (to ensure the "standard" modify) and then modify the invoice document with my custom data (by a call transaction).
    The problem is that this new task is .... endless !!
    I watch it writing a log file after the call transaction. Using AL11, i watched that every 10 second, the file is updated.
    Seems that this new task never ends: it call the trasaction, it writes the log file and the start again.
    The only way i have to stop that, is modify manually the same invoice document with VF02 trx.
    At exit, i don't save data (otherwise the endless cycle begins again) and then i watch that the log file stops to be updated.
    This task must be executed just one time. I've already try to put "exit" instruction at the end of the function module, but it doesen't work, the task start again and again.
    How i can solve this problem?
    Usefull solutions/hints/ideas etc will be sure rewarded (as usually).
    Thx a lot
    Andrea

    >
    Vinay parakala wrote:
    > ...But it didnt work.
    Moderator message - Give more information please in a new thread - post locked

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

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

  • Question on parallel processing using the STARTING NEW TASK keyword

    I have the following code in a program on my development system:
    call function 'FUNCTION_NAME'
        starting new task ld_taskname
        performing collect_output on end of task
          exporting
            pd_param1       = ld_param1
          tables
            pt_packet       = lt_packet.
    You'll notice in the code above I left out the following part of the function call:
    DESTINATION IN GROUP group
    In my one-server development system the topmost code executes fine, but I'm getting a 'REMOTE FUNCTION CALL ERROR' when I execute this in a multi-server Q&A system. 
    My question: Is the missing 'DESTINATION' keyword required in order for this technique to work in a multi-server environment or is it optional keyword?  I made the assumption that since it worked in my development environment that without the 'DESTINATION' addition the system simply used the current logged on system to start the new processes.
    Any input appreciated.
    Thanks,
    Lee

    Hi Lee,
    Just take F1 help on CALL FUNCTION key word and go to the variant
    CALL FUNCTION func STARTING NEW TASK task
                  [DESTINATION {dest|{IN GROUP {group|DEFAULT}}}]
                  parameter_list
                  [{PERFORMING subr}|{CALLING meth} ON END OF TASK].
    This gives you very clear information about this Key word.
    No one would give you better information better than this, i hope
    Cheers
    Ram

  • 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

  • CALL FUNCTION STARTING NEW TASK  DESTINATION

    Hi All,
    I have tried to use CALL FUNCTION 'ZWHV_TEST' STARTING NEW TASK 'TEST' DESTINATION 'NONE' But it didnt work.
    Please explain me  to use above statement and detail me more about NEW TASK 'TEST'.
    How to declare TEST in new task ?
    Thanks ,
    Vinay.

    >
    Vinay parakala wrote:
    > ...But it didnt work.
    Moderator message - Give more information please in a new thread - post locked

  • Behaviour of CALL FUNCTION fname STARTING NEW TASK DESTINATION 'NONE'

    As per ABAP help documentation, the statement CALL FUNCTION fname  STARTING NEW TASK DESTINATION 'NONE' should create a new main session in  same user session.The behaviour is wrong as per documentation.
    But  current behaviour:
    The statement CALL FUNCTION fname STARTING NEW TASK DESTINATION 'NONE'   is creating a new user session.
    Any reason?

    Hi Prakash,
    I'd agree with Suhas, that you're reading the documentation wrong. Here's your quote:
    As per ABAP help documentation, the statement CALL FUNCTION fname STARTING NEW TASK DESTINATION 'NONE' should create a new main session in current user session.
    If you look at the help, you can see that it says:
    When the destination NONE is used, a new main session is opened for the current user session.
    Do you see the difference? Also, note that in this context main session basically means that we're talking about a new external session:
    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.
    If you're still in doubt, check out the online ABAP documentation for [CALL FUNCTION - STARTING NEW TASK|http://help.sap.com/abapdocu_70/en/ABAPCALL_FUNCTION_STARTING.htm]. So I'd say the documentation is in line with the actual behavior.
    Cheers, harald

Maybe you are looking for