07-07-2010 1:19 PM
i have written a select statement that although the table is populated with values, it is not selecting the records based upon the field i have specificed.
TYPES: BEGIN OF measure_docs,
ref_obj TYPE imrc_mdocm,
nodeid TYPE diohfw_nodeid,
END OF measure_docs.
SELECT ref_obj nodeid FROM diohfw_nodes INTO TABLE gt_measure_docs
FOR ALL ENTRIES IN gt_diohfw_nodes
WHERE sup_nodeid = gt_diohfw_nodes-nodeid
AND type = 'MDC'.
IF NOT gt_measure_docs IS INITIAL.
SELECT * FROM imrg INTO TABLE gt_imrg
FOR ALL ENTRIES IN gt_measure_docs
WHERE mdocm = lt_measure_docs-ref_obj.
ENDIF.
i have 15 entries in my gt_measure_docs table... i can copy the paste into se11 IMRG and see the values in the data display.
the field mdocm has an ALPHA conversion on so i tried adding the 00000000000000000234 to convert to 234, but it still cannot find the entries... i am sure i have missed something simple....
i typed the "ref_obj" as imrc_mdocm but still no dice! :o( any ideas what i have missed?
07-07-2010 1:27 PM
Hi,
just add
IF NOT gt_measure_docs[] IS INITIAL.
and
SELECT * FROM imrg INTO TABLE gt_imrg
FOR ALL ENTRIES IN gt_measure_docs
WHERE mdocm = gt_measure_docs-ref_obj. --> GT
Edited by: Madhukar Shetty on Jul 7, 2010 2:27 PM
07-07-2010 1:27 PM
Hello
IF NOT gt_measure_docs IS INITIAL. " <- gt_measure_docs
SELECT * FROM imrg INTO TABLE gt_imrg
FOR ALL ENTRIES IN gt_measure_docs " <- gt_measure_docs
WHERE mdocm = lt_measure_docs-ref_obj. " <- lt_measure_docs ??? are you sure ?
ENDIF.
07-07-2010 1:30 PM
Ignore
Maroz - Well spotted
Edited by: Keshav.T on Jul 7, 2010 6:01 PM
07-07-2010 1:47 PM
sorry! that was still in there as i had loop round gt_measure_docs then called CONVERSION_EXIT_ALPHA_OUTPUT and changed the number and appended to a lt_measure_Docs as it was not working... i just did not change the LT back to GT for all of them.
i have now amended the code and it still does not like it.
07-07-2010 9:32 PM
07-07-2010 2:36 PM
Have you checked your data type/length mismatch? 40 characters in one table, 20 in the other...is it not matching because of that?
07-08-2010 12:57 PM
i linked up on another field and via another table... works better now..
thanks anyway!