cancel
Showing results for 
Search instead for 
Did you mean: 

BADI BBP_TARGET_OBJTYPE

Former Member
0 Kudos

Hello,

I'm working with SRM 5.O and due to some specific business requirements we needed to implement the BADI BBP_TARGET_OBJTYPE. But we still didn't cover all our requirements.

<u>Here is the required logic we need to pud into the BADI:</u>

1. If we're buying via "free text item" or via "Internal Goods/services" --> always PR

2. If we're buying items directly out of catalog (CCM catalog or punch out catalog), then we have 2 cases:

a) if account assignment different from ST --> always PO

b) if account assignement = ST --> if enough stock --> reservation else always PO

Point 1 is covered by our logic into the BADI. Point 2.a) also but we still have problems with 2.b). What would be nice is to put here the logic of the customizing table where you can define your follow-on documents. I think we need to change something in our first LOOP.

Below the logic of our BADI:

method IF_EX_BBP_TARGET_OBJTYPE~DETERMINE_TARGET_OBJECT_TYPES.

data: inti type i value 0.

data: ls_badi_item_data like line of ct_item,

ls_index type i.

data: t_accdata like line of IT_ACCOUNT.

field-symbols: <item> like line of ct_item,

<account> like line of IT_ACCOUNT.

loop at ct_item into ls_badi_item_data.

ls_index = sy-tabix.

*Catalog buying

if ls_badi_item_data-catalogid ne space.

<b>loop at IT_ACCOUNT into t_accdata where p_GUID eq ls_badi_item_data-guid.

if t_accdata-ACC_CAT ne 'ST'.

ls_badi_item_data-PACK_OBJTYPE = 'BUS2012'. "PO

  • ls_badi_item_data-FIXED_VEND = '1'.

endif.</b> endloop.

else.

loop at IT_ACCOUNT into t_accdata where p_GUID eq ls_badi_item_data-guid.

if t_accdata-ACC_CAT ne 'ST'.

move space to ls_badi_item_data-CTR_HDR_NUMBER.

move space to ls_badi_item_data-CTR_ITEM_NUMBER.

ls_badi_item_data-PACK_OBJTYPE = 'BUS2105'. "PR

endif.

endloop.

endif.

modify ct_item index ls_index from ls_badi_item_data transporting PACK_OBJTYPE.

modify ct_item index ls_index from ls_badi_item_data transporting CTR_HDR_NUMBER.

modify ct_item index ls_index from ls_badi_item_data transporting CTR_ITEM_NUMBER.

clear ls_badi_item_data.

clear ls_index.

endloop.

endmethod.

Does anybody know how I can put the required logic into this BADI?

Thanks a lot,

regards,

Caroline

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hello everybody,

Can anybody help me on that?

Thanks a lot,

Regards,

Caroline

Former Member
0 Kudos

Hi Caroline,

To activate this scenario you have to use BADI: BBP_EXTLOCALPO_BADI. Menupath: SPRO-> SRM Server -> Business Addinns -> Control Extended classic scenario -> Activate extended classic scenario

Regards,

Jos