Help in ABAP rountine : reading data from masterdata table

Hi,
I would like to have a rountine in my transformation rule (BI 7)
scenario
I have an info object (PROD) that has attributes such as Price which is key figure and prod group char.
I have  KeyFigures  info object REV and QUANTITY and would like to have a rountine that perform the following calculation
REV = Price * QUantity.
I tried using formula when loading transactional data  but I could only find Quantity but not price which made it difficult for me.
Now
I would like to have a routine in REV transformation that reads the Price data from infoobject PROD master data table and multiply it with Quantity.
thanks

hi,
since price is an attribute u cannot use it in calculation straight a way.
if u need to use in formula, make the price as ordinary key figure and do it.
these type of calculation can be done at report level.
Key figure as attribute
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/72f4a790-0201-0010-5b89-a42a32223ffc
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/009819ab-c96e-2910-bbb2-c85f7bdec04a
Ramesh

Similar Messages

  • 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

  • Help me,  How to read data from USB ???

    Help me, How to read data from USB ???

    If its a disk on key or some portable hard drive than once its connected to the usb and recognized by the system you can access it through java like you would access your hard drive.

  • Help with writing and retrieving data from a table field with type "LCHR"

    Hi Experts,
    I need help with writing and reading data from a database table field which has a type of "LCHR". I have given an example of the original code but don't know what to change it to in order to fix it and still read in the original data that's stored in the LCHR field.
    Basically we have two Function modules, one that saves list data to a database table and one that reads in this data. Both Function modules have an identicle table which has an array of fields from type INT4, CHAR, and type P. The INT4 field is the first one.
    Incidentally this worked in the 4.7 non-unicode system but is now dumping in the new ECC6 Unicode system.
    Thanks in advance,
    C
    SAVING THE LIST DATA TO DB
    DATA: L_WA(800).
    LOOP AT T_TAB into L_WA.
    ZDBTAB-DATALEN = STRLEN( L_WA ).
    MOVE: L_WA to ZDBTAB-RAWDATA.
    ZDBTAB-LINENUM = SY-TABIX.
    INSERT ZDBTAB.
    READING THE DATA FROM DB
    DATA: BEGIN OF T_DATA,
                 SEQNR type ZDBTAB-LINENUM,
                 DATA type ZDBTAB-RAWDATA,
               END OF T_TAB.
    Select the data.
    SELECT linenum rawdata from ZDBTAB into table T_DATA
         WHERE repid = w_repname
         AND rundate = w_rundate
         ORDER BY linenum.
    Populate calling Internal Table.
    LOOP AT T-DATA.
    APPEND T_DATA to T_TAB.
    ENDLOOP.

    Hi Anuj,
    The unicode flag is active.
    When I run our report and then to try and save the list data a dump is happening at the following point
    LOOP AT T_TAB into L_WA.
    As I say, T_TAB consists of different fields and field types whereas L_WA is CHAR 800. The dump mentions UC_OBJECTS_NOT_CONVERTIBLE
    When I try to load a saved list the dump is happening at the following point
    APPEND T_DATA-RAWDATA to T_TAB.
    T_DATA-RAWDATA is type LCHR and T_TAB consists of different fields and field types.
    In both examples the dumps mention UC_OBJECTS_NOT_CONVERTIBLE
    Regards
    C

  • Do I have to use lock when I am reading data from a table

    Hi,
    When i am reading data from a table , do I have to set a lock on that table .
    Is it necessary for us to set the lock on a table when I am reading data from the table.
    When I am updating the table , do I have to set a lock on the table ?
    If yes, then what sort of lock-read lock,write lock or shared lock?
    Regards,
    Sushanth H.S.

    check it out,
    Lock objects are use in SAP to avoid the inconsistancy at the time of data is being insert/change into database.
    SAP Provide three type of Lock objects.
    - Read Lock(Shared Locked)
    protects read access to an object. The read lock allows other transactions read access but not write access to
    the locked area of the table
    - Write Lock(exclusive lock)
    protects write access to an object. The write lock allows other transactions neither read nor write access to
    the locked area of the table.
    - Enhanced write lock (exclusive lock without cumulating)
    works like a write lock except that the enhanced write lock also protects from further accesses from the
    same transaction.
    You can create a lock on a object of SAP thorugh transaction SE11 and enter any meaningful name start with EZ Example EZTEST_LOCK.
    Use: you can see in almost all transaction when you are open an object in Change mode SAP could not allow to any other user to open the same object in change mode.
    Example: in HR when we are enter a personal number in master data maintainance screen SAP can't allow to any other user to use same personal number for changes.
    Technicaly:
    When you create a lock object System automatically creat two function module.
    1. ENQUEUE_<Lockobject name>. to insert the object in a queue.
    2. DEQUEUE_<Lockobject name>. To remove the object is being queued through above FM.
    You have to use these function module in your program.
    check this link for example.
    http://help.sap.com/saphelp_nw04s/helpdata/en/cf/21eea5446011d189700000e8322d00/content.htm
    tables:vbak.
    call function 'ENQUEUE_EZLOCK3'
    exporting
    mode_vbak = 'E'
    mandt = sy-mandt
    vbeln = vbak-vbeln
    X_VBELN = ' '
    _SCOPE = '2'
    _WAIT = ' '
    _COLLECT = ' '
    EXCEPTIONS
    FOREIGN_LOCK = 1
    SYSTEM_FAILURE = 2
    OTHERS = 3
    if sy-subrc 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    endif.
    Normally ABAPers will create the Lock objects, because we know when to lock and how to lock and where to lock the Object then after completing our updations we unlock the Objects in the Tables
    http://help.sap.com/saphelp_nw04s/helpdata/en/cf/21eea5446011d189700000e8322d00/content.htm
    purpose: If multiple user try to access a database object, inconsistency may occer. To avoid that inconsistency and to let multiple user give the accessibility of the database objects the locking mechanism is used.
    Steps: first we create a loc object in se11 . Suppose for a table mara. It will create two functional module.:
    1. enque_lockobject
    1. deque_lockobject
    before updating any table first we lock the table by calling enque_lockobject fm and then after updating we release the lock by deque_lockobject.
    Select the radio button "Lock object"..
    Give the name starts with EZ or EY..
    Example: EYTEST
    Press Create button..
    Give the short description..
    Example: Lock object for table ZTABLE..
    In the tables tab..Give the table name..
    Example: ZTABLE
    Save and generate..
    Your lock object is now created..You can see the LOCK MODULES..
    In the menu ..GOTO -> LOCK MODULES..There you can see the ENQUEUE and DEQUEUE function
    Reward if helpful

  • Read data from cluster tables

    Hi,
      I met a problem.
      How to read data from cluster tables using:
      b2-key-pernr = 20.
      b2-key-pabrj = 2006.
      b2-key-pabrp = 09.
      b2-key-cltyp = '1'.
      import saldo from database pcl2(b2) id b2-key.
    the problem is that the sy-subrc is always 4, could anyone help me?
    thank you very much!

    Hi,
    Import and export to database is used in two programs and not in the same program.
    <b>ZPROGRAM1.</b>
    tables : indx.
    Data : SALDO type i,
           indxkey LIKE indx-srtfd VALUE 'ZAB1'.
      indx-aedat = sy-datum.
      indx-usera = sy-uname.
      indx-pgmid = sy-repid.
    EXPORT SALDO TO DATABASE indx(zc) ID indxkey.
    In another program,
    <b>ZPROGRAM2.</b>
    tables : indx.
    Data : SALDO type i,
           indxkey LIKE indx-srtfd VALUE 'ZAB1'.
      indx-aedat = sy-datum.
      indx-usera = sy-uname.
      indx-pgmid = sy-repid.
      IMPORT SALDO FROM DATABASE indx(zc) ID indxkey.
    Best regards,
    Prashant

  • Failed to read data from Lock tables

    Hi,
    When i trying to update data using T_CODE j1i8. I am getting message (Failed to read data from Lock tables ) but where as my database tables are not been locked. can anyone plz help me out.
    Regards,
    Anaveer

    Hi
    Probably some other transation is modifying the Database table you are using & it may have locke the table using FOR UPDATE stmt.
    Using Deque_all FM module you can remove the locks
    Thanks
    Sandeep
    Reward if helpful

  • Read data from VBFA table

    hi gurus;
         I want to read data from VBFA table nd pass its VBELV to VBAK table to get VBAK values, Iam using FM SD_DOCUMENT_FLOW_GET ND RV_ORDER_FLOW_INFORMATION, BUT i am not getting desire result. WHEN iam using FM SD_DOCUMENT_FLOW_GET, it will give result only for last row of data, its not considering body part, so tell me how to used this FM properly.
    data: l_docflow type tdt_docflow.
    data lw_docflow type tds_docflow OCCURS 1 WITH HEADER LINE .
    SELECT VBELN KNUMV BUKRS KUNRG REGIO NETWR FKSTO FKDAT FKART  INTO CORRESPONDING FIELDS OF TABLE T_VBRK
          FROM VBRK WHERE BUKRS IN P_BUKRS AND FKDAT IN P_FKDAT AND VKORG IN P_VKORG AND REGIO = '07'
        ORDER BY VBELN KNUMV.
      SORT T_VBRK BY vbeln.
      LOOP AT T_VBRK.
        IF  T_VBRK-FKART = 'F2' OR T_VBRK-FKART = 'YF2' OR T_VBRK-FKART = 'ZF2' OR
            T_VBRK-FKART = 'ZG2' OR T_VBRK-FKART = 'ZL2' OR T_VBRK-FKART = 'YG2' OR T_VBRK-FKART = 'YL2' .
          IF T_VBRK-FKSTO IS INITIAL.
        CALL FUNCTION 'SD_DOCUMENT_FLOW_GET'
      EXPORTING
        IV_DOCNUM              = T_VBRK-vbelN
      IV_ITEMNUM             =
      IV_ALL_ITEMS           =
      IV_SELF_IF_EMPTY       = ' '
    IMPORTING
       ET_DOCFLOW             = l_docflow
    LOOP AT l_docflow INTO lw_docflow   .
      IF  lw_docflow-vbtyp_V = 'C' OR lw_docflow-vbtyp_V = 'K' OR lw_docflow-vbtyp_V = 'L' OR lw_docflow-vbtyp_V = 'E'.
    T_VBFA-vbelv = lW_docflow-vbelv.
    T_VBFA-VBELN = lW_docflow-VBELN.
    T_VBFA-vbtyp_V = lW_docflow-vbtyp_V.
    APPEND t_vbfa.
    endif.
    endloop.
    ENDIF.
    endloop.
    loop at t_vbfa.
      if t_vbfa-vbtyp_V = 'C' OR t_vbfa-vbtyp_V = 'K' OR t_vbfa-vbtyp_V = 'L' OR t_vbfa-vbtyp_V = 'E' .
    SELECT VBELN BSTNK BSTDK FROM VBAK INTO CORRESPONDING FIELDS OF TABLE T_VBAK FOR ALL ENTRIES IN T_VBFA
              WHERE VBELN = T_VBFA-VBELV .
    endif.
      ENDLOOP.

    Hello
    Use the below function module
    RV_ORDER_FLOW_INFORMATION pass the type as C and pass the number.You will get all the flow.
    SELECT VBELN KNUMV BUKRS KUNRG REGIO NETWR FKSTO FKDAT FKART  INTO CORRESPONDING FIELDS OF TABLE T_VBRK  FROM VBRK WHERE BUKRS IN P_BUKRS AND FKDAT IN P_FKDAT AND VKORG IN P_VKORG AND REGIO = '07'
        ORDER BY VBELN KNUMV.
    SORT T_VBRK BY vbeln.
      LOOP AT T_VBRK.
        IF  T_VBRK-FKART = 'F2' OR T_VBRK-FKART = 'YF2' OR T_VBRK-FKART = 'ZF2' OR
            T_VBRK-FKART = 'ZG2' OR T_VBRK-FKART = 'ZL2' OR T_VBRK-FKART = 'YG2' OR T_VBRK-FKART = 'YL2' .
          IF T_VBRK-FKSTO IS INITIAL.
    i_vbco6-vbeln = t_vbrk-vbeln.
    CALL FUNCTION 'RV_ORDER_FLOW_INFORMATION'
      EXPORTING
      AUFBEREITUNG        = '2'
      BELEGTYP            = ' '
        COMWA               = i_vbco6
      NACHFOLGER          = 'X'
      N_STUFEN            = '50'
      VORGAENGER          = 'X'
      V_STUFEN            = '50'
    IMPORTING
      BELEGTYP_BACK       =
      TABLES
        VBFA_TAB            = t_vbfa
    EXCEPTIONS
       NO_VBFA             = 1
       NO_VBUK_FOUND       = 2
       OTHERS              = 3
    endif.
    ENDIF.
    endloop.
    loop at t_vbfa.
      if t_vbfa-vbtyp_V = 'C' OR t_vbfa-vbtyp_V = 'K' OR t_vbfa-vbtyp_V = 'L' OR t_vbfa-vbtyp_V = 'E' .
    *clear t_vbfa.
    SELECT VBELN BSTNK BSTDK FROM VBAK INTO CORRESPONDING FIELDS OF TABLE T_VBAK FOR ALL ENTRIES IN T_VBFA WHERE VBELN = T_VBFA-VBELV .
    endif.
      ENDLOOP.
    In case of any more help is required do let me know
    Regards,
    Nabheet Madan

  • Reading Data from a Table With an Expert

    Hi all - I'm trying to write an Expert in OWB that would read data from a table and create a new table based on that information. I have the table creation part down, but how can I read data from a table with an Expert? From what I've read, Experts only deal with metadata, and there is no mechanism in Experts to actually read data in the tables. Does OraTcl work in Experts? Has anyone ever came across this problem, and if so, how did you solve it? Thanks in advance for your time! - Don

    Hi Don
    Can also use Java and JDBC from within Tcl, see the routines in this file below, take modify or whatever;
    http://blogs.oracle.com/warehousebuilder/ombora.tcl
    source <dir>\ombora.tcl
    set g_user scott
    set g_upwd zzzzzz
    set g_hostname localhost
    set g_port 1521
    set g_srvname ora111
    oraconnect $g_user $g_upwd $g_hostname:$g_port:$g_srvname
    oraselect "select * from emp" ""
    As well as dumping the results to stdout (you probably want to comment that part out and change any other part you don't like), g_res is a ResultSet object you can use to do whatever.
    Cheers
    David

  • Read data from 2 tables.

    Hello everyone,
    I created a SQL database in phpMyAdmin. It contains 2 tables.
    'Woninginformatie' and 'Makelaars'.
    I use the next SQL query in my PHP file to read from the
    database:
    SELECT DISTINCT * FROM Woninginformatie
    INNER JOIN Makelaars ON Woninginformatie.ID_mk =
    Makelaars.ID_mk
    WHERE Huiscode = $huiscode"
    The query works correct and I get all the fields from both
    tables. Anyway, in Flash I can only read out the information in the
    table 'Woninginformatie'.
    I use these kind of codes to read from the database:
    eigendomssituatie =
    gegevens.childNodes[0].childNodes[24].firstChild.nodeValue;
    How can I also read data from the second table?

    you can't read data from the 2nd table because because you
    have a table issue, php issue or you can read data from the table
    but are having trouble getting those data into flash? are you using
    echo to return data to flash?

  • Reading Data from Internal Table

    Hi,
    Can anyone please tell me how to read data from Internal Tables in the Event Handler without using the Select statement OnInitialization?
    Thanks,
    Gaurav

    Hi Siddhartha,
    Can you tell me the problem in my code. I tried to work on the way you suggested. Though I have not finished with the coding, I just wanted to know whether I am going in the direction or not.
    I have declared the the structure in Type Defination as
    TYPES: BEGIN OF TEST_STRUC,
             BEGDA TYPE BEGDA,
             ENDDA TYPE ENDDA,
           END OF TEST_STRUC.
    TYPES: TEST_TAB_TYPE TYPE TABLE OF TEST_STRUC.
    In the Event Handler, I have added the following code on OnInputProcessing:
    event handler for checking and processing user input and
    for defining navigation
    DATA TEST_INFO LIKE LINE OF TEST_TAB.
    DATA: MYTAB6 TYPE TABLE OF PA0006,
          MYTAB6_WA LIKE LINE OF MYTAB6.
    REFRESH TEST_TAB.
    CLEAR TEST_INFO.
    MYTAB6_WA-BEGDA = REQUEST->GET_FORM_FIELD( STARTDATE ).
    MYTAB6_WA-ENDDA = REQUEST->GET_FORM_FIELD( ENDDATE ).
    IF EVENT->NAME EQ 'button'
       AND EVENT->SERVER_EVENT EQ 'click'.
      LOOP AT MYTAB6 INTO MYTAB6_WA.
        TEST_INFO-BEGDA = MYTAB6_WA-BEGDA.
        TEST_INFO-ENDDA = MYTAB6_WA-ENDDA.
      ENDLOOP.
      APPEND TEST_INFO TO TEST_TAB.
      CLEAR TEST_INFO.
      NAVIGATION->SET_PARAMETER( NAME = 'test_tab'
      VALUE = 'begda' ).
      NAVIGATION->SET_PARAMETER( NAME = 'test_tab'
      VALUE = 'endda' ).
      NAVIGATION->GOTO_PAGE( 'MyBSP2.htm').
    ENDIF.
    P.S. MyBSP2.htm is my next page.
    Thanks,
    Gaurav

  • How to read Data from ZL table

    Can someone give me function module or sample code to read data from ZL table in B2 cluster
    Edited by: Saurabh Desai on Jan 13, 2010 9:13 PM

    You wanted to extract data, ZL table to precise, from B2 cluster, is that right?
    For this the snipped I gave you can be used.
    First you need an inlcude with appropriate declarations
    INCLUDE rpc2b201.       "-> here b2 structure, ZL table are declared
    Now you provide key for the cluster which is what below does
    b2-key-pernr = "ee number
    b2-key-pabrj = "year to extract data for
    b2-key-pabrp = "month to extract data for
    b2-key-cltyp = 1.
    Now all you need is to extract ZL table form B2 cluster
    IMPORT zl   "get ZL table
    FROM DATABASE pcl2(b2)  "from cluster B2
    ID b2-key.    "for this key
    That's it. Now you have correct data in ZL table which you can process further.
    Hope now it is clear.
    Regards
    Marcin

  • Reading data from BSEG table with Non-key fields in where clause

    Hi All,
        I have to read data from BSEG table based on WBS element field (PROJK). As I'm not passing key fields to WHERE clause system couldnt run the select statement. Since BSEG is a cluster table I cant even create secondary index on PROJK field.
       Could you please tell me, how to improve its performance.
    Regards
    Jaker.

    SELECT bukrs
                 belnr
                 gjahr
                 shkzg
                 dmbtr
                 hkont
                 lifnr
                 matnr
                 werks
                 menge
                 meins
                 ebeln
            FROM bseg
            INTO TABLE it_bseg
            PACKAGE SIZE 10
            FOR ALL ENTRIES IN it_final
            WHERE  bukrs EQ it_final-bukrs
               AND belnr EQ it_final-belnr
               AND gjahr EQ it_final-gjahr
               AND buzei EQ it_final-buzei
               AND hkont EQ it_final-hkont
               AND werks IN s_werks.
    By using package and fetch from BSEG table. gathering all other information to a final internal table.This will reduce the hit to database.And also try to put that data in hashed internal table which is it_bseg....then definetly improve the performance.
    <REMOVED BY MODERATOR>
    Dara.
    Edited by: Alvaro Tejada Galindo on Apr 21, 2008 12:47 PM

  • Ugrent help. User exit- Read data from BW BPS layout and write to ODS

    Hi,
    I am new to BW BPS and have a req. where i need to read data from BPS layout (EXCEL) and write it to ODS.
    Is there any function module or user exit which read data from excel layout and upload it to ODS. Or can any one help me out how can i write a code for this.
    It is urgent and i need your help.
    Appreciate any kind of input.
    Thanks
    Mamatha

    Dear Mamatha,
    read following documents. i hope it will work for you.
    [http://www.geocities.com/cynarad/reference_for_bps_programming.pdf]
    [Accessing BW Master Data in BPS Functions using ABAP ( Exit Function )|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/d3dcc423-0b01-0010-4382-aa3e0784b61e]
    Regards,
    Malik
    Give me points if its helpful for you.

  • Help! How to read data from an Excel file?

    Hi,
    I need to read data from an Excel file that may contain more then one table in a sheet. How can I read them?
    I would be eternally grateful to anyone who can give me any information.

    Did you try POI from Apache?
    http://jakarta.apache.org/poi/index.html

Maybe you are looking for

  • Very odd problem with Canon Pixma i4300 (color printing issue)

    My printer prints black text fine, including colorful illustrations. Also eg. test photo like http://printermaster.dk/TEST/Color_Print_Test.pdf are completely fine. BUT - when I print real photography on Glossy photo paper, in approximately 1/3 of th

  • How to get the list of tables having index in particular tablespace

    HI can anyone help me with this i need to display the list of tables that are having indexes in a particular tablespace(let it be A) and the list of tables that are not having indexes in tablespace A. thanks in advance...

  • Jdbc NullPointerException calling pl/sql procedure from java

    Hi. Getting the following exception calling a plsql procedure from jdbc. - Jdbc version is 10.2.0.2, but it also happens running several other variants, including 10.1.0.5.0. - Application is running in Weblogic 8.1.3 (8.1 SP 3). The procedure call i

  • Parked MM invoice creation time?

    Hi, I've been trying to find the parked MM document entry date but can't see it in any standard transactions or in FI tables.. Does anyone know if there is a specific table where the information is contained? Or if this field is maintained at all? -M

  • Parenting geht nicht

    Oh mann... ich versteh es einfach nicht. Ich hab einen camera tracker erfolgreich gemacht. ich kann auch null objekte oder text oder solid hinzufügen und er folgt der bewegung ABER wenn ich andere layer dem null objekt oder text oder solid als child