Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Cannot create charecteristic values using BAPI_OBJCL_CREATE

Former Member
0 Kudos

Hi guys, my req is to transfer material charecteristc values from one system to other. I am using BAPI_OBJCL_GETDETAIL to get characteristic values and by using BAPI_OBJCL_CREATE i am trying to create. But cannot create values in target system.thanks.

7 REPLIES 7

Former Member
0 Kudos

Paste your code pls.

0 Kudos

I am using

1.Create Batch by calling BAPI

      CALL FUNCTION 'BAPI_BATCH_CREATE'

        EXPORTING

          material             = lv_matnr

          batch                = lv_charg

        TABLES

          return               = lt_rettab.

2. Create Key

* Fetch Object key by passing Material, and Batch

* Fill Material Number

  lw_object-key_field = 'MATNR'.

  lw_object-value_int = lv_matnr.

  APPEND lw_object TO lt_object.

  CLEAR : lw_object.

* Fill Batch

  lw_object-key_field = 'CHARG'.

  lw_object-value_int = lv_charg.

  APPEND lw_object TO lt_object.

  CLEAR : lw_object.

* Concatenate Object Key

  CALL FUNCTION 'BAPI_OBJCL_CONCATENATEKEY'

    EXPORTING

      objecttable    = 'MCH1'

    IMPORTING

      objectkey_conc = lv_object

    TABLES

      objectkeytable = lt_object

      return         = lt_rettab.

To be continued...

0 Kudos

Fetch Batch Characteristics, these will be empty for new batches

* Fetch object characterstics.

      CALL FUNCTION 'BAPI_OBJCL_GETDETAIL'

        EXPORTING

          objectkey        = lv_object

          objecttable      = 'MCH1'

          classnum         = this is class name

          classtype        = this is class type '023' etc values

          keydate          = sy-datum

          unvaluated_chars = 'X'

          language         = sy-langu

        TABLES

          allocvaluesnum   = lt_alloc_num

          allocvalueschar  = lt_alloc_char

          allocvaluescurr  = lt_alloc_curr

          return           = lt_rettab.

. Modify the above num, char and curr internal tables with your values

. Create Batch characteristics

      CALL FUNCTION 'BAPI_OBJCL_CREATE' destination 'DEST'

        EXPORTING

          objectkeynew      = lv_object

          objecttable      = 'MCH1'

          classnum         = this is class name

          classtype        = this is class type '023' etc values

          keydate          = sy-datum

          no_default_values = 'X'

        TABLES

          allocvaluesnum    = lt_alloc_num

          allocvalueschar   = lt_alloc_char

          allocvaluescurr   = lt_alloc_curr

          return            = lt_rettab.

This is my code , I am able to create Batch  in destination but even after success message in BAPI_OBJCL_CREATE there are no characteristic values assigned in MM03 transaction for that Batch and Material.

michael_kozlowski
Active Contributor
0 Kudos

Hi, use standard tr. BD91, BD92, BD93 for transport. ALE-Configuration must be done before.

0 Kudos

ALE configurations has been done and I am able to create Batch in destination system , but even after success message in BAPI return table , there are no characteristics assigned in MM03 for that Material and Batch.

0 Kudos


Hi,

Did you commit the transaction afterwards. The documentation suggests that there are no database changes with this BAPI.

This BAPI does not change the database. To change the database, call BAPI BapiService.TransactionCommit afterwards.

Hope this helps.

0 Kudos

Yeah but I am using, BAPI_TRANSACTION_COMMIT.  Will there would be any difference with BapiService.TransactionCommit.