Application Development and Automation 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: 
Read only

existence check bapi's??

Former Member
0 Likes
901

can i use existence check bapi's for validations( like.....checking the company code exist in database ).......instead of select single??????????????????????

Message was edited by:

raam

Message was edited by:

raam

can i use existence check bapi's for validations( like.....checking the company code exist in database ).......instead of select single??????????????????????

Message was edited by:

raam

Message was edited by:

raam

5 REPLIES 5
Read only

Former Member
0 Likes
766

Hi,

We have function modules to check these things.for the company code use this

FM_CHECK_BUKRS_BT

AUTH_CHECK_BUKRS

Regards

Sudheer

Read only

Former Member
0 Likes
766

you can try searching in SE37 by giving

BAPIBUKRS ,

BAPICOMP

for company code and with different combinations for other requirements also

Read only

Former Member
0 Likes
766

hey but i know the existence check bapis......but my point is shall we use instead of select single validation????

Read only

0 Likes
766

I expect all that the BAPIs are doing is a select single, so if you know the table you need to check you are better doing the select than calling the BAPI.

Regards,

Nick

Read only

0 Likes
766

Hi,

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.

Regards