How to get common datas from two int.tables

hi,
please tell me , how to i will get the common datas between two int. tables
& place them in third int. table.
give me syntax.
regards
subhasis.

Hi Subhasis,
<b>SORT :</b></u>
SORT itab.
Extras:
1. ... BY f1 f2 ... fn
2. ... ASCENDING
3. ... DESCENDING
4. ... AS TEXT
5. ... STABLE
The syntax check performed in an ABAP Objects context is stricter than in other ABAP areas. See Field symbols not allowed as sort criterion.
Effect
The entries in the internal table are sorted in ascending order using the key from the table definition (DATA, TYPES).
Addition 1
... BY f1 f2 ... fn
Effect
Uses the sort key defined by the sub-fields f1, f2, ..., fn of the table itab instead of the table key. The fields can be of any type; even number fields and tables are allowed.
You can also specify the sort fields dynamically in the form (name). If name is blank at runtime, the sort field is ignored. If itab is a table with a header line, you can also use a field symbol pointing to the header line of itab as a dynamic sort criterion. A field symbol that is not assigned is ignored. If a field symbol is assigned, but does not point to the header line of the internal table, a runtime error occurs.
If the line type of the internal table contains object reference variables as components, or the entire line type is a reference variable, you can use the attributes of the object to which a reference is pointing in a line as sort criteria (see Attributes of Objects as the Key of an Internal Table.
You can address the entire line of an internal table as the key using the pseudocomponent TABLE_LINE. This is particularly relevant for tables with a non-structured line type when you want to address the whole line as the key of the table (see also Pseudocomponent TABLE_LINE With Internal Tables).
If you use one of the additions 2 to 5 before BY, it applies to all fields of the sort key by default. You can also specify these additions after each individual sort field f1, f2, ..., fn. For each key field, this defines an individual sort rule which overrides the default.
Addition 2
... ASCENDING
Effect
Sorts in ascending order. This is also the default if no sort order is specified directly after SORT. For this reason, it is not necessary to specify ASCENDING explicitly as the default sort order.
With the addition BY, you can also specify ASCENDING directly after a sort field to define ascending order explicitly as the sort sequence for this field.
Addition 3
... DESCENDING
Effect
Sorts in descending order. If the addition comes right after SORT, DESCENDING is taken as the default for all fields of the sort key.
With the addition BY, you can also specify DESCENDING directly after a sort field.
Addition 4
... AS TEXT
Effect
Text fields are sorted appropriate to the locale. This means that the relative order of characters is defined according to the text environment being used.
When an internal mode is opened (in other words, when a roll area is opened), the text environment is automatically set to the logon language specified in the user master record. If necessary, however, you can change the text environment explicitly in your program by using a SET-LOCALE statement.
If the addition comes directly after itab, locale-specific rules are used for all fields of the sort key where the type of these fields is C or W. After the sort, the sequence of entries usually does not match the sequence which results otherwise, without using the addition AS TEXT, i.e. with binary sorting.
With the addition BY, you can also specify AS TEXT directly after a sort field, provided it is of type C or W, or a structured type. Otherwise, a runtime error occurs. In sort fields with a structured type, AS TEXT only affects subcomponents with type C or W.
In case of an invalid character, a SYSLOG message is written, and the respective record is inserted at the end.
Note
Please keep the rules for site-specific sorting in mind.
Example
Sort a name table with different keys:
TYPES: BEGIN OF PERSON_TYPE,
         NAME(10)   TYPE C,
         AGE        TYPE I,
         COUNTRY(3) TYPE C,
       END OF PERSON_TYPE.
DATA: PERSON TYPE STANDARD TABLE OF PERSON_TYPE WITH
                  NON-UNIQUE DEFAULT KEY INITIAL SIZE 5,
      WA_PERSON TYPE PERSON_TYPE.
WA_PERSON-NAME    = 'Muller'. WA_PERSON-AGE = 22.
WA_PERSON-COUNTRY = 'USA'.
APPEND WA_PERSON TO PERSON.
WA_PERSON-NAME    = 'Moller'. WA_PERSON-AGE = 25.
WA_PERSON-COUNTRY = 'FRG'.
APPEND WA_PERSON TO PERSON.
WA_PERSON-NAME    = 'Möller'. WA_PERSON-AGE = 22.
WA_PERSON-COUNTRY = 'USA'.
APPEND WA_PERSON TO PERSON.
WA_PERSON-NAME    = 'Miller'. WA_PERSON-AGE = 23.
WA_PERSON-COUNTRY = 'USA'.
APPEND WA_PERSON TO PERSON.
SORT PERSON.
Now, the sequence of the table entries is as follows:
Miller  23  USA
Moller  25  FRG
Muller  22  USA
Möller  22  USA
If, for example, you apply German sort rules where the umlaut comes directly after the letter 'o' in the sort, the data record beginning with 'Möller' would not be in the right place in this sequence. It should come second.
Provided a German-language locale is set (e.g. sorting is according to German grammatical rules, see also SET LOCALE), you can sort the names according to German rules as follows:
SORT PERSON BY NAME AS TEXT.
Now, the sequence of table entries is as follows:
Miller  23  USA
Moller  25  FRG
Möller  22  USA
Muller  22  USA
Further examples:
SORT PERSON DESCENDING BY COUNTRY AGE NAME.
Now, the sequence of table entries is as follows:
Miller  23  USA
Möller  22  USA
Muller  22  USA
Moller  25  FRG
SORT PERSON DESCENDING BY AGE ASCENDING NAME AS TEXT.
Now, the sequence of table entries is as follows:
Muller  22  USA
Möller  22  USA
Miller  23  USA
Moller  25  FRG
Addition 5
... STABLE
Effect
Uses a stable sort, that is, the relative sequence of entries that have the same sort key remains unchanged.
Unlike additions 2 to 4, you cannot use this addition directly after a sort field.
Notes
General:
The number of sort fields is restricted to 250.
The sort process is only stable if you use the STABLE addition. Otherwise, a predefined sequence of fields used to sort a list is not usually retained.
It does not make sense to use the SORT command for a SORTED TABLE. If the table type is statically declared, the system returns a syntax error if you try to SORT the table. If the table type is not statically declared (for example, because the table was passed to a FORM routine as an INDEX TABLE in a parameter), and the system can interpret the SORT statement as an empty operation, it ignores the statement. This is the case when the key in the BY clause corresponds to the beginning of the table key. Otherwise, a runtime error occurs.
To delete all duplicate entries from a sorted internal table (e.g. just after SORT), you can use the DELETE ADJACENT DUPLICATES FROM itab statement.
When using the addition AS TEXT, the sequence of entries after the sort does not usually match the sequence resulting from a binary sort, i.e. if the addition AS TEXT is not specified. The consequence of this is that after the SORT, you are not allowed to access with the READ TABLE itab ... BINARY SEARCH statement.
If you still want to access data sorted apppropriate to the locale with a binary search, you can do this by including an additional component in the table where you can explictly store the data formatted using the CONVERT TEXT ... INTO SORTABLE CODE statement. This is also recommended for performance reasons if you have to re-sort the table several times according to locale-specific criteria.
If the internal table has more than 2^19 lines or is larger than 12 MB, the system sorts it physically using an external auxiliary file. You can specify the directory in which the file should be created using the SAP profile parameter DIR_SORTTMP. By default, the system uses the SAP data directory (SAP profile parameter DIR_DATA).
Notes
Performance:
The runtime required to sort an internal table increases with the number of entries and the length of the sort key.
Sorting an internal table with 100 entries with a 50 byte key requires about 1300 msn (standardized microseconds). Using a 30-byte key, the runtime is about 950 msn.
If one of the specified sort criteria is itself an internal table, SORT may sometimes take much longer.
The runtime increases if you use a stable sort.
Physical sorting reduces the runtime required for subsequent sequential processing.
Reward If Useful.
Regards,
Chitra

Similar Messages

  • How to get the data from a cluster table to BW

    Dear All,
    I want to extract the data from R/3 to BW by using 2 tables and one Cluster B2.
    Actually my report contains some fields from PA2001, PA2002 and one cluster table B2 (Table ZES). Can I create View by using these 3 tables? If it is not possible how can I get the data from the cluster? Can I create generic datasource by using cluster tables directly?
    In SE11 Transaction the Cluster (table ZES) is showing invalid table.
    I referred some Forums, but no use.
    Can any body tell me procedure to get the data from a cluster (table ZES) ?
    Waiting for you results.
    Thanks and regards
    Rajesh

    HI Siggi,
    Thank you for your reply..
    I am also planning to do FM to get the data. But it is saying that the Cluster table ZES does not exist (ZES is the the standard table, in SE11 also).
    How can I use the Fields from the that table.?
    What can I do now, can you please explain me about this point.
    Waiting for your reply.
    Thanks and Regards
    Rajesh
    Message was edited by:
            rajesh

  • Can we get the data from two internal tables in ALV.

    hi friends i would like to display the data using two internal tables using alv grid.please guide me.

    Hi,
    ALV would be having a specific layout say :
    MATNR
    MAKTX
    QTY
    Now, if you have two internal tables, then do they have a different structure. If they have different structures, then what kind of ALV layout you expect. The ALV output should be as per the structure of 1st or 2nd internal table.
    If both internal table have same layout, then populate the data from 2nd internal table into 1st internal table and pass the 1st internal table ( it will have data of both internal tables) to ALV.
    Best regards,
    Prashant

  • Getting same data from two diffrent tables

    Select * from events where  job_dtls_id IN (select job_dtls_id from job_details where job_no='' and consignment_id='' and carrier_reference='');
    Hello All,
    I have to retrieve job_dtls_id (query in brckets ) in which it will match the above shown criteria (job_no,consignment_id and carrier_reference).
    but the problem is job_no And consignment_id are in one table and carrier_reference is in another.
    the two table have relation on job_dtls_id.
    Do anybody have an Idea please Help.
    Thanks.

    Hi Nilesh,
    As suggested by John, having JOIN on the tables should give you the desired output and have it saved as stored procedure and invoke it from BizTalk, have a look at following post for reference: http://tech-findings.blogspot.com/2013/08/polling-data-from-sql-using-wcf-sql.html
    Maheshkumar
    S Tiwari|User
    Page|Blog|How
    to Access an Orchestration variable in Map

  • How to get the data from mysql database which is being accessed by a PHP application and process the data locally in adobe air application and finally commit the changes back in to mysql database through the PHP application.

    How to get the data from mysql database which is being accessed by a PHP application and process the data locally in adobe air application and finally commit the changes back in to mysql database through the PHP application.

    If the data is on a remote server (for example, PHP running on a web server, talking to a MySQL server) then you do this in an AIR application the same way you would do it with any Flex application (or ajax application, if you're building your AIR app in HTML/JS).
    That's a broad answer, but in fact there are lots of ways to communicate between Flex and PHP. The most common and best in most cases is to use AMFPHP (http://amfphp.org/) or the new ZEND AMF support in the Zend Framework.
    This page is a good starting point for learning about Flex and PHP communication:
    http://www.adobe.com/devnet/flex/flex_php.html
    Also, in Flash Builder 4 they've added a lot of remote-data-connection functionality, including a lot that's designed for PHP. Take a look at the Flash Builder 4 public beta for more on that: http://labs.adobe.com/technologies/flashbuilder4/

  • How to get all data from nokia to i5s

    how to get all data from nokia E71 to i5s???

    if you can put those data in your computer then add it in iTunes. your iPhone 5s should get it thru syncing.

  • How to get the data from multiple nodes to one table

    Hi All,
    How to get the data from multiple nodes to one table.examples nodes are like  A B C D E relation also maintained
    Regards,
    Indra

    HI Indra,
    From Node A, get the values of the attributes as
    lo_NodeA->GET_STATIC_ATTRIBUTES(  IMPORTING STATIC_ATTRIBUTES = ls_attributesA  ).
    Similarily get all the node values from B, C, D and E.
    Finally append all your ls records to the table.
    Hope you are clear.
    BR,
    RAM.

  • How to get the data from pcl2 cluster for TCRT table.

    Hi frndz,
    How to get the data from pcl2 cluster for tcrt table for us payroll.
    Thanks in advance.
    Harisumanth.Ch

    PL take a look at the sample Program EXAMPLE_PNP_GET_PAYROLL in your system. There are numerous other ways to read payroll results.. Pl use the search forum option & you sure will get a lot of hits..
    ~Suresh

  • How to get the data from Pooled Table T157E.

    Hi Experts,
    How to get the data from Pooled Table T157E.
    Any help.
    Thanks in Advance,
    Ur's Harsha.

    create some internal table similar to T157E and pass all data as per SPRAS.
    After that use internal table in your program as per the requirement.
    Regds,
    Anil

  • How to get purchasing data from SAP R/3 to OWB (Oracle warehouse builder).

    Hi,
    My name is Pavan Tata. I work as a SAP BW developer. Here is the situation at my client place. Client decided to retire BW system and wants to replace with OWB(Oracle warehouse). In all this currently we have purhchasing application in BW production system and wants to move this application to OWB for the same type of reporting what they are getting currently.
    Here is my question:
    How to get purchasing data from SAP R/3 to OWB(Warehouse) with initial full loads and deltas mechanism in the same way as we do in BW.
    Please help on this, also send me any documentation about this if you have.
    Thanks,
    Pavan.

    Hello,
    here is a short report which converts S012 entries to strings with separator semicolon. Perhaps this will help you?
    Regards
    Walter Habich
    REPORT habitest2 LINE-SIZE 255.
    TYPES:
      strtab_t TYPE TABLE OF string.
    CONSTANTS:
      separator VALUE ';'.
    DATA:
      it_s012 LIKE s012 OCCURS 0,
      wa_s012 LIKE s012,
      strtab TYPE strtab_t,
      strele TYPE string.
    SELECT * FROM s012 INTO TABLE it_s012 UP TO 100 ROWS.
    PERFORM data_to_string
      TABLES
        strtab
      USING
        'S012'. "requires it_s012 and wa_s012
    LOOP AT strtab INTO strele.
      WRITE: / strele.
    ENDLOOP.
    *&      Form  data_to_string
    FORM data_to_string TABLES strtab TYPE strtab_t
                        USING  ittab TYPE any.
      DATA:
        h_zaehler TYPE i,
        line_str TYPE string,
        l_tabellenname(10) TYPE c,
        l_arbeitsbereichsname(10) TYPE c,
        h_string TYPE string,
        h_char(255) TYPE c.
      FIELD-SYMBOLS: <l_tabelle> TYPE ANY TABLE,
                     <l_arbeits> TYPE ANY,
                     <feldzeiger> TYPE ANY.
      CLEAR strtab.
      CONCATENATE 'IT_' ittab INTO l_tabellenname.
      ASSIGN (l_tabellenname) TO <l_tabelle>.
      CONCATENATE 'WA_' ittab INTO l_arbeitsbereichsname.
      ASSIGN (l_arbeitsbereichsname) TO <l_arbeits>.
      LOOP AT <l_tabelle> INTO <l_arbeits>.
        CLEAR: h_zaehler, line_str.
        line_str = ittab.
        DO.
          ADD 1 TO h_zaehler.
          ASSIGN COMPONENT h_zaehler OF
            STRUCTURE <l_arbeits> TO <feldzeiger>.
          IF sy-subrc <> 0. EXIT. ENDIF.
          WRITE <feldzeiger> TO h_char LEFT-JUSTIFIED.          "#EC *
          h_string = h_char.
          CONCATENATE line_str separator h_string INTO line_str.
        ENDDO.
        APPEND line_str TO strtab.
      ENDLOOP.
    ENDFORM.                    "data_to_string

  • How can get formatted data from hard drive

    how can get formatted data from hard drive?

    No chance without special tools/knowledge. There are companies that can do it, unless you use multiple format or rewrite data with special erase ustility or unless you have done low level format.
    Regards
    Milos

  • How to get the data from multiple tabes into single table

    hi all,
    here i am having 10 data base tables,how to get the data into a single table.
    regards,
    subba reddy

    hi,
    non XI/PI related
    Regards,
    Michal Krawczyk

  • Selecting data from two different tables.

    Do we need to use join two tables with primary/foreign key while trying to use select statement for getting data from those to table.? If no who can i go about do it.

    872959 wrote:
    If i am using From clause to get data from two different tables, is it necessary that both tables have column of identical data in them.In general, they ought to (or you need to join in a third table that tells you how to map rows from one table to rows of the other table).
    It is not strictly necessary that there be any join condition between tables. If you don't provide a join condition, Oracle has to do a Cartesian product. That means that if there are n rows in one table and m rows in the other, the result set will have n * m rows. It is very rarely a good idea to write queries that do Cartesian products but it does occasionally happen.
    Justin

  • How can I modify data from a Transparent Table without ABAP code.

    Hi,All
    How can I modify data from a Transparent Table (like TCURR),  and important thing is I want do all that with no ABAP code here. It is like that we always do that in a Oracle database use TOAD or PLSQL third party tools, with no script code here.
    I had fond that there is a way can do that:
    1, type 'se11',and Display Database table 'TCURR', click Contents, then click Execute to display all data
    2, type '/h' and let debugging on
    3, select one of this data then click 'Display',enter in debugging system.
    4, then make a breakpoint in the code. But... display a dialog let I type a 'ABAP Cmnds', I want to know what can be type in for that?
    and, My system is ECC6.
    thank you all
    Edited by: xuehui li on Aug 20, 2008 6:30 PM

    Hello,
    Your approach (with Vijay's suggestion) MAY work.  However, depending on how tight security is at the company that you are working at you may or may not be able to acutaly change the value of the SHOW field to EDIT.  This will be especially true if you are working in a Production environment.  Vijay's other comment is true as well.  This is not a recommended approach to change data (especially data with a financial impact like TCURR) in a production environment.  The auditors will not be impressed.
    Explore the option of a maintenace view or look at tcode TBDM to upload a file which includes daily rates from providers like Reuters or try tcode s_bce_68000174 which is a maintenance view on TCURR.
    Regards
    Greg Kern

  • OBIEE 11g - Combine data from two Oracle tables

    Good day!
    I tried to combine data from two Oracle tables as fact data, but it doesn't work.
    My steps: I created SCOTT.EMP2 table from SCOTT.EMP table, update EMPNO and ENAME values of EMP2 table to distinguish data of my tables. Then I imported physical tables DEPT, EMP and EMP2 to BIEE 11g, created joins DEPT-EMP and DEPT-EMP2 in physical diagram. Then I dragged DEPT and EMP tables to BMM, and EMP2 table to EMP as second LTS. In Content tab for EMP and EMP2 I checked "This source should be combined with other sources at this level" checkboxes. Then I renamed logical tables EMP and DEPT to Employees and Departments and dragged them to Presentation area. In Answers I created Analysis with columns DNAME and ENAME.
    The problem is that data on results tab is only from one physical table EMP or EMP2 (depending on the order of sources EMP and EMP2 of LT Employees) and not from both.
    Can anybody help? Am I missed something?
    Al.

    Hi Al,
    I think you have to define the content of the LTS.
    http://download.oracle.com/docs/cd/E12096_01/books/admintool/admintool_BusModSetup16.html
    You have to specify the content of the different fragments.
    http://download.oracle.com/docs/cd/E12096_01/books/admintool/admintool_SetUpAggNav3.html#wp1005333
    Maybe you have to add an additional column 'Source' ('EMP1', 'EMP2')
    Good Luck,
    Daan Bakboord
    http://obibb.wordpress.com

Maybe you are looking for

  • Distributing multiple versions of an app within a single Windows Store app

    The company I work for creates Point Of Sale (POS) software using Software As A Service (SAAS), so we host our clients' databases.  We do not force all of our clients to all be on the same version of our software; i.e. some clients are on version 3,

  • My MacBook Pro isn't recognising my SD card

    I have previosuly imported photos from the SD card in my camera although today when I try and do it it's not even recognising my card, it's not rejecting it or saying there is a fault it jsut does nothing when I put it in... Any suggetions?

  • Panels (windows) in gnome

    In KDE you can select an option for the number of screens available 1, 4 ,6, etc. is there a similar option in gnome and how do I find it.

  • Can we use two costing variants for standards cost estimate release.

    Hi, We have 2 plants (plant 5100 and plant 5200) under company code 5000. We have run standard cost estimate(CK11N) for material 98001000027 at plant 5100 using costing variant ZG01 and at plant 5200 using costing variant ZG02. First, we released  st

  • Encounter problem when I'm using JTextArea

    hi everyone: I have less experience on Swing development. Recently, I encounter a weird problem. I have a JTextArea component which it was populated on JInternalFrame, and when I try to switch an inputmethod(Actually is Chinese inputmethod). the appl