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

BADI Implementation - activating

Former Member
0 Likes
1,854

In BADI definition of CUSTOMER_ADD_DATA, how do i activate my own implementation when the list of Implementations are already listed and activated.

7 REPLIES 7
Read only

Former Member
0 Likes
1,392

Create and activate a BADI implementation using transaction SE19

Andrew

Read only

Former Member
0 Likes
1,392

hi

You can have as many implementations of a bady as you want.

Just go to transaction se19 and create one.

regards

Dinesh

Read only

shishupalreddy
Active Contributor
0 Likes
1,392

Hello,

Can you explain u r requirement clearly .

See if u want to implement the BADI method of any definition u can implement if it is not a filter dependent BADI , If it is filter dependent BADI then you need to dfine a filter and then u can implement the same in se19 .

regards

Read only

Former Member
0 Likes
1,392

Hi,

Steps:

1. Execute Business Add-In(BADI) transaction SE18

2. Enter BADI name i.e. CUSTOMER_ADD_DATA and press the display

button

3. Select menu option Implementation->Create

4. Give implementation a name such as Z_CUSTOMER_ADD_DATA,

5. You can now make any changes you require to the BADI within this

implementation, for example choose the Interface tab

6. Double click on the method you want to change, you can now enter

any code you require.

7. Please note to find out what import and export parameters a

method has got return the original BADI definition

(i.e. CUSTOMER_ADD_DATA,) and double click on the method name

for example within CUSTOMER_ADD_DATA, contract is a method

8. When changes have been made activate the implementation

Assuming you want to make a field on tabstrip "Address" (screen '0301') mandatory then you have to return the message (E_MSGID, E_MSGNO, E_MSGV1,...) and E_DYNNR = '0301' (leaving E_SCRGR and E_FCODE empty).

To see which values for E_DYNNR, E_SCRGR (attribute of the screens) and E_FCODE are possible have a look at the following coding (just behind the BAdI call) in SAPMF02D (form CHECK_ALL_DATA):

*&----


*

*& Form check_all_data

*&----


*

  • text

*----


*

FORM CHECK_ALL_DATA .

DATA: L_MSGID TYPE SYMSGID,

L_MSGTY TYPE SYMSGTY,

L_MSGNO TYPE SYMSGNO,

L_MSGV1 TYPE SYMSGV,

L_MSGV2 TYPE SYMSGV,

L_MSGV3 TYPE SYMSGV,

L_MSGV4 TYPE SYMSGV,

L_DYNNR TYPE SYDYNNR,

L_SCRGR TYPE CUST_SCGR,

L_FCODE TYPE TAXITABS-FCODE,

L_TARGET_DYNNR TYPE SYDYNNR.

PERFORM GET_BADI_INSTANCE.

check not g_additional_data is initial. " TP 563352

CALL METHOD G_ADDITIONAL_DATA->CHECK_ALL_DATA

EXPORTING

I_ACTIVITY = T020-AKTYP

S_KNA1 = KNA1

S_KNB1 = KNB1

S_KNVV = KNVV

T_KNAS = XKNAS[]

T_KNB5 = XKNB5[]

T_KNBK = XKNBK[]

T_KNEX = XKNEX[]

T_KNVA = XKNVA[]

T_KNVD = XKNVD[]

T_KNVI = XKNVI[]

T_KNVK = XKNVK[]

T_KNVL = XKNVL[]

T_KNVP = XKNVP[]

T_KNZA = XKNZA[]

CHANGING

E_MSGID = L_MSGID

E_MSGNO = L_MSGNO

E_MSGV1 = L_MSGV1

E_MSGV2 = L_MSGV2

E_MSGV3 = L_MSGV3

E_MSGV4 = L_MSGV4

E_DYNNR = L_DYNNR

E_SCRGR = L_SCRGR

E_FCODE = L_FCODE.

  • Fehlerbehandlung uebernehmen

CHECK NOT L_MSGID IS INITIAL.

  • Wandelt E-message in W-message, wenn man navigieren muss

IF NOT ( L_DYNNR IS INITIAL

AND L_SCRGR IS INITIAL

AND L_FCODE IS INITIAL ).

PERFORM DETERMINE_TARGET_SCREEN USING L_DYNNR

L_SCRGR

L_FCODE

CHANGING L_TARGET_DYNNR.

ENDIF.

CLEAR OK-CODE.

IF NOT L_TARGET_DYNNR IS INITIAL.

MESSAGE ID L_MSGID TYPE 'S' NUMBER L_MSGNO DISPLAY LIKE 'E'

WITH L_MSGV1 L_MSGV2 L_MSGV3 L_MSGV4.

PERFORM NAVIGATE_TO_AFFECTED_SCREEN USING L_TARGET_DYNNR

L_SCRGR

L_FCODE.

ELSE.

  • Dieser Fall tritt nur auf, wenn L_DYNNR, L_SCRGR und L_FCODE keine

  • sinnvolle Kombination darstellen.

  • Nur als Notlösung vorgesehen, damit die Sicherung nicht beendet wird

MESSAGE ID L_MSGID TYPE 'E' NUMBER L_MSGNO

WITH L_MSGV1 L_MSGV2 L_MSGV3 L_MSGV4.

ENDIF.

ENDFORM. " check_all_data

Reward points

Regards

Read only

0 Likes
1,392

Hello I've already created my badi of CUSTOMER_ADD_DATA. I wud like to know how to activate my own BADI by not disturbing others who has already created the BADI's using the same CUSTOMER_ADD_DATA. I am able to activate mine by only removing the last created BADI of the same. Thanks.

Read only

0 Likes
1,392

Hi,

This BADI is for multiple implementation. So you can keep old implementation as it is. Till you confirm your coding, you can add condition to check user id. Upon completion remove this condition.

With this there will be two implementations for this BADI & they will be executed one after the other.

I hope this may answer your query.

Thanks & Regards

Mahindra

Read only

0 Likes
1,392

Hi,

Sorry missed a point in previous reply. You should be creating a new implementation for your code & add a user sepcific condition till complete testing is done.

Thanks & Regards

Mahindra