Skip to Content
Author's profile photo Rakshith Gore

Send Material in Full – Change Pointers option in BD10

We all came across the scenario where material master has to be sent to external system whenever there is a change in particular fields. So we generally achieve this by configuring the change pointers for message type and all the necessary configuration. Now we execute BD21 for our message type, which will generate the material master idoc only with mandatory segment and then only the segments which have changed fields.

That was simple and everything was a standard process but if there is a requirement to send the material master details in full even one field is changed then we cannot use this standard approach so we may end up in developing a custom function module to create a idoc with all the segments.

This document will explain a way to create material master using BD10 transaction, SAP has provided a several Explicit Enhancements in the program RBDSEMAT

we can make use of those enhancements to modify the selection screen and to call the function module CHANGE_POINTERS_READ before creating the idoc and CHANGE_POINTERS_STATUS_WRITE after creation of idoc.

Step 1 – We need to modify the selection screen so that a option is provided to create the idoc using change pointers

If you don not want the title of the frame, then no need to create a second enhancement which populate the frame title

Step 2 – Enhancement AT SELECTION-SCREEN OUTPUT, to populate field label GC_CHG and to retrieve the materials using CHANGE_POINTERS_READ

Step 3 – The above step will populate the materials which are not yet processed in the ECC system, Once the Idoc is generated for the relevant materials you have to change the status of change pointers

Result – Modified Selection Screen

Once you execute the program, Idoc gets created for all the Materials and then status of the change pointers are updated as ‘Processed’

Currently, I did this enhancement to trigger the MATMAS idoc. Code can be modified accordingly to process ARTMAS, MATCOR etc idocs

Assigned tags

      3 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Former Member
      Former Member

      Hi Rakshith,

       

      Thanks for this post, it was very helfull.

       

      Regards.

      Author's profile photo Balakrishna Vegi
      Balakrishna Vegi

      Hi Rakshith,

       

      Could you please send this code ZBD10_* class .

       

      Author's profile photo David Schwarting
      David Schwarting

      Thanks Rakshith for sharing.

      As I just needed it, I´ll share my coding for the class

      class zcl_bd10_changepointer definition
        public
        final
        create public .
      
        public section.
          types:
            begin of ty_material_range,
              sign   type ddsign,
              option type ddoption,
              low    type char18,
              high   type char18,
            end of ty_material_range.
          types:
            tt_material_range type table of ty_material_range with default key .
          types:
            tt_mat_key    type table of bdimarakey with default key.
      
          class-methods read_change_pointer
            importing
              !i_mestyp      type edi_mestyp
            returning
              value(r_value) type tt_material_range.
          class-methods change_pointer_status
            importing
              !it_keys  type tt_mat_key
              !i_mestyp type edi_mestyp .
        protected section.
        private section.
      endclass.
      
      
      
      class zcl_bd10_changepointer implementation.
      
        method change_pointer_status.
      
          data: change_pointers    type table of bdcp with default key,
                change_pointer_ids type table of bdicpident with default key.
      
          check i_mestyp is not initial.
      
          call function 'CHANGE_POINTERS_READ'
            exporting
              message_type    = i_mestyp
            tables
              change_pointers = change_pointers.
      
          loop at it_keys reference into data(key).
            loop at change_pointers reference into data(cp)
                 where cdobjid = key->matnr.
              change_pointer_ids = value #( base change_pointer_ids ( cpident = cp->cpident ) ).
            endloop.
          endloop.
      
          call function 'CHANGE_POINTERS_STATUS_WRITE'
            exporting
              message_type           = i_mestyp
            tables
              change_pointers_idents = change_pointer_ids.
      
        endmethod.
      
      
        method read_change_pointer.
      
          data change_pointers type table of bdcp with default key.
          call function 'CHANGE_POINTERS_READ'
            exporting
              message_type    = i_mestyp
            tables
              change_pointers = change_pointers.
      
          if lines( change_pointers ) is not initial.
            r_value = value #( for cp in change_pointers
                         ( sign = 'I' option = 'EQ' low = cp-cdobjid ) ).
            delete adjacent duplicates from r_value.
          endif.
      
        endmethod.
      endclass.