How to compare the two same fields of different tables

Hi can any one let me know the logic for compare the two fields of different tables.

hi
good
IF it_1[] = it_2[].
   " Tables contents are the same
ELSE.
   " Tables contents are different
ENDIF.
If they have different structure, you probably must loop one of the tables, and inside read the other, then compare field by field.
Or if you don't need the contents (just comparing) you can do this, for example:
LOOP AT it_1 INTO wa_1.
   READ TABLE it_2 WITH KEY field2 = wa_1-field2
                            field5 = wa_1-field5
                   TRANSPORTING NO FIELDS.
   IF sy-subrc = 0.
      " Record is on both tables (field2 and field5 are the fields in common for both tables).
   ENDIF.
ENDLOOP.
thanks
mrutyun^

Similar Messages

  • How to compare the Two Date field

    Hi
    i am doing a program with has two field in the Database IssueDate and the ReturnDate. But these two Field Data Type are Text. i don't use them as Data/Time. Now i want to compare the ReturnDate With Today's Date. That is whether ReturnDate is Less than Today's Date.
    Please give me a suggestion to proceed with this Particular Program.
    Thank you for your suggestion
    jofin

    Hi thank you for your reply
    1) i am Creating a library system In that when i issue a book i have to add the number days that a candidate Eligible to hold the Book with a Issue Date and store it as a Return date.
    2) i want to know who has to return the Books on Today.
    3) i want to know you has to return the Book Yet.
    For 1 st one i used GregorianCalendar gcal=new GregorianCalendar();
              ridate= gcal.get(Calendar.DATE);
              rimonth=(int)gcal.get(Calendar.MONTH)+1;
              riyear= gcal.get(Calendar.YEAR);
              rissuedate = ridate+"/"+rimonth+"/"+riyear;this and Calulate it the Returndate.
    is it Possible to convert This rissuedate = ridate+"/"+rimonth+"/"+riyear; string into date like this Formate dd/mmd/yy. and store the Date in the Database
    if so please tell me how to write a query to insert a date and while retriving how to retrive the Date.
    i mean when we retrive a String from database we use getString(); method . Like this how to retrive the Date
    Please help me on this Issue
    Thank you very much for your Help
    Cheers
    Jofin

  • Collecting same field from different tables. (query or abap)

    Hi,
    I need to create a report to show comparison and difference of material consumptions and reservations for each order.
    this means the report will show me the planned amount and the consumed amount of materials for each order.
    orders are in AUFK
    reservations are in RESB
    consumptions are in MSEG
    my problem is. i need to list planned but not consumed materials and consumed but not planned materials too.
    so the material column in the list should contain unique material list in resb and mseg. then i will create two additional fields to get total reservations and total consumptions for that material.
    The question is : How can i create a unique material list from both resb-matnr and mseg-matnr
    Thanks,
    Alper,

    is this the right forum for this question?

  • How to compare the two field in jasper report design

    hi to all,
    I am new to jasper report design
    I want to compare two fields (or) variable using if..else condition.
    pls help me out

    Check out these postings:
    http://forum.java.sun.com/thread.jspa?threadID=5286462
    http://forum.java.sun.com/thread.jspa?threadID=5286468

  • How an i compare the two forms ( script) that are in two systems ?

    Hi,
    How can I compare the two forms(sap script)  which are in different versions  or systems? One form is in D22 and other form is P22 .
    My requirement is to change the form when they are different.
    Thanks,
    Suresh.

    Hi,
    You can download the form info for each script and compare these two files.
    In the SAPscript choose Utilities -> Form info and save this as a file.  As they are structured in the same format you can then look for differences in these files rather than having to look through the form window by window.
    Regards,
    Nick

  • How to compare the contents of two different tables

    hello. can somebody give me an idean on how to compare the contents of two different tables in mysql?
    example, i have a table named Main List and a table named New List.
    The contents of the New List should be compared to the contents of the
    Main List, to check if they are equal. I don't have any idea how to manipulate
    this data. Hoping for your help. Thanks.

    it is better to comapre it using java.. try get the resultset first and store that in collections then comapre the two collections

  • How to compare the programs in two different systems

    Hi,
    I have two systems say A & B and i have the program say 'Z_TESTPROG'.
    How to compare the program in two different systems.
    Regards,
    Venkat

    Hi,
    Check the version in Utilities -> version -> version management in both servers is one option.
    Another one is using SE39 transaction.
    Regards
    Manasa

  • How to assign the two values for constant (same key)

    How to assign the two values for constant (same key)
    CONSTANTS: c_pstkey TYPE  bschl VALUE '09',
               c_splgl  TYPE  umskz VALUE 'I',
               c_buzei  TYPE  buzei VALUE '001'.
    using BSCH1 again i have two asign vaue
    can you just let me know
    Edited by: sravya_se38 on Nov 23, 2010 12:14 AM

    You can create a structure for that constant .
    You can define in this way
    CONSTANTS : BEGIN OF c_pstkey,
                             01 TYPE bschl VALUE '01',
                             02 TYPE bschl VALUE '02',
                          END OF c_pstkey.
    and can access using...
    c_pstkey-01, c_pstkey-02 ........

  • Can I create a custom XMP panel but using the exact same fields from standard XMP panels?

    Hi,
    I am new to XMP and not very technical, so please excuse me if this sounds like a stupid question!
    I have managed to create my own custom panels for Photoshop using the Generic Panel method with my own custom fields and they work fine. However what I need to do now is create a custom panel that uses the exact same fields from some of the standard panels. The reason being is that I have 4 fields that need to be integrated into another non-adobe system (Extensis Portfolio) that recognizes standard XMP fields, but at present these 4 fields are spread across different standard panels and it would be much easier for the user in Photoshop if they were all together on one panel.
    An example field is the "Additional Model Info" field that currently resides on the standard IPTC Extension panel. If I fill in a value in this field on a JPEG then open the the image in Extensis Portfolio, then the field is also filled in in a field called IPTC - Model Info, displaying a key of Iptc4xmpExt:AddlModelInfo.
    Is there a way I can take this standard field and use it on a custom panel, so that it can still be filled in in Photoshop and the value viewed in Extensis Portfolio? Sure I can create a custom panel and create a field called "Additional Model Info" but I can't figure out how to connect it to the corresponding field in Portfolio. I tried changing the  xmp_property name="Iptc4xmpExt:AddlModelInfo" but this just broke the panel.
    Is what I am trying to do possible and if so how and can it be done using the Generic Panel method?
    Many thanks!

    I am trying to do the same thing but with only the IPTC Keywords field. Searching everywhere but no luck.
    Thanks!

  • On Pages, let's say you have two similar documents, but you need to compare the two to see the differences.  Is there a way to do that?

    On Pages, let's say you have two similar documents. Two versions of the same document, but not merged in Cloud and saved as two separate files. B ut you need to compare the two to see the differences, some things on one, but not in the other.  In Word, they would merge the two and differences would be highlighted in red.  Is there a way to do something like that?

    Not actually in Pages, but there is third party software that purports to do this, google around.
    Peter

  • How to pass the two viewname in narative View

    Hi all,
    How to pass the two viewnames in the narative view.
    Ex.<iframe src="saw.dll?Go&Path=/shared/Subjectarea/Domain/Reports/Detailed%20reports/Sub%20Reports/Monthly/Report17&Action=Navigate&ViewName=tableView!1+&ViewName=tableView!+2&P0=1&P1=eq&P2=%22Dim%20Time%22Time%20Key%22&P3=@19&Options=d" Width=500 Height=500 frameborder=0 Align=MIDDLE></iframe>
    thanks,
    Siva

    Hi Siva,
    I could be mistaken, but I do not think you can reference two views via URL.
    The proper way to achieve what you asking is to use the Compound View object. The compound view acts like a wrapper to multiple views. And the best part about it is that you can have as many compound views you want in the same Answer request. By default, all requests start out as a compound view that has a title view and a table view. However, if you click the "Duplicate, specialize or delete current view" button, you can add a "New" compound view. That way a single Request can have many different layouts. Then when you want to reference a particular layout, you reference that particular compound view.
    So in your situation, assuming you create a new compound view to store your layout, you can reformat your code as follows:
    <iframe src="saw.dll?Go&Path=/shared/Subjectarea/Domain/Reports/Detailed%20reports/Sub%20Reports/Monthly/Report17&Action=Navigate&ViewName=compoundView!2&P0=1&P1=eq&P2=%22Dim%20Time%22Time%20Key%22&P3=@19&Options=d" Width=500 Height=500 frameborder=0 Align=MIDDLE></iframe>
    Good luck and if you found this post useful, please award points!
    Best regards,
    -joe

  • How to control the number of fields in the Advanced mode in af:query

    Hi,
    How to control the number of fields in the Advanced mode in <af:query>?
    Say i have 20 fields in my table and i created a view criteria with 2 fields. It would work perfectly in Basic mode. But in the Advanced mode all other fields selection is possible on clicking the ADD Fields button. I did not want the client to make a search with all 20 fields. Only 10 fields are to be listed in the Advanced Mode even though there are 20 fields in my table.
    How do i control the list of fields in ADDFields button?
    Any ideas?
    KR

    You can uncheck the Querable property of the attributes which you need not show up in the Advanced Mode (but they will not show up in other modes too !) or programatically set the same as mentioned here -
    http://adfcodebits.blogspot.com/2010/11/bit-27-setting-view-object-attributes.htmlAlso you can hide the AddFields button as suggested here - http://www.notjustjava.com/2011/12/cool-tips-to-showhide-components-of-the-query-control-of-adf/

  • How to get the object class field value in CDHDR table for vendor

    hi
    how to get the object class field value in CDHDR table for vendor

    Try KRED/KRED_N as object class in CDHDR for Vendor.

  • How to create the sub type field in hr abap infotype

    hi ,
        how to create the sub type field in hr abap infotype.
    regards,
    venkat.

    Try like this also
    creating of infotype please follow these steps ...
    Step 1: Create Infotypes
    i. Goto Transaction PM01 – To create Infotypes:
    ii. Enter the Infotype Number and say create all.
    iii. The following message would display:
    i. PSnnnn Does not exist. How do you want to proceed?
    iv. Click
    v. A maintain Structure screen appears.
    Fill in the short text description and the PS structure of the Infotype.
    Since the fields Personnel No, Employee Begin Date, End Date, Sequential Number,Date of Last Change, Name of user who changed the object are available in the PAKEY and PSHD1 structure, define the PSnnnn structure with only the fields you required.
    vi. Once the PS Structure is created, save and activate the structure.
    vii. In the initial screen of PM01, now click on .
    Create a new entry for the infotype.
    Fill in the values as mentioned below and save.
    Infotype Characteristics:
    Infotype Name of the infotype_ Short Text: __Short Description________
    *General Attributes :
    Time constraint = 1
    Check Subtype Obligatory
    Display and Selection:
    Select w/ start = 3 “Valid record for entered data
    Select w/ end = 5 “Records with valid dates within the period entered
    Select w/o date = 6 “Read all records
    Screen header = 02 “Header ID
    Create w/o end = 1 “Default value is 31.12.9999
    Technical Data:
    Single screen = 2000
    List screen = 3000; List Entry Checked.
    viii. In the initial screen of PM01, now click on .
    Choose the infotype entry in the list.
    Fill in the values as mentioned below and save.
    Technical Attributes:
    In tab section,
    The following attribute values are given:
    Applicant DB Tab = PAnnnn “Infotype Name
    Subtype field = SUBTY
    Subtype table = T591A
    Subty.text tab. = T591S
    Time cnstr.tab. = T591A
    Prim. /Sec. = I Infotype
    Period/key date = I Interval
    and .
    ix. Infotype Screen Modification:
    Edit Screen 2000 from PM01 for the Infotype.
    ABAP Editor for the Infotype Program MPnnnn00 will be displayed.
    Click . Flow Logic will be displayed. There string coding of your own logic.
    Regards
    Pavan

  • How to hide the select-options fields on radiobutton select in webdynpro

    hi
    Could you please help how to hide the select-option fields in webdynpro
    there are four radio buttons
    for every radiobutton there is corresponding the select_option filed is associated to it
    user as only provision select  one radio button and reset of the select-option fileds should be hidden
    which ever the radio button is selected corresponding the select-options fileld should be displayed
    please find the attachement below

    Hi Nine,
    To hide select options you should use interface method REMOVE_SELECTION_SCREEN_ITEM of IF_WD_SELECT_OPTIONS.
    Sample code :
    Write the below code in the Event handler of Radio Button.
    DATA lv_r_helper_class TYPE REF TO if_wd_select_options.
    lv_r_helper_class = lo_interfacecontroller->init_selection_screen(
    lv_r_helper_Class->REMOVE_SELECTION_SCREEN_ITEM(exporting i_id = 'Select_option1_id1').
    This will hide first select option of your screen.Similarly pass select_option_id2 to hide it and so on.
    Regards,
    Ravikiran.k

Maybe you are looking for