Application Development and Automation 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: 
Read only

Any BAPI available for Tcode MSC2N

Former Member
0 Likes
4,492

Hello,

Very Good Afternoon,

I need to change the few vlaues in the t-code MSC2N.

I need to change the City of Origin and Reg Of orign for few Batch numbers

in Basic Data1 tab.

There are around 1000 batch numbers which needs this change

Is there any BAPI available to go ahead..

Any suggestions will be appreciated.

Regards,

Kittu

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,501

There is no BAPI Availabe for MSCxN transactions. You have to Use BDC/LSMW.

7 REPLIES 7
Read only

Former Member
0 Likes
2,502

There is no BAPI Availabe for MSCxN transactions. You have to Use BDC/LSMW.

Read only

Former Member
0 Likes
2,501

HI,

Try these Bapi's for u r transaction.

BAPI_BATCH_CREATE

BAPI_BATCH_CHANGE,

BAPI_BATCH_REPLICATE,

BAPI_BATCH_SAVE_REPLICA

Regards,

Sudhakar Reddy.A

Read only

Former Member
0 Likes
2,501

Dear Kittu,

You have to use BDC for this.

There is no BAPI for the same.

Regards,

Flavya.

Read only

Former Member
2,501

Hi

Check This BAPI

BAPI_OBJCL_CREATE Classification BAPI: Create Assignment
BAPI_OBJCL_CREATE_KEY BAPI for Classification: Create Assignment (Key)
BAPI_BATCH_CHANGE
BAPI_OBJCL_CHANGE

Ranga

Read only

Former Member
0 Likes
2,501

Hello,

I am sorry for the late resposne!

The information provided was helpful!

Thank you for your response!

Regards,

Kittu

Read only

0 Likes
2,501

Hi, You can update classification for a batch using the following code.

But first, you'll need to find out that the batch management is cross-plant or plant dependant.

If it is cross plant then plant(WERKS) is not part of the key to BAPI_OBJCL_CONCATENATEKEY.



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.

Regards,

Hashir Ahmed

Read only

0 Likes
2,501

here what is the value that we need to pass for object key.