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's

Former Member
0 Likes
901

Hi Guys,

i have learned badi's theoretically, now i want some practise , Can one of give me the scenario's that u used in your project, which will help me in understanding better.

Pls don't give me links, as i have theoretical knowledge, just give me some simple scenario's with step by step. my email-id is [email protected].

full points will be awarded only who gives me scenario's only...

thanks in advance...

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
848

Hi

See the sample codes for BADI:

To restrict the user for creating PR

BAdI Name: ZPUR_RFQ (Implementation name) Purchase Requisitions

Definition Name: ME_REQ_POSTED

Interface Name : IF_EX_ME_REQ_POSTED

Implementing Class: ZCL_IM_PUR_REQ

Method : POSTED

************************************************************************

METHOD if_ex_me_req_posted~posted .

DATA : v_mtart TYPE mtart.

DATA l_s_eban TYPE ueban.

LOOP AT im_eban INTO l_s_eban.

IF l_s_eban-estkz NE 'B'.

CLEAR v_mtart.

SELECT SINGLE mtart INTO v_mtart FROM mara WHERE matnr = l_s_eban-matnr.

IF v_mtart EQ 'ZERS' OR v_mtart EQ 'FHMI' OR v_mtart EQ 'UNBW'.

MESSAGE e000(zm_msg) WITH 'You are not allowed' 'to create PR for stock items'.

ENDIF.

ENDIF.

IF l_s_eban-knttp NE 'F' OR l_s_eban-pstyp NE '9'.

IF l_s_eban-knttp NE 'A'.

IF ( l_s_eban-pstyp NE '9' AND l_s_eban-pstyp NE 'D' ) AND l_s_eban-matnr EQ space.

MESSAGE e000(zm_msg) WITH 'You cannot create' 'a PR without material number'.

ENDIF.

ENDIF.

ENDIF.

ENDLOOP.

ENDMETHOD.

BAdI Name: ZPUR_RFQ (Implementation name) Purchase Requisitions

Definition Name: ME_REQ_POSTED

Interface Name : IF_EX_ME_REQ_POSTED

Implementing Class: ZCL_IM_PUR_REQ

Method : POSTED

************************************************************************

METHOD if_ex_me_req_posted~posted .

DATA : v_mtart TYPE mtart.

DATA l_s_eban TYPE ueban.

LOOP AT im_eban INTO l_s_eban.

IF l_s_eban-estkz NE 'B'.

CLEAR v_mtart.

SELECT SINGLE mtart INTO v_mtart FROM mara WHERE matnr = l_s_eban-matnr.

IF v_mtart EQ 'ZERS' OR v_mtart EQ 'FHMI' OR v_mtart EQ 'UNBW'.

MESSAGE e000(zm_msg) WITH 'You are not allowed' 'to create PR for stock items'.

ENDIF.

ENDIF.

IF l_s_eban-knttp NE 'F' OR l_s_eban-pstyp NE '9'.

IF l_s_eban-knttp NE 'A'.

IF ( l_s_eban-pstyp NE '9' AND l_s_eban-pstyp NE 'D' ) AND l_s_eban-matnr EQ space.

MESSAGE e000(zm_msg) WITH 'You cannot create' 'a PR without material number'.

ENDIF.

ENDIF.

ENDIF.

ENDLOOP.

ENDMETHOD.

Regards

Anji

Hi Guys,

i have learned badi's theoretically, now i want some practise , Can one of give me the scenario's that u used in your project, which will help me in understanding better.

Pls don't give me links, as i have theoretical knowledge, just give me some simple scenario's with step by step. my email-id is [email protected].

full points will be awarded only who gives me scenario's only...

thanks in advance...

5 REPLIES 5
Read only

Former Member
0 Likes
849

Hi

See the sample codes for BADI:

To restrict the user for creating PR

BAdI Name: ZPUR_RFQ (Implementation name) Purchase Requisitions

Definition Name: ME_REQ_POSTED

Interface Name : IF_EX_ME_REQ_POSTED

Implementing Class: ZCL_IM_PUR_REQ

Method : POSTED

************************************************************************

METHOD if_ex_me_req_posted~posted .

DATA : v_mtart TYPE mtart.

DATA l_s_eban TYPE ueban.

LOOP AT im_eban INTO l_s_eban.

IF l_s_eban-estkz NE 'B'.

CLEAR v_mtart.

SELECT SINGLE mtart INTO v_mtart FROM mara WHERE matnr = l_s_eban-matnr.

IF v_mtart EQ 'ZERS' OR v_mtart EQ 'FHMI' OR v_mtart EQ 'UNBW'.

MESSAGE e000(zm_msg) WITH 'You are not allowed' 'to create PR for stock items'.

ENDIF.

ENDIF.

IF l_s_eban-knttp NE 'F' OR l_s_eban-pstyp NE '9'.

IF l_s_eban-knttp NE 'A'.

IF ( l_s_eban-pstyp NE '9' AND l_s_eban-pstyp NE 'D' ) AND l_s_eban-matnr EQ space.

MESSAGE e000(zm_msg) WITH 'You cannot create' 'a PR without material number'.

ENDIF.

ENDIF.

ENDIF.

ENDLOOP.

ENDMETHOD.

BAdI Name: ZPUR_RFQ (Implementation name) Purchase Requisitions

Definition Name: ME_REQ_POSTED

Interface Name : IF_EX_ME_REQ_POSTED

Implementing Class: ZCL_IM_PUR_REQ

Method : POSTED

************************************************************************

METHOD if_ex_me_req_posted~posted .

DATA : v_mtart TYPE mtart.

DATA l_s_eban TYPE ueban.

LOOP AT im_eban INTO l_s_eban.

IF l_s_eban-estkz NE 'B'.

CLEAR v_mtart.

SELECT SINGLE mtart INTO v_mtart FROM mara WHERE matnr = l_s_eban-matnr.

IF v_mtart EQ 'ZERS' OR v_mtart EQ 'FHMI' OR v_mtart EQ 'UNBW'.

MESSAGE e000(zm_msg) WITH 'You are not allowed' 'to create PR for stock items'.

ENDIF.

ENDIF.

IF l_s_eban-knttp NE 'F' OR l_s_eban-pstyp NE '9'.

IF l_s_eban-knttp NE 'A'.

IF ( l_s_eban-pstyp NE '9' AND l_s_eban-pstyp NE 'D' ) AND l_s_eban-matnr EQ space.

MESSAGE e000(zm_msg) WITH 'You cannot create' 'a PR without material number'.

ENDIF.

ENDIF.

ENDIF.

ENDLOOP.

ENDMETHOD.

Regards

Anji

Read only

0 Likes
848

thanks reddy, i have given points for u, can u have some more scenario's.. if u have can u pls provide ... thanks again

Read only

Former Member
0 Likes
848

Hi,

User is creating a PO using transaction ME23N.

If he enters quantity less than 10, then quantity should be defaulted to 20.

You need to implement BADI ME_PROCESS_PO_CUST for the same.

Best regards,

Prashant

Read only

0 Likes
848

Thanks very much prashant.... i have given points for you... if u some more Scenarios , can u pls provide me ... thanks again...

Read only

Former Member
0 Likes
848

hey dear go to transaction SE90 select the enhancement and then badi .. and enter some criteria.. and press F8 and u will get a whole list of badi .. whith their description ..

description is all that can help u to understand what that badi does. or just enter the badi name on google and u will get more info abt it...

No Rewards Plz