Quantcast
Channel: SCN : All Content - ABAP Development
Viewing all articles
Browse latest Browse all 8332

Retrieve a value with many conditions

$
0
0

Hi experts,


Let’s take an example with those three tables:


Source Table

 

Account

Functional Area

Profit Center

Amount

60000

00

10001

50,00

60000

05

20002

130,00

70000

13

30001

-450,00

 

Master Data Table:

 

Account

Functional Area Range from

Functional Area Range To

Profit Center Range from

Profit Center Range To

Virtual Account

60000

 

03

10001

10010

AX

60000

04

10

20001

20010

AY

70000

11

20

30000

30010

BX

 

Target Table


Account

Functional Area

Profit Center

Amount

Virtual Account

60000

00

10001

50,00

AX

60000

05

20002

130,00

AY

70000

13

30001

-450,00

BX

 

Source table is feeding Target Table. I have to fill virtual account in target table by reading the master data table.

The idea is like this:


-When the accounts are equal between source table and Master data table

-Check in a first time the functional area in source table between from and to in master data table

-Then check the profit center in source table between from and to in master data table

-Then fill virtual account

 

At the end, the expected results are in green in target table.In my next message I will send my proposal , I would like to see if it's OK and how I can enhance it.


Thanks.


Amine


Viewing all articles
Browse latest Browse all 8332

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>