<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic BAPI_BATCH_CHANGE to update data on classification tab in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-batch-change-to-update-data-on-classification-tab/m-p/2821942#M660088</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to update the country of origin in the classification tab of batches. It gets updated in change mode (MSC2N) but when I am in Batch Display mode (MSC3N) it is not updated. The code I am using is as follows. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;      t_batchattributes-countryori  = wa_mcha-herkl.
      t_batchattributesx-countryori = 'X'.

      CALL FUNCTION 'BAPI_BATCH_CHANGE'
        EXPORTING
          material         = wa_mcha-matnr
          batch            = wa_mcha-charg
          plant            = wa_mcha-werks
          batchattributes  = t_batchattributes
          batchattributesx = t_batchattributesx
        TABLES
          return           = i_return.

        CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
          EXPORTING
            wait   = 'X'
          IMPORTING
            return = wa_return.

        CALL FUNCTION 'VB_UPDATE_BATCH'.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 21 Sep 2007 13:36:59 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-09-21T13:36:59Z</dc:date>
    <item>
      <title>BAPI_BATCH_CHANGE to update data on classification tab</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-batch-change-to-update-data-on-classification-tab/m-p/2821942#M660088</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to update the country of origin in the classification tab of batches. It gets updated in change mode (MSC2N) but when I am in Batch Display mode (MSC3N) it is not updated. The code I am using is as follows. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;      t_batchattributes-countryori  = wa_mcha-herkl.
      t_batchattributesx-countryori = 'X'.

      CALL FUNCTION 'BAPI_BATCH_CHANGE'
        EXPORTING
          material         = wa_mcha-matnr
          batch            = wa_mcha-charg
          plant            = wa_mcha-werks
          batchattributes  = t_batchattributes
          batchattributesx = t_batchattributesx
        TABLES
          return           = i_return.

        CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
          EXPORTING
            wait   = 'X'
          IMPORTING
            return = wa_return.

        CALL FUNCTION 'VB_UPDATE_BATCH'.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Sep 2007 13:36:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-batch-change-to-update-data-on-classification-tab/m-p/2821942#M660088</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-21T13:36:59Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_BATCH_CHANGE to update data on classification tab</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-batch-change-to-update-data-on-classification-tab/m-p/2821943#M660089</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;Try with the Bapi&lt;/P&gt;&lt;P&gt;BAPI_OBJCL_CHANGE&lt;/P&gt;&lt;P&gt;and see&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reagrds&lt;/P&gt;&lt;P&gt;Anji&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Sep 2007 13:42:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-batch-change-to-update-data-on-classification-tab/m-p/2821943#M660089</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-21T13:42:30Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_BATCH_CHANGE to update data on classification tab</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-batch-change-to-update-data-on-classification-tab/m-p/2821944#M660090</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How to use this BAPI. how to fill the tables. I am trying to update the 'COUNTRY OF ORIGIN' classification value. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;* Assign the fields respecting blanks to object key
    MOVE: wa_mcha-matnr TO gv_objek(18),
          wa_mcha-werks TO gv_objek+18(4),
          wa_mcha-charg TO gv_objek+22(10).
   
   CALL FUNCTION 'BAPI_OBJCL_CHANGE'
        EXPORTING
          objectkey                = gv_objek
          objecttable              = 'MCHA'
          classnum                 = 'BATCHMGT'
          classtype                = '022'
        TABLES
          allocvaluesnumnew        =
          allocvaluescharnew       =
          allocvaluescurrnew       =
          return                   =
                .&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Megan Flores&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Sep 2007 13:55:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-batch-change-to-update-data-on-classification-tab/m-p/2821944#M660090</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-21T13:55:16Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_BATCH_CHANGE to update data on classification tab</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-batch-change-to-update-data-on-classification-tab/m-p/2821945#M660091</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is not working. Can someone help me please. thank you. &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;      wa_allocvaluescharnew-charact = c_txt_origin.
      wa_allocvaluescharnew-value_char = wa_mcha-herkl.
      APPEND wa_allocvaluescharnew TO t_allocvaluescharnew.

      CALL FUNCTION 'BAPI_OBJCL_CHANGE'
        EXPORTING
          objectkey          = gv_objek
          objecttable        = 'MCHA'
          classnum           = 'BATCHMGT'
          classtype          = '022'
        TABLES
          allocvaluesnumnew  = t_allocvaluesnumnew
          allocvaluescharnew = t_allocvaluescharnew
          allocvaluescurrnew = t_allocvaluescurrnew
          return             = i_return.

      CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
        EXPORTING
          wait   = 'X'
        IMPORTING
          return = wa_return.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Sep 2007 14:25:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-batch-change-to-update-data-on-classification-tab/m-p/2821945#M660091</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-21T14:25:12Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_BATCH_CHANGE to update data on classification tab</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-batch-change-to-update-data-on-classification-tab/m-p/2821946#M660092</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Look at &amp;lt;a href="https://service.sap.com/sap/support/notes/619913"&amp;gt;Note 619913 - FAQ: Basic functions of batch management&amp;lt;/a&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;i&amp;gt;&amp;lt;b&amp;gt;Change classification data of a batch&amp;lt;/b&amp;gt;&amp;lt;/i&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;i&amp;gt;Up to and including Release 4.6C, BAPI BAPI_OBJCL_CHANGE needs to be used.&lt;/P&gt;&lt;P&gt;In later releases, BAPI BAPI_BATCH_SAVE_REPLICA may also be used for that purpose.&amp;lt;/i&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Sep 2007 14:29:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-batch-change-to-update-data-on-classification-tab/m-p/2821946#M660092</guid>
      <dc:creator>RaymondGiuseppi</dc:creator>
      <dc:date>2007-09-21T14:29:52Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_BATCH_CHANGE to update data on classification tab</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-batch-change-to-update-data-on-classification-tab/m-p/2821947#M660093</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When I execute the BAPI using SE37, it gives out error 'COUNTRY OF ORIGIN' characteristic not found. But in MSC3N I can see the char.. .what could I be doing wrong?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Sep 2007 14:34:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-batch-change-to-update-data-on-classification-tab/m-p/2821947#M660093</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-21T14:34:40Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_BATCH_CHANGE to update data on classification tab</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-batch-change-to-update-data-on-classification-tab/m-p/2821948#M660094</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I used this BAPI to update the classification data. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;* Assign the fields respecting blanks to object key
    MOVE: wa_mcha-matnr TO gv_objek(18),
          wa_mcha-werks TO gv_objek+18(4),
          wa_mcha-charg TO gv_objek+22(10).

* Assign the country of origin value to the characteristic
      MOVE   c_atnam               TO wa_allocvaluescharnew-charact .
      MOVE   wa_mcha-herkl         TO wa_allocvaluescharnew-value_char.
      APPEND wa_allocvaluescharnew TO t_allocvaluescharnew.

* Call BAPI_OBJCL_CHANGE to update the country of origin value
      CALL FUNCTION 'BAPI_OBJCL_CHANGE'
        EXPORTING
          objectkey          = gv_objek
          objecttable        = c_mchatbl
          classnum           = c_batchmgt
          classtype          = c_batches
        TABLES
          allocvaluesnumnew  = t_allocvaluesnumnew
          allocvaluescharnew = t_allocvaluescharnew
          allocvaluescurrnew = t_allocvaluescurrnew
          return             = t_return.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 23 Sep 2007 19:29:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-batch-change-to-update-data-on-classification-tab/m-p/2821948#M660094</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-23T19:29:52Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_BATCH_CHANGE to update data on classification tab</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-batch-change-to-update-data-on-classification-tab/m-p/2821949#M660095</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, You can update classification for a batch using the following code.&lt;/P&gt;&lt;P&gt;But first, you'll need to find out that the batch management is cross-plant or plant dependant.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If it is cross plant then plant(WERKS) is not part of the key to BAPI_OBJCL_CONCATENATEKEY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

CLEAR: objectkey, objectkeytable, objectkeytable[],
           allocvaluesnumnew, allocvaluesnumnew[],
           return.

    objectkeytable-key_field = 'MATNR'.
    objectkeytable-value_int = matnr.
    APPEND objectkeytable.

    objectkeytable-key_field = 'CHARG'.
    objectkeytable-value_int = charg.
    APPEND objectkeytable.

* Only if Batch management is Plant dependant
    objectkeytable-key_field = 'WERKS'.
    objectkeytable-value_int = werks.
    APPEND objectkeytable.

    CALL FUNCTION 'BAPI_OBJCL_CONCATENATEKEY'
      EXPORTING
        objecttable    = objecttable
      IMPORTING
        objectkey_conc = objectkey
      TABLES
        objectkeytable = objectkeytable
        return         = return.

    allocvaluesnumnew-charact = "characteristic name goes here".
    allocvaluesnumnew-value_from ="characteristic value goes here".
    APPEND allocvaluesnumnew.

    allocvaluesnumnew-charact =  "characteristic name goes here".
    allocvaluesnumnew-value_from =  "characteristic value goes here".
    APPEND allocvaluesnumnew.

    CALL FUNCTION 'BAPI_OBJCL_CHANGE'
      EXPORTING
        objectkey                = objectkey
        objecttable              = objecttable
        classnum                 = classnum
        classtype                = classtype
*   STATUS                   = '1'
*   STANDARDCLASS            = STANDARDCLASS
*   CHANGENUMBER             = CHANGENUMBER
*   KEYDATE                  = SY-DATUM
*   NO_DEFAULT_VALUES        = ' '
* IMPORTING
*   CLASSIF_STATUS           = CLASSIF_STATUS
      TABLES
        allocvaluesnumnew        = allocvaluesnumnew
        allocvaluescharnew       = allocvaluescharnew
        allocvaluescurrnew       = allocvaluescurrnew
        return                   = return
              .
* Do not forget to commit, otherwise changes would not take effect.
commit work.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hashir Ahmed&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Dec 2008 11:37:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-batch-change-to-update-data-on-classification-tab/m-p/2821949#M660095</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-12-15T11:37:45Z</dc:date>
    </item>
  </channel>
</rss>

