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

regarding BADI implementation

Former Member
0 Likes
625

Hi,

Can any one tell me how we will do BADI's.If possible explain with a example.

points will be given.

Regards,

Amit Teja V

Message was edited by: amit teja

6 REPLIES 6
Read only

Former Member
0 Likes
594

BAPI's are nothing function modules, so from ABAP you just make a call to the function.

Here is a example

http://www.sap-img.com/abap/bapi-goodsmvt-create-to-post-goods-movement.htm

Regards,

Ravi

Note : Please mark the helpful answers

Read only

Former Member
0 Likes
594

Hi,

Check this step by step example

http://www.sapgenie.com/abap/bapi/example.htm

Regards

vijay

Read only

Former Member
0 Likes
594

Hi,

Check this too..

http://www.sap-img.com/bapi.htm

Regards

vijay

Read only

aris_hidalgo
Contributor
0 Likes
594

Hi Amit,

BAPIs are just function modules with the exception that it can be called from other non sap systems. For example, in our company we have a billing system that calls a certain BAPI to get the required data and after that it processes it then it will generate a text file which we use to upload using BDC. You can also use BAPIs the same way you use function modules. Take a look at the example below:

DO lv_counter TIMES.

CALL METHOD me->conversion EXPORTING

year = <fs_asof>

rate_type = t_rate_type

from_curr = t_from_curr

to_curr = t_to_curr

IMPORTING

exch_rate = t_exch_rate.

wa_exch-year = <fs_asof>.

wa_exch-rate = t_rate_type.

wa_exch-from_curr = t_from_curr.

wa_exch-exch_rate = t_exch_rate-exch_rate_v.

INSERT wa_exch INTO TABLE it_exch.

CLEAR wa_exch.

IF sy-index = 1.

WRITE: (15) t_exch_rate-exch_rate_v LEFT-JUSTIFIED.

ELSEIF sy-index = 4 OR sy-index = 5 OR sy-index = 6.

ADD 1 TO lv_pos.

WRITE: AT lv_pos(15) t_exch_rate-exch_rate_v CENTERED.

ELSE.

WRITE: AT lv_pos(15) t_exch_rate-exch_rate_v CENTERED.

ENDIF.

CLEAR t_exch_rate-exch_rate_v.

SUBTRACT 1 FROM <fs_asof>.

ADD 20 TO lv_pos.

ENDDO.

METHOD conversion.

CALL FUNCTION 'HR_E_GET_FISC_YEAR_DATES'

EXPORTING

fisc_year = year

IMPORTING

  • FISC_FECINI =

fisc_fecfin = lv_date

  • EXCEPTIONS

  • ERROR = 1

  • OTHERS = 2

.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

t_date = lv_date.

CALL FUNCTION 'BAPI_EXCHANGERATE_GETDETAIL'

EXPORTING

rate_type = rate_type

from_curr = from_curr

to_currncy = to_curr

date = t_date

IMPORTING

exch_rate = t_exch_rate

  • RETURN =

.

ENDMETHOD.

*In the example above, it calls the BAPI to get the exchange rate for a given currency and year.

Hope this helps...

P.S. Please award points for useful answers.

Read only

0 Likes
594

just refer...

<b></b>

Read only

shivananddeshmu
Explorer
0 Likes
594

Hi Amit

There are already many posts on this topic.

go thru the following posts.

Rgds

Shivanand