cancel
Showing results for 
Search instead for 
Did you mean: 

Update an attribute's Min. & Max. Attribute value after opening date

Faaiez
Advisor
Advisor
0 Kudos

Hi

We have created an attribute 'projected price' on a bid invitation. The minimum and maximum attribute values will only be known after all bids have been submitted. So we need to populate the minimum and maximum attribute values after the opening date before running the evaluation report. Any assistance on how we could do this will be appreciatted.

Regards

Accepted Solutions (1)

Accepted Solutions (1)

dennis_bruder
Employee
Employee
0 Kudos

Hi,

function module BBP_PD_BID_GETDETAIL gives you back the dynamic attributes and the corresponding weighting.

Regards

Dennis

Faaiez
Advisor
Advisor
0 Kudos

Thank you Dennis.

I see that this does provide me with the weightings but I need to update these weightings after the end date.

Faaiez

Answers (1)

Answers (1)

Faaiez
Advisor
Advisor
0 Kudos

I've managed to solve this by doing the following.

<b>1) Get the items on the Bid Invitation</b>

CALL FUNCTION 'BBP_PROCDOC_GETDETAIL'
 EXPORTING
   I_GUID                        = ip_guid
   I_OBJECT_TYPE                 = 'BUS2200'
 IMPORTING
   E_HEADER                      = ls_header
   ET_ATTACH                     = lt_attach
   ET_CONDITIONS                 = lt_conditions
   ET_DYN_ATTR                   = lt_dyn_attr
 TABLES
   E_ITEM                        = rt_items.

<b>2) Get all the weightings for these items.</b>

  CALL FUNCTION 'BBP_PDWGT_GETDETAIL'
    EXPORTING
      i_p_guid            = ip_guid
      i_p_kind            = 'B'
      i_object_type       = 'BUS2200001'
    tables
      e_weight            = rt_weights.

<b>3) Then updated the specific attributes values.</b>

  DATA: lt_x_weight TYPE bbpt_pds_weight_ic,
        ls_weight TYPE bbp_pds_weight_ic,
        lt_y_weight TYPE bbpt_pds_weight_ic.

  CLEAR ls_weight.
  SELECT SINGLE * INTO CORRESPONDING FIELDS OF ls_weight
    FROM bbp_pdwgt WHERE guid = ip_guid.
  IF sy-subrc NE 0.
    EXIT.
  ENDIF.
  APPEND ls_weight TO lt_y_weight.

  ls_weight-value_amount1 = ip_min.
  ls_weight-value_amount2 = ip_max.
  ls_weight-kz            = 'U'.
  APPEND ls_weight TO lt_x_weight.

  CALL FUNCTION 'BBP_PDWGT_DB_UPDATE'
    TABLES
      i_x_weight = lt_x_weight
      i_y_weight = lt_y_weight.
  IF sy-subrc EQ 0.
    COMMIT WORK.
  ENDIF.

Regards