‎2006 Nov 27 6:58 PM
Hi:
I an SQL statement in which I have a where clause in which I am comparing/matching 2 fields. I get the error message "...the fields *A and B* must have the same length and type". I know that the types are same but how do I reduce the length of field A to match field B. Field A is 18 characters and field B is 40 chars. Thanks in advance.
B
‎2006 Nov 27 7:27 PM
Hi,
If you use DP_XX9...
The field DP_XX9 will always have only one value..If the values are different in the internal table DATA_PACKAGE then you have to use the technique that I suggested.
Thanks,
Naren
‎2006 Nov 27 7:00 PM
Hi,
if it is possible then take the same TYPE or else,
Move the Field to another field using the offset and use the new field in the where condition
Regards
Sudheer
‎2006 Nov 27 7:01 PM
‎2006 Nov 27 7:03 PM
Hi,
If you are using FOR ALL ENTRIES in your SQL..Move the values to an internal table that matches the data type and length..And use that internal table for the FOR ALL ENTRIES..
Thanks,
Naren
‎2006 Nov 27 7:09 PM
Okay here's a little more details. Also can you be a little more detailed (exact Syntax) as I'm not an ABAP programmer. Thanks
SELECT /BIC/XX1
/BIC/XX2
/BIC/XX3
FROM /BIC/ODS1
INTO TABLE ITAB_ODS1
FOR ALL ENTRIES IN DATA_PACKAGE
WHERE /BIC/XX1 = DATA_PACKAGE-/BIC/XX1
AND /BIC/XX2 = DATA_PACKAGE-/BIC/XX9.
Note: /BIC/XX2 length is 18 and /BIC/XX9 length is 40. Thanks
null
‎2006 Nov 27 7:13 PM
Hi,
Check this solution..
TYPES: BEGIN OF TYPE_DATA,
/BIC/XX1 TYPE /BIC/ODS1-/BIC/XX1,
/BIC/XX2 TYPE /BIC/ODS1-/BIC/XX2,
END OF TYPE_DATA.
DATA: T_DATA TYPE STANDARD TABLE OF TYPE_DATA.
DATA: S_DATA TYPE TYPE_DATA.
LOOP AT DATA_PACKAGE.
S_DATA-/BIC/XX1 = DATA_PACKAGE-/BIC/XX1.
S_DATA-/BIC/XX2 = DATA_PACKAGE-/BIC/XX9.
APPEND S_DATA TO T_DATA.
ENDLOOP.
SELECT /BIC/XX1
/BIC/XX2
/BIC/XX3
FROM /BIC/ODS1
INTO TABLE ITAB_ODS1
<b>FOR ALL ENTRIES IN T_DATA
WHERE /BIC/XX1 = T_DATA-/BIC/XX1
AND /BIC/XX2 = T_DATA-/BIC/XX2</b>.
Thanks,
Naren
‎2006 Nov 27 7:25 PM
What do you think of this solution. Do you think this is workable? I like your solution but in the meanwhile I had worked up this one so I thought I might as well check with you. Thanks for your help sir.
DATA DP_XX9 LIKE DATA_PACKAGE-/BIC/XX9.
DP_XX9 = DATA_PACKAGE-/BIC/XX9.
DP_XX9 = DP_XX9(18). -
>I may be wrong but I'm trying to trim it------
(Fill Internal Table)
SELECT /BIC/XX1
/BIC/XX2
/BIC/XX3
FROM /BIC/ODS1
INTO TABLE ITAB_ODS1
FOR ALL ENTRIES IN DATA_PACKAGE
WHERE /BIC/XX1 = DATA_PACKAGE-/BIC/XX1
AND /BIC/XX2 = DP_XX9.
‎2006 Nov 27 8:14 PM
‎2006 Nov 27 7:27 PM
Hi,
If you use DP_XX9...
The field DP_XX9 will always have only one value..If the values are different in the internal table DATA_PACKAGE then you have to use the technique that I suggested.
Thanks,
Naren