Skip to main content

Custom BAPI creation - Step-by-step Procedure

To create the custom BAPI, we need to follow this step-by-step procedure. The steps are 
  1. Create the BAPI structure.
  2. Create Remote Function Module.
  3. Place the Remote Function Module into BOR (Business Object Repository).
  4. Implement, Generate and Release the BAPI.
Step 1: To create BAPI structure, the structure name should start with the keyword ZBAPI. Here, Two BAPI structures are created in this scenario .The name of these BAPI structures are ZBAPI_IMPORT and ZBAPI_TABLE. 
Step 2:  ZBAPI_IMPORT structure contains the following fields. 
 
Step 3: ZBAPI_TABLE structure contains the following fields. 
 
Step 4: Now, define the Remote Enabled Function Module using T-Code SE37 starting with the ZBAPI . Provide the name of the function module as ZBAPI_DEMO_SD. We must pass the Import and export parameters as value parameters
Attribute Parameters:   
Import Parameters:   
Export Parameters:   
Return parameter in the Export parameter contains the error messages. Here, we must create a parameter of type structure BAPIRETURN either in Export Parameter or Table Parameter. 
Table Parameters:   
Source Parameter:   
Step5: Place this Function Module in to BOR using the T-code SWO1. Provide the name of the object and press create button. 
 
Provide the following details. 

Step 6: Add our Custom BAPI using Utilities->API Method->Add Method 
 
Now, Provide the created Custom Function Module name and click enter. 
 
Press the Next Step Button. 
 Press the Next Step Button. 
 
Click the YES button. 
 
Now, Method is added in the BOR. 
 
And Press Save button. 
Step 7: Now Implement the BAPI. 
 
Now, Generate the BAPI by clicking symbol ‘ball’. 
 
Lastly, Release the BAPI. 
Step 8: Now test the BAPI by clicking Execute Button. 
 
The following screen appears and click execute button. 
Provide the sales document number and press execute button. 
 
Now check the output as follows… 

Comments

Popular posts from this blog

Step by Step guide on BADI with Filter implementation

Step 1 à Before implementing filter objects to a BADI. We need to deactivate all the implementation for that BADI. Go to SE18 (BADI definition) and from there navigate to all BADI implementation to view all the active implementations for that BADI Select the BADI implementations listed on the screen and deactivate the implementation. Once done, return back to the initial screen of SE18 and proceed with next step. Step 2 à go to SE18 – BADI Definition screen and change the existing BADI definition that we created in the earlier tutorial.   Select the FILTER –DEPENDENT check box under the TYPE section. This will open up the FILTER TYPE field for inputs. And do an F1 on the FILTER TYPE field. Click on the F4 on the FILTER TYPE field name and enter some search criteria to find a relevant data element. And click on the continue button   Select the data element from the list to set up your filter and hit enter. Click on the save butto...

Creating Hierarchies

Prerequisites In the InfoObject maintenance, the indicator with hierarchies is set for the relevant characteristic, meaning that the characteristic can have hierarchies. Procedure Step 1: Select the InfoObject tree in the Administrator Workbench. If you have assigned the characteristic to an InfoObject catalog, select the corresponding InfoObject catalog for an InfoArea. If the characteristic does not belong to an InfoObject catalog, select the Not Assigned Nodes InfoArea and the Not Assigned Characteristics InfoObject catalog. Step 2: Select the characteristic for which you want to create a hierarchy, choose the context menu with the right mouse button, and then Create hierarchy. Step 3: In the dialog box, enter the technical hierarchy name, or the hierarchy version if applicable, the time-reference, and at least one short description of the hierarchy. Confirm your entries. You come to the screen Maintain hierarchies. You can now define your hierarchy here. Creating Nodes and Leaves...

Introduction to SAP Hierarchies

Definition A hierarchy is a method of displaying a characteristic structured and groupedaccording to individual evaluation criteria.A BW hierarchy has the following properties: Hierarchies are created for basic characteristics (characteristics containing master data).The characteristic 0COSTCENTER is an example. Hierarchies are stored in master data tables. They are also similar to master data, and can therefore be used and modified in all InfoCubes. You can define several hierarchies for a single characteristic. A hierarchy can have a maximum of 98 levels. You can load hierarchies from the R/3 system, or from a flat file. You can also create andchange hierarchies manually in the BW system. Use: Hierarchies are used in two main ways: 1. Firstly, the structured display of characteristic values (tree display) in a presentation hierarchy. 2.Secondly, selecting a defined quantity of characteristic values as a selection of hierarchy nodes. Structure A hierarchy consists of nodes. A node can...