Function module not working when used with 'In Background Task'

hi,
this is my code
call function 'Z_IBD_FILL_ZINETACT'
              in background task
              destination  'SAPD220125'
              tables
                  it_net1 = it_net1
                  it_net2 = it_net2
                  it_net3 = it_net3  .
when this code is executed i am not getting any data in my internal tables i.e it_net1, it_net2, and it_net3
but i changed this code see the below code
      call function 'Z_IBD_FILL_ZINETACT'
             in background task (THIS IS COMMENTED)
              destination  'SAPD220125'
              tables
                  it_net1 = it_net1
                  it_net2 = it_net2
                  it_net3 = it_net3  .
now i am getting data into my internal tables
can any one tell me what can be the problem and how to solve it in my case
its very urgent

Hi,
Pls. go through the  docu..
CALL FUNCTION
Variant 5
CALL FUNCTION func IN BACKGROUND TASK.
Additions:
1. ... AS SEPARATE UNIT
2. ... DESTINATION dest
3. ... EXPORTING  p1 = f1    ... pn = fn
4. ... TABLES     p1 = itab1 ... pn = itabn
Effect
Flags the function module func to be run asynchronously. It is not executed at once, but the data passed with EXPORTING or TABLES is placed in a database table and the next COMMIT WORK executes it in another work process.
Note
This variant applies only as of Release 3.0, so both the client system and the server system must be Release 3.0 or higher.
Note
qRFC with Outbound Queue
This is an extension of tRFC. The tRFC is serialized using queues, ensuring that the sequence of LUWs required by the application is observed when the calls are sent.
For further information about qRFC, refer to the Serialized RFC: qRFC With Outbound Queue section of the SAP Library.
Addition 1
... AS SEPARATE UNIT
Effect
Executes the function module in a separate LUW under a new transaction ID.
Addition 2
... DESTINATION dest
Effect
Executes the function module externally as a Remote Function Call (RFC); dest can be a literal or a variable.
Depending on the specified destination, the function module is executed either in another R/3 System or as a C-implemented function module. Externally callable function modules must be flagged as such in the Function Builder (of the target system).
Since each destination defines its own program context, further calls to the same or different function modules with the same destination can access the local memory (global data) of these function modules.
Note
Note that a database commit occurs at each Remote Function Call (RFC). Consequently, you may not use Remote Function Calls between pairs of statements that open and close a database cursor (such as SELECT ... ENDSELECT).
Addition 3
... EXPORTING p1 = f1 ... pn = fn
Effect
EXPORTING passes values of fields and field strings from the calling program to the function module. In the function module, formal parameters are defined as import parameters. Default values must be assigned to all import parameters of the function module in the interface definition.
Addition 4
... TABLES p1 = itab1 ... pn = itabn
Effect
TABLES passes references to internal tables. All table parameters of the function module must contain values.
Notes
If several function module calls with the same destination are specified before COMMIT WORK, these normally form an LUW in the target system. Calls with the addition 1 are an exception to this rule - they each have their own LUW.
You cannot specify type 2 destinations (R/3 - R/2 connections).
(See Technical details and Administration transaction.)
Example
REPORT  RS41503F.
/* This program performs a transactional RFC.
TABLES: SCUSTOM.
SELECT-OPTIONS: CUSTID FOR SCUSTOM-ID DEFAULT 1 TO 2.
PARAMETERS: DEST LIKE RFCDES-RFCDEST DEFAULT 'NONE',
            MODE DEFAULT 'N',
            TIME LIKE SY-UZEIT DEFAULT SY-UZEIT.
DATA: CUSTITAB TYPE TABLE OF CUST415,
      TAMESS   TYPE TABLE OF T100,
      WA_CUSTITAB TYPE CUST415.
SELECT ID NAME TELEPHONE INTO CORRESPONDING FIELDS OF TABLE CUSTITAB
               FROM SCUSTOM WHERE ID IN CUSTID ORDER BY ID.
PERFORM READ_CUSTITAB.
EDITOR-CALL FOR CUSTITAB TITLE 'Editor for table CUSTITAB'.
PERFORM READ_CUSTITAB.
CALL FUNCTION 'TRAIN415_RFC_CALLTRANSACTION'
     IN BACKGROUND TASK
     DESTINATION DEST
     EXPORTING
          TAMODE    = MODE
     TABLES
          CUSTTAB   = CUSTITAB.
CALL FUNCTION 'START_OF_BACKGROUNDTASK'
     EXPORTING
          STARTDATE = SY-DATUM
          STARTTIME = TIME
     EXCEPTIONS
          OTHERS    = 1.
IF SY-SUBRC = 1.
  EXIT.
ENDIF.
COMMIT WORK.
CALL TRANSACTION 'SM58'.
      FORM READ_CUSTITAB                                   *
FORM READ_CUSTITAB.
  WRITE: / 'System ID:', SY-SYSID.
  SKIP.
  LOOP AT CUSTITAB into WA_CUSTITAB
    WRITE: / WA_CUSTITAB-ID, WA_CUSTITAB-NAME,
             WA_CUSTITAB-TELEPHONE.
  ENDLOOP.
  ULINE.
ENDFORM.
Pls. reward if useful....

Similar Messages

  • WMI InvokeMethod for StartService does not work when used with ManagementOperationObserver on IIS

    Hi,
    I am using .net 4.5 and C# to remotely restart the services. I am using WMI to do this task.  This code works when called from windows application on the machine, but same code when used inside web application it gives exception of invalid parameter.
    We saw it log error in System Event log 
    The machine-default permission settings do not grant Local Activation permission for the COM Server application with CLSID
    {49BD2028-1523-11D1-AD79-00C04FD8FDFF}
     and APPID
    {49BD2028-1523-11D1-AD79-00C04FD8FDFF}
     to the user IIS APPPOOL\<app pool user> SID (S-1-5-82-634865507-143429395-1373251082-3464226226-3883016302) from address LocalHost (Using LRPC). This security
    permission can be modified using the Component Services administrative tool.
    I am pasting below code for reference.
    m.InvokeMethod(observer, "Startservice", null, null);
    //wait until invoke method is complete or 30 sec timeout
    int intCount = 0;
    while
    (!completionHandlerObj.IsComplete)
    if (intCount > 60)
    MessageBox.Show("Inside 30 seconds");
    break;
    //wait 1 sec.
    System.Threading.Thread.Sleep(1000);
    //increment counter
    intCount++;
    //see if call was successful.
    if (HandlerObj.ReturnObject.
    Properties["returnValue"].Value.ToString() == "0")
    isStarted = true;
    Dhanaji

    For web apps the context will be the context of the app pool.  Unless you set the app pool to run as a user account that has admin privileges on the remote machine then you won't be able to control the services on a remote machine.  If you have
    enabled Win auth such that the app runs in the context of the remote user then you might need to turn on delegation otherwise the hop won't work.
    Note that if you are using Win auth then consider using ServiceController instead which provides the same functionality as WMI but with a cleaner syntax.  This wouldn't work if you need to impersonate a user though.
    Michael Taylor
    http://blogs.msmvps.com/p3net

  • Function Key not work when using jre1.5

    My application was based on JDK1.3 to develop and JRE 1.3 is using in the client side.
    In the application, function keys are the shortcut and it is working fine based on the above setting.
    Since JRE 1.5 is encouraged to be used in the future, we try to use it to run our application. But we find that all function keys are not working.
    I am not sure the fact, but I get the following exception sometimes in the console:
    Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException
    at javax.swing.LayoutComparator.compare(LayoutComparator.java:61)
    at java.util.Arrays.mergeSort(Arrays.java:1307)
    at java.util.Arrays.mergeSort(Arrays.java:1296)
    at java.util.Arrays.mergeSort(Arrays.java:1296)
    at java.util.Arrays.mergeSort(Arrays.java:1295)
    at java.util.Arrays.sort(Arrays.java:1223)
    at java.util.Collections.sort(Collections.java:159)
    at javax.swing.SortingFocusTraversalPolicy.enumerateAndSortCycle(Sorting
    FocusTraversalPolicy.java:119)
    at javax.swing.SortingFocusTraversalPolicy.getFirstComponent(SortingFocu
    sTraversalPolicy.java:425)
    at javax.swing.LayoutFocusTraversalPolicy.getFirstComponent(LayoutFocusT
    raversalPolicy.java:148)
    at javax.swing.SortingFocusTraversalPolicy.getDefaultComponent(SortingFo
    cusTraversalPolicy.java:502)
    at javax.swing.LegacyGlueFocusTraversalPolicy.getDefaultComponent(Legacy
    GlueFocusTraversalPolicy.java:131)
    at java.awt.FocusTraversalPolicy.getInitialComponent(FocusTraversalPolic
    y.java:149)
    at java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFoc
    usManager.java:318)
    at java.awt.Component.dispatchEventImpl(Component.java:3841)
    at java.awt.Container.dispatchEventImpl(Container.java:2024)
    at java.awt.Window.dispatchEventImpl(Window.java:1766)
    at java.awt.Component.dispatchEvent(Component.java:3803)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
    at java.awt.SequencedEvent.dispatch(SequencedEvent.java:93)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
    at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchTh
    read.java:234)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThre
    ad.java:163)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
    I try to compile my code using JDK 1.3 and 1.5. Actually, there is no compilation error.
    Please help me if you know the fact or solution.
    Thanks a lot!

    The supported Software in iPlanet's Portal Server is JDK/JRE 1.2.2_07 and JDK 1.2.2_09(in SP4). Starting with JDK1.3.1_01, applets are handled somewhat differently. Enable Java and look at the error messages in Java Console to find why the Netlet is not loading in JDK1.3.1_02. The issue might be with two JRE's or with your cache setting. Hope this helps you.
    Thanks,
    Raj_indts
    Developer Technical Support
    Sun Microsystems
    http://www.sun.com/developers/support

  • Airport Express not working when used with Broadband Router **HELP!!!**

    Hello.
    I have an ethernet network in my house, and I am connected to the network via a Linksys router for Broadband VOIP and internet. I am on a G5 in my home office and want to stream music to my Airport Express for my home stereo in the living room, via the ethernet connection.
    The problem is that when using the router in my network, only the Admin Utility sees the base station-- iTunes does not.
    If I remove the router from the equation altogether and plug the network ethernet cable directly into the G5, the AX in the other room works just fine and I can get internet on the G5 in the office. The problem is that I need the router to operate my Vonage VOIP phone service and to connect a second computer to the internet as well. The IP address for the router in the home office is "192.168.x.xxx" and when I try moving it to the living room and connecting the AX to it, the Admin Asst doesn't see the AX at all.
    When I connect the router to the network in the office, I can use internet on both computers and the VOIP phone service, and the AX Admin Asst. sees the base station from the other room. But again, iTunes does not.
    Is there a way to configure the router to see the AX?
    Thanks for your help!

    Forgive me if this a little off thread, but I have just managed to get this to work and thought it might help people with similar configuration issues (mix manufacturer wireless networks)
    I received an Airport Express (FW v. 6.3) for Christmas this year. I already am using a D-Link DI-524 wireless(G) router (Rev A FW 1.03) for my Comcast cable modem in my house (downstairs). What I wanted to do is to add the Airport Express in my office upstairs to my network (client mode) so that I could print from my HP Deskjet 3740 printer and listen to iTunes on my stereo through Airtunes. I have two iBooks (G3) with regular (802.11b) airport cards in them) running Tiger.
    I ran into a couple of snags though. I could see the printer in Rendezvou and I could see the airport express in iTunes. I however could not print to the printer or connect to the speakers. I was able to connect to the speakers very intermittenly and then the audio would be disrupted every few seconds.
    After a bit of hacking, what I found is that it seems that WPA PSK security doesn't work between the two. I changed the security to 128 bit WEP (ASCII mode). This means that you need an exactly 13 character pass phrase. This is necessary because Apple (and pretty much only Apple) supports 40 bit WEP (5 chars) and D-Link (and the rest of the Windows wireless universe) supports 64 bit WEP (7 chars), but they both support 128 bit WEP. I assume you could set both up as an open network if you were far enough from your neighbors, but I am in a townhouse complex, so I thought I probably better have some security on the network.
    Now I only see one network (the one set up on my D-Link router) and I can print to my printer and stream to my stereo through iTunes (without disruption). Seems to work seemlessly now.
    I should also mention that I did about three other things. I moved the LAN subnet on the D-link router to 192.168.1.1 (DHCP client address are now between 1.100 and .1.200) I had heard that this was necessary since both routers tried to use the 192.168.0 subnet, but I think this is only necessary in relay mode. I also statically assigned the IP address for the Airport Express. Finally I set up a firewall rule of Source WAN/LAN IP addresses of 192.168.1.100-200 of any protocol from ports 1-20000 to the same destination address range should be allowed to allow for all LAN traffic to be passed. I am very certain this is unnecessary and possible dangerous for security, but I thought I should mention that I did it.
    Hope this might help someone.
    Michael
    iBook G3 (600 MHz)   Mac OS X (10.4.3)   D-Link DI-524 Router. Motorola Surfboard Cable Modem. Comcast Broadband

  • Plug-ins in Color Efex do not work when used with Lightroom? really need help

    Dear all,
    I am suffering the problem with some plug-ins (some others still okey) of Color Efex when I use them with Lightroom. Specifically, the image I chose to edit in Color Efex turned black as I tried to apply a plug-in, ex Detail extractor. Pls see the pic below:
    Before
    ...and After
    I am using Win XP and wondering whether this is the root of this problem? Pls help me for a solution if you know it.
    Many thanks for reading and supporting!

    Dear all,
    I emailed Nik team and it is just exact as what you said, they are very helpful and supportive when provide me several of solutions. Thank god one amongst them solves my issue completely. I performed the following steps:
    If you are able to open Color Efex Pro 4and can see part of the interface, see if you can click on the"Settings" button in the lower left.
    In Settings locate the section "GPU" and expand it, in this section you will see a check box "Enable GPU Processing", uncheck this so the GPU will be disabled, then close the settings window.
    Close out of Color Efex Pro 4 (click Cancel), quit out of any and all host applications (Photoshop,Lightroom, Aperture), and then relaunch Color Efex Pro 4 to see if this corrects this issue.
    Thank to Nik team and you guys here. I'm now able to work with my new project better

  • HT204168 touch screen function not working when using facetime

    Why is my iPad touch screen function not working when using FaceTime?

    Hi megascones,
    I apologize, I'm a bit unclear on the exact nature or scope of the issue you are describing. If you are having issues with the touch screen on your iPad, you may find the troubleshooting steps outlined in the following article helpful:
    If the screen on your iPhone, iPad, or iPod touch doesn't respond to touch - Apple Support
    Regards,
    - Brenden

  • Why is my touch screen function not working when using facetime

    Why is my touch screen function not working when using facetime

    Hello megascones,
    After reviewing your post, it sounds like the screen is not responding to touch in one app. I would recommend that you read this article, it may be able to help the issue.
    If the screen on your iPhone, iPad, or iPod touch doesn't respond to touch - Apple Support
    Restart your device. If you can't restart, reset your device.
    Thanks for using Apple Support Communities.
    Have a nice day,
    Mario

  • Siri does not work when used for calling a contact function

    Siri does not work when used for calling a contact function

    Very strange, try to turn off/on your iPhone. Or make a reset (home+power button)...
    If it continues try to restore it.

  • Function Module not working for old Role

    Dears
    Function Module not working for old Role
    Function Module: /VIRSA/BAPI_AE_USERS_FOR_ROLES
    Before EHP4 upgrade this functional module working fine, but after updated users are not visible.
    We have chekced if the users are assigned directly users are visible but indirect (Position Based) assignment users are not apprearing.
    Pl check the fucntion module with given roles below and identify the root cause,
    EP_TRVL_ALL_CAB     - Old Role
    EP_TRN_TRVL_DRGC_V2 - New Role
    Regards
    Krishna Mohan CH
    9704500717

    Krishna,
    I do not think this BAPI is meant to be called by anyone but the application using it, and its functionality may therefore change without notice.
    What are you trying to achieve? Maybe there's a better way to do that...
    Frank.

  • Excel Functions Do Not Work When Data Source is BW

    Hello,
    My platform is, BOBJ BI 4.0. Data source is SAP BW. BW is connected to XCelsius with BEx. My problem is, excel functions do not work when data source is BW. For example, Excel cell A1=quantity1  B1= quantity2   C1= excel function "=A1+B1" When data source is Excel, for example A1=5, B1=9 C1 automatically equals to 14. (There is no problem when data source is Excel) But, in BW, for example when BW set values to A1=5, B1=9, the system does not calculate C1. C1 always equals to initial value, the system does not care any excel calculation when data source is BW.  Any guess for my problem? Thank you for your effort.

    Hi,
    As you are using very simple formula,it will work no matter which source you are consuming.As mentioned,try to place a simple component(Eg:spreadsheet),just to check whether you are getting the right calculated value or not.
    As you are using BW as source,the Preview option will not show the runtime data,so you need to publish in Portal to check whether the calculation happened or not.
    As far as I know only few fromulas are supported in Xcelsius,but these kind of simple formulas are very much supported.
    Rgds,
    Murali

  • The Open URL or File function is not working when I publish as a exe?

    The Open URL or File function is not working when I publish as a exe.  I have tried putting the exe in the same location as the files with no luck.  How do I get the buttons to function properly with a exe file.

    Have you set the Publish folder as a trusted location in Flash Global Security?
    If not, please read this post:
    http://www.infosemantics.com.au/adobe-captivate-troubleshooting/how-to-set-up-flash-global -security
    It may explain your issue.

  • How do I set up a mail group on mac mail?  All the advise on line seems to refer to 'address book' and I only have 'contacts'.  The guidance does not work when using 'contacts' - can anyone help me?

    How do I set up a mail group on mac mail?  All the advise on line seems to refer to 'address book' and I only have 'contacts'.  The guidance does not work when using 'contacts' - can anyone help me?

    Create a group and send mail
    http://www.dummies.com/how-to/content/how-to-create-a-basic-contact-group-in-mac -os-x-li.html
    http://www.macworld.com/article/1165582/how_to_email_groups_with_mail.html
    Best.

  • Photoshop CC. Colour selection not working when using alt and brush.

    Hi, Photoshop CC. Windows 8.1 64 bit. Colour selection not working when using alt and brush. I have tried rebooting and other things like closing swatch panel etc.
    The alt key is otherwise OK.  It's not the recent upgrade from Win 8 to 8.1 (5 days ago) because the colour selection facility was working yesterday. Any ideas.

    I'd say things sound desperate enough to try resetting Preferences
    Reset Preferences
    Windows — Hold down Shift Ctrl Alt immediately after starting Photoshop
    Mac — Hold down Shift Cmd Opt immediately after starting Photoshop
    If that fails, we need to know your operating system?
    Do you have a full CC subscription, or by apps do you mean Photoshop, Bridge and Lightroom?
    Another other information that might pertain ?

  • Lenovo S8-50LC Wlan(WiFi) Does not work when use Sim Cart(3G)

    Hi
    Tablet Lenovo S8-50LC
    Wlan(WiFi) Does not work when use Sim Cart(3G).
    What is the solution for this problem?
    Build Number : TABS8-50LC_S000200_150121_ROW
    SoftWarw Version : TABS8-50LC_150121

    Right, but if you have the SIM in the tablet and you put the tablet in airplane mode, does wifi work then? If so, it may be a bad SIM. Do you have another SIM you can try?

  • Function module PTRA_WEB_EXPENSE_REPORT_GET_2 not working when used in loop

    Hi All,
    I have used a function module PTRA_WEB_EXPENSE_REPORT_GET_2  in a custom fumction module which i am developing fetch the travel expense data . The function module PTRA_WEB_EXPENSE_REPORT_GET_2  returns the travel expense data based on the employee and the trip number. I want to fetch the travel expense data for a given set of employees and trip number and hence i have used this function module inside a loop statement.
    The function module returns the travel expense data for the employee and trip in the first loop pass. From the second loop passs it doesn't return the value. I have also checked this in se37 and the same thing happens. Value is returned for the fist employee but for the next employee we have to go to initial screen of se37 and execute the Func. module again.
    I debugged this function module and found that the value of the employee and the trip number is stored in the global variable. The value passed for the employee and trip is compared with the correspomding value in the global variable and if they are not same an error message is returned. Since we are using in a loop , each time a different value is passed for the employee and trip and the check fails .
    Is there any way to clear the value in the global parameters or is there any other function module which can be used to clear the values of the global variables?
    Thanks!
    Regards
    Manipal Parkala

    Hello Archana,
    May be we can try several ways...
    1) can you try calling function module BUFFER_REFRESH_ALL ??
       after each call...
    2) May be u can call Function module "PTRA_WEB_EXPENSE_REPORT_GET_2 " in background task or seperate task , it will load the function group everytime when u call it in loop.
    ***DO let us know if it does not work.
    thanks
    ~Raj

Maybe you are looking for