Skip to Content
0
Former Member
Apr 23, 2014 at 05:37 AM

To use Tvarc or custom table?

3033 Views

Got an interesting situation at a client,

background situation:

Take for ex Company Code 0010,0020,0030, 0040

Lets suppose the below company code, customers, ending balance exist

CC 0010 has customers C0020 (+$1000) , C0030 (+$2000), C0040 (+$3000)

CC 0020 has customers C0010 (+$1000) , C0030 (+$1000), C0040 (+$1000)

CC 0030 has customers C0010 (+$2000), C0020 (+$2000), C0040 (+$3000)

CC 0040 has customers C0010 (+$100) . C0020 (-$5000) , C0030 (-$2000)

and there are transactions between each and every company code.

transactions are posted via i/c document posting or manual journal's directly to customers. I/C posting uses OBYA config to derive customer number when posting between company codes

Program :

There is a program which has the following selection fields , Customer number & company code. The program was incorrectly designed to pick up all balances for entered customers and company codes

so for example, if I enter customer number range between CC0010 and CC0040 and leave company code blank then , it will net all balances between all company codes 0010 to 0040

if I leave customer numbeer empty and enter * for company codes, then it will do the same ; pick up all customer balances for all company codes and outputs them.

so when i run program for company code 0010 to 0040, i get the following balances

CC0010 ($3100), CC020 (-$2000), CC030 (+$1000), CC040 +($7000)

What do I want?:

The issue is that at the client there is a special relationship between 0010 and 0030 and 0010 and 0020 , which means only customers that have a special relationship between these company codes need to be picked up.

so what needs to happen is that when program is run the program for all company codes, only the relevant customers need to be picked up

so when program is run between 0010 and 0040, the following is the to be based on special relation between company codes 0010 /0030 & 0010/0020

CC0010 ($3000), CC020 (+$3000), CC030 (+$3000), CC040 +($7000)

As you can see values from CC0040 is not picked up. The reason we cannot exclude 0040 company code is because CC0040 may have a relationship with another company code for ex CC0080.

Option 1 : I thought of maintaining a table with customer number and company code relationship where the program only picks up values if maintained if a business maintained Z table

option 2: Can a two column TVAR be created. i remember using a 2 column TVAR previously though I am unable to replicate that now using tcode TVARVC

Can you folks think of any other solutions that is sustainable and scalable as the number of special relationships between companies increase?