cancel
Showing results for 
Search instead for 
Did you mean: 

BAPI Code

Former Member
0 Kudos

Hi,

I am trying to use a BAPI (BAPI_CompanyCode_GetDetail), can you pls tell me the abap code that needs to be written for this.

Call transaction BAPI_companycode_getdetail.

exporting parameters companycode.

Commit work.

Is the above code write?

Do I need to declare any tables on top?

Thanks,

Ashish

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi There

The code would be:

CALL FUNCTION 'BAPI_COMPANYCODE_GETDETAIL'

EXPORTING

companycodeid = l_bukrs

IMPORTING

COMPANYCODE_DETAIL = ls_comcode_det

COMPANYCODE_ADDRESS = ls_compcode_address

RETURN = ls_ret_msgs

In the code above:

1. l_bukrs is the company code you want to get the details for

2. ls_comcode_det is the Company Code Detail Data whose structure is of type

BAPI0002_2

3. ls_compcode_address is the Company Code Address Data whose structure is

of type BAPI0002_3

4. ls_ret_msgs is the structure for the return messages whose structure is of type

BAPIRETURN.

No commit needed for this as you are just extracting information.

Hope this helps

Cheers

shivika

Former Member
0 Kudos

Ashish...since your BAPI is quering for information there is no need for a commit...

bhavesh_kantilal
Active Contributor
0 Kudos

Ashish,

This is a standard BAPI. Go to Se37 in your R3 and you will be able to see the code of this BAPI.

You just need to pass the value s to these parameters in XI.

regards

Bhavesh