SAP calls external programs

Source: Internet
Author: User
How to Implement the sap method (function) in other languages is sap's funcation module. If it is implemented outside, it is to create an FM in SAP, and then use other languages outside, Java ,. net.

Start a service outside sap. This service connects to sap's geteway service. When SAP calls the RFC method, this method is found based on the RFC name (sm59) specified by destination.Program, Find the implementation method.

Purpose:
1. implement complex business processing, which is more difficult to implement in the ABAP Language
2. interface with external systems to compare the external jobs triggered when SAP is doing business
3. obtain data from the outside. The problem is that sap is active.
4. independence between SAP and external languages
5. For example, the interface between SAP and fresh food is called. When SAP receives the goods, it calls an external program in this way and returns the weight back to the SAP system. Very good!

RFC Configuration:
I. T-code : Sm59;Create RFC Connection, the project to be configured: Enter RFC destination , Connection Type Select T (Used TCP/IP Method), enter Description (Description ), Technical settings Select registered server program, configure Program ID This is important and PC The name of the service program registered externally on is the same, Gateway host (Host gateway, which is composed Basis Personnel) XXX. XXX , Gateway Service ( Gateway Service. Basis Personnel, for example: Sapgw10 ).
II. Test Test connection If the configuration is successful, it should pass. No error message.
FM creation:

Se37. Note that the attribute must be set to the remote-enabled module.
FM call method:
 

* ** Initialize the table in l_itab_data ***
Rochelle rfc_destination = 'sm59dname '."'Rfcscale'." specifies the RFC Program
L_WA_WEIGHT-WAAGE ='Sm59programid'. "It is best to have the same two names when configuring sm59,
AppendRochelle wa_weightToRochelle itab_weight."Assign value to internal table

* ** Call the sap function module to obtain data ***'Hu _ get_rfc_data'Is the external Implementation Method Name, please refer to the instance
Call Function 'Hu _ get_rfc_data' Destination l_rfc_destination
Tables
Et_weight = l_itab_weight
Exceptions
Communication_failure = 1 Message Msg_text
System_failure = 2 Message Msg_text.

C # implement FM:

Sap.net is very simple to implement. It uses the sap.net service to generate an RFC interface access method class.

Attachment: sap.net standard instance
Http://files.cnblogs.com/byfhd/CSServerSimple.rar

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.