Hi,
I am querying table DD05P for info on foreign-key relations between a set of SAP tables. I have two issues about that - I had already solved one, but just today I came across another and the seemingly only way to solve that was to revert what I had done to solve #1 - guess what happened ;-)
The thing is like this:
- I query DD05P for the foreign-key relation between two tables (there are more, but I must always take two at a time).
- Between some tables (KNB1 and KNA1 are an obvious example), there are several relations - but I want only one because putting several into my join-expression will, if nothing else, make the whole thing - the entire statement for Joins between maybe 10 tables goes into one variable - very long.
=> There is, however, only one relation which uses the keyfields (MANDT and KUNNR). So an obvious solution to this is filtering for the keyfield. I can do that by joining DD05P with DD03L, the latter has a field 'keyflag' which tells me what field is a key in a given table.
Now comes the second issue:
- I am building a scenario with HR tables, among them the text-table T528T (position texts). That one is linked to T528B.
- There is a link between PA0001 and T528B.
=> Obviously, I will need those three tables.
<=> For some reason I cannot yet figure out, only one of the three fields that make up the key to link those two (MANDT, OTYPE and PLANS) is flagged as a keyfield in DD03L.
=> Obviously, filtering for the keyflag will result in not selecting that set of records (between PA0001 and T528B) from table DD05P.
There is my dilemma: One scenario only works with a filter for the keyflag activated, the other one does not work when it's activated. I could help myself for now by just checking the scenario_key and, depending on that, activating or deactivating that filter - but that is a crutch that I'd rather not use in the long run.
I hope I have explained it sufficiently understandable. Does anybody have any thoughts/ ideas/ comments to share on this?
Thanks a lot!
Best regards,
Sapperdapper