‎2009 Jun 19 9:47 AM
Any ideas why the following code dumps? The fields in the type are of the same type as the database fields.
TYPES:
BEGIN OF gy_ratings,
objid TYPE hrobjid,
scale_id LIKE t77tp-scale_id,
stext LIKE t77ts-stext,
rating LIKE t77tp-rating,
pstext LIKE t77tp-pstext,
END OF gy_ratings.
Data:
gt_ratings TYPE TABLE OF gy_ratings,
SELECT hobjid ascale_id arating apstext b~stext
FROM hrp1033 AS h
INNER JOIN t77tp AS a ON ascale_id = hscale
INNER JOIN t77ts AS b ON bscale_id = hscale
AND blangu = alangu
INTO TABLE gt_ratings
WHERE h~plvar = g_plvar
AND h~otype = c_qk
AND a~langu = sy-langu.
‎2009 Jun 19 9:53 AM
‎2009 Jun 19 9:50 AM
Hi,
What does your Short dump say?
And the order of selection of fields should be in the same order as they are declared
Regards,
Shailaja
‎2009 Jun 19 9:53 AM
The order change did the trick, didn't think it was something so simple! Thanks
‎2009 Jun 19 9:52 AM
Hi ,
Try with this,
TYPES:
BEGIN OF gy_ratings,
objid TYPE hrobjid,
scale_id LIKE t77tp-scale_id,
stext LIKE t77ts-stext,
rating LIKE t77tp-rating,
pstext LIKE t77tp-pstext,
END OF gy_ratings.
Data:
gt_ratings TYPE TABLE OF gy_ratings,
SELECT hobjid ascale_id bstext arating a~pstext
FROM hrp1033 AS h
INNER JOIN t77tp AS a ON ascale_id = hscale
INNER JOIN t77ts AS b ON bscale_id = hscale
AND blangu = alangu
INTO TABLE gt_ratings
WHERE h~plvar = g_plvar
AND h~otype = c_qk
AND a~langu = sy-langu.
Please let me know if you still face problem.
Thanks and regards,
rajeshwar
‎2009 Jun 19 9:56 AM
‎2009 Jun 19 9:53 AM
‎2009 Jun 19 9:58 AM
sequence of fields RATINGS, PSTEXT and STEXT does not match in select statement and in the Internal table defined.
Modify the internal table as
TYPES:
BEGIN OF gy_ratings,
objid TYPE hrobjid,
scale_id LIKE t77tp-scale_id,
* stext LIKE t77ts-stext, "Comment this field
rating LIKE t77tp-rating,
pstext LIKE t77tp-pstext,
stext LIKE t77ts-stext, "Add field here
END OF gy_ratings.Hope it will work.