07-09-2010 6:36 AM
Hi,
I want to compare two fields of two different tables. One field is Char type , another is Numc.
How can I compare these fields ?
Is it possible ?
If not, tell me any other ways..
07-09-2010 6:42 AM
07-09-2010 7:08 AM
I am using inner join to combine two tables.
I want to fetch the data from these tables.
The field in one table char, and in another the field is numc.
How to compare these two ?
07-09-2010 7:17 AM
Hi Rajesh,
Can you please tell me the table names if they are standard. I will just give a try.
07-09-2010 7:19 AM
HI,
In the inner table in which you have numc field, create one more field of type char. THen loop the internal table and then fill the new char field using numc.
Then use the char field in inner join with second table char field.
07-09-2010 7:22 AM
SELECT ACBRQNO AGJAHR AWERKS AREQR BREFNUM BDESCRIPT
FROM ZBUDGET_MASTER AS A INNER JOIN ZTRACK_NO_MAST AS B ON
<h5>ACBRQNO = BTRACKNO</h5>
INTO TABLE ITAB
WHERE A~GJAHR = IT_GJAHR AND
A~WERKS IN IT_WERKS AND
A~PROJ IN IT_PROJ.
<h4>CBRQNO is char</h4>
<h4>TRACKNO is numc </h4>
How to compare and fetch ?
07-09-2010 7:36 AM
HI
Comparing wont be problem in your case
as char can accomadate the numerics also .but weder you are getting any bug while performing te querry ...!
07-09-2010 7:39 AM
It is not showing any bug at all.
But , I couldn't fetch the data from the database.
10-14-2010 12:23 PM
ACBRQNO = BTRACKNO
for above two fields CBRQNO & TRACKNO , please check out their Conversion routine in their respective Database table.
1st in SE11-> enter table name ZBUDGET_MASTER & ZTRACK_NO_MAST in different sessions. and check out the data domain used by this fields(CBRQNO & TRACKNO).
In their respective domains of fields(CBRQNO & TRACKNO), click on tab 'DEFINITIONS', then check out the conversion routines in Output Characteristics of the Data Domain of field(CBRQNO & TRACKNO).
From my point of view, both the Conversion routines should be the same.
If Conversion Routines are not there, then insert suitable Conversion routine for both the fields domain(CBRQNO & TRACKNO).
For help for for conversion routines:
http://help.sap.com/saphelp_46c/helpdata/en/cf/21ee19446011d189700000e8322d00/content.htm
http://help.sap.com/saphelp_nw04/helpdata/en/35/26b217afab52b9e10000009b38f974/content.htm
http://abaplovers.blogspot.com/2008/03/conversion-routines-in-sap.html
hope this solution could solve your issue..
Awaiting for your reply!!
07-09-2010 6:43 AM
hello Rajeshblack ,
you cand do it using 'LIKE' addition in your query....and you can use wild Characters also like '%' '+' & '_'
just like select * from makt where makt like '%ABC%'. it will work as 'CP' operater i
just check for the help for LIKE addition in Where clause in query...!
Hope it helps.
07-09-2010 6:43 AM
07-09-2010 6:47 AM
Hi,
Try assigning numc also to char type locally in a variable and then compare the char.