‎2010 Dec 15 9:03 AM
Dear All,
Am selecting records from KEKO and storing into E1KEKO internal table. But am getting dump error. I need to send those E1KEKO records as idoc. Kindly help me out how to fix this dump.
SELECT * INTO CORRESPONDING FIELDS OF e1keko
FROM keko
WHERE keko~matnr = p_matnr
AND keko~werks = p_werks
AND keko~bwtar = 'Z06'
AND keko~bwvar = 'Z06'.
CLEAR t_idoc_data.
t_idoc_data-segnam = c_segnam_e1keko.
t_idoc_data-mandt = sy-mandt.
t_idoc_data-sdata = e1keko.
APPEND t_idoc_data.
CLEAR e1keph.
endselectThanks in advance.
Anandhan
‎2010 Dec 15 9:06 AM
what kind of dump are you getting?
Your select doesnt look too bad so we need more information for a proper analysis.
regards
‎2010 Dec 15 9:15 AM
Hi,
If i use the below select query in a test program, that time also am getting the same dump.
DATA: e1keph TYPE e1keph,
e1keko TYPE e1keko.
SELECT * INTO CORRESPONDING FIELDS OF e1keko
FROM keko
WHERE keko~matnr = '000000000010801071'.
endselect.
(code}
The dump showing the below message
The reason for the exception is:
In a SELECT access, the read file could not be placed in the target
field provided.
Either the conversion is not supported for the type of the target field
the target field is too small to include the value, or the data does no
have the format required for the target field.
Thanks in advance
Anandhan
‎2010 Dec 15 9:22 AM
All fields on an IDoc are of type C. You cannot select fields from a database table and expect them to be put into type C fields. You should select into a structure of type KEKO then do a move-corresponding.
‎2010 Dec 15 9:19 AM
Anadan,
Check the declaration of the data types you are passing in the where condition. In the declaration I have notices
Make shire you have declared p_werks as type WERKS_D not werks coz 'WERKS' is a structure.
Hope this helps,
Murthy
‎2010 Dec 15 9:21 AM
well if you are selecting * into a structure without the statement INTO CORRESPONDING FIELDS OF, you need to select into a structure of exactly the same linetype as the table.
declare your structure of type koke and all is fine.
‎2010 Dec 15 9:25 AM
Your structure E1KEKO needs to have same number of fields with same name as KEKO since you have used * IN CORRESPONDING fields.
Declare E1KEKO TYPE STANDARD TABLE OF KEKO
‎2010 Dec 15 12:12 PM
Hi Sim,
>
> Your structure E1KEKO needs to have same number of fields with same name as KEKO since you have used * IN CORRESPONDING fields.
This is not correct. The only precondition is that fields with same name in database and internal table must have the same data type and length.
All other fields selected or present in INTO table are just not used.
The assumption he used data type werks instead of werks_d is quite probable.
Regards,
Clemens
‎2010 Dec 15 10:00 AM
hello Balu ,
Copy paste your orignal code here . where you getting dump in query. so we can help you.
vanu.
‎2010 Dec 15 10:10 AM
Hi,
The below sample is my test program. I am getting dump in my original program so i tried a sample program. Here also am getting the same.
Friends, Just copy and past the below code. You also will get the same.
Report ztest123456.
DATA: e1keph TYPE e1keph,
e1keko TYPE e1keko.
SELECT * INTO CORRESPONDING FIELDS OF e1keko
FROM keko
WHERE keko~matnr = '000000000010801071'.
endselect.
Write : / 'Test'.
Kindly help me out.
Anandhan
‎2010 Dec 15 10:13 AM
Are you not reading the advice you have been given. It doesn't matter if the queen executes the code, it will still fail.
‎2010 Dec 15 10:14 AM
‎2010 Dec 15 10:20 AM
‎2010 Dec 15 10:22 AM
Hi,
Structures are E1KEKO and KEKO are not same. Hence you are getting Dump.
LOSGR check this field - we have this field as QUAN 13, 3 in KEKO and as CHAR14 in E1KEKO. So even MOVE CORRESPONDING fails.
Thanks,
Naveen.I
‎2010 Dec 15 11:48 AM
‎2010 Dec 15 10:07 AM
‎2010 Dec 15 10:40 AM
‎2010 Dec 15 12:05 PM
Hi,
if you try this, because you don't use inner join::
SELECT * INTO CORRESPONDING FIELDS OF e1keko
FROM keko
WHERE matnr = p_matnr "not keko~matnr
AND werks = p_werks "not keko~werks
AND bwtar = 'Z06' "not keko~bwtar
AND bwvar = 'Z06'. "not keko~bwvar
CLEAR t_idoc_data.
t_idoc_data-segnam = c_segnam_e1keko.
t_idoc_data-mandt = sy-mandt.
t_idoc_data-sdata = e1keko.
APPEND t_idoc_data.
CLEAR e1keph.
endselect
did you get also a dump?
Regards, Dieter