Skip to Content

Update Business partner Grouping field in BUT000 table using BAPI.

Hello Everyone,

Requirement: to update the BP Grouping field of the Business partners in the table BUT000 using BAPI or FM.

BU_GROUP Business Partner Grouping

I found some Bapi: BAPI_BUPA_CENTRAL_CHANGE and BUPA_CENTRAL_CHANGE but i didn't find any field for BP Group in their structures.

Is there anyway other FM or BAPI to update the same to avoid direct table updates or any enhancement in the above BAPI's where i can update the business group field.

thank you.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    Feb 24, 2017 at 01:31 PM

    Hello,

    i have created Z_BAPI which is copy of BUPA_CENTRAL_CHANGE.

    i have added an importing parameter for IM_BU_GROUP for BU_GROUP.

    and have pushed the Importing parameter in ls_but000_db-bu_group and it's successfully updating the database table.. Code where i implemented my logic is mentioned below.

          IF NOT iv_partner IS INITIAL.
    
            CALL FUNCTION 'BUP_BUT000_SELECT_SINGLE'
    
              EXPORTING
    
                i_partner    = iv_partner
    
                i_valdt_sel  = iv_valid_date
    
                i_cp_exclude = gc_x
    
              IMPORTING
    
                e_but000     = ls_but000_db
    
              EXCEPTIONS
    
                not_found    = 1
    
                OTHERS       = 2.
    
            IF sy-subrc <> 0.
    
              PERFORM exception_message_store TABLES et_return.
    
            ELSE.
              if im_bu_partner is not initial.
                ls_but000_db-bu_group = im_bu_group.<<< this where i am pushing value of importing parameter
              endif.
              MOVE-CORRESPONDING ls_but000_db TO ls_but000.
    
              MOVE-CORRESPONDING ls_but000_db TO ls_but000_old.
    
            ENDIF.

    Since i am going to use this bapi in a custom report in which i will only provide partner number and BP grouping.So i want to know whether my approach is correct or not regarding pushing the data in the structures which are getting populated via 'BUP_BUT000_SELECT_SINGLE' .

    or what could be the other options to achieve the same??

    thank you!!

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      I did exactly as you did in the copy FM but its not updating the Table. Did I miss something here?

  • avatar image
    Former Member
    Feb 17, 2017 at 11:11 AM

    I haven't tried it myself, but see if FKK_BUPA_MAINTAIN_SINGLE works.

    Add comment
    10|10000 characters needed characters exceeded

    • Hello,

      FKK_BUPA_MAINTAIN_SINGLE will not fulfill my requirement since it's specific for FICA and the business partner whose Business Group i want to update are not having contract related role(contract partner).

      thank you!!

  • Feb 24, 2017 at 03:47 PM

    Maybe you can get some pointers looking at FM "BAPI_BUPACRM_MAINTAIN" : there, you can find the FM's used when Creating a NEW Bus.Partner or when Updating one.

    Unfortunately, only when having a NEW Bus.Partner the Grouping is taken into account and then it makes use of "BUPA_CREATE_FROM_DATA" ...

    ... or check this SAP-Wiki on Partner Grouping : link, in which the use of "BUPA_EVENTS" is also suggested ...

    Add comment
    10|10000 characters needed characters exceeded

    • No, i am using copy of BUPA_CENTRAL_CHANGE with an additional importing parameter for BU_GROUP(BP grouping), since BU_GROUP is not available in any importing structure or tables which are present in the interface of the standard bapi.