Can we code in ABAP to run on all available instances?

Hi,
My requiremnet is to run a custom report to run on all available instances?
how do we handle it??
Rgds
praveen

You can use RFC enabled function module to do what i understood you wanted. :
Establish a list of instances with
      CALL FUNCTION 'TH_SERVER_LIST'
           TABLES
                list = list.
Then encapsulate your report in a function module converting parameters of the report into import parameters of the function module and enabling RFC calling under SE37. Then do a loop on servers calling the function
      taskname = '000'.
      LOOP AT list.
        DO.
          ADD 1 TO taskname.
          CALL FUNCTION <YourFunMod>
               STARTING NEW TASK taskname
               DESTINATION list-name
               PERFORMING end_of_task ON END OF TASK
               EXPORTING
                    <your parameters>
               EXCEPTIONS
                    communication_failure = 1 MESSAGE msg_text
                    system_failure        = 2 MESSAGE msg_text
                    RESOURCE_FAILURE      = 3.
          CASE sy-subrc.
*           Ok, goto next
            WHEN '0'.
              ADD 1 TO nbr_tasks.
              EXIT.
*           Fatal error
            WHEN '1' OR '2'.
              MESSAGE x208(00) WITH msg_text.
*           Not enough resources, wait
            WHEN '3'.
              WAIT UP TO 10 SECONDS.
          ENDCASE.
        ENDDO.
      ENDLOOP.
* wait until the end
      WAIT UNTIL nbr_tasks IS INITIAL.
The subroutine decrement nbr_task
FORM end_of_task USING taskname.
* Receive results if export data
*  RECEIVE RESULTS FROM FUNCTION <YourFunMod>
*    TABLES
*      <if export data/tables in funmod>
*    EXCEPTIONS
*      nodata    = 1.
  SUBTRACT 1 FROM nbr_tasks.
ENDFORM.
Regards

Similar Messages

  • ITunes can't find music & won't run at all

    A couple weeks ago we changed servers. All of my iTunes music was on the old server; now it on the new server (with a different server name).
    When I try to run iTunes an error message comes up saying iTunes cannot find or create the iTunes directory. When you acknowledge the error it simply drops back to Windows and never runs iTunes. You have no opportunity to go into preferences to tell it the new directory.
    I've tried removing iTunes an reinstalling. And going into the Registry and removing references to iTunes. Nothing helps.

    When I try to run iTunes an error message comes up saying iTunes cannot find or create the iTunes directory.
    this document is a good place to start with that one:
    iTunes for Windows: "Disk is locked" or "iTunes folder cannot be found" when installing or opening iTunes

  • How to make an ABAP program run for a specified number of times ?

    assalamoalikum all!!!
    Can some 1 plz tell me that How can I make my ABAP program run ONLY for 2 times (after it went in production etc)
    AND when the program runs for 2 times It then gets hanged/Locked foreever.
    Suppose my program is:
    REPORT twice002.
    write ' I will run only twice bye bye'.

    Well, I guess the only full proof way is to create a custom "Z" table which will hold the counter, in your program you would update this table every time the program runs. In this same program before updating the counter, you would retrieve the counter and check if it is = 2, if so, then write a message and RETURN.
    Regards,
    Rich Heilman

  • ABAP/4 run time error with error code  SNAP_NO_NEW_ENTRY

    Dear All,
               I've installed SAP R/3 IDES on Oracle on Windows 2003 server.After clicking Log on button , I should be asked to enter client,user and password.But, my system does not display such details.Instead I get ABAP/4 run time error with error code  SNAP_NO_NEW_ENTRY that too after a long time.
                Can you please address what is the reason for this problem and how to over ride it?
    Regards,
    S.Suresh

    Hi,
    the most probable reason is an archiver stuck. Backup the archived redo log files and delete them afterwards.
    The database will archive some more logs after this. Handle them in the same manor. For complete explanation search for brtools.
    Regards
    Ralph Ganszky

  • ABAP: Can I reproduce this Excel code in ABAP?

    Hi Experts,
    I've got a process that I want to improve using ABAP code so that I can reduce user interaction. I have a table (SKAS) on the ECC side that contains some data that I need to report on within BI. I am currently exporting this to a flat file, doing string manipulation in Excel, and then importing it into BI using a File type datasource.
    The problem with this is that I constantly have to do this maintenance for the simple task of adding another field (from the string manipulation) to the table. Is there a way that I can do this using ABAP, so that I can build an extractor for SKAS and then set a transformation to DSO level and add the field there.
    Here is my code in Excel:
    =IF(ISERROR(LEFT(A318,FIND("CTY",A318)-1)),A318,LEFT(A318,FIND("CTY",A318)-1))&IF(ISERROR(RIGHT(A318,LEN(A318)-FIND("CTY",A318)-3)),"",RIGHT(A318,LEN(A318)-FIND("CTY",A318)-3))
    Any questions about the code, please let me know.
    Thanks!

    Brian - for a non abapper the simplest way to do this is create a generic data extractor based on a view of the SKAS table
    then in transformations use the forumula builder to replicate your excel code
    True you could do it in abap and normally I would if it were me - but the transformation builder is very very similar to the way you have built your excel forumula - ie it contains IF and LEFT and STR functions

  • Can somebody tell me what is g-code in abap language

    hi,
    please help me about  g-code in abap language.
    thank u,
    subhasis,.

    I think,
    g-code means custom code.
    Custom one's will be started with Z, however Z is pronounced as "Zee".
    So, this seems to be relevant to customs.
    You may post this issue in ABAP group to get appropriate answer.
    warm regards
    sairam akundi

  • Program Name which helps to hide the code of abap program

    Hello Experts,
              Could anybody help me in finding the name of the program on running which we can hide the CODE OF Abap program

    Here´s a snippet demonstrating how to hide the ABAP code of a given program
    REPORT z_hide_abap
      NO STANDARD PAGE HEADING.
    DATA: gt_code(72)  TYPE c OCCURS 0,
          gv_code      LIKE LINE OF gt_code,
          gt_code2(72) TYPE c OCCURS 0.
    PARAMETERS: program LIKE sy-repid.
    START-OF-SELECTION.
      READ REPORT program INTO gt_code.
      IF sy-subrc NE 0.
        MESSAGE e398(00) WITH 'Report' program 'not found.'.
    *   ATTENTION:
    *   READ REPORT on a hidden source code return SY-SUBRC=8 !!!
      ENDIF. "IF sy-subrc NE 0
      READ TABLE gt_code INDEX 1 INTO gv_code.
    * append *special* 1st line to hide cource code
      APPEND '*@#@@[SAP]' TO gt_code2.
      LOOP AT gt_code INTO gv_code.
        APPEND gv_code TO gt_code2.
      ENDLOOP.
      INSERT REPORT program FROM gt_code2.
    Reward points if helpful.

  • Optimization of Codes in ABAP

    Hello there,
    Can anyone help me about my problem in optimizing my code in ABAP..
    before i used SDF logical dbf..but simple select in BSIS,BKPF and BSEG tables are much faster than using logical dbf..but my main problem is it took a while also in processing a report while using a select statement..here is my sample code.
    It took 2mins in processing a report...Hope someone can help me
    Please give me some advice.
    Thanks in advance
    aVaDuDz
    SELECT SINGLE *
      FROM skb1
      WHERE bukrs EQ p_bukrs
      AND saknr EQ p_saknr.
      IF sy-subrc EQ 0.
        SELECT blart belnr waers monat budat bukrs hkont buzei
               shkzg dmbtr wrbtr gjahr
        INTO CORRESPONDING FIELDS OF TABLE it_bsis
        FROM bsis
        WHERE bukrs EQ p_bukrs
        AND hkont EQ p_saknr
        AND gjahr IN p_gjahr
        AND monat IN p_monat.
        PERFORM add_record.
      ENDIF.
    FORM add_record .
      LOOP AT it_bsis.
        g_percn = 1.
        CLEAR g_indic.
        g_indic = c_indic.
        REPLACE '&' WITH it_bsis-belnr INTO g_indic.
        REPLACE '%' WITH it_bsis-buzei INTO g_indic.
        CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
          EXPORTING
            percentage = g_percn
            text       = g_indic.
        READ TABLE it_data ASSIGNING <data>
             WITH KEY  belnr = it_bsis-belnr "document #
                       buzei = it_bsis-buzei. "Line Item
        IF sy-subrc <> 0.
          APPEND INITIAL LINE TO it_data ASSIGNING <data>.
          <data>-belnr = it_bsis-belnr. "document #
          <data>-buzei = it_bsis-buzei. "Line Item
        ENDIF.
        <data>-bukrs = it_bsis-bukrs. "Company
        <data>-hkont = it_bsis-hkont. "G/L Acct.
        <data>-gjahr = it_bsis-gjahr.
        <data>-waers = it_bsis-waers.
        <data>-belnr = it_bsis-belnr.
        <data>-monat = it_bsis-monat.
        <data>-budat = it_bsis-budat.
        <data>-blart = it_bsis-blart.
        IF it_bsis-shkzg ='H'.
          <data>-wrbtr = it_bsis-wrbtr * -1.
          <data>-dmbtr = it_bsis-dmbtr * -1.
        ELSE.
          <data>-wrbtr = it_bsis-wrbtr.
          <data>-dmbtr = it_bsis-dmbtr.
        ENDIF.
        SELECT SINGLE lifnr sgtxt
         FROM bseg
         INTO gs_vendor
         WHERE belnr  =  it_bsis-belnr
         AND gjahr IN p_gjahr
         AND lifnr NE ''.
        SELECT SINGLE lifnr name1 stcd1
         FROM lfa1
         INTO gs_lfa1
         WHERE lifnr = gs_vendor-lifnr.
        <data>-lifnr = gs_lfa1-lifnr.
        <data>-sgtxt = gs_vendor-sgtxt.
        <data>-name1 = gs_lfa1-name1.
        <data>-stcd1 = gs_lfa1-stcd1.
        SELECT SINGLE wt_withcd
        FROM with_item
        INTO gs_item
        WHERE belnr = it_bsis-belnr
        AND gjahr IN p_gjahr.
        IF sy-subrc EQ 0.
          <data>-mwskz = gs_item.
        ENDIF.
        SELECT SINGLE ppnam usnam bldat
        FROM bkpf
        INTO gs_bkpf
        WHERE belnr = it_bsis-belnr
        AND gjahr IN p_gjahr.
        <data>-ppnam = gs_bkpf-ppnam.
        <data>-usnam = gs_bkpf-usnam.
        <data>-bldat = gs_bkpf-bldat.
      ENDLOOP.
    ENDFORM.                    " add_record

    Hi,
    Check this code. See the comments where i have mentioned "Add / Remove this".
    For tables like BSEG, BKPF and WITH_ITEM you have to provide complete key to read from table. BUKRS should be the first field in select statement.
    Also, you do not need to check LIFNR  NE '', when you select from BSEG. Just read the first line item. It is vendor / customer line item.
    Also, <b>DO NOT USE SAPGUI_PROGRESS_INDICATOR inside loop</b>. It does affect performance.
    Let me know if you still have performance issue.
    SELECT SINGLE *
                   FROM skb1
                   WHERE bukrs EQ p_bukrs
                   AND saknr EQ p_saknr.
    IF sy-subrc EQ 0.
      SELECT blart belnr waers monat budat bukrs hkont buzei
      shkzg dmbtr wrbtr gjahr
      INTO CORRESPONDING FIELDS OF TABLE it_bsis
      FROM bsis
      WHERE bukrs EQ p_bukrs
      AND hkont EQ p_saknr
      AND gjahr IN p_gjahr
      AND monat IN p_monat.
      PERFORM add_record.
    ENDIF.
    *       FORM add_record                                               *
    FORM add_record .
      LOOP AT it_bsis.
        g_percn = 1.
        CLEAR g_indic.
        g_indic = c_indic.
        REPLACE '&' WITH it_bsis-belnr INTO g_indic.
        REPLACE '%' WITH it_bsis-buzei INTO g_indic.
        CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
             EXPORTING
                  percentage = g_percn
                  text       = g_indic.
        READ TABLE it_data ASSIGNING <data>
        WITH KEY belnr = it_bsis-belnr "document #
        buzei = it_bsis-buzei. "Line Item
        IF sy-subrc <> 0.
          append initial line to it_data assigning <data>.
          <data>-belnr = it_bsis-belnr. "document #
          <data>-buzei = it_bsis-buzei. "Line Item
        ENDIF.
        <data>-bukrs = it_bsis-bukrs. "Company
        <data>-hkont = it_bsis-hkont. "G/L Acct.
        <data>-gjahr = it_bsis-gjahr.
        <data>-waers = it_bsis-waers.
        <data>-belnr = it_bsis-belnr.
        <data>-monat = it_bsis-monat.
        <data>-budat = it_bsis-budat.
        <data>-blart = it_bsis-blart.
        IF it_bsis-shkzg ='H'.
          <data>-wrbtr = it_bsis-wrbtr * -1.
          <data>-dmbtr = it_bsis-dmbtr * -1.
        ELSE.
          <data>-wrbtr = it_bsis-wrbtr.
          <data>-dmbtr = it_bsis-dmbtr.
        ENDIF.
        SELECT SINGLE
                     lifnr
                     sgtxt FROM bseg
                           INTO gs_vendor
                           WHERE bukrs = it_bsis-bukrs " --> Add this
                           AND belnr = it_bsis-belnr
                           AND gjahr IN p_gjahr
                           AND buzei = '001'.    " --> Add this
    *                       AND lifnr NE ''.     " --> Remove this
        SELECT SINGLE lifnr name1 stcd1
        FROM lfa1
        INTO gs_lfa1
        WHERE lifnr = gs_vendor-lifnr.
        <data>-lifnr = gs_lfa1-lifnr.
        <data>-sgtxt = gs_vendor-sgtxt.
        <data>-name1 = gs_lfa1-name1.
        <data>-stcd1 = gs_lfa1-stcd1.
        SELECT SINGLE wt_withcd
        FROM with_item
        INTO gs_item
        WHERE bukrs = it_bsis-bukrs  " --> Add this
        AND belnr = it_bsis-belnr
        AND gjahr IN p_gjahr.
        IF sy-subrc EQ 0.
          <data>-mwskz = gs_item.
        ENDIF.
        SELECT SINGLE ppnam usnam bldat
        FROM bkpf
        INTO gs_bkpf
        WHERE bukrs = it_bsis-bukrs   " --> Add this
        AND belnr = it_bsis-belnr
        AND gjahr IN p_gjahr.
        <data>-ppnam = gs_bkpf-ppnam.
        <data>-usnam = gs_bkpf-usnam.
        <data>-bldat = gs_bkpf-bldat.
      ENDLOOP.
    ENDFORM.
    Regards,
    RS

  • Can't get LR CC to run

    I see I'm not alone, restarted computer, uninstalled it twice, reinstalled and still wouldn't run.. At lease light room 5.7.1 is still working..

    3 things: FIrst can you run the applet in Appletviewer? If you can't then you'll never run it in a browser.
    If it runs in appletviewer then I would ask, are you testing it on the same computer you're compiling it on. Applets are pure client side,and the client computer must have the java jvm (also called the jre) The browser must be set up to use the jvm. Go to control panel, Java plug in and check which jvm the browser is using.
    Third, make your applet tag the the simplest possible and make sure the applet tag itself is within the body of the html:
    <APPLET CODE="HelloWorld.class" WIDTH=150 HEIGHT=100>
    </APPLET>
    or whatever your heigh and width are.
    if the class files are on a linux box make sure they have correct permission, I think its 755.
    Fourly take this code directly from sun, compile it, put it in the same folder, point the applet tag to the class and see if it runs. import java.awt.Graphics;
    public class HelloWorld extends java.applet.Applet {
        public void init() {
         resize(150,25);
        public void paint(Graphics g) {
         g.drawString("Hello world!", 50, 25);
    }

  • Requied code in abap to display sales order header text

    hi all,
    can anybody help me to send the code in abap to display sales order header text.

    Use FM, Read_text. Pass the necessary parameters like object name, id, language. You can see some of the infos in by clicking the scroll-like button.
    Reward points if useful

  • My iTunes won't detect my iPhone that has to be restored via iTunes *because if pass code problems* and its running iOS 7.2

    my iTunes won't detect my iPhone that has to be restored via iTunes *because if pass code problems* and its running iOS 7.0.4

    If itunes is comming up and saying it can't read the device because it's locked with a passcode, you may have to put your device into recovery mode first.
    To put your device in recovery mode: (Following these steps will erase your device and reset everything to factory defaults)
    1) press and hold the power button until you see the slide to power off option
    2) swipe to power off
    3) Press and hold the home button while the device is off and connect it to your computer. Continue holding the home button until you see a graphic with the iTunes logo with a picture of a USB cable below it.
    4) iTunes should give you a message that it has detected a device in recovery mode. Click ok and then select Restore iPhone. iTunes will download a fresh copy of iOS and then wipe the device and restore it. Depending on the speed of your computer's internet connection this may take a while. Just leave the iphone connected to your computer until it's finished.
    If itunes is not detecting it at all or is Not giving you the message that the phone is locked with a passcode, you may end up having to reinstall itunes. This seems to be a fairly common problem after the most recent itunes update (11.1.5)
    If this is the case and you happen to be running a windows based computer you will have to uninstall itunes in this order from your programs and features option in control panel:
    iTunes
    Apple Software Update
    Apple Mobile Device Support
    Bonjour
    Apple Application Support (iTunes 9 or later)
    Then download and reinstall itunes from itunes.com try putting your device into recovery mode again and restore.
    Hope this helps.
    Cheers.

  • Is $99 sign up required before you can test code on a device (iphone/itouch

    Hi
    Is the $99 sign up required before you can test code on an iPhone/ Itouch device?
    I am just trying to compile a simple program and run it on the device, but I get a CodeSign error. Is Codesign something that can be done without signing up for $99, or is there a special code given during sign up to use unique to the developer? Just want to test code on a real device, not in the simulator. Seems a bit much to require me to pay a $99 fee to do so if I'm just writing stuff for myself at this point.

    Even after paying the $99 fee, I don't believe this provides for being able to install your own developed app on your iPhone - not via the simulator only, or does it?

  • Access code  for abap

    Hi everyone,
    Can you please guys post the access code for abap to mscagin at yahoo com
    thanks
    sri

    What do you mean by access code? Is this the same as a developer key?

  • T.code for ABAP Varaints

    Hi,
    Can anybody tell me the transaction code for ABAP varaints.
    In Se38 , Giving a program name and selecting the radiobutton varaints and click on display.
    We get  varaints screen. I need the transaction code for that screen.
    Regards,
    Sai

    Hi,
    This screen is only called from function module RS_VARIANT_SCREEN (easily found by using 'where-used').  This in turn is called from a number of places (SE38, SA38 etc) but I don't know of a transaction that goes to the variant screen directly.
    After all, the screen is only used if you populate the program name first, like in SE38 for example.
    Regards,
    Nick

  • Change code in ABAP debugger mode ?

    Hello ABAP Experts,
    How to change the code in the abap Debugger mode.
    Suggestions appreciated.
    Thanks,
    BWer

    You can not change the code in ABAP debugger. But you can change the value of variable/ internal table / structure in ABAP Debugger. Also you can not change the constant and if you are debugging the function module, you can not change the import parameters while debugging.
    Regards,
    Pratik

Maybe you are looking for

  • Should the USB port on my MacBook Pro charge my phone?

    Should the USB port on my MacBook Pro charge my phone?

  • How to use byte[] in EJB Model

    Hi Colleagues, I have problem with binding byte[] to model attribute. So I have methos myMethod(byte[] byteArr). byte[] in the model is represent as Byte_Item type. So I fill this attribute in this way: inputFile is of type byte[] for (byte b: inputF

  • Forecast Entry

    We key the forecast in MC88 by month(we use this method from log in SAP, it's ok all the time), But we are not getting the same in MD62, there are some parts have the problem (From Mar, 2008,  which never happen before.  Y we are not getting in MD62

  • HT1766 need help retrieving backed up iphone info on itunes

    Went to the Apple store yesterday with iphone (blue tooth and wifi not working) and power cord (mac book) issues. Since the iphone 4s had already been replaced  once (due to blue tooth and wifi issues) I backed up the phone using itunes on my compute

  • Java 1.3 comparing two dates using Calendar.before(Calendar)

    Has anyone used the Calendar.before() method for comparing two dates, how accurate is this? Some users have found problem with this method, is this true?