cancel
Showing results for 
Search instead for 
Did you mean: 

Requirement to default Product #

Former Member
0 Kudos

Hi, I have a requirement to default in a specific product # when the users go into the describe requirements link. Does anyone know how this can be done? We already default in the category via config.

Thanks,

Marty

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

I was able to do this through SHD0 and the BBP_SCREENVARIANT BADI..

Former Member
0 Kudos

Hello Marty,

Just use the CHANGE BADI on the SC.

With this BADI you can complete SC items, and then add product data (product GUID, description, UOM, category, etc...).

Rgds

Christophe

former_member195032
Active Contributor
0 Kudos

Hi Marty,

We have similar requirement for our solution and we used BADI

BBP_ECS_PO_OUT_BADI for extended classic scenario.

This changes only backend PO with default product number.It keep the text of the describe requirement as it is.

Please reward if this helps.

Nishant

Code is mentioned below.

METHOD if_ex_bbp_ecs_po_out_badi~bbp_b46b_po_outbound.

DATA : lt_sc_item TYPE STANDARD TABLE OF bbp_pds_sc_item_d.

DATA : lw_ct_bapi_poitem TYPE bbps_if_bapimepoitem_pi,

lw_ct_bapi_poservices TYPE bbps_if_bapiesllc_pi,

lw_sc_item TYPE bbp_pds_sc_item_d,

lw_item TYPE bbp_pds_po_item_d,

lw_comm_product TYPE comm_product.

DATA : lv_product_id TYPE comm_product-product_id,

lv_be_object_id TYPE be_object_id.

lv_be_object_id = is_header-object_id.

  • If the PO is created from Shopping Cart

CALL FUNCTION 'BBP_PD_OBJREL_READ_VIA_REF'

EXPORTING

iv_objectkey = lv_be_object_id

iv_object_type = 'BUS2201'

TABLES

et_item = lt_sc_item.

LOOP AT lt_sc_item INTO lw_sc_item.

IF lw_sc_item-ordered_prod IS INITIAL. " Check for free-text purchasing

lv_product_id = lw_sc_item-category_id.

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

EXPORTING

input = lv_product_id

IMPORTING

output = lv_product_id.

  • Check for the category id as a product in the product table if yes then assign that to outbound part.

SELECT SINGLE * FROM comm_product

INTO lw_comm_product

WHERE product_id EQ lv_product_id.

IF sy-subrc EQ 0.

IF lw_comm_product-product_type EQ '01'. " Check for goods

  • Fill the material number with generic material number

LOOP AT ct_bapi_poitem INTO lw_ct_bapi_poitem WHERE matl_group EQ lw_sc_item-category_id.

<b>* Add logic to move product into the structure. </b>

MODIFY ct_bapi_poitem FROM lw_ct_bapi_poitem.

ENDLOOP.

ELSEIF lw_comm_product-product_type EQ '02'. " Check for service

LOOP AT ct_bapi_poservices INTO lw_ct_bapi_poservices WHERE matl_group EQ lw_sc_item-category_id.

  • Fill the service number with generic service number

<b>* Add your own logic to move product. </b>

MODIFY ct_bapi_poservices FROM lw_ct_bapi_poservices.

ENDLOOP.

ENDIF.

ENDIF.

ENDIF.

ENDLOOP.

ENDMETHOD.