cancel
Showing results for 
Search instead for 
Did you mean: 

AMDP in BW transformation: SELECT with JOIN on same or last month

yj
Participant
0 Kudos

Dear all,

I have the following requirement: There's an ADSO with material prices for each month until the last month (no data for the current month).

Then I have material movements with quantities and I have to add the material prices from the above mentioned ADSO. For material movements in the current month, I should join the material prices from last month and for material movements in the past, I should join the material prices from the respective month.

For example:
booking date = today (13th December 2023) --> take the material price from the previous month (11/2023), which is the max. month in this ADSO
booking date = 10th May 2022 --> take the material price from 05/2022

How can I achieve this in AMDP in an end routine of a BW transformation?

For requirement to select the respective month, I can do the following:

OUTTAB = SELECT ....
FROM :INTAB as i
LEFT OUTER JOIN ADSO as pr
ON i.CALMONTH = pr.CALMONTH;

Thanks & best regards,
Yvonne

MKreitlein
Active Contributor
0 Kudos

Hello Yvonne,

I am no expert in AMDP, I only write Endroutines in ABAP.

From that point of view, you would not join pr.CALMONTH with i.CALMONTH but with a variable, which you filled out of the sy-datum month -1.

LEFT OUTER JOIN ADSO as pr
ON pr.CALMONTH = lf_last_month.

How you do this in AMDP, I have no clue 😉

BR, Martin

Accepted Solutions (0)

Answers (0)