To  create the custom BAPI, we need to follow this step-by-step procedure.  The steps  are 
-      Create the BAPI structure. 
-      Create Remote Function Module. 
-      Place the Remote Function Module into BOR (Business Object Repository). 
-      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… 



 Atom Feed (xml)
 Atom Feed (xml)
 

2 comments:
thaks for ur updata and let me know about badi basic and one real time ex with screen shot
thanks for ur posting and now i want to know badi both se18 and se19 plz send me with screen shot
Post a Comment