It's possible to make Hierarchical Tree from multiple tables ?

the famous example for Hierarchical Tree is about employee_id and manager_id field in employees table ............ so I was wondering it's possible to make[b] Hierarchical Tree from multiple tables ? and How ??
if the answer associate with example that will be so kind of you :D
and thanks in advance.

HI
use curose in when new form instance or procedure then u can got data more then one table like that
DECLARE
htree ITEM;
top_node FTREE.NODE;
new_node FTREE.NODE ;
child_node ftree.node ;
item_value VARCHAR2(30);
cursor prime_cur is select main_desc mgr_name, main_code dept
from pur_item_group_mst;
cursor child_cur(v_dept number) is select sub_desc,sub_code
from pur_item_group_dtl where main_code = v_dept ;
BEGIN
htree := Find_Item('tmp.tree4');
for dummy in prime_cur loop
new_node := Ftree.Add_Tree_Node(htree,
ftree.root_node,
Ftree.PARENT_OFFSET,
Ftree.LAST_CHILD,
Ftree.EXPANDED_NODE,
dummy.mgr_name,
'D:\ORYX_POLYBAGS\accept',
dummy.dept);
for child in child_cur(dummy.dept) loop
     child_node := Ftree.Add_Tree_Node(htree,
new_node,
Ftree.PARENT_OFFSET,
Ftree.LAST_CHILD,
Ftree.EXPANDED_NODE,
child.sub_desc||' '||'('||child.sub_code||' '||')',
'D:\ORYX_POLYBAGS\next',
child.sub_code);
end loop;
end loop;
END;
Rizwan Shafiq
www.rizwanshafiq.blogspot.com

Similar Messages

  • ** Is it possible to give select command from multiple tables in JDBC

    Hi Friends,
    Is it possible to give the select command to select data from multiple tables directly in the 'Query SQL statement' in JDBC sender communication channel ? (Instead of Stored Procedure)
    Thanking you.
    Kind Regards,
    Jeg P.

    Hi,
    here is a sample:
    Table #1
    Header
    Name EmpId Status
    Jai 5601 0
    Karthik 5579 0
    Table #2
    Name Contactnumber
    Jai 9894268913
    Jai 04312432431
    Karthik 98984110335
    Karthik 04222643993
    select Header.Name, Header.EmpId, Item.Contactnumber from Header,Item where Header.Name = (select min(Header.Name) from Header where Header.Status = 0) and Header.Name = Item.Name
    Regards Mario

  • Trouble with Frank Nimph Building a hierarchical tree from recursive table

    I copy the example, but when i run it i get the error:
    javax.faces.el.EvaluationException: javax.faces.FacesException: javax.faces.FacesException: Can't instantiate class: 'vuo.view.TreeHandler'.. class vuo.view.TreeHandler : java.lang.ClassCastException: oracle.jbo.domain.Number
    Caused by: java.lang.ClassCastException: oracle.jbo.domain.Number     at vuo.view.TreeHandler.populateTreeNodes(TreeHandler.java:58)
    This is line 58 of TreeHandler.java : employeeNode.setEmployee_id((Number)row.getAttribute("EmployeeId"));
    The problem is that i couldn't import oracle.jbo.domain.Number; like in the files TreeHandler.java and GenericTreeNode.java because when i type import oracle.jbo.domain.Number;on my java classes It doesn't compile, in GenericTreeNode does not recongnize:
    private Number employee_id;
    private Number manager_id;
    private Number salary;
    and in TreeHandler it said Number not found.
    So i comment the import oracle.jbo.domain.Number; on both classes and compile ok, but when i run the page i get the error:
    javax.faces.el.EvaluationException: javax.faces.FacesException: javax.faces.FacesException: Can't instantiate class: 'vuo.view.TreeHandler'.. class vuo.view.TreeHandler : java.lang.ClassCastException: oracle.jbo.domain.Number
    So what can i do?
    Thanks.

    Hi,
    as you copied the code, male sure that your classes import statement has oracle.jbo.Number and not java.lang.Number in it. It seems that you try to cast oracle.jbo.Number to java.lang.Number. Note that oracle.jbo.Number requires the ADF Business Component runtime libraries to be selected for the ViewLayer project (see project libraries)
    Frank

  • Is it possible to create hierarchical tree report (not group tree) CR2008?

    Hi,
    Is it possible to create hierarchical tree kind report using CR 2008(no group tree in the report)?  The report somewhat look like below and a node can have multiple Child and so and so. Is there any magical way either as a chart or any object which supports the below structure.
                                                          Parent1
                                           Child1              Child2             Child3             Child4          Child5
                     Child1A     Child1B      Child1C
        Child1Aa  Child1Ab
    its hierarchical tree  structure and it should be in detail section of the report so that print in paper is possible.
    Please help first of all, can we able to create a report in above structure(each item needs to be surronuded with box and the each last child will contain a table valued data.
    (if I post this thread, it may look like plain text, please consider the above data as a hierarchical tree  structure with child having N number of children)
    Thanks

    Moved from .NET Development - Crystal Reports forum to Crystal Reports Design forum.
    Ludek

  • Can I use Hierarchical Tree from Forms6.0 in Forms5.0

    Hello
    The Oracle Custumer Support tell me that it should be possible to
    use Hierarchical Trees also in Forms5.0
    I look for a possibility to build a Navigator in Forms5.0
    with Symbols. (look and feel like the Navigator in Forms6.0 if I
    use Symbols in the Record Group).
    I Description should be on
    http://developer.us.oracle.com
    but either i have no access to this side or
    the URL is false.
    Sure is that there is a description over this Problem.
    And i have to get this description ;-)))
    Thanks for Help
    JK
    null

    That is not recommended. The new code editing features do not play well with an old workspace.
    Please create a new workspace and import your projects into that.
    -Anirudh

  • It's is possible to make a select from a view?

    I don't know if it's possible to make a select of a table-view like V_T5F99FW if it's possible does anybody tell me how can I do?
    Thanks a lot,
    Regards,
    Rebeca

    Hi Rebeca,
    You can surely do a selection from a projection and database view but not from a maintenance view.
    The selection from a view works like a normal selection only.
    watch this link
    http://sap.ionelburlacu.ro/abap/ABAPperformance.html#Select_with_view
    Regards,
    Manish
    Edited by: MANISH GUPTA on Aug 31, 2008 1:38 PM

  • Is it possible to make a movie from sequence of images in JMF?

    I am in need of make a movie from image sequences created from YCbCr(YUV) values. Is it possible to make a movie from sequence of images in JMF?

    yes, it is.
    at www.java.sun.com in the JMF session there are several examples about your problem!
    cheers
    thomas

  • Is it Possible to make a join from a single table

    Hi all,
    Is it Possible to make a join from a single table
    Suppose HR_ALL_ORGANIZATION_UNITS table
    can we make a join in the following way
    HR_ALL_ORGANIZATION_UNITS.ORGANIZATION_ID =HR_ALL_ORGANIZATION_UNITS.BUSINESS_GROUP_ID
    Thanks in advance

    Hi
    Yes you can join,
    Like below =- it is called self join -
    Slect a.oersson_id,a.employee_numebr, b.full_name
    form
    hr_all_organization_units a,
    hr_all_organization_units b
    where
    a.person_id = b.person_id and
    sysdate between a.effective_start_date and a.effective_end_date and
    sysdate between b.effective_start_date and b.effective_end_date
    914618 wrote:
    Hi all,
    Is it Possible to make a join from a single table
    Suppose HR_ALL_ORGANIZATION_UNITS table
    can we make a join in the following way
    HR_ALL_ORGANIZATION_UNITS.ORGANIZATION_ID =HR_ALL_ORGANIZATION_UNITS.BUSINESS_GROUP_ID
    Thanks in advance

  • ALV for fields from multiple tables and make them editable

    Hi,
    I am working on a forecasting report. We have created few custom table e.g. store forcaset detail for whole year month wise. tables are say sales data, budget data, forcast data etc.
    Now i need to make a report based on monthwise based on above mention table.
    eg.o/p looks like:
    column name                     type desc monthapr monthmay .......
    table forcast                      Qty  sales    100          150
    table budget/sales             amt   amou    20.50    130.50
    table sales vs forcast       amt   amount  3000     50000
    -Now i don't know how to display data from multiple table in single ALV list that to with different field type.
    -2nd issue is i need to make only perticuler row editable so that user can chage data.
    -3rd when user change data and press calulate button - it should calculate data for future month - i got formula for that and disply the calulated data.
    - 4th if user like the forcast data then when press save - change data should update dbtable.
    Is this all possible with simple abap FM Or need to use ABAPOO.
    I will appericiate all expert help.
    Many thanks in advance.
    KDE.
    Edited by: kde_test on Jun 4, 2010 5:44 PM

    Hi,
    Solutions :
    1. You can use  FM REUSE_ALV_HIERSEQ_LIST_DISPLAY as guided by Ashutosh.
    You can also check out this
    [http://www.sap technical.com/Tutorials/ABAP/3DGraph/demo.htm]  change link to saptechnical without space
    2. [How to make certain rows in ALV grid editable...;
    3 & 4. Use two importing paramaters 'PF_STATUS_SET' 'USER_COMMAND' of  REUSE_ALV_GRID_DISPLAY.
    create two function codes 'CALC and 'SAVE' in pf-status and provide your required functionality to these function codes using User-Command.
    Sorry am unable to provide you with supporting code, but you can search for it and It can solve your problem
    Regards,
    Rohit

  • Delete records from multiple table

    Hi,
    I need to delete records from multiple tables using a single delete statement. Is it possible ? If so please let me know the procedure.
    Kindly Help.
    Thanks,
    Alexander.

    Hi Tim,
    Syntax of DELETE statement does not allow for multiple tables to be specified in this way. Infact, none of the DMLs allow you to specify table names like this.
    Technically, there are other ways of deleting from multiple tables with one statement.
    1. "Use a trigger":
    What was probably meant by this is that you have a driving-table on which you create a on-delete trigger. In this trigger, you write the logic for deleting from other tables that you want to delete from.
    This does mean a one-time effort of writing the trigger. But the actual DML operation of deleting from all the tables would be simply triggered by a delete on driving-table.
    2. Dynamic SQL:
    Write a PL/SQL code to open a cursor with table-names from which you want the data to be deleted from. In the cursor-for loop, write a dynamic SQL using the table-name to delete from that table.
    3. Using Foreign-Key constraint with Cascade-Delete:
    This I feel is a more 'cleaner' way of doing this.
    Having to delete data from multiple tables means that there is some kind of parent-child relationship between your tables. These relationships can be implemented in database using foreign-key constraints. While creating foreign-key constraint give the 'on delete cascade' clause to ensure that whenever data is deleted from parent-table, its dependent data is deleted from child-table.
    Using foreign-key constraint you can create a heirarchy of parent-child relationships and still your DELETE would be simple as you would only have to delete from parent-table.
    IMPORTANT: Implementing foreign-key constraints would also impact other DML operations that you should keep in mind.

  • Dbms_xmlgen.newcontext query from multiple tables and ||

    I have two questions
    How do I get a dbms_xmlgen.context to query from multiple tables? I have been able to make it work with using one table only, but not with multiple tables.
    And how to get the || (concat) to work within my query for my output to an xml file?
    Here is my current query:
    create or replace function get_xml return clob is
    result clob;
    qryctx dbms_xmlgen.ctxHandle;
    SELECT DBMS_XMLGEN.getxml('select prefix, suffix, fiscal_yr
    FROM rcv.recv_accessions ra
    where ra.prefix = 8 and ra.fiscal_yr = 11')xml into result FROM dual;
    result := DBMS_XMLGEN.getXML(qryCtx);
    This is what I desire:
    SELECT DBMS_XMLGEN.getxml('select ra.prefix||'-'|| ra.suffix||'-'|| ra.fiscal_yr accession, ss.date_in, st.test
    FROM rcv.recv_accessions ra, ser.sero_samples ss, ser.sero_tests st
    where ra.prefix = 8 and ra.fiscal_yr = 11 and ss.raid = ra.id and st.ssid = ss.id')xml into result FROM dual;
    On this both the reference to multiple tables and the concat function cause errors.
    Thank you
    Edited by: user583094 on Mar 2, 2011 3:36 PM

    Hi,
    for the concat do I use xmlconcat?No, XMLConcat is used to concatenate XMLType fragments.
    The || operator will do fine, but you must escape any single quote inside the string :
    SELECT DBMS_XMLGEN.getxml(
    'SELECT ra.prefix ||''-''|| ra.suffix ||''-''|| ra.fiscal_yr as accession,
            ss.date_in,
            st.test
    FROM rcv.recv_accessions ra,
          ser.sero_samples ss,
          ser.sero_tests st
    WHERE ra.prefix = 8
    AND ra.fiscal_yr = 11
    AND ss.raid = ra.id
    AND st.ssid = ss.id'
    INTO result
    FROM dual;Or, use the quoting operator to define a custom string delimiter :
    SELECT DBMS_XMLGEN.getxml(
    q'{SELECT ra.prefix ||'-'|| ra.suffix ||'-'|| ra.fiscal_yr as accession,
            ss.date_in,
            st.test
    FROM rcv.recv_accessions ra,
          ser.sero_samples ss,
          ser.sero_tests st
    WHERE ra.prefix = 8
    AND ra.fiscal_yr = 11
    AND ss.raid = ra.id
    AND st.ssid = ss.id
    INTO result
    FROM dual;BTW, a good practice would be to use bind variables for the query. DBMS_XMLGEN can handle them nicely :
    CREATE OR REPLACE FUNCTION get_xml
    RETURN CLOB
    IS
    qryctx   DBMS_XMLGEN.ctxHandle;
    v_out    CLOB;
    qrystr   VARCHAR2(4000) :=
    'SELECT ra.prefix ||''-''|| ra.suffix ||''-''|| ra.fiscal_yr as accession,
            ss.date_in,
            st.test
    FROM rcv.recv_accessions ra,
          ser.sero_samples ss,
          ser.sero_tests st
    WHERE ra.prefix = :b_prefix
    AND ra.fiscal_yr = :b_fiscal_yr
    AND ss.raid = ra.id
    AND st.ssid = ss.id';
    BEGIN
    qryctx := DBMS_XMLGEN.newContext(qrystr);
    DBMS_XMLGEN.setBindValue(qryctx, 'b_prefix', '8');
    DBMS_XMLGEN.setBindValue(qryctx, 'b_fiscal_yr', '11');
    -- to generate empty elements if necessary :
    DBMS_XMLGEN.setNullHandling(qryctx, DBMS_XMLGEN.EMPTY_TAG);
    v_out := DBMS_XMLGEN.getXML(qryctx);
    DBMS_XMLGEN.closeContext(qryctx);
    RETURN v_out;
    END;

  • Jdbc getting data from multiple tables

    hi guys
    how can i get data from multiple tables in MSAccess
    please help

    >
    here is code thata i want to do
    i have 3 tables in my MSAccess databace
    Stud_O which consist name,surname fields
    Stud_I consist address,tel
    Stud_E department,faculty fields
    Based on this I would guess that you are missing a key field. There is no way to connect the tables.
    I make the class to insert data to the tables. But
    cant do getting datas from this tables.
    can anybody help me in making query
    and method that displays reultset strings to the
    textBoxes
    A select ...
    select name,surname from Stud_O. Use the executeQuery() method.

  • XDK Export in XML from multiple tables

    Hello everybody,
    I have to export data from an Oracle database to a XML file and then generate the Java classes.
    1)
    I used XSU successfully with one table. My problem is to retrieve data not from a unique table but from multiple tables linked by relations.
    I wanted to do this using XSU to retrieve data from the database and create the corresponding XML schema.
    That seems to be possible but I need help for database relations.
    Can someone help me to explain if it is possible to export from multiple tables (and if yes how)?
    2)
    Having my XML schema then I will have to generate Java objects. How is it possible with the XML Class Generator for Java?
    Does anybody have experience and samples?
    Many Thanks in advance!

    Hi Elodie,
    Please refer the Product Order sample on OTN that describes the usage of XML Class Generator for Java.
    The URL for it is:
    http://otn.oracle.com/tech/xml/xdk_sample/ProductOrdersSample.html
    Hope it helps
    Shefali

  • JDBC outbound reading from multiple tables

    Hi,
    I have a scenario in which I have to read data from multiple tables.
    The keys of these tables (employee details) are dependent on a employee master table.
    Now there is a 1-N relationship between master and the details table. I have to send the data to an IDOC.
    I am stuck since reading from all the tables at the same time is not possible.
    Please suggest some solution.
    Thanks,
    Vaibhav

    Hi Bhavesh,
    Thanks for ur reply. It solved my problem.
    Full points to you...
    Pls help me with one more issue.
    As per the method u told i am reading from multiple tables. Each table has data for multiple employees.
    The response message is of the format
    <STATEMENT_Table1_response>
    <row>
       Data for emp 1
    </row>
    <row>
       Data for emp 1
    </row>
    </STATEMENT_Table1_response>
    <STATEMENT_Table1_response>
    <row>
       Data for emp 2
    </row>
    <row>
       Data for emp 2
    </row>
    </STATEMENT_Table1_response>
    <STATEMENT_Table2_response>
    <row>
       Data for emp 1
    </row>
    <row>
       Data for emp 1
    </row>
    </STATEMENT_Table2_response>
    <STATEMENT_Table2_response>
    <row>
       Data for emp 2
    </row>
    <row>
       Data for emp 2
    </row>
    </STATEMENT_Table2_response>
    I want to collect it to an idoc where i have data of each employee collected together. Like
    <Emp1>
      <Data from Table1>
      <Data from Table2>
    </Emp1>
    <Emp2>
      <Data from Table1>
      <Data from Table2>
    </Emp2>
    I have tried many ways and looks like a custom code in java have to written.
    Is there anything else possible?
    Thanks in Advance,
    Vaibhav

  • Generic datasource by function module to fetch data from multiple tables?

    I'm writing a function module to fetch price, for generic datasource.
    At first, extract test is OK. But InfoPackage never stop  when loading data to PSA in BW.
    And I find the example codes:
         OPEN CURSOR WITH HOLD S_CURSOR FOR
          SELECT (S_S_IF-T_FIELDS) FROM SFLIGHT
                                   WHERE CARRID  IN L_R_CARRID AND
                                         CONNID  IN L_R_CONNID.
        ENDIF.                             "First data package ?
    * Fetch records into interface table.
    *   named E_T_'Name of extract structure'.
        FETCH NEXT CURSOR S_CURSOR
                   APPENDING CORRESPONDING FIELDS
                   OF TABLE E_T_DATA
                   PACKAGE SIZE S_S_IF-MAXSIZE.
        IF SY-SUBRC <> 0.
          CLOSE CURSOR S_CURSOR.
          RAISE NO_MORE_DATA.
        ENDIF.
        S_COUNTER_DATAPAKID = S_COUNTER_DATAPAKID + 1.
      ENDIF.
    There using Cursor to fetch data package by package, and raise exception NO_MORE_DATA to stop the loading process.
    Now I fetch data from multiple tables, I don't think I can use Cursor.
    Then How can I handle this?  
    Thanks a lot.

    Thanks
    IF IT_999[] IS INITIAL.
        SELECT A~KNUMH A~MATNR A~KSCHL VKORG VTWEG A~DATBI A~DATAB KBETR KMEIN KPEIN C~MTART APPENDING CORRESPONDING FIELDS OF
          TABLE TP_DATA
            FROM A999 AS A
              INNER JOIN KONP AS B
                  ON A~KNUMH = B~KNUMH
              INNER JOIN MARA AS C
                 ON A~MATNR = C~MATNR
    *          FOR ALL ENTRIES IN IT_999
                    WHERE
    *      A~KNUMH = IT_999-KNUMH  AND
           ( ( A~KSCHL = 'ZPRC' AND VKORG = 'Z000' AND VTWEG = 'Z1' ) OR
                          ( A~KSCHL = 'ZPRD' AND VKORG = 'A000' AND VTWEG = 'Y3' ) ) AND
    *                      A~DATBI >= SY-DATUM AND
                          LOEVM_KO = ''.
        SELECT A~KNUMH A~MATNR A~KSCHL VKORG VTWEG A~DATBI A~DATAB KBETR AS KHETR  KMEIN KPEIN C~MTART APPENDING CORRESPONDING FIELDS OF
          TABLE TP_DATA
            FROM A999 AS A
              INNER JOIN KONP AS B
                  ON A~KNUMH = B~KNUMH
              INNER JOIN MARA AS C
                 ON A~MATNR = C~MATNR
    *          FOR ALL ENTRIES IN IT_999
                    WHERE
    *      A~KNUMH = IT_999-KNUMH AND
          A~KSCHL = 'ZPR3' AND A~VKORG = 'I000' AND
    *                      DATBI >= SY-DATUM AND
                          LOEVM_KO = ''.
      ENDIF.
      IF IT_997[] IS INITIAL.
        SELECT A~KNUMH A~MATNR A~KSCHL VTWEG A~DATBI A~DATAB KBETR AS KHETR KMEIN KPEIN C~MTART APPENDING CORRESPONDING FIELDS OF
          TABLE TP_DATA
            FROM A997 AS A
              INNER JOIN KONP AS B
                  ON A~KNUMH = B~KNUMH
              INNER JOIN MARA AS C
                 ON A~MATNR = C~MATNR
    *          FOR ALL ENTRIES IN IT_997
                    WHERE
    *      A~KNUMH = IT_997-KNUMH      AND
          A~KSCHL = 'ZPRA' AND VTWEG = 'Y1' AND
    *                      DATBI >= SY-DATUM AND
                      LOEVM_KO = ''.
      ENDIF.
      IF IT_996[] IS INITIAL.
        SELECT A~KNUMH A~MATNR A~KSCHL A~DATBI A~DATAB KBETR AS KHETR KMEIN KPEIN C~MTART APPENDING CORRESPONDING FIELDS OF
           TABLE TP_DATA
             FROM A996 AS A
               INNER JOIN KONP AS B
                   ON A~KNUMH = B~KNUMH
               INNER JOIN MARA AS C
                  ON A~MATNR = C~MATNR
    *          FOR ALL ENTRIES IN IT_996
                    WHERE
    *      A~KNUMH = IT_996-KNUMH AND
          A~KSCHL = 'ZPRB' AND
    *                       DATBI >= SY-DATUM AND
          LOEVM_KO = ''.
      ENDIF.
      SELECT   MATNR     "u7269u6599u53F7u7801
               MEINH     "u4ED3u50A8u5355u4F4Du7684u5907u7528u8BA1u91CFu5355u4F4D
               UMREZ     "u57FAu672Cu8BA1u91CFu5355u4F4Du8F6Cu6362u5206u5B50
               UMREN     "u8F6Cu6362u4E3Au57FAu672Cu8BA1u91CFu5355u4F4Du7684u5206u6BCD
          FROM MARM
          INTO CORRESPONDING FIELDS OF TABLE IT_MARM
           FOR ALL ENTRIES IN TP_DATA
         WHERE MATNR = TP_DATA-MATNR AND  MEINH = TP_DATA-KMEIN.
      LOOP AT TP_DATA.
        IF TP_DATA-KPEIN NE 0.
          TP_DATA-KBETR =  TP_DATA-KBETR / TP_DATA-KPEIN.
          TP_DATA-KHETR =  TP_DATA-KHETR / TP_DATA-KPEIN.
        ENDIF.
        IF TP_DATA-KSCHL = 'ZPRA'.
    *       TP_DATA-MEINH = 'ZI'.
    *      TP_DATA-KSCHL = 'B4'.
          IF TP_DATA-KMEIN = 'ZI'.
            TP_DATA-KBETR = TP_DATA-KHETR / '1.17'.
          ELSE.
            READ TABLE IT_MARM INTO WA_MARM1 WITH KEY MATNR = TP_DATA-MATNR MEINH = TP_DATA-KMEIN.
    *           READ TABLE IT_MARM INTO WA_MARM2 WITH KEY MATNR = TP_DATA-MATNR MEINH = 'CT'.
            TP_DATA-KHETR = TP_DATA-KHETR * WA_MARM1-UMREN / WA_MARM1-UMREZ.
    *           * WA_MARM2-UMREZ / WA_MARM2-UMREN.
            TP_DATA-KBETR = TP_DATA-KHETR / '1.17'.
          ENDIF.
        ELSEIF TP_DATA-KSCHL = 'ZPRB'.
    *      TP_DATA-KSCHL = 'L0'.
    *       TP_DATA-MEINH = 'ZI'.
          IF TP_DATA-KMEIN = 'ZI'.
            TP_DATA-KBETR = TP_DATA-KHETR / '1.17'.
          ELSE.
            READ TABLE IT_MARM INTO WA_MARM1 WITH KEY MATNR = TP_DATA-MATNR MEINH = TP_DATA-KMEIN.
    *           READ TABLE IT_MARM INTO WA_MARM2 WITH KEY MATNR = TP_DATA-MATNR MEINH = 'BAG'.
            TP_DATA-KHETR = TP_DATA-KHETR * WA_MARM1-UMREN / WA_MARM1-UMREZ.
    *           * WA_MARM2-UMREZ / WA_MARM2-UMREN.
            TP_DATA-KBETR = TP_DATA-KHETR / '1.17'.
          ENDIF.
        ELSEIF TP_DATA-KSCHL = 'ZPRC' OR TP_DATA-KSCHL = 'ZPRD'.
    *       TP_DATA-MEINH = 'ZI'.
          IF TP_DATA-KMEIN = 'ZI'.
            TP_DATA-KHETR = TP_DATA-KBETR * '1.17'.
          ELSE.
            READ TABLE IT_MARM INTO WA_MARM1 WITH KEY MATNR = TP_DATA-MATNR MEINH = TP_DATA-KMEIN.
    *           READ TABLE IT_MARM INTO WA_MARM2 WITH KEY MATNR = TP_DATA-MATNR MEINH = 'WZI'.
            TP_DATA-KBETR = TP_DATA-KBETR * WA_MARM1-UMREN / WA_MARM1-UMREZ.
    *           * WA_MARM2-UMREZ / WA_MARM2-UMREN.
            TP_DATA-KHETR = TP_DATA-KBETR * '1.17'.
          ENDIF.
        ELSEIF TP_DATA-KSCHL = 'ZPR3'.
    *      TP_DATA-KSCHL = 'B2'.
          IF TP_DATA-KMEIN = 'ZI'.
            TP_DATA-KBETR = TP_DATA-KHETR / '1.17'.
          ELSE.
            READ TABLE IT_MARM INTO WA_MARM1 WITH KEY MATNR = TP_DATA-MATNR MEINH = TP_DATA-KMEIN.
    *           READ TABLE IT_MARM INTO WA_MARM2 WITH KEY MATNR = TP_DATA-MATNR MEINH = 'BAG'.
            TP_DATA-KHETR = TP_DATA-KHETR * WA_MARM1-UMREN / WA_MARM1-UMREZ.
    *           * WA_MARM2-UMREZ / WA_MARM2-UMREN.
            TP_DATA-KBETR = TP_DATA-KHETR / '1.17'.
          ENDIF.
        ENDIF.
        TP_DATA-MEINH = '01'.
        MODIFY TP_DATA.
    E_T_DATA-MATNR =   TP_DATA-MATNR.
    E_T_DATA-KSCHL =   TP_DATA-KSCHL.
    E_T_DATA-KHETR =   TP_DATA-KHETR.
    E_T_DATA-KBETR =   TP_DATA-KBETR.
    E_T_DATA-KMEIN =   TP_DATA-KMEIN.
    E_T_DATA-DATAB =   TP_DATA-DATAB.
    E_T_DATA-DATBI =   TP_DATA-DATBI.
    APPEND E_T_DATA.
        CLEAR WA_MARM1.
        CLEAR WA_MARM2.
      ENDLOOP.
    Edited by: Shen Peng on Oct 20, 2010 10:09 AM

Maybe you are looking for