How to fetch data for all OUs

Hi,
Run below query:
select * FROM PO_headers
Result: no data
EXECUTE MO_GLOBAL.set_POLICY_CONTEXT('S','120');
Run below query:
select * FROM PO_headers
Result:data for org_id=120
EXECUTE MO_GLOBAL.set_POLICY_CONTEXT('A','');
select * FROM PO_headers
Result: no data
So how can we fetch data from all OUs whothout using PO_HEADERS_ALL tables?
why do we have this MO_GLOBAL.set_POLICY_CONTEXT('A','') option?

in 11i PO_HEADERS is view with org_id policy
in r12 PO_HEADERS is synonym with policies based on multi-org
so for r12
SQL> select count(*) from po_headers;
  COUNT(*)
         0
SQL> begin
  2    mo_global.set_policy_context('S', 101);
  3  end;
  4  /
PL/SQL procedure successfully completed
SQL> select count(*) from po_headers;
  COUNT(*)
       110
SQL> begin
  2    mo_global.set_policy_context('S', 82);
  3  end;
  4  /
PL/SQL procedure successfully completed
SQL> select count(*) from po_headers;
  COUNT(*)
       235
SQL>
SQL> begin
  2      mo_global.init('SQLAP');
  3  end;
  4  /
PL/SQL procedure successfully completed
SQL> select count(*) from po_headers;
  COUNT(*)
       345
SQL> select unique org_id from po_headers;
    ORG_ID
        82
       101
SQL> mo_global.set_policy_context('S',<org_id>) - single operating unit
mo_global.init(<app_short_name>) - multi operating unit

Similar Messages

  • How to fetch data for sales order costing

    Hi All,
    How to fetch data for VA03 --> Extras --> Costing having cost element details.
    Thanks
    Gaurav

    Hi Gaurao ,
    There is no such function module  to extract data  in one column   , you have to  Convert all the columns data    in one column
    for period   .
    regards
    Deepak.

  • How to fetch data for a struture from a cluster table

    How can I fetch data for a struture, from a cluster table, based on the name of the structure?

    Hi,
    In order to read from Cluster DB Table use the following statement:
    Syntax
    IMPORT <f1> [ TO  < g1 > ] <f2> [TO < g2 >] ...
    FROM DATABASE <dbtab>(<ar>)
    [CLIENT <cli>] ID <key>|MAJOR-ID <maid> [MINOR-ID <miid>].
    This statement reads the data objects specified in the list from a cluster in the database <dbtab>.
    You must declare <dbtab> using a TABLES statement. If you do not use the TO <gi> option, the
    data object <fi> in the database is assigned to the data object in the program with the same
    name. If you do use the option, the data object <fi> is read from the database into the field <gi>.
    For <ar>, enter the two-character area ID for the cluster in the database. The name <key>
    identifies the data in the database. Its maximum length depends on the length of the name field
    in <dbtab>.
    The CLIENT <cli> option allows you to disable the automatic client handling of a client-specific cluster database, and specify the client yourself. The addition must always come directly after the name of the database.
    For Eg:
    PROGRAM SAPMZTS3.
    TABLES INDX.
    DATA: BEGIN OF JTAB OCCURS 100,
    COL1 TYPE I,
    COL2 TYPE I,
    END OF JTAB.
    IMPORT ITAB TO JTAB FROM DATABASE INDX(HK) ID 'Table'.
    WRITE: / 'AEDAT:', INDX-AEDAT,
    / 'USERA:', INDX-USERA,
    / 'PGMID:', INDX-PGMID.
    SKIP.
    WRITE 'JTAB:'.
    LOOP AT JTAB FROM 1 TO 5.
    WRITE: / JTAB-COL1, JTAB-COL2.
    ENDLOOP.
    Regards,
    Neha
    Edited by: Neha Shukla on Mar 12, 2009 1:35 PM

  • How to fetch data for the Change Request in PROCESS_EVENT

    Hi All,
    I need to write some custom logic on Save/Submit button. For this I am planning to enhance the PROCESS_EVENT method of class CL_USMD_CR_MASTER. Within this method I need to access runtime data of the change request currently being processed.
    I am going to create a post-method exit for this PROCESS_EVENT method. Is this correct?
    I have heard we have APIs in MDG which can be used to fetch data, however I do not know how to use the same.
    Can someone please help me with sample code how to fetch the runtime data of the Change Request
    Thanks in advance.
    Regards,
    Vanessa

    What MDG domain are you working on? What you are trying to do is called "reuse mode" enhancement and you do NOT want to tinker with the FPM feeder classes in this case. SCN document Configuration and Enhancement of SAP Master Data Governance contains many examples on how to achieve this.
    This is a how-to document for MDG-M reuse mode enhancement: Extend MDG-M Data Model by a New Entity Type (Reuse Option)
    This is a how-to document for MDG-C/S reuse mode enhancement: SAP How-To Guide: Extend the MDG Business Partner - Node Extension (Reuse Option)
    Keep in mind, these examples are mainly for additional "master data" fields. If you need additional fields that are not master data but are more related to the Change Request itself, you should use this how-to document: Enhancement of the User Interface Building Block for Change Requests
    Again, all of these documents can be found on the first document I referenced above. I suggest that you bookmark it.

  • How to fetch data from all the libraries/lists from a website only present in a site collection.

    Hi,
    I have a sitecollection named sitecollectionA....
    There are 3  subsites under this site collection named as site A, site B, site C
    and there are many libraries present in these subsites.
    I want to fetch the items from all the libraries present in site B ONLY.
    My custom webpart is in site B.But I am not able to fetch the data from this particular site(site B).
    I am using SPSiteDatauery....but getting nothing with below scopes-
    query.Webs = "<Webs  Scope=\"Recursive\" />";   ---- this gives data from all subsites and their subsites
    query.Webs = "<Webs  Scope=\"\" />";  -               ----this gives data from only the top level subsite of sitecollectionA
    Below are few lines from my code.....
     SPSiteDataQuery query = new SPSiteDataQuery();
                            query.Lists = "<Lists ServerTemplate=\"101\" />";
                            query.Webs = "<Webs  Scope=\"\" />";
    Please help...

    Got the answer....
    I defined my site collection object like below and it worked.
     SPSite site = new SPSite(SPContext.Current.Web.Url);

  • How to fetch data for cash voucher

    Hi,
    I came to know that there is not direct connection to database tables.
    How to get the data for cash voucher?
    Thanks in advance,

    Hi
    You can get data from BKPF table by passing document type BLART = 'SK'. 
    SK: - Cash document

  • How to fetch data for CRM Product Master

    Hi,
    I'm trying to write a report on the product master in CRM.
    In our current setup, we have few Ztables attached to the Product Master tabs.
    The key field linking the Ztables is
    field name:FRG_GUID     
    component type COMT_FRG_GUID
    description:SET GUID     
    I would like to know if there is any function module which reads the product master table based on Product_ID  just like 'for example 'CRM_ORDER_READ'.( which gives all the GUID's based on Business Transaction Numbers)
    I need this because I'm not able to match the Fragment_guid of many DB tables to each other.
    Please help.
    Regards
    Rasheed

    Hi Pratik,
    Thank you for trying to help me. I shall explain my scenario for better undestanding.
    I'm creating a Product Master Report which is linked to several Z tables.I need to fetch the details based on the price group .
    The structure of one of the Z tables is as below:
    Field Name               Component Type
    .INCLUDE                     COMT_FRG_KEY
    CLIENT                     MANDT
    FRG_GUID     COMT_FRG_GUID
    .INCLUDE                     COMT_PRODUCT_ADM
    VALID_FROM     COMT_VALID_FROM
    VALID_TO                     COMT_VALID_TO
    UPNAME                     COMT_UPNAME
    HISTEX                     COMT_HISTEX
    LOGSYS                     COMT_LOGSYS
    ZZ0010                     ZMODELTYPE
    ZZ0011                     ZMODELDESC
    ZZ0012                     ZMODSALEABLEAREA
    ZZ0013                     ZMEAUNIT
    ZZ0014                     ZBUILTUPAREA
    ZZ0015                     ZCARPETAREA
    ZZ0016                     ZTERRACEAREA
    ZZ0017                     ZGARDENAREA
    ZZ0018                     ZBALCONYAREA
    now the only way I can get the information from this table is if I get the FRG_GUID.
    Is there any way where I can get all the FRG_GUID for the PRODUCT_GUID'S.
    Regards
    Rasheed

  • How to fetch data for skills catalog to the ESS skills profile

    Hi Experts,
    I am adding qualifications using the following path:
    SPRO > Personnel Management > Personnel Development > Master Data > Edit Qualifications Catalog
    This should reflect in the Portal under Career and Job > Learning Page > Skills Profile. Can you please guide me about the steps to be taken to make this available.
    Further to this,
    If an employee updates his skills in the portal skills profile, that should update his infotype 24 accordingly. What configuration should be done to make this happen.
    Your guidance is much appreciated.
    Thanks,
    Toa

    Hi Toa,
    Can you have a look at the switch QUALI/ESSST in T77S0 the documentation says:
    "Within the ESS service used to edit the skills profile, this entry
    enables you to restrict the view of the skills catalog to the skills
    group determined here."
    It might help
    Best regards
    Sarah

  • In mdx how to get max date for all employees is it posible shall we use group by in mdx

    in mdx how to get max date for all employees is it posible shall we use group by in mdx
    example
    empno  ename date
    1         hari        12-01-1982
    1         hari        13-06-2000
    by using above data i want to get max data

    Hi Hari3109,
    According to your description, you want to get the max date for the employees, right?
    In your scenario, do you want to get the max date for all the employees or for each employee? In MDX, we have the Max function to achieve your requirement. You can refer to Naveen's link or the link below to see the details.
    http://www.sqldbpros.com/2013/08/get-the-max-date-from-a-cube-using-mdx/
    If this is not what you want, please provide us more information about the structure of you cube, so that we can make further analysis.
    Regards,
    Charlie Liao
    TechNet Community Support

  • How to generate a list of  pick dates for all scheduled deliveries?

    Hi!
      How to generate a list of  pick dates for all scheduled deliveries?
      What all the tables involved?
    Thanks
    Imran.

    Thanks for the suggestion concerning the file path.  And certainly it would have been nice to have done this before beginning.  However this is a project that has been around for quite a while, and the files have been moved into different bins.  And now the project sequence is being revised.
    So the problem is, worded slightly differently, how can I search all of the bins for the files that are used just by this sequence, ignoring the files which are used by other sequences?  Or, how can I get a list of the file paths of the files that are used in the sequence?

  • HOW TO MIGRATE DUNNING LEVEL & LAST DUNNED DATE FOR ALL OPEN LINE ITEMS

    Hi,
    We need to upload dunning level & last dunned date for all open items (to be done separately i.e. after all open items migrated) which is different for each and every line item so if we use mass upload (fbl5n) we have to do for each and every open line item which is not feasible as open line items in thousands..I tried LSMW also,problem is that for Batch input recording we need to run one complete cycle in sm30 but there is no maintenance dialog for BSEG & BSID table.. Please share your valuable Inputs how we can go ahead..
    Thanks in advance

    Hi Mark,
    Thanks for your reply.
    It is complete a Zcopy of a standard one, but we are facing one or two records are not updating correctly out of hundreds of customers in the worklist.

  • How to fetch data where reference with two values

    Hello Gurus,
    How to fetch data from database table with two values for reference. like
             SELECT  < FIELDS>
                              FROM <DB>
                              INTO TABLE TAB2
                              FOR ALL ENTRIES IN
                              TAB1
                              WHERE
                               FIELD1 = TAB1-FIELD1 AND
                               FIELD1 =  TAB1-FIELD2.

    Hi,
    If you want to get data for both fields then Instead of AND use OR
            SELECT  < FIELDS> 
                              FROM <DB>
                              INTO TABLE TAB2
                              FOR ALL ENTRIES IN
                              TAB1
                              WHERE
                               FIELD1 = TAB1-FIELD1 OR
                               FIELD1 =  TAB1-FIELD2.
    Or if you want that only common data for both fields should be fetched then create new internal table. Append data of both fields into that table. Sort new table and do delete adjust duplicate. Now use new internal table in your select query.
    Let me know if this helps.
    Regards,
    Jigar Thakkar.

  • How to access data of all users in a page?

    Hi all, I am new to APEX and have a query.
    I have installed APEX on my local machine, created a workspace, and added a few users with roles.
    I am creating an application, similar to a Library app, where I have a table that stores Books information (BOOK_ID, BOOK_NAME, etc). I'd like to create another table BOOK_USER with two columns, BOOK_ID and USER_ID. BOOK_ID would refer to the BOOKS table, and I want USER_ID to refer to the table that stores user details of the workspace that I am using. The data entry would happen from a page that has two LOVs, one for book name (using BOOK_ID as the value) and another for user name (USER_ID, or whatever field APEX uses to store user's ID). Can I do that in APEX? I've found ways to access and authenticate a user for a page, but how to get data of all users in the workspace? In other words, how to get all usernames in a LOV?
    As I am new to APEX, I'd appreciate if someone can guide me through the steps, or post links to tutorial, etc.

    Assuming that you are using the Application Express User Accounts for authentication, in that case you have to use built-in apex views
    selet * from APEX_WORKSPACE_APEX_USERSAnd use USER_NAME column instead of user_id
    See http://docs.oracle.com/cd/E37097_01/doc/doc.42/e35125/priv_public001.htm#HTMDB25949

  • Why files in Lightroom mobile and files in the creative cloud not the same? idea-  one place(stored date) for all application ??????

    Why files in Lightroom mobile and files in the creative cloud not the same? idea- one place(stored date) for all application ??????

    Lightroom Mobile is not a cloud storage service. You shouldn't treat it as a way of backing up your files. You are merely storing Smart Previews of your files in the cloud space, high-quality JPEGs of your files regardless of their original format on your desktop. The point is that they are there so you can continue editing them in a Lightroom-like environment even while away from your desktop/laptop computer. The files in Lightroom Mobile can only be used in Lightroom Mobile.
    This is very different from what is offered by the Creative Cloud storage, which can be used to synchronize your files between any device (that can support the individual files).
    The vast difference in how each service works and its intended use is why they are separate.

  • How to extract data for particular two members of same dimension.

    As per the requirement i need to export data for certain members of a dimension. Lets say we need data for two account members A and B which is in in Account dimension only but is not a direct children. I need the data for all the available years too. Please suggest me how my DATAEXPORT command should look like.
    When i am using an AND statement it is not working accordingly. Say i am fixing for years 2007 and 2009 but the output file is coming for 2009 and 2010.
    Something other is happening when i am fixing OPEX_31 and OPEX_32. The values are coming not only for OPEX_31 and OPEX_32 but for many more accounts too.
    Here is my dataexport statement for your reference
    SET DATAEXPORTOPTIONS
    DataExportLevel "ALL";
    DataExportColFormat ON;
    DataExportDimHeader ON;
    DataExportOverwriteFile ON;
    FIX("LC","Total_Year","ESB1","2009","SIERRA","COSTCENTER_NA","CELLULAR_NA","OPEX_31",
    "January","February","March","April","May","June","July","August","September","October","November","December");
    DATAEXPORT "File" "     " "D:\exports\feb.txt";
    ENDFIX;
    I need data for OPEX_31 and OPEX_32 for all the available years starting from 2001 to 2025.
    Please suggest what are the modification needed to get the desired result.
    Thanks in advance

    Hi,
    There a few different options you can use for fixing on the months, years..
    e.g. FIX(January:December)
    or FIX(@CHILDREN(YearTotal)) < depends what the parent of the months is
    sames goes for years
    FIX(2009:2025)
    or
    FIX(@CHILDREN(Year)
    If your period dimension is dense you can always use that as the column header e.g. DataExportColHeader "Period" and then fix on the accounts you require.
    Cheers
    John
    http://john-goodwin.blogspot.com/

Maybe you are looking for

  • Down Payment Clearing pushbutton in MIRO (SAP ECC6 EP4)

    Dear Experts, As i am trying to do the same process in my organisation to post the DP in PO at header or item level and after that following the ME2DP process for posting DP and then i do MIGO. After GR as i do MIRO process and select the PO there is

  • Help with fuzzy search (doesn't work if change order of certain 2 letters)

    Hi, need some help with fuzzy search. It's pretty simple - we use fuzzy search on varchar2 columns that contain first name and last_name. The problem is that i don't really understand why it can't find name in some cases. Say i want to search for 'Ta

  • How to replace line break for comma

    Hi there, i have a string which is like header1,value1,header2,value2,header3,value3,header4,value4now i have to write the above string to a file which should be like file.txt should be header1,value1 header2,value2 header3,value3 header4,value4i can

  • Tables created using Enterprise Console Manager do not show up in SQLPLUS

    I am struggling with Enterprise console manager and command line SQLPLUS. I have tried scott/tiger , system/manager and the new user that I have created. But I am having the following problems: 1. I cannot connect as NORMAL through Enterprise Console

  • Problem with appletViewer.exe

    After installed JDK1.4.1 on my system (Win2000, SP3), I tried to run a very simple java applet. But I got the exception like the following: F:\javaTest>appletviewer Hello.html Exception in thread "main" java.util.MissingResourceException: Can't find