Extracting data from multiple tables based on somelogic on each tables

Hai
I need to extract data from some base tables.
1) first i need extract COMPANYCODE, PROFIT CENTER , PRODUCT from ZRLR custom Rl3-table.
2) Then i need extract MATERIALS based on above selected COMPANY CODE , PROFIT CENTER , PRODUCT from MKAL , CRHD Base R/3-Tables.
3) Then i need to extract the MATERIALS based on the above PROFIT CENTERS from MARC table with filters Material Type = 2P , 3P, 2N, 3N , 2S.
How i extract like this data . Please let me know
kumar

Hi,
you need to create a generic extractor using a function module for this. For some help check this: /people/siegfried.szameitat/blog/2005/09/29/generic-extraction-via-function-module
Additionally you can get a template from me. You'll find my email in my business card.
regards
Siggi

Similar Messages

  • How to extract data from multiple flat files to load into corresponding tables in SQL Server 2008 R2 ?

    Hi,
              I have to implement the following scenario in SSIS but don't know how to do since I never worked with SSIS before. Please help me.
              I have 20 different text files in a single folder and 20 different tables corresponding to each text file in SQL Server 2008 R2 Database. I need to extract the data from each text file and
    load the data into corresponding table in Sql Server Database. Please guide me in how many ways I can do this and which is the best way to implement this job.  Actually I have to automate this job. Few files are in same format(with same column names
    and datatypes) where others are not.
    1. Do I need to create 20 different projects ?
                   or
        Can I implement this in only one project by having 20 packages?
                 or
        Can I do this in one project with only one package?
    Thanks in advance.

    As I said I don't know how to use object data type, I just given a shot as below. I know the following code has errors can you please correct it for me.
    Public
    Sub Main()
    ' Add your code here 
    Dim f1
    As FileStream
    Dim s1
    As StreamReader
    Dim date1
    As
    Object
    Dim rline
    As
    String
    Dim Filelist(1)
    As
    String
    Dim FileName
    As
    String
    Dim i
    As
    Integer
    i = 1
    date1 =
    Filelist(0) =
    "XYZ"
    Filelist(1) =
    "123"
    For
    Each FileName
    In Filelist
    f1 = File.OpenRead(FileName)
    s1 = File.OpenText(FileName)
    rline = s1.ReadLine
    While
    Not rline
    Is
    Nothing
    If Left(rline, 4) =
    "DATE"
    Then
    date1 (i)= Mid(rline, 7, 8)
     i = i + 1
    Exit
    While
    End
    If
    rline = s1.ReadLine
    End
    While
    Next
    Dts.Variables(
    "date").Value = date1(1)
    Dts.Variables(
    "date1").Value = date1(2)
    Dts.TaskResult = ScriptResults.Success
    End
    Sub

  • How to extract data from multiple tables (always got errors)

    Dear Experts,
    I have a simple mapping to extract data from multiple tables as a source (A, B, C) to a target table (X). Below is the picture:
    (Sources)....(Target)
    A----------------***
    B----------------X
    C----------------***
    Sample Source Data:
    Table A:
    ColA1
    100
    200
    etc
    Table B:
    ColB1 ColB2 ColB3
    10 Y Ten
    20 Y Twenty
    30 Y Thirty
    etc
    Table C:
    ColC1 ColC2
    11
    12
    13
    etc
    Target table (X) should be (just has 1 group INGRP1):
    ColA1 ColB1 ColB3 ColC1
    100 10 Ten 11
    100 10 Ten 12
    100 20 Twenty 21
    etc
    Scenarios:
    1. Directly map from A, B, C to X. Unable to map with error message: "API8003: Connection target attribute group is already connected to an incompatible data source. Use a Joiner or Set operator to join the upstream data first before connecting it into this operator."
    2. Map each source to Expression Operator and then map from each Expression to target table. I am able to map all attributes successfully but got error when validating it with message: "VLD-1104: Attributes flowing into TEST.EXPR_SRC.INGRP1 have different data sources."
    How can I achieve the correct mapping for this purpose?
    Use Joiner? I have no key to join the sources
    Use Set? The sources have different number of columns
    Thanks in advance
    Prat

    Thanks Nico,
    I think it will results data like this:
    100 10 Ten 11
    200 20 Twenty 12
    300 30 Thirty 13
    etc
    and not the expected:
    100 10 Ten 11
    100 10 Ten 12
    100 20 Twenty 21
    etc
    But it inspired me to solve this by adding key expression in each source table (B & C) to be joined to table A with this formula:
    100+TRUNC(INGRP1.COLB1,-2)
    Regards
    Prat

  • JDBC-XI-FILE scenario. How to extract data from multiple tables

    Hi,
    At this moment I didn't have the access for XI system. So here I have some silly question. Could you please clarify the same ??
    If I got to extract data from single table using JDBC adapter I can put the below query in communication channel
    SELECT *FROM orders WHERE new='true'.
    But if I got to extract data from multiple tables, logic to be used should be like as shown below. ( from previous thread------prabhu).
    SELECT <Table_2>.EID, <Table_2>.FName, <Table_2>.LName, <Table_1>.REC_DAT, <Table_1>.DESCRP
    FROM <Table_1> INNER JOIN <Table_2> on
    <Table_1>.CARDNO = <Table_2>.CARD
    where REC_DAT = <condition>
    union
    SELECT <Table_2>.EID, <Table_2>.FName, <Table_2>.LName, <Table_1>.REC_DAT, <Table_1>.DESCRP
    FROM <Table_1> INNER JOIN <Table_2> on
    <Table_1>.CARDNO = <Table_2>.CARD
    where REC_DAT = <condition>
    But my query is ........how to put the above entire code in one line. (i.e in Qery place of communication channel ) ??
    Thanks
    Kumar

    Hi Palnati,
        You either use a select query with join or a stored procedure which will contain the logic to extract the data from multiple tables. But, the limitation in case of stored procedure is u can hv only one selct query in it.
    You write ur actual query provided in the parameter 'Query SQL Statement". u can also wrt a stored procedure in it. Also, u can provide a update statement in it which will update a certain flag so tht u don selct the data again.
    Check the following link
    <a href="http://help.sap.com/saphelp_nw04/helpdata/en/14/80243b4a66ae0ce10000000a11402f/frameset.htm">http://help.sap.com/saphelp_nw04/helpdata/en/14/80243b4a66ae0ce10000000a11402f/frameset.htm</a>
    Regards,
    Akshay
    Message was edited by:
            Akshay Salunke

  • Does ODI has ability to extract data from multiple tables

    We have requirement using ODI to extract data from multiple tables depending on certain logic and spool 100+ files.
    How efficient ODI is in data extraction from several multiple tables especially when the extraction is dependent on certain business logic conditions ? Also, if anyone used Peoplesoft Application Engine process to extract volumes of data, how efficient Peoplesoft Applicaiton Engine process is as compared to ODI ? I will really appreciate if someone throws some light on this ? Thanks in advance.
    Ram

    One more option
    Create two Integration Interfaces and launch them sequentially:
    1st Interface : select a IKM ... Append and activate the Distinct rows check box.
    2nd Interface : select an IKM ... Incremental Update and set the UPDATE option to No.
    Be aware that the update key in this Integration Interface should be composed of all the target columns mapped. Also activate the Distinct rows check box.
    Thanks,
    Sutirtha
    Edited by: Sutirtha Roy on Jul 21, 2009 10:08 AM

  • Extracting data from multiple tables using DB connect

    Hi,
       I am having different tables which are  having the same structure in oracle database but  there names are different.Now i have only one datasource at BI side.This datasource shld extract data from the  tables dynamically.How can i do it using DB Connect .
    Thnxs

    ahh I see - problem as you said then is if you then take on a new location!
    I would then put into the source system a table identifier and create a view across all the tables
    Then dbconnect from the view and use the selection parameter of table parameter if you wanted one infopackage per "location"
    If you do need to have a new table in the source then just expand the view and create a new ipak
    hence NO bw changes required that need a dev-q-p transport - just the ipak in prod and it;s the source systems problem to add the extra table to the view

  • How to extract data from the fields present in two or three tables

    Hi Experts,
          I have a scenario where i have to extract data from the fields of different tables. e.g. let there 2 tables which have some number of fields . I want the data of 3 fields each from these 2 tables. How can i get that??
    Sam

    Hi
    You can create view in tcode se11..
    here you include all tables from which you want to fetch the data..
    you need to give selection condition here
    eg..
    say select empname from table A, select empadd from table B.. where empno(from A)=empno(from B)
    (note that you dont need to write queries like this.. i have just given u the example)
    After creating the view you can create datasource in RSO2..
    Regards
    Swati

  • Extracting data FROM SAP BW/BI TO SAP R/3 Tables

    Dear Experts,
            I would like to know How to get the data from SAP BI/BW which we extracted earlier to SAP R/3 Tables.
    in specific I want to get the data from BW/BI to R/3 Tables again.
    for Ex: I have loaded data to ZFC_C25 Cube from SAP R/3 System. But now I want to load the data from ZFC_C25 Cube to my selected R/3 Tables.
    Please give a clue if it is possible or not if YES How.
    Thanks & Regards,
    Sai.

    Hi
    Check this Retraction document
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/1910ab90-0201-0010-eea3-c4ac84080806
    You can find more details regarding R/3 retractors :
    https://websmp101.sap-ag.de/~form/sapnet?_FRAME=CONTAINER&_OBJECT=011000358700003587872003E
    regards
    Chandra SekharT

  • Extracting data from multiple datasources through DAC

    We have to extract data from two Oracle datasources (GL datasource 1 and GL datasource 2) by DAC client to one Datawarehouse. We have configured DAC for one datasource and it is working fine. How can we add another datasource into the same DAC client.
    Neeraj

    You will need to update the Source DB connections in both the DAC and Informatica Workflow before you want to load the DW with the other GL Database. You will contnuously have to switch these configuration settings or stand up another DAC Server, Repository and Client that point to the same Datawarehouse.

  • Extracting data from multiple tables, avoiding duplicates.

    Hi
    I currently have two tables called Book and JournalPaper, both of which have a column called Publisher. Currently the data in the Publisher column is the Publisher name that is entered straight into either table and has been duplicated in many cases. To tidy this up I have created a new table called Publisher where each entry will have a unique ID.
    I now want to remove the Publisher columns from Book and JournalPaper, replace it with an ID foreign key column and move the Publisher name data into the Publisher table. Is there a way I can do this without duplicating the data as some publishers appear several times on both tables?
    Any help with this will be greatly appreciated as my limited SQL is not up to this particular challenge!!!
    Jude

    Jude,
    SQL> create table book as
      2  select 1 id, 'Book 1' name, 'A' publisher from dual union all
      3  select 2 id, 'Book 2' name, 'B' publisher from dual union all
      4  select 3 id, 'Book 3' name, 'A' publisher from dual union all
      5  select 4 id, 'Book 4' name, 'B' publisher from dual
      6  /
    Tabel is aangemaakt.
    SQL> create table journalpaper as
      2  select 1 id, 'Journal Paper 1' name, 'A' publisher from dual union all
      3  select 2 id, 'Journal Paper 2' name, 'B' publisher from dual union all
      4  select 3 id, 'Journal Paper 3' name, 'C' publisher from dual union all
      5  select 4 id, 'Journal Paper 4' name, 'C' publisher from dual
      6  /
    Tabel is aangemaakt.
    SQL> select * from book
      2  /
       ID NAME   PUBLISHER
        1 Book 1 A
        2 Book 2 B
        3 Book 3 A
        4 Book 4 B
    SQL> select * from journalpaper
      2  /
       ID NAME            PUBLISHER
        1 Journal Paper 1 A
        2 Journal Paper 2 B
        3 Journal Paper 3 C
        4 Journal Paper 4 C
    SQL> create sequence publisher_seq start with 1 increment by 1
      2  /
    Reeks is aangemaakt.
    SQL> create table publisher
      2  ( id   number
      3  , name varchar2(50)
      4  )
      5  /
    Tabel is aangemaakt.
    SQL> insert into publisher
      2  select publisher_seq.nextval, publisher
      3    from ( select publisher from book
      4           union
      5           select publisher from journalpaper
      6         )
      7  /
    3 rijen zijn aangemaakt.
    SQL> alter table publisher add constraint publisher_pk primary key (id)
      2  /
    Tabel is gewijzigd.
    SQL> alter table book add (publisher_id number)
      2  /
    Tabel is gewijzigd.
    SQL> alter table book add constraint book_publisher_fk
      2  foreign key (publisher_id) references publisher(id)
      3  /
    Tabel is gewijzigd.
    SQL> alter table journalpaper add (publisher_id number)
      2  /
    Tabel is gewijzigd.
    SQL> alter table journalpaper add constraint journalpaper_publisher_fk
      2  foreign key (publisher_id) references publisher(id)
      3  /
    Tabel is gewijzigd.
    SQL> update book b
      2     set b.publisher_id = (select p.id from publisher p where p.name = b.publisher)
      3  /
    4 rijen zijn bijgewerkt.
    SQL> update journalpaper j
      2     set j.publisher_id = (select p.id from publisher p where p.name = j.publisher)
      3  /
    4 rijen zijn bijgewerkt.
    SQL> alter table book drop column publisher
      2  /
    Tabel is gewijzigd.
    SQL> alter table journalpaper drop column publisher
      2  /
    Tabel is gewijzigd.
    SQL> select * from publisher
      2  /
       ID NAME
        1 A
        2 B
        3 C
    SQL> select * from book
      2  /
       ID NAME   PUBLISHER_ID
        1 Book 1            1
        2 Book 2            2
        3 Book 3            1
        4 Book 4            2
    SQL> select * from journalpaper
      2  /
       ID NAME            PUBLISHER_ID
        1 Journal Paper 1            1
        2 Journal Paper 2            2
        3 Journal Paper 3            3
        4 Journal Paper 4            3Regards,
    Rob.

  • Pulling/Extracting Data from Multiple SAP Systems - Scripting, ABAP?

    Hello All,
    I am working as an analyst for a large company that has multiple SAP installations across the world.  What I am trying to do is create some global reporting metrics based on data from all of those systems on an ad-hoc basis without having the other units send the data to a central repository.  I can receive access to all of the systems but I am unsure how to pull the data. The access to one of the systems I have currently does not allow the use of ABAP or RFC but does allow scripting.  If I have a good business case I could ask for ABAP access and RFC as well.
    I have researched and read through many posts and articles within the forums but I am yet to find a solution.  I have experience in VB, VBA, and MS Access.
    Can anyone suggest any ways to move forward? 
    Thanks!

    According to my understanding, you may use vba in your excel or a just vb by programming against rfcsdk(librfc32.dll) or the newly nwrfcsdk, or use jco or nco..., but all these method are based on rfc function call.
    You may write a simple abap side data extraction agent, just a function select some table with the data you interest, and then call this function from outside regularly, then you may save the returned table to a csv then bcp to sqlserver(c + batch), or just write to excel sheets(vba).
    The simple table read function you may check RFC_READ_TABLE, but it has some limits and are not released. The more functional agent is also can be found from other vendors, eg ms sqlserver2005 kit`s sap adapter...
    I do not have idoc or services experience, maybe in that senerio you will find a easier solution.Good luck, you may reach me at <b><REMOVED BY MODERATOR></b>
    Message was edited by:
            Alvaro Tejada Galindo

  • Extract data from Flat file CSV to SQL Server 2008 using SSIS 2008 (Data gets corrupted when extraction)

    Hi,
    I am trying to extract data from multiple CSV files to SQL into a single table. The data type of all the columns in SQL table is nvarchar(MAX).  I am able to extract the data from the flat files but some of the data(on extraction) is
    corrupt including question marks(?) and other invalid special characters. Also I tried selecting the UTF-8, 65001(Unicode) format but the problem still persists. Also I tried using data converter but no use.
    I checked with the data in the flat file but there is no data with question mark(?) or any other special characters.
    The separator in the flat file is Comma(,)
    Please help.
    Thanks in advace.

    The source system and application determines the code page and encoding. Is it Windows, Unix, Mainframe or some other type? 
    Unicode files sometimes begin with a byte order mark (2 bytes) to indicate little or big endian.  If you open the file in notepad and then select save as, the encoding in the dialog will show the encoding notepad detected based on the BOM.  If
    that is ANSI instead of Unicode or UTF-8, you will need to know the code page the source system used when the file was created.
    Dan Guzman, SQL Server MVP, http://www.dbdelta.com

  • Extract data from Java to Excel

    Apologies for my ignorance in this field but is it possible to extract data from a Java based application (stock charts and the like) directly into Excel? If so could someone please contact me and explain the process in very simple terms as i have no idea how Java works :o)
    Many thanks.
    Gilsey

    Actually I should qualify my "Yes" answer. It is possible for a Java application to output data to Excel (using Jakarta POI for example). Whether it is possible to persuade an existing Java application to do that depends on the application. If it has been programmed to do it, then yes. Or if it has an underlying database where it stores its data, and you have access to that database, it might be possible to extract data from the database into Excel. Otherwise the programming of the application would have to be changed.

  • How can I join 3 tables while extracting data from SAP R/3?

    I have 3 tables with the following columns
    Emp table (emp)
      emp_id
      emp_name
      emp_add
    Dept table (dept)
      dept_id
      dept_name
      dept_loc
    Location table (loc)
      loc_id
      loc_name
    Now. If I want to select data from loc_id = 10 and emp_id between 2000 and 3000
    How to join these three tables while extracting data from R/3
      join condition
       loc.loc_id = dept.loc_id
    and dept.dept_id = emp.dept_id
    and loc.loc_id =10
    and emp.emp_id between 2000 and 3000.
    Could any one let me know the procedure to extract this data into BW system.

    Hi,
    shouldn't your join condition be:
    loc.loc_id = dept.DEPT_LOC
    and dept.dept_id = ??
    If you can join the three tables then create a generic datasource (RSO) based on a view (create your view with your join in SE11).
    Enable the loc_id and the emp_id as selectable in the datasource so you can then select the values from a BW IPack.
    hope this helps...
    Olivier.

  • 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

  • Interactive pdf issue

    Hey guys, I've got really strange and annoying issue with interactive pdf files. I've created with Indesign CS5.5. an interactive pdf with some clickable buttons. The preview mode works like a charm and when I export it my Reader 8.0 displays evertyh

  • How do I uninstall adobe reader on my Mac Air

    How do I uninstall Adobe reader,  PDF viewer from my Mac air:  OS 10.7.4 Thank you for your help

  • Bluetooth file transfer protocol

    hello everybody....i want to implement PC to PC chat using bluetooth.however,i can implement mobile to PC transfer of messages or files using bluetooth but not between 2 PC's. can anybody please help me with its coding?

  • I can't get rid of the I-play start up page after doing what oberon instructions, I want the firefox Google page as defalt

    I was trying to download a reader for a windows application. Hidden in the download was the I-play junk (I am not a game person). I went to the I-play site and got their instructions and completed them, but the I-play page keeps coming up when I sign

  • 7.01 is still bugged!

    When 7.0 became available I immediately installed it - liked the new coverflow thingy. When I went to do something else aswell on my pc it all went downhill - the music played too fast etc etc, so I went back to 6. When 7.01 was announced I installed