‎2007 Nov 06 10:24 AM
Hi,
pls look into the code.
clear: wf_etenr,
vbep.
To get the Scheduled Loading date and Scheduled Arrival Date.
SELECT MAX( etenr ) FROM vbep INTO wf_etenr
WHERE vbeln = tvbdpl-vgbel
AND posnr = wl_posnr.
IF sy-subrc EQ 0.
clear vbep.
SELECT SINGLE * FROM vbep "R02
WHERE vbeln = tvbdpl-vgbel "R02
AND posnr = tvbdpl-vgpos "R02
AND etenr = wf_etenr.
IF sy-subrc EQ 0.
when i see the values at dictionary level using the same wher conditions are mismatching with the query excution result in the program.
here in the second query ( SELECT SINGLE * ) it giving the wrong results .
if i compare the results at table level ,some of the field values are missing after excuting the above second query.
pls can any one give me ur suggestion on this !
rgds
sanjay reddy
‎2007 Nov 06 10:33 AM
Hi,
are these the same?
wl_posnr and tvbdpl-vgpos
try
SELECT SINGLE * FROM vbep
WHERE vbeln = tvbdpl-vgbel
AND posnr = wl_posnr
AND etenr = wf_etenr.
IF sy-subrc EQ 0.
to make somewhat consistent querys.
regards
Message was edited by: Zlatko
Zlatko Stracenski
‎2007 Nov 06 10:38 AM
declare the workarea similar to vbep and do the select single from vbep into wa_vbep and give the conditions.
whereas for first query select that field without max function and then sotr it accordingly and get the first record.
‎2007 Nov 06 10:46 AM
Hi,
DATA WA type VBEP.
SELECT VBELN POSNR MAX( ETENR ) FROM vbep INTO WA
WHERE vbeln = tvbdpl-vgbel
AND posnr = wl_posnr.
IF sy-subrc EQ 0.
clear vbep.
SELECT SINGLE * FROM vbep "R02
WHERE vbeln = WA-VBELN "R02
AND posnr = WA-POSNR "R02
AND etenr = WA-ETENR.
IF sy-subrc EQ 0.
Trythis,
KC