Since BAPI is a special RFC that encapsulates the business logic and converts all businesses into one object, you only need to pass in the output parameters.
Before connecting to BAPI, let's take a look at some BAPI parameter rules. We use the example of BAPI_USER_CREATE. This BAPI can be called to generate a user. Of course, it is not as simple as writing USR02. This account has no permissions after being generated.
Enter the T-CODE: BAPI, and then find the BAPI on the second tab:
In the red box is the name of the BAPI we want to call. Double-click it to go to some descriptions of this BAPI:
As you can see, on the properties page, it selects Remote..., indicating that it can be remotely controlled!
Note that the red box is not optional, that is, the check box is not selected. It tells us that these parameters must be passed in when calling BAPI!
This is the returned parameter. Of course, this Return is also a value that must be passed out.
As you can see from the pictures above, the "reference printing" column is a structure starting with BAPI or a field in the structure. Double-click these structures to view the related fields.
Return to the Import tab and double-click "reference print" -- BAPIBNAME-BAPIBNAME of USERNAME. The front part of "-" is the structure, followed by a column in the structure. Enter:
This BAPINAME structure has only one column, and it is CHAR type, 12 yards, SO. When passing in the user name, it is necessary to write the string.
Let's take a look at the PASSWORD. The structure is: BAPIPWD double-click it, for example:
It is found that there is only one column, CHAR type, 40 yards, and password transfer.
Let's take a look at the structure of BAPIADDR3 corresponding to the ADDRESS field. Double-click it:
This structure has more columns. Although it is not specified that there must be a value, some do need to be assigned, and some can be left empty.
When we create a user in SU01, the system will prompt you to enter the surname and name, so the FIRSTNAME and LASTNAME here are required.
The input parameter LOGONDATA in BAPI puts the login data. The specific structure is not described in detail. The returned message return contains the information of the call result, which is used to RETURN the result information in N3.
After learning about these principles, we can clearly understand how to write them in C #. Those parameters are mandatory and clear at a glance. SO, in the next blog, we will release the code for calling BAPI by NO3!