Search code examples
foreign-keysabapsap-data-dictionary

How to auto-populate field via foreign key relation in SM30?


Sorry if my title doesn't make sense but I found it hard to describe! I have a Z table in SAP TM:

Z table

With a foreign key relationship to the standard table /SAPAPO/LOC

/SAPAPO/LOC

But I want to have an SM30 maintenance where the user populates the /SAPAPO/LOC-LOCNO field (i.e. the depot) and the LOCID is hidden and auto populated. Is this possible? Here is my view:

View

But in SM30 the depot is blanked out after entering. I think I can get it to work by messing around with the auto-generated screen but I would prefer to follow SAP standard.


Solution

  • I decided to go a different route by having LOCNO in my Z table instead of LOCID and then creating a custom check table (copied from /SAPAPO/LOCNO_V). So the user enters the depot name and this is validated against /SAPAPO/LOC.