Calling FM in background

Hi All,
I have a requirement to call one function module in background job. To acheive this, I tried to call this FM in another FM using 'IN BACKGROUND TASK' option. But this option is not scheduling it as a background job, rather its running this FM as a dialog session in background. And it gets terminated after the dialog timeout period.
The other option is to call this FM in a program and submitting this program in background. But as the input parameter of this FM is complex structure, I am not able to pass this complex table to the pragram.
Can you please suggest some solution..
Thanks in advance..
Archana

Hi,
Not sure , but Try using  AS SEPARATE UNIT.
CALL FUNCTION func IN BACKGROUND TASK
                   [DESTINATION dest]
                    [AS SEPARATE UNIT].
regards,
Naveen

Similar Messages

  • Creation of spool for job created by calling FM in background task

    Hi Gurus,
    1.Wanted to confirm if it is possible to attach spool to the job that has been created by calling a function module in background task.
    Currently I have created one RFC enabled FM and called it in background task. It runs fine, and the job is created which can be seen in SM37. But it does not contain the spool even if the RFC FM contains the code for list ALV.
    2. Also is it possible to control the name of the job created by calling the RFC FM in background task?
    Code for calling the FM is given below(ZK_XX is th RFC FM):
    CALL FUNCTION 'ZK_XX' IN BACKGROUND TASK
    CALL FUNCTION 'START_OF_BACKGROUNDTASK'
    EXPORTING
       startdate       = sy-datum
       starttime       = sy-uzeit
      NOSEND          = ' '
    COMMIT WORK.
    Thanks a lot for your help!!
    Warm Regards,
    Raveesh

    Thanks for replying.
    I need to do the processing in background. Hence using 'IN BACKGROUND TASK' addition.
    Please let me knowif you have some idea.
    Thanks & Warm Regards,
    Raveesh

  • Call function in background task... How to get the result?

    I want to use Call function in background task parameter.
    But I cannot find the result of this function. (No export parameter, no table result, no exception)
    How to get the result of this function module? Correct or not?

    Hi Heinz,
    You can check the result in SM58 transaction.
    For more information pls. refer this thread :
    No IMPORTING parameters allowed in CALL FUNCTION IN BACKGROUND TASK
    Best regards,
    Prashant

  • Call transaction in background in report

    I have a report in which I call a transaction, but the requirement is that I have to call it in background.
    Can you please suggest how I can achieve this.
    <removed_by_moderator>
    Edited by: Julius Bussche on Aug 26, 2008 3:20 PM

    Hi charles,
    Use the mode 'N'
    Example:-
    DATA:
      fs_opt TYPE ctu_params.
      fs_opt-dismode = 'N'.
        CALL TRANSACTION 'PA30'  USING t_bdcdata OPTIONS FROM fs_opt.
    Luck,
    Bhumika

  • Call transaction in Background job

    Hi,
    I am executing a program in background. In that program I am having a CALL TRANSACTION as below:
    CALL TRANSACTION 'ME22'
        USING g_t_bdctab
        MODE 'N'
        UPDATE 'S'
        MESSAGES into g_t_bdcmsg.
    But it is not working. The same is working when the program is executed in foreground.
    Is this means, we cannot have CALL TRANSACTION in background?
    If Yes, then what could be the solution for it?
    Thanks,
    Pankaj.

    Hello Pankaj,
    Call transaction works in background.
    Provided you are not picking file from presentation server.
    If you are picking file from presentation server, place the same file in application server and during background job pick the file from application server then your program works perfectly.
    Regards,
    Tarun

  • Problem in Call Transsaction in background..

    Dear Friends ,
       I have written Call Transaction (BDC) inside the program.
    In output it will diaplays the document numbers and those document numbers r updated in one Tcode(through call transaction).
      if i run in Foregroung the documents numbers updating in that Tcode. but in Background it is not updating in that Tcode..
    What could b d probelm...

    Hi !
    Generally Call-Transaction in background is working fine...
    Check something out:
    - Do you get any errors back from the Call-Transaction ?
    - Does the background-user have permission do execute
      the called transaction ?
    - Is the update-task on the background-server running 
      (SM13) (If you have saparate server for background)
    - put an explicid COMMIT WORK after you call transaction
      (if you can do so). Commonly updatetask starts it's
      work by getting an COMMIT WORK.
      In dialog there's an implicid COMMIT WORK when
      then LIST oder the SELECTION-SCREEN apperas again.
    Regards
    Rainer
    Some points would be nice if that helped...

  • CALL FUNCTION IN BACKGROUND UNIToref.

    Hi All,
    Please tell me the method how to use FM IN Backgorund job(only  IN BACKGROUND UNIToref)
    CALL FUNCTION IN BACKGROUND UNIToref.
    it would be better if give practical example.
    Regards,
    Anuj jain

    Hi Heinz,
    You can check the result in SM58 transaction.
    For more information pls. refer this thread :
    No IMPORTING parameters allowed in CALL FUNCTION IN BACKGROUND TASK
    Best regards,
    Prashant

  • Save Order - Call function in background Task

    Hi all,
    I have written a function module which is called in order save Badi and copies the system status on the Master contract to the sub contracts.
    This works fine but when I call this function in background task the status is not getting copied over.For testing I have created a program similar to function module and scheduled that in background and this was working as required.
    Can someone please let me know if I missed out anything or how can i resolve this issue.
    Any inputs in this regard would be very helpful.
    Thanks and regards,
    Vijay

    Hi Heinz,
    You can check the result in SM58 transaction.
    For more information pls. refer this thread :
    No IMPORTING parameters allowed in CALL FUNCTION IN BACKGROUND TASK
    Best regards,
    Prashant

  • General BADi question:Call BADi in background job/batch input. Possible?

    Hi out there,
    i'm using thoe following BADi: /SAPSLL/CTRL_SD0C_R3 (Global Trade Service).
    But also, this question is a general question.
    If we are calling on screen the transaction VF01, the BADi is called correctly.
    But unfortunately it seemes that the BADi is NOT called (im not really sure, cause i can't debug the background task) when we are calling a batch input sequence wth f.e. form bdc_transaction VF01 nothing happens.
    Maybe BADi cannot be called in a background task? If it's possible, how could it be monitored. Thare isw no spool entry or anything like that!
    Any answer can help.
    Thank you in advance!
    Regards,
    Timo
    Edited by: Timo Ehl on Apr 14, 2009 7:27 PM

    Hi,
    generally BADIs are called in background mode. You can use the following trick to debug your BADI. You just need to create an infinite loop in your BADI implementation. Something like this.
    DATA: l_a TYPE c.
    WHILE l_a IS INITIAL.
    ENDWHILE.
    Obviously when your BADI is called in background mode then program will get into infinite loop. You can easily connect and debug running programs from transaction SM50. You need to select your background process and go to Program/Session -> Program -> Debugging. You will jump directly into your BADI methos with infinite loop. Then you will just set value to l_a and you will start debugging your BADI. If you can not find any process then your BADI is not called in background mode.
    Cheers

  • Help with Designing a Website Call to Action Background

    Hi there,
    This is my first post here, but I am having a bit of trouble designing a background call to action background for my website. My website is a common responsive 980px site but the problem is how I should go about designing a background that will properly adjust to the reponsive nature of the site.
    If you want to have a look at what I mean here is my site, Galactic FX,
    Any help would be greatly appreciated,
    Kieren Hovasapian.

    Mazza,
    Try this VI out. It returns a boolean instead of an integer, but this is really the same thing from what you are talking about.
    You would use this VI as a subVI. It will pop up and allow user data entry. It passes the boolean out of it to see if the login was successful or not. You could also change things so that the password comparison (password in my case) is an input to the subVI as well.
    Randy Hoskin
    Applications Engineer
    National Instruments
    http://www.ni.com/ask
    Attachments:
    Timed_login_panel.vi ‏29 KB

  • Qs about call FM in background task, and monitoring in SM37.

    Hi, guys, i got a question here, if I call a FM using addition "in background task" in a Z program, does this mean the FM process is running in background? And can I monitor my task in sm37?
    i've tried to do that, the FM was successfully proceeded, but I cannot see anything related to that task in SM37 under mine user ID.

    No, you cannot see that in SM37.
    What it means is that the function is being executed in a seprated thread and the program that called the function will continue the execution without waiting for the function finish execution, that means the function is called in a synchronous manner.
    Regards,
    Ravi
    Note : Please mark all the helpful answers

  • Require Job name in SM37 while executing call transaction in background

    Hi all,
    I am executing a report program, which contains Call transaction.
    I have recorded properly. The recording contains background job screen also ( means a separate popup came and i gave the job name and i gave immediately )
    When i execute in this program in foreground its creating job,its showing the job in sm37.
    But when i execute this program in background, it does not showing the job name in sm37.
    Anyone kindly help this out?
    Anandhab

    Hi,
    The job will be created by the step level user.
    Try searching again with jobname and * for username.
    Regards,
    Jovito

  • Call Function in Background Task

    Hi all,
    I have written a method in which I call a function in background task, I would like to perform a task after the function has ended succesfully. this is possible with the addition PERFORMING 'next_task' ON END OF TASK.
    This is sadly not possible in a global class.
    How can I get info back on the state of the function in the background?
    greetings Fred.

    Hi,
       try using export import statement in FM
       call function ...
        flay = 'Y'.
        export flag to memory id 'TESt'
       endfunction
        import flag from memory id 'TEST'.
        if flag = 'Y'.
          perform next_task.
          endif.
    Regards
    amole

  • Call Transaction in background mode

    Hi everyone,
    What I am currently trying to do is to perform a 'call transaction' while forcing the 'background processing' mode even when the user is running the program in online mode; this allows me to retrieve a lot more messages that are useful to the user than the messages generated in online mode.
    As long as I have seen there is no field for that in the options table that can be passed to the 'call transaction' sentence. The only way to see that behavior while in online mode is by 'playing back' a recording thru the SHDB transaction and checking the 'Simulate background' option.
    My first attempt was to set the SY-BATCH flag before doing the call transaction but it doesn't work, the flag seems to reset itself with the correct value during the call.
    Any comments on this would be greatly appreciated.
    Regards,
    Sergio

    You would have to create a job on the fly to do this.  This example shows how to kick off a background job via an ABAP program.
    report zrich_0004 .
    data:   sdate type sy-datum,
            stime type sy-uzeit,
            l_valid,
            ls_params like pri_params,
            l_jobcount like tbtcjob-jobcount,
            l_jobname  like tbtcjob-jobname.
    start-of-selection.
    * Get Print Parameters
      call function 'GET_PRINT_PARAMETERS'
           exporting
                no_dialog      = 'X'
           importing
                valid          = l_valid
                out_parameters = ls_params.
    * Open Job
      l_jobname = 'ZRICH_0005'.
      call function 'JOB_OPEN'
           exporting
                jobname  = l_jobname
           importing
                jobcount = l_jobcount.
    * Submit report to job
      submit zrich_0005   
           via job     l_jobname
               number  l_jobcount
           to sap-spool without spool dynpro
               spool parameters ls_params
                  and return.
    * Schedule and close job.
      call function 'JOB_CLOSE'
           exporting
                jobcount  = l_jobcount
                jobname   = l_jobname
                strtimmed = 'X'

  • CALL Transaction in background not working pls help URGENT

    hi i have writtin a bdc program which uses CALL TRSANCTION everything is working in foreground.
    if i schedule the program in background the call transaction does not work. any idea why?????????
    pls help its urgent

    hi
    good
    have you checked in the debug mode, if you have checked in the debug mode check wheather it is giving any error before data is displaying in the screen, if any error is displaying as a message than check that error why it is coming there.
    If no error is coming than check your flow of the bdc screen in the debug mode , there must be some prob, so that it is not working in the background.
    thanks
    mrutyun^

  • Call Transaction in Background for IW52

    Hi All..
    When i execute my BDC (Call Transaction) in foreground, the code will update IW52 screens without any errors/warnings.
    But if we schedule this in background, the IW52 screens are not getting updated.
    Even there are no Errors observed.
    We have used the syntax as follows..
    CALL Transaction IW52 using it_bdcdata MODE 'N' messages into it_bdcmsg.
    Can anyone help me how to rectify it and make it to execute successfully in background mode..??
    Your Help will be highly appreciated..
    Regards
    Pavan

    Hello Friends...
    I am running a call Transaction code in Background mode.
    I am facing Error message..
    If i run the same in foreground, it is working fine...
    Error Message is "No Batch Input data for screen <SAPNV screen No>"
    Expecting your guidence in this case...
    Regards
    Pavan
    Message was edited by:
            Pavan Sanganal

Maybe you are looking for

  • What is the maximum number of email aliases allowed?

    I just tried to set up 2 email aliases via iCloud.com.  I already have one setup and wanted to add a further two, which should be allowed as it says I can setup 2 more at the bottom of the preferences pane.  I did delete an alias that I no longer use

  • I recently updated my Lumia to 8.1 ..but....

    In settings the extra+info is still showing black ... I updated my phone through preview of developer and i am very worried....Doesn't i got all the features plz tell me.... Solved! Go to Solution.

  • Converting Excel file By File adapter

    Hi, I need to convert .xsl file using XI and send an IDOC. I am not sure how to do that. Do i need to write some JAVA API's for the same. Is File adapter capable of converting .xsl files. Any pointers are most welcome. Best regards, Satish Chauhan

  • Rendering HTML JSF Component via java code

    Hey, I was wondering, I want to build sort of HTML generator (for a very specific process), I thought about taking the advantage of JSF components instead of writing an HTML generator, Is it possible to render Html JSF Components via simple java clas

  • Structure enhance ment

    i am enhancing a structure kuweg ..that is i am inserting another stucture into that structure by using appending structure.->and in that i use .include  type <my struc type> tthe problem is i can get the data saved in db tables but they are not comi