Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

help need

Former Member
0 Likes
683

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

6 REPLIES 6
Read only

Former Member
0 Likes
632

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

Read only

0 Likes
632

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

Read only

Former Member
0 Likes
632

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.

Read only

Former Member
0 Likes
632

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

Read only

Former Member
0 Likes
632

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

Read only

Former Member
0 Likes
632

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