‎2006 Sep 08 12:15 PM
hi friends,
Could u please help me
SELECT all the records from A903 where
KAPPL in S_KAPPL
AND KSCHL in S_KSCHL
AND VKORG in S_VKORG
AND VTWEG in S_VTWEG
AND PLTYP in S_PLTYP
AND KFRST in S_KFRST
AND KNUMH = CDHDR-OBJECTID
up to this i have written the coading
for below one i have a little bit confusion could u please help me how to do this
Select all condition records for all materials in which the Condition Type = ZPR0, Sales Organization = 1100 and Distribution Channel = 01 and the Price List = 01 or 02.
IF there are multiple records (unlikely, but ) take ONLY the one with the highest end date (DATBI).
From this record the program will get the required values for all the dates needed on the outbound record and the KNUNH is the required condition record.
Regards
Srilavi
‎2006 Sep 08 12:23 PM
put like this
SELECT all the records from A903 where
KAPPL in S_KAPPL
AND KSCHL in S_KSCHL
AND VKORG in S_VKORG
AND VTWEG in S_VTWEG
AND PLTYP in S_PLTYP
AND KFRST in S_KFRST
AND KNUMH = CDHDR-OBJECTID
AND DATBI GE S_budat_low or HIGN.<b>
While Creating the Conition Records each and very record has validation dates.
So DATBI for latest records always will be '99991231'.</b>
Regards
Prabhu
Message was edited by: Prabhu Peram
‎2006 Sep 08 12:28 PM
hi prabhu,
Thanks a lot
but i did nt under stood below one coul u please elabrate
AND DATBI GE S_budat_low or HIGN.
Regards
srilavi
‎2006 Sep 08 12:34 PM
Hi,
do like this
sort the internal table by the date (DATBI) field in descending order,and read the first record.
sort itab by datbi descending.
read table itab index 1.
regards,
sowjanya.
‎2006 Sep 08 12:38 PM
hi,
its simple,first get the data without this condition and then you can just add the records that satisfies the date condition. just sort the internal table fields kschl vkorg vtweg pltyp datbi in descending order and read the first record and append this record to the final internal table.
Regards,
Richa
‎2006 Sep 08 12:41 PM
Hi,
sort itab by kschl vkorg vtweg pltyp datbi descending.
loop at itab where kschl = 'ZPRO'
and vkorg = '1100'
and vtweg = '01'
and ( pltyp = '01 or pltyp ='02').
endloop.
Regards
amole
‎2006 Sep 08 12:48 PM
SELECT MAX(DATBI) into table itab From A903 where KAPPL in S_KAPPL AND KSCHL in S_KSCHL AND VKORG in S_VKORG AND VTWEG in S_VTWEG AND PLTYP in S_PLTYP AND KFRST in S_KFRST AND KNUMH = CDHDR-OBJECTID GROUP BY .
Regards
Anurag