Configuring HTTP and RFC Connections 
For local RFC connections between AS ABAP and AS Java (that is, for RFC connections within the same instance), the variable $$ is used for local addressing.
Specify the following parameters:
hostname: localhost
gwservice: 'sapgw$$'
instno: '$$'
At runtime, rfcengine substitutes '$$' with the local instance number.
Call transaction SM59.
Choose the HTTP destination INTEGRATION_DIRECTORY_HMI.
Set the HTTP connect data to <virtual host>:<httpport>.
Choose the RFC destination AI_RUNTIME_JCOSERVER.
Delete the gateway settings.
Repeat step 5 for the following RFC destinations:
LCRSAPRFC
SAPSLDAPI
Start the SAP NetWeaver Administrator.
Choose .
Select the RFC destination AI_RUNTIME_JCOSERVER.
Change the gateway connection data to localhost, sapgw$$.
Change the repository connection data to localhost, $$.
Repeat steps 4 and 5 for the following RFC destinations:
LCRSAPRFC
SAPSLDAPI
Choose .
Select the HTTP destination pmistore.
Set the HTTP connect data to <virtual host>:<httpport>.
RFC and HTTP destinations to the Integration Server should address the load balanced components Message Server and Web Dispatcher.