05-09-2013 7:50 AM
With Respect Gurus,
I have a problem in a query using 3 table tables with inner join...
SELECT a~DIVID a~DPTID b~SFTCD c~FRMTM c~TOTTM
INTO (YEMPMST-DIVID, YEMPMST-DPTID, YESHTMST-SFTCD,
YSHIFTM-FRMTM, YSHIFTM-TOTTM)
FROM yempmst as a
INNER JOIN YESHTMST as b
on b~ADRNR = a~ADRNR
AND b~EMPCD = a~EMPCD
AND b~untno = a~untno
AND b~FRMDT <= YATNDENT-PCHDT
AND b~TODAT >= YATNDENT-PCHDT
INNER JOIN YSHIFTM as c
on c~untno = b~untno
AND c~sftcd = b~sftcd
WHERE a~EMPCD = YATNDENT-EMPCD
AND a~UNTNO = YEMPMST-UNTNO.
ENDSELECT.
Error is:
The list "(YEMPMST-DIVID, YEMPMST-DPTID, YESHTMST-SFTCD,
YSHIFTM-FRMTM, YSHIFTM-TOTTM)" after "INTO" is not of the the form (f1,
...,fn), or contains an undefined field. the form (f1, ...,fn), or
contains an undefined field or contains an
But here all the fields are in correct order ..
Kindly give me suggestion...
Many Thanks / Himanshu Gupta
05-09-2013 8:10 AM
Hi Himansh,
Probably one or more of the destination fields are not well defined (or not defined at all). But you really should go to INTO TABLE instead of SELECT/ENDSELECT.
Cheers,
Custodio
05-09-2013 7:59 AM
Hi!
Just to see where exactly your problem lies, why dont you first make an internal table with columns
'YEMPMST-DIVID', 'YEMPMST-DPTID', 'YESHTMST-SFTCD',
'YSHIFTM-FRMTM', 'YSHIFTM-TOTTM'
And if error persists you would know problem is in your condition else in 'into' statement. Most likely 1 of the column is not declared in the internal table or there is size/ data type mismatch.
Regards,
KS
05-09-2013 7:59 AM
Hi,
It generally comes when one the fields are not available in that work area. Cross check the field names if you have mapped to proper tables. If still not found, then check by keeping only variable and removing others. if it is correct, then keep addign one by one and check which is causing the issue..
Thanks & Regards,
Swarna
05-09-2013 8:01 AM
05-09-2013 8:02 AM
Hi Himanshu,
Instead of using like
SELECT a~DIVID a~DPTID b~SFTCD c~FRMTM c~TOTTM
INTO (YEMPMST-DIVID, YEMPMST-DPTID, YESHTMST-SFTCD,
YSHIFTM-FRMTM, YSHIFTM-TOTTM)
you can make an internal table with these fields or you can make variables. Try once i guess this will resolve your problem.
05-09-2013 8:06 AM
Hi,
You cannot put the values directly to the columns of an internal table. You can use local variables such as lv_DIVID, lv_DPTID and then pass them on. Or you can also do into corresponding fields of and have a internal table defined with the fields.
Cheers,
Arindam
05-09-2013 8:10 AM
Hi Himansh,
Probably one or more of the destination fields are not well defined (or not defined at all). But you really should go to INTO TABLE instead of SELECT/ENDSELECT.
Cheers,
Custodio
05-09-2013 8:23 AM
Dear All,
Very very thank you to all for your suggestions.
I got it, sometimes some small things get skip of mind .
I didn't defined that YSHIFTM uder TABLES that's why it was causing..
Many Thanks / Himanshu Gupta