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: 

BAPI_OBJCL_GETDETAIL

Former Member
0 Kudos

Hi All,

My requirement is to fetch characteristic value for the material and batch from MSC3N tcode.

I think we can use this Function module BAPI_OBJCL_GETDETAIL, however I am not able to use it.

Kindly let me know how to pass the data to obtain cahracteristics value based on Material no and Batch no.

What will be the following input parameters

OBJECTKEY

OBJECTTABLE

Thanks in advance,

Amruta

8 REPLIES 8

Former Member
0 Kudos

This message was moderated.

Former Member
0 Kudos

Try a where used list on this FM or serach in this Forum only

Former Member
0 Kudos

hi amruta sawant , try this sample code .

CALL FUNCTION 'BAPI_OBJCL_CHANGE'

EXPORTING

objectkey = '102315' "Customer

objecttable = 'KNA1'

classnum = 'CATALOG_VIEW_CUST' "Class Number

classtype = '011' "Class Type

regards

chinnaiya

Former Member
0 Kudos

CALL FUNCTION 'BAPI_OBJCL_GETDETAIL'

EXPORTING

objectkey = l_objkey " concatenate material ,batch

objecttable = table "MCH1

classnum = class name "u can find this in MSC3n

classtype = Classtype "023

TABLES

allocvalueschar = i_allocvalueschar

allocvaluesnum = i_char_val

allocvaluescurr = i_allocvaluescurr

return = i_return1.

READ TABLE i_char_val into <wa> WITH KEY charact = 'ACCEPTBY' or any other charc

*call this FM for convertion

CALL FUNCTION 'CTCV_CONVERT_FLOAT_TO_DATE'

0 Kudos

Hi,

Try this sample code:

* Retreive the existing Class Data First
  CALL FUNCTION 'BAPI_OBJCL_GETDETAIL'
    EXPORTING
      OBJECTKEY        = V_OBJNUM
      OBJECTTABLE      = C_TABL                           " EQUI
      CLASSNUM         = C_CLSNUM                         " GL_INSP
      CLASSTYPE        = C_CLAS                             " Z02
      UNVALUATED_CHARS = C_X                              " X
      LANGUAGE         = SY-LANGU
    TABLES
      ALLOCVALUESNUM   = I_ALLOCNUM
      ALLOCVALUESCHAR  = I_ALLOCCHAR
      ALLOCVALUESCURR  = I_ALLOCCURR
      RETURN           = I_RETURN.
* Handle errors for when reading the class data
  LOOP AT I_RETURN WHERE TYPE = C_E.                      " E
* Read long text of error message
    CALL FUNCTION 'BAPI_MESSAGE_GETDETAIL'
      EXPORTING
        ID         = I_RETURN-ID
        NUMBER     = I_RETURN-NUMBER
        TEXTFORMAT = C_TEXT                               " ASC
        MESSAGE_V1 = I_RETURN-MESSAGE_V1
        MESSAGE_V2 = I_RETURN-MESSAGE_V2
        MESSAGE_V3 = I_RETURN-MESSAGE_V3
        MESSAGE_V4 = I_RETURN-MESSAGE_V4
      IMPORTING
        MESSAGE    = V_MESSAGE
      TABLES
        TEXT       = I_BAPITGB.
    MESSAGE V_MESSAGE TYPE C_E.                           " E
    LOOP AT I_BAPITGB.
      MESSAGE I_BAPITGB-LINE TYPE C_E.                    " E
    ENDLOOP.
  ENDLOOP.

Rgds.

RamaniN

Former Member
0 Kudos

Hi

It's:

OBJECTKEY = 000000000031000015 (a full lenght mat. number (which internally is stored as C(18))

OBJECTTABLE = MARA

Br,

Philippe

Edited by: Philippe Addor on Nov 11, 2010 2:10 PM

0 Kudos

>

> Hi

>

> It's:

> OBJECTKEY = 000000000031000015 (a full lenght mat. number (which internally is stored as C(18))

>

> OBJECTTABLE = MARA

>

> Br,

> Philippe

>

> Edited by: Philippe Addor on Nov 11, 2010 2:10 PM

Almost... if it's a batch without plant: use MCH1

If it's within a plant use MCHA and possible concatenate the WERKS into OBJECTKEY as well. Check the contents in table INOB to see how the fields must be concatenated.

edit:

As said before: concatenate MATNR and CHARG into OBJECTKEY for MCH1.

If you only have the 40 long (external) material number: then you can find the 18 long (internal) in table MATERIALID.

edit2: ok.. just noticed it.. reply on on an necro'ed thread...

-


Stop hugging me!

0 Kudos

This is an example of data imput for BAPI_OBJCL_GETDETAIL

lv_key_object = matnr + charg " 28 CHARACTERS LONG.

lv_objecttable = 'MCH1'.

lv_classnum = 'XA_LOTE_MATERIAL'.

lv_classtype = '023'.

CALL FUNCTION 'BAPI_OBJCL_GETDETAIL'
    EXPORTING
      objectkey              = lv_key_object
      objecttable            = lv_objecttable
      classnum               = lv_classnum
      classtype              = lv_classtype
*      KEYDATE                = SY-DATUM
*       UNVALUATED_CHARS       = ' '
*      LANGUAGE               = SY-LANGU
*     IMPORTING
*       STATUS                 = STATUS
*       STANDARDCLASS          = STANDARDCLASS
    TABLES
      allocvaluesnum         = lt_num
      allocvalueschar        = lt_char
      allocvaluescurr        = lt_curr
      RETURN                 = lt_return.