Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Business Objects and BAPI

Former Member
0 Kudos

I have create a Remote Enabled function module and named

it using BAPI naming conventions. I have created a

business object and used this BAPI as one of its methods.

When i add an attribute to the BO, I am not able to access

the attribute from the FM. Why? Then wat is the purpose of

a FM in a BO? Why a BO in the first place?

Pls explain.

Thanks in advance.

1 REPLY 1

Former Member
0 Kudos

Hi,

Every method of the BAPI will have a associate method and in that method the function you have mentioned will be called. I would assume that the attribute that you have created will be accessible in the code of the method as its a part of the BAPI object. As function is created as a stand alone object, the attribute will be accessible.

When you call this BAPI object from an external system you can set the attribute and then you call the method of the BAPI and not the function, so you should not have a issue with the attribute setting.

Here is a sample code of the method


BEGIN_METHOD CREATEFROMDATA CHANGING CONTAINER.                 
DATA:                                                           
      ORDERHEADERIN LIKE BAPISDHEAD,                            
      SOLDTOPARTY LIKE BAPISOLDTO,                              
      SHIPTOPARTY LIKE BAPISHIPTO,                              
      BILLINGPARTY LIKE BAPIPAYER,                              
      RETURN LIKE BAPIRETURN,                                   
      ORDERITEMSIN LIKE BAPIITEMIN OCCURS 0,                    
      ORDERPARTNERS LIKE BAPIPARTNR OCCURS 0,                   
      ORDERITEMSOUT LIKE BAPIITEMEX OCCURS 0,                   
      ORDERCFGSREF LIKE BAPICUCFG OCCURS 0,                     
      ORDERCFGSINST LIKE BAPICUINS OCCURS 0,                    
      ORDERCFGSPARTOF LIKE BAPICUPRT OCCURS 0,                  
      ORDERCFGSVALUE LIKE BAPICUVAL OCCURS 0.                   
  SWC_GET_ELEMENT CONTAINER 'OrderHeaderIn' ORDERHEADERIN.      
  SWC_GET_TABLE CONTAINER 'OrderItemsIn' ORDERITEMSIN.          
  SWC_GET_TABLE CONTAINER 'OrderPartners' ORDERPARTNERS.        
  SWC_GET_TABLE CONTAINER 'OrderItemsOut' ORDERITEMSOUT.        
  SWC_GET_TABLE CONTAINER 'OrderCfgsRef' ORDERCFGSREF.          
  SWC_GET_TABLE CONTAINER 'OrderCfgsInst' ORDERCFGSINST.        
  SWC_GET_TABLE CONTAINER 'OrderCfgsPartOf' ORDERCFGSPARTOF.    
  SWC_GET_TABLE CONTAINER 'OrderCfgsValue' ORDERCFGSVALUE.      
  CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDATA'                
..........

.

regards,

Ravi

Note : Please mark the helpful answers