Question

I need a search help for my bukrs field. The problem is data should come from different system. There are 2 systems like X and Y. i am in X system and running a program.

At selection screen bukrs field exists. When i click on search help data should come from system Y.

I heard that it is possible to pull data to search help but couldn't find enough info in sites.

Best Regards.

5 month experienced with SAP/ABAP :)

Was it helpful?

Solution

To create a search help with a custom data selection, you can define a search-help exit in your search help. To select data in a custom way and not from a database table, go to the tab "Definition" of the search help, remove the content of the input "Selection Method" and enter a function module into the input "Search help exit". This function module must have the same signature as the example module F4IF_SHLP_EXIT_EXAMPLE. The comments in the sourcecode of this example module will explain you how to implement it. Your implementation of this function module can then perform the data acquisition from another system with a remote function call.

To get data from another system, you have to call a function module in a remote system via RFC (remote function call). To do this you need:

  1. the RFC-capable function module in the remote system which exports the data you need. You can set a tick on the properties tab of a function module to make it RFC-capable.
  2. An RFC connection from the local system to the remote system. RFC destinations can be created and configured with the transaction SM59.

To call a function module via RFC, you just have to add DESTINATION [rfc-destination] to the function call.

CALL FUNCTION 'Z_YOUR_RFC_CAPABLE_FUNCTION_MODULE'
     DESTINATION 'my_rfc_destination'
     IMPORTING [...]

The user will have to log into the remote system in order to call RFC function modules in it, unless you define a username with password in the RFC connection. When you do that, you should create a dedicated system user in the remote system with minimal permissions especially for this RFC connection. When the user has too wide permissions, the RFC connection can be abused for other purposes.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top