GETTING DATA FROM ODS BY USING A FUNCTION MODULE..

Hi Frnzs,
Here is my issue..Plz go thru it..
I  have a function module (YFSF_ICR_GET_EXCHG_RATE_ODS).
the function performs the current logic without any changes,
that is reading SPOT rates for actuals (the planning cycle is empty) or S rates
for forecasts based on the planning cycle. Nothing needs to be changed here
concultion : Based on flag I_ICR ni , we have to read new exchange rates ( From ODS)
the fucntion module code is here
FUNCTION yfsf_icr_get_exchg_rate_ods.
""Local interface:
*"  IMPORTING
*"     REFERENCE(I_PLANCYC) TYPE  /BIC/OIYPLANCYC OPTIONAL
*"     REFERENCE(I_SALESORG) TYPE  /BI0/OISALESORG OPTIONAL
*"     REFERENCE(I_IC) TYPE  /BIC/OIYINVCURR
*"     REFERENCE(I_RC) TYPE  /BIC/OIYREPCURR
*"     REFERENCE(I_FISCPER) TYPE  /BI0/OIFISCPER
*"  EXPORTING
*"     REFERENCE(E_EXG) TYPE  /BI0/OIEXCHG_RATE
*"  EXCEPTIONS
*"      NO_RATE_FOUND
  DATA: l_s_exg TYPE /bic/ayfsfexg00,
        l_t_exg TYPE /bic/ayfsfexg00 OCCURS 0,
        l_year TYPE /bi0/oifiscyear.
  IF i_plancyc IS INITIAL.
Actuals
    FREE l_t_exg.
    SELECT *
      INTO CORRESPONDING FIELDS OF TABLE l_t_exg
      FROM /bic/ayfsfexg00
      WHERE fiscper <= i_fiscper
        AND fiscvarnt = 'JJ'
        AND /bic/yrepcurr = i_rc
        AND /bic/yinvcurr = i_ic
        AND /bic/yplancyc = ''
        AND /bic/yexchtype = 'SPOT'
     ORDER BY fiscper DESCENDING.
    IF sy-subrc <> 0.
      RAISE no_rate_found.
    ELSE.
      READ TABLE l_t_exg INTO l_s_exg INDEX 1.
      e_exg = l_s_exg-exchg_rate.
    ENDIF.
  ELSE.
Forecasts
    l_year = i_fiscper+0(4).
    SELECT SINGLE *
      INTO l_s_exg
      FROM /bic/ayfsfexg00
      WHERE fiscvarnt = 'JJ'
        AND fiscyear = l_year
        AND salesorg = i_salesorg
        AND /bic/yrepcurr = i_rc
        AND /bic/yinvcurr = i_ic
       AND /bic/yplancyc = i_plancyc
        AND /bic/yplancyc = ''
        AND /bic/yexchtype = 'S'
        AND exchg_rate GE '0.0000001'.
    IF sy-subrc <> 0.
      RAISE no_rate_found.
    ELSE.
      e_exg = l_s_exg-exchg_rate.
    ENDIF.
  ENDIF.
ENDFUNCTION.
ok
now my requirement is that I need to enhance the Function module for reading exchange rates.
for this i got the following information:
- It requires an additional flag I_ICR for instance that can be empty or 'X'
for instance
   - If the flag is empty, the function performs the current logic without any changes,
that is reading SPOT rates for actuals (the planning cycle is empty) or S rates
for forecasts based on the planning cycle. Nothing needs to be changed here
   - If the flag is 'X', the function reads a new exchange rate type, let's call
it "ICR". As stated in the requirements and functional specs, these exchange rates
are the Reuter rates valid for a complete year. These are fixed rates so no planning
cycle. The users will enter records in the format (year, reporting currency, invoicing
currency, exchange rate). If the input flag I_ICR is X, the function determines
the year based on the input period, then, based on the year it selects on the same
table as for the other exchange rates with a restriction on exchange rate type "ICR",
year, from and to currency and return the exchange rate
Update rules. There are two:
   - To the consolidation ODS. No changes are required there; the function has to
read either S or SPOT rates (I_ICR flag is empty)
   - From the consolidation ODS to the cube. As stated in my previous email, the
from currency is the one available in the data package. The to currency is determined by reading the sales organization master data (reporting currency attribute) based on the inter-company sales organization (also available in the incoming record). It then calls the function module above with the parameter I_ICR set to 'X' so it reads the Reuter rates.
I guess i need to create another function module and can be used.
Observation
ODS table fields.
- FISCPER
- FISCVARNT JJ
- FISCYEAR 2006
- /BIC/YREPCURR EUR
- /BIC/YINVCURR JPY
- SALESORG 0010
- /BIC/YMRC 3090
- /BIC/YPLANCYC
- /BIC/YEXCHTYPE S
- - RECORDMODE
Thanx in advance..

Haii
I have given below the basic functionality..u can go throught the api and start working..
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import java.io.File;
import org.w3c.dom.Document;
public class OrderProcessor {
   public static void main (String args[]) {
      File docFile = new File("orders.xml");
      Document doc = null;     
      try {
         DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
         DocumentBuilder db = dbf.newDocumentBuilder();
         doc = db.parse(docFile);
       Element root = doc.getDocumentElement();
      System.out.println("The root element is " + root.getNodeName());
     NodeList children = root.getChildNodes();
   System.out.println("There are "+children.getLength()
                                  +" nodes in this document.");
      } catch (Exception e) {
         System.out.print("Problem parsing the file.");
}regards
Shanu

Similar Messages

  • How do i get data from a structure using join?

    hi,
    what is the actual use of a structure.?
    my problem is :
    KUAGV is an existing STRUCTURE. it has got one fields each which links to MARA, AND VBKD tables. i want to fetch all related information from KUAGV, mara, vbkd . which is the better way : using joins or views or anything else? how do i
    get data from a structure using join?

    structure temporarily holds  any data passed to it dynamically throughout the runtime but doesnot store it permanently. so
    a structure cannot be included in a join.so instead of incuding structure KUAGV's field in a join 
    search the transparent table in which same field are present and  use it in join.
    A structure if created in DDIC(Data Dictionary) is a global DATA STRUCTURE which is used to group related information, for example you would group all the details of your bank account into a structure BANK_ACCOUNT that contains fields like account_Id, account_holder_name etc.
    If you create a structure in your program then it is local to your program. So you use this structure to create data holders of this DATA TYPE to hold data in your program.
    Edited by: suja thomas on Feb 11, 2008 6:24 AM
    Edited by: suja thomas on Feb 11, 2008 6:31 AM

  • Best way To get data from another application using NDDE lbrary

    My vb.net application gets data from another application using NDDE Library. I got stocks prices (open,high,low,close,volume,change......(about 15 records for each stock)) (about 200 stocks) . I don't know if there is a problem in my code.
    This is my code:
    l : is the list of stocks.
    This Sub connects to server and requests the data :
    Public Shared Sub GetQuotes()
    Try
    client1 = New DdeClient(server, topic)
    client1.Connect()
    For i As Integer = 0 To l.Count - 1
    client1.StartAdvise("QO." & l(i).t & ".TAD$last", 1, True, 60000)
    client1.StartAdvise("QO." & l(i).t & ".TAD$open", 1, True, 60000)
    client1.StartAdvise("QO." & l(i).t & ".TAD$high", 1, True, 60000)
    client1.StartAdvise("QO." & l(i).t & ".TAD$low", 1, True, 60000)
    client1.StartAdvise("QO." & l(i).t & ".TAD$pclose", 1, True, 60000)
    client1.StartAdvise("QO." & l(i).t & ".TAD$volume", 1, True, 60000)
    client1.StartAdvise("QO." & l(i).t & ".TAD$date", 1, True, 60000)
    client1.StartAdvise("QO." & l(i).t & ".TAD$time", 1, True, 60000)
    Next
    Catch ex As Exception
    MsgBox(ex.Message)
    End Try
    End Sub
    and then I get the data from Client_advise sub (called each time a value changed )and fill the list. What I know is that client advise gets only one record for single stock each time is called..
    Example: for stock AAPL. 1st time enters client_Advise I get open price for AAPL, 2nd time I get high price for AAPL,3rd time I get low price..... and I update the value in the List (l)
    This the client_Advise Sub:
    Private Shared Sub client1_Advise(ByVal sender As Object, ByVal e As NDde.Client.DdeAdviseEventArgs) Handles client1.Advise
    For q As Integer = 0 To l.Count - 1
    If l(q).t = w(1) Then
    Dim item() As String = e.Item.Split("$")
    If l(q).Open = "#" Then
    l(q).Open = "0"
    End If
    If l(q).hi = "#" Then
    l(q).hi = "0"
    End If
    If l(q).lo = "#" Then
    l(q).lo = "0"
    End If
    If l(q).Close = "" Or l(q).Close = "#" Then
    l(q).Close = "0"
    End If
    If l(q).pclose = "#" Then
    l(q).pclose = "0"
    End If
    If item(1) = "open" Then
    l(q).Open = Format(Val(e.Text), "0.00")
    ElseIf item(1) = "last" Then
    l(q).Close = Format(Val(e.Text), "0.00")
    ElseIf item(1) = "high" Then
    l(q).hi = Format(Val(e.Text), "0.00")
    ElseIf item(1) = "volume" Then
    l(q).Volume = Val(e.Text)
    ElseIf item(1) = "low" Then
    l(q).lo = Format(Val(e.Text), "0.00")
    ElseIf item(1) = "pclose" Then
    l(q).pclose = Format(Val(e.Text), "0.00")
    If l(q).pclose <> "" And l(q).pclose <> "#" And l(q).Close <> "" And l(q).Close <> "#" Then
    l(q).c = Format(l(q).Close - l(q).pclose, "0.00")
    l(q).cp = Format(((l(q).Close - l(q).pclose) / l(q).pclose) * 100, "0.00")
    End If
    l(q).flag1 = 2
    ElseIf item(1) = "date" Then
    l(q).Date1 = e.Text
    ElseIf item(1) = "time" Then
    l(q).Time = e.Text
    End If
    Exit For
    End If
    Next
    End Sub
    Am I doing something wrong which inreases CPU usage to 80 or 90 % ?
    Thanks in advance.

    Hi MikeHammadi,
    According to your description, you'd like to get data from another app using NDDE library.
    When using the NDDE library, the CPU usage is high. As the NDDE library is third-party library, it is not supported here. I suggest you checking if the problem is caused by the NDDE library.
    If you'd like to get data from another app. I suggest you could save the data in the dataBase, and then read it in another application if necessary.
    If you have any other concern regarding this issue, please feel free to let me know.
    Best regards,
    Youjun Tang
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Read data from ODS table using value mapping

    hi all;
    can anyone help on how to read data from ODS table using value mapping

    Mudit,
    Take a look at this blog,
    <a href="/people/siva.maranani/blog/2005/08/23/lookup146s-in-xi-made-simpler">DB Lookup in Mapping</a>
    Regards,
    Bhavesh

  • How to get data from live site using C# on grid view

    hi, how am I able to get data from a website and display it in a grid view ?
    Can anyone show me how I would do this? Thanks

    Hello,
    This post does not fit to this forum, read the
    stickies.
    Regards, Eyal Shilony

  • Getting Data From MySQL Database using Dreamweaver CS4 Built In Functions

    Hi,
    I am really in need of some help if you don't mind.
    I basically have a website with user regsitration system etc and so on.
    I basically connected to my Data Base in Dreamweaver CS4 and now want to use the tools in Dremweaver CS4 to display Data from database.
    Problem is i see the tools but not really sure how i use them. I see on Data bar all the tools to view, update delete records etc.
    I basically created a page where i want to display all the records in the DB. I done this using dynamic data selecting what fields to display etc and 15 records per page.
    When i view the page in localhost thou it is only showing 1 record althou i have like 5 users in my test db.
    So if anyone can really tell me how i go about displaying data from db that be great. When i learn how to do that i probably will understand and learn how to update records etc.
    Thanks

    To display all records, you need to apply a repeat region to the paragraph, div, or table row that contains the dynamic text objects for the database results. You might also find it helpful to follow the dynamic application tutorial in the Adobe Developer Connection.

  • Not able to get data from ce_reconciled _transactions_v in a function after intialising the view

    Hi all ,
    I have written a function  to  get the gl_date from ce_reconcilied transactions_v . but when i call th function in a select query , it is not returning any data.
    I have used the following intialization in the function
    Mo_Global.set_policy_context('S',p_org_id);
    cep_standard.init_security;
    But when i use anonymous block to get gl_date printed it is fetching data from the view.
    Below is the  code for Function
    CREATE OR REPLACE Function l3get_gl_date(p_org_id NUMBER,p_statement_line_id NUMBER)
    RETURN DATE
    AS
    v_gl_date DATE;
    ct NUMBER;
    BEGIN
    Mo_Global.set_policy_context('S',p_org_id);
    cep_standard.init_security;
    SELECT count(*) into ct from ce_reconciled_transactions_v where org_id=p_org_id ;
    dbms_output.put_line('count:' ||ct || 'org ' ||p_org_id || ' line ' ||p_statement_line_id);
    SELECT  gl_date INTO v_gl_date
      FROM ce_reconciled_transactions_v where statement_line_id=p_statement_line_id;
      RETURN v_gl_date;
    EXCEPTION
    WHEN OTHERS
    THEN
    dbms_output.put_line('unable to get GL_DATE' ||SQLERRM);
    RETURN NULL;
    END;
    below is tha anonymous block
    declare
    p_org_id NUMBER;
    p_statement_line_id NUMBER;
    ct NUMBER;
    v_gl_date DATE;
    BEGIN
    select org_id into p_org_id from ce_bank_acct_uses_all where bank_account_id=10911;
    select statement_line_id  into p_statement_line_id from ce_statement_lines where statement_header_id=41130 and line_number=4;
    Mo_Global.set_policy_context('S',p_org_id);
    cep_standard.init_security;
    SELECT count(*) into ct from ce_reconciled_transactions_v where org_id=p_org_id ;
    dbms_output.put_line('count:  ' ||ct || 'org  ' ||p_org_id || ' line  ' ||p_statement_line_id);
    SELECT  gl_date INTO v_gl_date
      FROM ce_reconciled_transactions_v where statement_line_id=p_statement_line_id;
    dbms_output.put_line('GL Date:   ' || v_gl_date);
    EXCEPTION
    WHEN OTHERS
    THEN
    dbms_output.put_line(SQLERRM);
    END;
    please suggest .

    Hi,
    Try adding the following code so we can verify the org is set in your function:
    Add to the definition:
    v_org_id number;
    Add after setting the policy:
    select MO_GLOBAL.get_current_org_id()
    into v_org_id from dual;
    FND_FILE.PUT_LINE(FND_FILE.LOG,'Current MO Org_id='||v_org_id);
    This will verify that the org_id was set.
    Are you getting any errors, or simply no data found.
    Cheryl

  • Getting data from a photodetector using LABVIEW

    I have an infra red interferometer and I am using an IR photodiode in my setup. I have a connector box and a DAQ card ( model number NI-PCI-MIO-16E1). How can i use labview to get intensity data versus time ?   

    Unlike Paul wrote, I would suggest to use RSE instead of Differential, as the photodiode is not grounded. Otherwise you will pick up massive (sometimes above input limits) power line signal.
    Felix 
    www.aescusoft.de
    My latest community nugget on producer/consumer design
    My current blog: A journey through uml

  • How to make this function module as RFC to get data from different system?

    Hi
    I am trying to use following function module . This function module is used to copy data from one cube to another cube within same system however I need a this should happen across two different system. How can I use this function module to make it remote call to different system and do the same function what it is doing ?
    Name of function module -
    RSDRT_INFOCUBE_DATA_COPY
    Any help would be really helpful
    AG

    HI,
      let us say you want to copy the data of a cube in system A to a cube in system B .
      1) create a RFC function module in system B (in this function module  call the function module RSDRI_CUBE_WRITE_PACKAGE to update the data), this RFC function module should have same parametersa as RSDRI_CUBE_WRITE_PACKAGE .
    2) write a program in system A .. read the data from the infocube using the function module RSDRI_INFOPROV_READ and call the RFC function module in system B that you have created..
    for the details of the parameters to pass to these two function modules use the RSDRT_INFOCUBE_DATA_COPY and get the required code
    Thanks
    mahesh

  • Characterestics is not getting displayed from ODS in Multiprovider

    I have Join ODS and remote cube in Multiprovider.And data is not getting displayed from ODS fields neither char not KF getting displyed in Multiprovider.I have checked the identification in Char that Char is presend in both the Cube and ODS,But that Char has data in ODS and not in Cube so I checked Char from ODS in Identification.I am still not getting data from ODS.
    Can anyone help me in it?

    How many requests do u have in the ODS?
    If u have only 1 then just right click on DSO and say delete data it will be faster than deleting by request wise....
    What is the message u r getting when u r trying to delete the request?
    Khaja

  • JSON - get data from Oracle table

    Hi all,
    I hope it is correct thread...
    My need is to get data from oracle table using JSON and show output at html table. I'm very new to JSON (got some experience in PL/SQL and basic html knowledge). Could someone direct me to manual or give me simple example?

    JSON is a way to format data, not a way to fetch data. Call it an alternative to XML.
    Are you perhaps talking about doing an ajax request to fetch data?

  • How to ensure data from ods to cube are correct or not

    hi all,
    i am just trying to get data from ods to cube. how to make ensure that the records that i fetched from ods to the respective cube are correct and number of records are the same.
    thanxs in advance
    regds
    hari

    Dear Hari,
    There are two ways of confirming correct loads:
    1. Level by Level Analysis
    2. Comparision with Virtual InfoProvider
    First method is by analysing data at each level. First at Database Table (if loading from R/3) or Excel (if loading from flatfile), then at extraction level (See data at RSA 3, not possible with flatfile). After this load data to BW through PSA and check the content of PSA. After that load it to Infoprovider and varify there.
    Second method is to create a Virtual Infocube on the datasource (extract exact data through FM). And create a multiprovider by combining this Virtual cube and original Cube. Then create a Query with calculated key figures as difference of each key figures from two cubes. This way you can say that which value is not matching.
    I suggest you the first method, but the standard way would be second one at highly critical loads where you cannot match huge ammount of data.
    Hope it helps...
    Regards,

  • Extracting Text Field using a function module

    Hi Experts,
          We are trying to extract a test field from the R3 using a Function Module.
                  The Text from R3 Looks like this
                 Input Parameters
                  ID -1
                  SEQ 2
    It displays
              Column 1 Column2
               This is test
               strategy for Function
               Module xxxx
    So we put in some parameters to get this test field displayed. As you see the above is just one field but they are in different lines
            So what happens when we put in the database is it adds a new field
    Eg
    ID SEQ Column 1 Column2
    1   2        *            This is test
    1   2        *            strategy for Function
    1   2        *            Module xxxx
    The result that we need is
    D SEQ Column 1 Column2
    1   2        *            This is test strategy for Function Module xxxx
    How can we handle this in the Query Transform
    Your help in advance is appreciated.
    Thanks
    Edited by: alangilbi on Nov 17, 2010 3:49 AM

    Have you considered using a pivot transform to get your rows into columns and then a query transform to concatenate the columns together?

  • Help needed with variable - trying to get data from Oracle using linked svr

    Sorry if I posted this in the wrong forum - I just didn't know where to post it.
    I'm trying to write a simple stored procedure to get data from an oracle database via a linked server in SQL Enterprise manager. I have no idea how to pass a variable to oracle.
    Here's how I would get the variable in SQL:
    declare @maxkey INTEGER
    select @maxkey= MAX(keyfield) from [server].Data_Warehouse.dbo.mytable
    select * from [server].Data_Warehouse.dbo.mydetailtable where keyfield=@maxkey
    the select statement I need to do in oracle would use that variable like this:
    select * from OPENQUERY(OracleLinkedServer,'select
    * from ORACLEDB.TABLE where keyfield > @maxkey')
    and I get this message: OLE DB provider "OraOLEDB.Oracle" for linked server "OracleLinkedServer" returned message "ORA-00936: missing expression".
    I realize that I can't pass the @maxkey variable to oracle - so how do I accomplish this?

    Please refer the example in this link which deals with Oracle date format.
    You can finnd a command DECODE which is used for date formats. If you have a look at whole theory then you will get an idea.
    Link:[Bulk insert SQL command to transfer data from SAP to Oracle|http://sap.ittoolbox.com/groups/technical-functional/sap-dev/bulk-insert-sql-command-to-transfer-data-from-sap-to-oracle-cl_sql_connection-3780804]

  • How to get data from Oracle using Native SQL in SAP.. Problem with date

    Hi Masters.
    I'm trying to get data from an Oracle DB. I was able to connect to Oracle using tcode DBCO. The connetion works fine
    I wrote this code and it works fine without the statement of where date > '01-09-2010'
    But i need that statement on the select. I read a lot about this issue, but no answer.
    My code is (this code is in SAP ECC 6.0)
    DATA: BEGIN OF datos OCCURS 0,
          id_numeric(10),
          component_name(40),
          comuna(10),
          record_id(10),
          status,
          sampled_date(10),
          END OF datos.
    DATA: c TYPE cursor.
    EXEC SQL.
      connect to 'LIM' as 'MYDB'
    ENDEXEC.
    EXEC SQL.
      SET CONNECTION 'MYDB'
    ENDEXEC.
    EXEC SQL PERFORMING loop_output.
      SELECT ID_NUMERIC, COMPONENT_NAME, COMUNA, RECORD_ID, STATUS, SAMPLED_DATE
      into :datos from lims.SAMP_TEST_RESULT
      where     date > '01-09-2010'
    ENDEXEC.
    EXEC SQL.
      disconnect 'MYDB'
    ENDEXEC.
    How can i get the data from that date?? If i delete the where statemet, the program works well, it takes 30 mins and show all the data, I just need the data from that date.
    Any help
    Regards

    Please refer the example in this link which deals with Oracle date format.
    You can finnd a command DECODE which is used for date formats. If you have a look at whole theory then you will get an idea.
    Link:[Bulk insert SQL command to transfer data from SAP to Oracle|http://sap.ittoolbox.com/groups/technical-functional/sap-dev/bulk-insert-sql-command-to-transfer-data-from-sap-to-oracle-cl_sql_connection-3780804]

Maybe you are looking for

  • Inspection Lot not coming in QA16

    Dear Masters, I am using inspection lot origin 04.Inspection is carried out by uaing a task list.As soon as the production confirmation is done , inspection lot is cretaed and  it is seen in QA32.But the same lot is not coming in QA16 , Why?Please su

  • InDesign Workflow with spot colors only

    Please can someone explain me why InDesign treats working with four spot colors differently than working with CMYK? They are just four colors or channels, right? What is the difference between Cyan or PANTONE Reflex Blue? It is true that 99% of the t

  • Using SVN under OS X.5 Leopard Server

    Hi there! We run a Mac Pro with OS X Server Leopard 10.5.1 for collaboration services. We also need to use SVN for other matters. As this service is not directly accessible from Server Admin, but is always running because it's used as a backend for W

  • B/up via iTunes goes to computer even thought I tick icloud. How can i get a b/up to icloud (on iPhone needs a wif-fi connection)

    When I b/up via iTunes the b/up automatically goes to my computer. However, it would be more sensible to b/up to icloud so even if my computer crashes i can still retrieve the iPhone b/up. Ticking the icloud option makes no difference. I can't do it

  • Do i need bridge cc to upgrade camera raw?

    Hi i bought a laptop with w8.1 64bit i installed photoshop cc , 64bit only i updated to 14.2 i guess it's the last version but when i open a raw file like 5d mark3 , i don't see camera raw 8.3 to update camera raw with all the lens profiles and camer