Comparing two tables and picking the records
I have two tables A and B. I have to compare a column ID in both table A and table B A.ID=B.ID And based on the above comparison if the match is found I need to pick the records from table A and if no match then need to pick the records from table B My problem is if I join then I will have table A and table B as one record and will be difficult to separate out. Please let me know how this can be acheived. Thnx.
I have two tables A and B. I have to compare a column ID in both table A and table B A.ID=B.ID And based on the above comparison if the match is found I need to pick the records from table A and if no match then need to pick the records from table B My problem is if I join then I will have table A and table B as one record and will be difficult to separate out. Please let me know how this can be acheived. Thnx.
Similar Messages
-
Compare two tables and log the difference
Hi,
I want to compare two tables and log the difference in new table with the fields as (old value,new value, column name). The column name should be the changes value columnCan you show an example?
SELECT Foo.*, Bar.*
FROM Foo
FULL OUTER JOIN
Bar
ON Foo.c1 = Bar.c1
AND Foo.c2 = Bar.c2
AND Foo.cn = Bar.cn
WHERE Foo.key IS NULL
OR Bar.key IS NULL;
Best Regards,Uri Dimant SQL Server MVP,
http://sqlblog.com/blogs/uri_dimant/
MS SQL optimization: MS SQL Development and Optimization
MS SQL Consulting:
Large scale of database and data cleansing
Remote DBA Services:
Improves MS SQL Database Performance
SQL Server Integration Services:
Business Intelligence -
Used to be able to pick out which songs in iTunes in my computer were not on a 2nd computer on homeshare in iTunes 10. Now with V11, cant find the button that compares two libraries and finds the songs that are different. Anyone know how to do this now?
Jneklason wrote:
~snip~
I know this email is confusing and really hard to understand...perhaps now you will know how i've been feeling--lost and confused with all the mis-information, with a hit and miss phone, and out of time with all the 1 1/2 hr to 2 hrs EACH wasted on this issue.
On top of all this, I can't even find out how to file a complaint with anyone higher up than Customer Service.
I hate to tell you this, but you didn't write an email. You wrote a discussion post on the Verizon Wireless Community forum which is a public peer to peer forum. Unfortunately since you didn't mark your post as a question, the VZW reps that roam this community won't ever see your post. Before you re-post it, don't. Duplicate posts get removed from the community.
I see there were several missteps both by the reps and yourself in your post. First you should have insisted on returning the phone within the 14 day return policy period. Second which Samsung Galaxy mini model did you purchase? The S3 mini or the S4 mini? Did you do any research prior to deciding on this device. The reps at that time deflected the easiest course of action, by trying to get you to replace the phone under insurance instead of returning the phone. The Early Edge payment option requires the current phone on the line using the early Edge must be returned to Verizon Wireless. Did you once considered going to a third party site like Swappa to purchase a gently used device for your daughter? -
Comparing two internal tables and deleting the record not present in second
Hi All,
I have a internal table itaba with PERNR as primary key and various other columns (1000 records) and table B with PERNR as primary key and 800 records.
Now what is the best way to compare these two and delete the record from table A when its corresponding record is not present in table B?
Thanks and Regards,
MohanHI SIR
u trained us in accenture
Hi all
when ever m running this session in SM35 , M getting error as :
"LEAVE TO TRANSACTION" MARA-BISMT is not allow
in batch input
REPORT YASEC_BDC_NIK_SESSION
no standard page heading
message-id zmm
line-count 65
line-size 150.
tables : mara.
*Top includr program
INCLUDE YNEW_MAIN_TOP.
*include yasec_bdc_nik_session_top.
***********selection screen *******************
selection-screen begin of block b1 with frame title text-001.
selection-screen skip.
PARAMETERS: p_ifile(128) TYPE c .
SELECTION-SCREEN SKIP.
SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.
PARAMETERS: rad1 TYPE c RADIOBUTTON GROUP 1 USER-COMMAND gr1,
rad2 TYPE c RADIOBUTTON GROUP 1 .
SELECTION-SCREEN SKIP.
PARAMETERS: p_sess TYPE c.
SELECTION-SCREEN END OF BLOCK b2.
SELECTION-SCREEN SKIP.
SELECTION-SCREEN END OF BLOCK b1.
Subroutine call***************************
INCLUDE YNEW_MAIN_F01.
*include yasec_bdc_nik_session_f01.
*********At selection event triggered *************
at selection-screen on value-request for p_ifile.
To get F4 help for the input file path
PERFORM f_f4_input_file.
AT SELECTION-SCREEN ON p_ifile.
To validate and upload the input file
PERFORM f_load_file.
AT SELECTION-SCREEN ON p_sess.
To validate the Number of Sessions field
IF rad2 IS NOT INITIAL AND sy-ucomm EQ c_onli.
PERFORM f_check_sessions.
ENDIF.
***********Start of selection *******************
start-of-selection.
*To process BDC
PERFORM f_process_bdc.
TOP OF PAGE
TOP-OF-PAGE.
Writes the report heading and for displaying line number.
PERFORM f_report_header.
TYPES : BEGIN OF t_final,
matnr(50) TYPE c,
bismt(18) type c,
end of t_final.
TYPES: BEGIN OF t_fdata,
data(256) TYPE c,
END OF t_fdata.
TYPES: BEGIN OF t_error,
message(100) TYPE c,
END OF t_error.
*Internal table declarations
*Internal table to load the data from the file that is changed throgh BDC
DATA : i_final TYPE STANDARD TABLE OF t_final,
wa_final TYPE t_final.
*Internal table to store the error messages
DATA : i_error TYPE STANDARD TABLE OF t_error,
wa_error TYPE t_error.
*Internal table to load the raw data
DATA : i_fdata TYPE STANDARD TABLE OF t_fdata,
wa_fdata TYPE t_fdata.
*Internal table to store records of BDC
DATA : i_bdcdata TYPE STANDARD TABLE OF bdcdata INITIAL SIZE 0,
wa_bdcdata TYPE bdcdata.
Internal table to store BDC messages
DATA: i_bdcmsgcoll TYPE STANDARD TABLE OF bdcmsgcoll INITIAL SIZE 0,
wa_bdcmsgcoll TYPE bdcmsgcoll.
VARIABLE DECLARATIONS
DATA: v_ifile TYPE string,
v_input TYPE i,
c_delimiter TYPE c VALUE 'X',
v_mode TYPE c VALUE 'A',
v_sessions TYPE i.
CONSTANTS
CONSTANTS : c_flagx TYPE c VALUE 'X',
c_slash TYPE c VALUE '/',
c_onli(4) TYPE c VALUE 'ONLI',
c_vl02(4) TYPE c VALUE 'VL02',
c_s TYPE c VALUE 'A'.
FORM f_f4_input_file .
CALL FUNCTION 'F4_FILENAME'
EXPORTING
program_name = syst-cprog
dynpro_number = syst-dynnr
IMPORTING
file_name = p_ifile.
ENDFORM. " f_f4_input_file
*& Form f_load_file
FORM f_load_file .
v_ifile = p_ifile.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = v_ifile
filetype = 'ASC'
has_field_separator = 'X'
TABLES
data_tab = i_fdata
EXCEPTIONS
file_open_error = 1
file_read_error = 2
no_batch = 3
gui_refuse_filetransfer = 4
invalid_type = 5
no_authority = 6
unknown_error = 7
bad_data_format = 8
header_not_allowed = 9
separator_not_allowed = 10
header_too_long = 11
unknown_dp_error = 12
access_denied = 13
dp_out_of_memory = 14
disk_full = 15
dp_timeout = 16
OTHERS = 17.
IF sy-subrc <> 0.
*Text-103-Input file does not exist.
MESSAGE e000 WITH text-103 .
ELSEIF NOT i_fdata IS INITIAL.
DELETE i_fdata WHERE data = space.
DESCRIBE TABLE i_fdata LINES v_input.
ENDIF.
IF v_input EQ 0.
Text-104 - Input file is empty.
MESSAGE e000 WITH text-104 .
ENDIF.
ENDFORM. " f_load_file
*& Form f_check_sessions
FORM f_check_sessions .
IF p_sess IS INITIAL.
MESSAGE e000 WITH text-106.
ELSE.
v_sessions = v_input DIV p_sess.
ENDIF.
ENDFORM. " f_check_sessions
*& Form f_process_bdc
text
FORM f_process_bdc.
LOOP AT i_fdata INTO wa_fdata.
SPLIT wa_fdata AT cl_abap_char_utilities=>horizontal_tab
INTO wa_final-matnr
wa_final-bismt.
APPEND wa_final TO i_final.
CLEAR wa_fdata.
ENDLOOP.
IF rad1 = c_flagx.
PERFORM f_passbdc_vl02.
ELSEIF rad2 = c_flagx.
PERFORM f_sessions_vl02.
ENDIF.
ENDFORM. "f_process_bdc
To populate the Screen information
p_program Program Name
p_dynpro Screen Number
FORM bdc_dynpro USING p_program TYPE any
p_dynpro TYPE any.
CLEAR wa_bdcdata.
Populate the BDC structure with the Screen Information.
Move the Program name PROGRAM
wa_bdcdata-program = p_program.
Move the Screen Number DYNPRO
wa_bdcdata-dynpro = p_dynpro.
Indicate the beginning of a new screen
wa_bdcdata-dynbegin = c_flagx.
APPEND wa_bdcdata TO i_bdcdata.
ENDFORM. "f_bdc_dynpro
*& Form f_passbdc_vl02
text
FORM f_passbdc_vl02.
DATA: l_lines_im TYPE i.
SORT i_final BY matnr ASCENDING.
CLEAR wa_final.
LOOP AT i_final INTO wa_final.
CLEAR: i_bdcmsgcoll[],
wa_bdcmsgcoll,
wa_bdcdata.
CLEAR: i_bdcdata[].
perform bdc_dynpro using 'SAPLMGMM' '0060'.
perform bdc_field using 'BDC_CURSOR'
'RMMG1-MATNR'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'RMMG1-MATNR'
wa_final-matnr.
perform bdc_dynpro using 'SAPLMGMM' '0070'.
perform bdc_field using 'BDC_CURSOR'
'MSICHTAUSW-DYTXT(01)'.
perform bdc_field using 'BDC_OKCODE'
'=ENTR'.
perform bdc_field using 'MSICHTAUSW-KZSEL(01)'
'X'.
perform bdc_dynpro using 'SAPLMGMM' '4004'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'BDC_CURSOR'
'MARA-BISMT'.
perform bdc_field using 'MARA-BISMT'
wa_final-bismt.
perform bdc_dynpro using 'SAPLSPO1' '0300'.
perform bdc_field using 'BDC_OKCODE'
'=YES'.
perform bdc_transaction using 'MM02'.
perform bdc_dynpro using 'SAPLMGMM' '0060'.
perform bdc_field using 'BDC_CURSOR'
'RMMG1-MATNR'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_dynpro using 'SAPLMGMM' '0070'.
perform bdc_field using 'BDC_CURSOR'
'MSICHTAUSW-DYTXT(01)'.
perform bdc_field using 'BDC_OKCODE'
'=ENTR'.
perform bdc_dynpro using 'SAPLMGMM' '4004'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'BDC_CURSOR'
'RMMG1-MATNR'.
perform bdc_dynpro using 'SAPLSPO1' '0300'.
perform bdc_field using 'BDC_OKCODE'
'=YES'.
perform bdc_transaction using 'MM03'.
CALL TRANSACTION 'MM02' USING i_bdcdata
MODE v_mode
UPDATE c_s
MESSAGES INTO i_bdcmsgcoll.
If error occurred in call transaction 'VA02' then stores all
information of failed records into internal table i_error_im.
IF sy-subrc NE 0.
DESCRIBE TABLE i_bdcmsgcoll LINES l_lines_im.
CLEAR wa_bdcmsgcoll.
READ TABLE i_bdcmsgcoll INTO wa_bdcmsgcoll INDEX l_lines_im.
To capture success and error messages in BDC.
CALL FUNCTION 'FORMAT_MESSAGE' "#EC *
EXPORTING
id = wa_bdcmsgcoll-msgid
lang = wa_bdcmsgcoll-msgspra
no = wa_bdcmsgcoll-msgnr
v1 = wa_bdcmsgcoll-msgv1
v2 = wa_bdcmsgcoll-msgv2
v3 = wa_bdcmsgcoll-msgv3
v4 = wa_bdcmsgcoll-msgv4
IMPORTING
msg = wa_error-message
EXCEPTIONS
not_found = 1
OTHERS = 2.
IF sy-subrc <> 0.
ENDIF.
ELSE.
WRITE: text-111 COLOR 7.
ENDIF.
CLEAR: wa_final.
REFRESH i_bdcdata.
ENDLOOP.
ENDFORM. "f_passbdc_va02
*& Form bdc_field
text
-->P_FNAM text
-->P_FVAL text
FORM bdc_field USING p_fnam TYPE any
p_fval TYPE any.
CLEAR wa_bdcdata.
Populate the Field Name
wa_bdcdata-fnam = p_fnam.
Populate the field value
wa_bdcdata-fval = p_fval.
APPEND wa_bdcdata TO i_bdcdata.
ENDFORM. "f_bdc_field
*& Form f_sessions_vl02
text
FORM f_sessions_vl02 .
DATA: l_sindex TYPE sy-tabix VALUE 1,
l_eindex TYPE sy-tabix,
l_flag TYPE c VALUE space.
l_eindex = v_input.
SORT i_final BY matnr ASCENDING.
DO p_sess TIMES.
CALL FUNCTION 'BDC_OPEN_GROUP'
EXPORTING
client = sy-mandt
group = 'Y_VL02_NIK'
user = sy-uname
keep = c_flagx
EXCEPTIONS
client_invalid = 1
destination_invalid = 2
group_invalid = 3
group_is_locked = 4
holddate_invalid = 5
internal_error = 6
queue_error = 7
running = 8
system_lock_error = 9
user_invalid = 10
OTHERS = 11.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
CLEAR wa_final.
CLEAR: i_bdcdata[].
LOOP AT i_final INTO wa_final FROM l_sindex TO l_eindex .
IF l_flag = v_sessions.
CLEAR l_flag.
EXIT.
ENDIF.
l_flag = l_flag + 1.
CLEAR: i_bdcdata[].
perform bdc_dynpro using 'SAPLMGMM' '0060'.
perform bdc_field using 'BDC_CURSOR'
'RMMG1-MATNR'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'RMMG1-MATNR'
wa_final-matnr.
perform bdc_dynpro using 'SAPLMGMM' '0070'.
perform bdc_field using 'BDC_CURSOR'
'MSICHTAUSW-DYTXT(01)'.
perform bdc_field using 'BDC_OKCODE'
'=ENTR'.
perform bdc_field using 'MSICHTAUSW-KZSEL(01)'
'X'.
perform bdc_dynpro using 'SAPLMGMM' '4004'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'BDC_CURSOR'
'MARA-BISMT'.
perform bdc_field using 'MARA-BISMT'
wa_final-bismt.
perform bdc_dynpro using 'SAPLSPO1' '0300'.
perform bdc_field using 'BDC_OKCODE'
'=YES'.
perform bdc_transaction using 'MM02'.
perform bdc_dynpro using 'SAPLMGMM' '0060'.
perform bdc_field using 'BDC_CURSOR'
'RMMG1-MATNR'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_dynpro using 'SAPLMGMM' '0070'.
perform bdc_field using 'BDC_CURSOR'
'MSICHTAUSW-DYTXT(01)'.
perform bdc_field using 'BDC_OKCODE'
'=ENTR'.
perform bdc_dynpro using 'SAPLMGMM' '4004'.
perform bdc_field using 'BDC_OKCODE'
'/00'.
perform bdc_field using 'BDC_CURSOR'
'RMMG1-MATNR'.
perform bdc_dynpro using 'SAPLSPO1' '0300'.
perform bdc_field using 'BDC_OKCODE'
'=YES'.
perform bdc_transaction using 'MM03'.
l_sindex = l_sindex + 1.
ENDLOOP.
CALL FUNCTION 'BDC_CLOSE_GROUP'
EXCEPTIONS
not_open = 1
queue_error = 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.
ENDDO.
ENDFORM. " f_sessions_vl02
*& Form f_report_header
FORM f_report_header .
FORMAT COLOR COL_HEADING INTENSIFIED ON.
ULINE.
text-201 - Company: Carrier
text-102- Batch Data Communication.
text-202 - System: SAP
WRITE: /1 sy-vline,
3 text-201,
50 text-102,
100 text-202,
AT sy-linsz sy-vline.
text-203 - Program:
text-204 - Date/Time:
WRITE: /1 sy-vline,
3 text-203, sy-repid ,
100 text-204,sy-datum ,c_slash, sy-uzeit,
AT sy-linsz sy-vline.
text-205 - User ID:
text-206 - Page:
WRITE: /1 sy-vline,
3 text-205, sy-uname,
100 text-206, sy-pagno,
AT sy-linsz sy-vline.
FORMAT COLOR OFF.
ULINE.
ENDFORM. " f_report_header
FORM bdc_transaction USING tcode.
CALL FUNCTION 'BDC_INSERT'
EXPORTING
tcode = tcode
TABLES
dynprotab = i_bdcdata
EXCEPTIONS
internal_error = 1
not_open = 2
queue_error = 3
tcode_invalid = 4
printing_invalid = 5
posting_invalid = 6
OTHERS = 7.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ELSE.
WRITE: / text-109 ,wa_final-matnr,
text-110 .
ENDIF.
ENDFORM. "bdc_transaction -
Script to compare 2 tables and retrieve the differences in records data
Dear All,
please I need a script to compare two oracle database tables and retrieves the differences in data records between the two tables.
I have tried this one :
-- all rows that are in T1 but not in T2
(select * from T1 minus select * from T2)
union all
-- all rows that are in T2 but not in T1
(select * from T2 minus select * from T1);
But it generates the following error:
ORA-01789: query block has incorrect number of result columns
Thank you for your cooperation , please it is urgentok I used this statement with dblink, the problem is that i cannot use PL/SQL developer since it is a process repeated for 300 tables , that why i am trying to automate it:
-- all rows that are in T1 but not in T2
(select * from schema.T1minus select * from T2@dblink_name)
union all
-- all rows that are in T2 but not in T1
(select * from T2@dblink_name minus select * from schema.T1);
I created the db link on a database A and when i run the statement
(select * from schema.T1minus select * from T2@dblink_name)
on the database B i get the error ORA-02019: CONNECTION DESCRIPTION FOR REMOTE DATABASE NOT FOUND.
DOes anybody have an idea please -
How to compare two images and display the difference on Front Panel
HI..
I have attached two images.
I want to compare these two images and subtract the differenc from these two images and display the difference(the mouse) on the front panel
Anyone can help me?
Really thanks
Attachments:
IMG_2117.JPG 1677 KB
IMG_2118.JPG 1650 KBThe missing thing. You have to keep in mind that what you see is not the same as the camera sees.
So when using IMAQ Substract it gives you the difference of the value of every single pixel!
In order to find the mouse as only difference you have to manage that every other pixel value stays the same, e.g. with a proper lightening.
At the other hand you can combine different filters or alogorithms to get the object, e.g. if the object is darker or brighter then everything else in the image you could use a threshold and then use morphologic operations to get the objects size and position.
Christian -
How to join two tables and get the supply delivery date next to order?
So there are two tables. One has customer's order no, ordered date, order quantity, available quantity and code of article-
The other table comes form supply side where we have supply order no, article number, ordered qty, and delivery date.
We keep stock so this can not be MOT (made to order) system.
What i need is correct date of arrival to appear next to cusotmers spoecirfic order. The older cusotmers order get's the parts first, second oldest order is next in line etc.
here is any example
customer's order
ref order
art. code
ordered qty
available qty
order date
1809202491
700497
60
0
3.7.2014
1809200528
700497
13
0
20.6.2014
1809198640
700497
7
0
9.6.2014
supply order
supply order
art. code
qty orderd
date of arrival
4501243378
700497
50
4.8.2014
4501263437
700497
20
6.10.2014
There is actually a 3rd "table" and that sort of connects the two and that is stock on hand per art. code.
The main issue is that stock is assigned to purchase orders only when it actually arrives in the warehouse.
A human can easilly connect the dates of when the stock will arrive and quantities with correct customer's order. In this case the firts order will get 50 pcs in August while 10 pcs will remain on backorders. The missing 10 pcs Will arrive in October. The second order will get 10 pcs in october and 3 will remain on backorders with no delivery date. While the third customer orders does not have a delivery date.
So how to make the SAP do this calculations and display the arrival date next to date of customer's order?I checked the instructions as i do not have access to this part. It seem this is a query. We had issues with queries in the past as not all codes from orders would appear in them. They never found the reason why that is happening.
However, I think the main issue is that the information here is not connected and is separately provided for supply and for sales. So i doubt it can be connected in this query.
edit: as you can see the only connection is stock on hand.
and total number of various items we have is close to 100.000 of various article codes. -
Need to compare two fields and populate the other fields.
Hi All,
I have scenario like this.
DATA: text1(150) type C
VALUE 'Step: SHORT DUMP; Scenario: PRE; Date :09.07.2007. Time :13:08:33.'.
DATA: text2(150) TYPE C
VALUE 'Step: &; Scenario: &; &',
DATA: text_A(150) TYPE C,
text_B(150) TYPE C,
text_C(150) TYPE C.
Now I need to compare text1 and text2 and populate text_A, text_B and text_C as follows.
text_A = SHORT DUMP
text_B = PRE
text_C = Date :09.07.2007. Time :13:08:33.
Basically I need to fill text_A, text_A and text_A with the values in text1 which are replaced by '&'.
Can anyone suggest me a code snippet to do it?
Thanks in advance.
Regards
AnkitSorry for slow response - I'm in a different timezone I think... Well it's not a short algorithm, but you could try something like the following (there's probably a sweeter algorithm, but this is what occured to me overnight)... I realise that it's not foolproof as you could have words substituted in for the "&" that also appear in the original message text and that would skew the results...
Jonathan
report zlocal_jc_get_msgvars.
types:
gty_char150(150) type c.
parameters:
p_text_1 type gty_char150 lower case,
p_text_2 type gty_char150 lower case.
initialization.
perform initialization.
start-of-selection.
perform extract_msgv.
*& Form initialization
form initialization.
*" Default screen variables
concatenate
'Step: SHORT DUMP; Scenario: PRE;'
'Date :09.07.2007. Time :13:08:33.'
into p_text_1 separated by space.
p_text_2 = 'Step: &; Scenario: &; &'.
endform. "initialization
*& Form extract_msgv
form extract_msgv.
*" Work out the values that have been substituted
*" into p_text2 to make p_text1
data:
l_text_a type gty_char150,
l_text_b type gty_char150,
l_text_c type gty_char150,
l_text_d type gty_char150,
l_tabix_1 type i,
l_tabix_2 type i,
l_word_1 type gty_char150,
lt_word_1 type gty_char150 occurs 10,
l_word_2 type gty_char150,
lt_word_2 type gty_char150 occurs 10,
l_result type gty_char150,
l_tabix type sy-tabix,
l_tabix_next type sy-tabix,
l_tabix_from type sy-tabix,
l_tabix_to type sy-tabix,
lt_tabix type sy-tabix occurs 4,
lt_result type gty_char150 occurs 10.
*" Break the strings into words
split p_text_1 at space into table lt_word_1.
split p_text_2 at space into table lt_word_2.
format reset.
format color col_total.
write: / p_text_1(80).
write: / p_text_2(80).
format reset.
*" Look at where the words in the shorter string appear in the longer
loop at lt_word_2 into l_word_2.
add 1 to l_tabix_2.
write: / 'P_TEXT_2, Word', l_tabix_2, l_word_2.
if l_word_2+0(1) = '&'. "placemarker
continue.
endif.
*" examine the expanded version
read table lt_word_1 into l_word_1
with key = l_word_2.
if not sy-subrc is initial.
write: /
'ERROR: Word not found in expanded version' color col_negative.
continue.
endif.
l_tabix_1 = sy-tabix. "Where we found word from short msg
append l_tabix_1 to lt_tabix.
endloop.
*" add pointer to end of list of words too
describe table lt_word_1 lines l_tabix_1.
add 1 to l_tabix_1. "because we subtract 1 below...
append l_tabix_1 to lt_tabix.
loop at lt_tabix into l_tabix_from.
l_tabix = sy-tabix.
write: / l_tabix_from.
*" get the range of words we want by getting next tabix row
*" and subtracting 1
l_tabix_next = l_tabix.
add 1 to l_tabix_next.
read table lt_tabix into l_tabix_to index l_tabix_next.
if not sy-subrc is initial. "no more words...
exit.
endif.
add 1 to l_tabix_from.
subtract 1 from l_tabix_to.
loop at lt_word_1 into l_word_1
from l_tabix_from to l_tabix_to.
write: / l_word_1 color col_positive.
* Push into text_A, text_B, text_C, text_D
case l_tabix.
when 1.
concatenate l_text_A l_word_1 into l_text_a
separated by space.
when 2.
concatenate l_text_b l_word_1 into l_text_b
separated by space.
when 3.
concatenate l_text_c l_word_1 into l_text_c
separated by space.
when 4.
concatenate l_text_d l_word_1 into l_text_d
separated by space.
endcase.
endloop.
endloop.
uline.
format reset.
format color col_group.
write: / 'TEXT_A', l_text_a(80).
write: / 'TEXT_B', l_text_b(80).
write: / 'TEXT_C', l_text_c(80).
write: / 'TEXT_D', l_text_d(80).
format reset.
endform. "extract_msgv -
Refresh table and display the records after insertion of data from back end
Hi Experts,
JDEV 11.1.2.1
I have a useacase which needs data to be inserted from oracle back end procedure and displayed in a ADF Table Component, when a button is pressed.
is this possible?..if yes , how?
Is view object will automatically refreshed and fetches newly created(from back end) rows?
thankz in advance
PMSHi user707,
thankz for ur reply....
i think after executing a procedure you want to call commit operation. better you can perform this.getDbtransaction().commit In Application Module;yes i want to commit transaction after executing back end procedure using preparedStatement.Procedure is for inserting data into same table , which used for creating VO and Read only ADF Table.Procedure is executed fine, but newly created records are not getting into ADF table.Once i did commit opeartion inside back end procedure, whole records are getting into ADF Table.
Is there any way to get whole records without doing Commit operation inside Back end procedure?
PMS -
Hello!
I have one table in ERP6.0 system, let's say T082G that is different in DEV and in PRD system after the Upgrade. The difference is the one table has more activated radio buttons than the other one.
How can I compare the two tables and fix the problem?
Which tcode can be applied here?
Thank you very much!
regards
ThomHi,
Compare a contents of a table between clients.
and also, The contents of a table between two systems can be checked through the transaction OY19
Regards -
Stored Procedure to compare two tables data
Hello,
I want to have a Stored Procedure which will compare data (only a single column) of two tables and delete the row which is not present in the second table.
For eg.,
I have got 2 tables called Table1 and Table2, which have the same column called ID(PK).
The data in Table1 is 1,2,3 and data in Table2 is 1,3. When the stored procedure runs, it has to compare the ID column in Table1 to ID column in Table2 and since '2' is not there in Table2, I want to delete this row from Table1.
Thanks in advance.user11281601 wrote:
Hello,
I want to have a Stored Procedure which will compare data (only a single column) of two tables and delete the row which is not present in the second table.
For eg.,
I have got 2 tables called Table1 and Table2, which have the same column called ID(PK).
The data in Table1 is 1,2,3 and data in Table2 is 1,3. When the stored procedure runs, it has to compare the ID column in Table1 to ID column in Table2 and since '2' is not there in Table2, I want to delete this row from Table1.
Thanks in advance.
delete from table1 where id_column in
(select id_column from table1
minus
select id_column from table2); -
How to compare two tables in SSIS?
I am creating an SSIS package that will compare two tables and then insert data in another table.
Which tool shall I use for that? I tried to use "Conditional Split" but it looks like it only takes one table as input and not two.
These are my tables:
TABLE1
ID
Status
TABLE2
ID
Status
TABLE3
ID
STatus
I want to compare STATUS field in both tables. If Status in TABLE1 is "Pending" and in TABLE2 is "Open" then insert this record in TABLE3.You can use MERGE command , Sorry cannot test it right now.
MERGE INTO tbl3
USING (SELECT tbl2.ID, tbl2.status,tbl1.status as st1 FROM tbl1 JOIN tbl2 ON tbl1.ID=tbl2.ID) AS t ON T.ID=tbl3.ID
AND t.status='OPEN' AND t.st1='pending'
WHEN NOT MATCHED
INSERT (status) VALUES (t.status)
Best Regards,Uri Dimant SQL Server MVP,
http://sqlblog.com/blogs/uri_dimant/
MS SQL optimization: MS SQL Development and Optimization
MS SQL Consulting:
Large scale of database and data cleansing
Remote DBA Services:
Improves MS SQL Database Performance
SQL Server Integration Services:
Business Intelligence -
Comparing Two tables with 300k records and update one table
Could you let me know how to compare two tables having 300k records and update one table.below is the scenario.
Table Tabl_1 has columns A,B and Tabl_2 has columns B,new_column.
Column B has same data in both the tables.
I need to update Tabl_2 in new_column with Tabl_1 A column data by comparing B column in both tables.
I m trying to do using PLSQL Tables.
Any suggestion?
Thanks.Hi,
Whenever you have a problem, please post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) from all tables involved, so that the people who want to help you can re-create the problem and test their ideas.
Also post the results you want from that data, and an explanation of how you get those results from that data, with specific examples.
If you're asking about a DML statement, such as UPDATE, the CREATE TABLE and INSERT statements should re-create the tables as they are before the DML, and the results will be the contents of the changed table(s) when everything is finished.
Always say which version of Oracle you're using (for example, 11.2.0.2.0).
See the forum FAQ: https://forums.oracle.com/message/9362002
ef2019c7-080c-4475-9cf4-2cf1b1057a41 wrote:
Could you let me know how to compare two tables having 300k records and update one table.below is the scenario.
Table Tabl_1 has columns A,B and Tabl_2 has columns B,new_column.
Column B has same data in both the tables.
I need to update Tabl_2 in new_column with Tabl_1 A column data by comparing B column in both tables.
I m trying to do using PLSQL Tables.
Any suggestion?
Thanks.
Why are you trying to use PL/SQL tables? If tabl_1 and tabl_2 are regular database tables, it will be much simpler and faster just to use them.
Depending on your requirements, you can do an UPDATE or MERGE, either in SQL or in PL/SQL. -
Compares two tables S780 and S720 by material , Print the Difference value
Hi abapers,
Report which compares the two tables S780 and S720 by material
the Statistic currency value of these two tables if show the differences
the report should display only Diffrece value:
The selection should be by
Revenue country, Salesorganisation , month and version
output like this
Material Value S720 / Value S780 / currency difference should be print out.
Regards
RajHi
Use join or for all entries
then move the records into a final table
loop at itab
then get the difference.
modify the itab by transporting the difference.
Regards
Shiva -
Comparing and picking the right value form one of the line item in a doc.
Hi Gurus,
I have requirement such that I have to show the tax jurisdiction code of only one item. That is if there are 5 line items with in a document and each one has diffeerent tax jurisdiction code, then we should be showing only one tax jurisdiction code for a document. Line items are not displayed in report. The condition to pick up tax jurisdiction code is the one which has least ending zeros.
Supppose
Doc1 Item Tax Jurisdiction code
1800000002 1 CNQC00000000000
1800000002 2 CNQC00000000000
1800000002 3 CN0000000000000
1800000002 4 CNQC00000000000
1800000002 5 TXJOHNCLEBUR000
I have to display the value of tax jurisdiction code corresponding to item 5 as its has least zeros in it.
So what I am trying to do is add another custom z object tax jurisdiction code and the value for this is populated using a routine in the update rules, such that comparing all the tax jurisdiction code for all the corresponding items in a document.
Now the question is if I am reading all values of document no. line item and tax jurisdiction code into an internal table form communication structure for a data package. And in the update rule I will be writing a routine comparing the values of tax jurisdiction code from internal table and populating the desired value. Now the big question for me is if there are two line items of a document in one data package and another 3 line items of the corresponding same document in data package 2 then how can we compare the values of Tax jurisdiction code of all the 5 line items of a document.
If this can be achieved using customer exit on the front end let me know and just inputs how the abap code would be or if not do I have to write abap in updates rules. I just want to know how to compare different values of Tax Jurisdiction code and select the one with has least ending zeros. For information the tax jurisdiction code is of type character and length 15.
Any help is really appreciated.
Thanks,
RajYes, it's possible. Just use a regular text item. Create an LOV using the LOV wizard. When you define the query for the LOV's record group, enter a statement that selects from the other database table. Set the return value of the appropriate LOV column to be the text item on the form. Finally, assign the LOV to that text item, so that the LOV pops up when the user presses the LOV key with the cursor in that text item. You can also set the LOV so that it automatically displays when the cursor enters the text item.
Just look up LOV in online help if you need more info.
Maybe you are looking for
-
Phones not getting IP address via DHCP server on same VLAN
Hello....we have a new series of Cisco SF-200s and one new Cisco SF-300. All switches are operating in layer 2 mode currently. Let's say for all intents and purposes, all ports are in VLAN1....pretty much default setup. There is a fiber backbone b
-
I recently deleted my entire I tunes library (deliberately) and before I did I consolidated the library and burnt the entire itunes folder to disc. Now I want to reinstate the library and so I have put the itunes folder back in its original position.
-
Display of JPG in binary format
Hi, I'd like to diplay a jpg in ABAP WD. This jpg ist stored as binary in a table (several table lines of type raw). Could anyone tell me how to display this jpg in ABAP WD. Thank you and best regards, Edgar
-
Premiere pro cc 2014 new update terribly slow, previous versions available?
recently updated to the newest version of premiere pro in the middle of a project. ( silly, i know) been experiencing so many problems. specifically lag in the program and rendering previews. ive searched all over threads and google for what could be
-
i havent had any problems with my camera up until now. i have had the Curve 8310 for 3 months and now all of a sudden the camera wont zoom. can anyone help me out with that. Solved! Go to Solution.