Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Assigning the standard relationship flag to the contact person of the BP

Hi,

I have a requirement where I have to assign the standard relationship flag to the contact person of the Dealer BP and make it as the Primary Contact Person of the Dealer BP.

Please see the code below and let me know where I am going wrong.

          CALL FUNCTION 'BAPI_BUPA_RELATIONSHIPS_GET'
          EXPORTING
            businesspartner = lw_dealer-dealer
          TABLES
            relationships   = lt_rel
            return          = gt_return.

        CLEAR gt_return.

        CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
          EXPORTING
            input  = lw_dealer-prim_cont
          IMPORTING
            output = lw_dealer-prim_cont.

        READ TABLE lt_rel INTO ls_rel WITH KEY relationshipcategory = 'BUR001'
                                               partner2             = lw_dealer-prim_cont.
        IF sy-subrc = 0.

          CALL FUNCTION 'BUPR_RELATIONSHIP_CHANGE'
            EXPORTING
              iv_partner_1    = lw_dealer-dealer
              iv_partner_2    = lw_dealer-prim_cont
              iv_relationship = 'BUR001'
              iv_date_from    = ls_rel-validfromdate
              iv_date_to      = ls_rel-validuntildate
              iv_x_save       = 'X'
              iv_xdfrel       = 'X'
              iv_xdfrel_x     = 'X'
            TABLES
              et_return       = gt_return.

        ENDIF.

Thank You.

Former Member
Not what you were looking for? View more on this topic or Ask a question