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: 

characterstics value equipment master

former_member184551
Contributor
0 Kudos

Hi guys in ie03 , when we go to classes info, i see a calue contract end date and a val associated with it, this is a characterstics, please tell me how to determine it at runtime ? I need to include this in a custom program

Thanks

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Sameer,

To get the Characteristic Values of Equipment number you need to use 2 Function modules.

BAPI_OBJCL_GETCLASSES

BAPI_CLASS_GET_CHARACTERISTICS

This is the sample code to get the characteristic values for Material.

REPORT  ztemp.
 
DATA: i_alloc_list   TYPE STANDARD TABLE OF bapi1003_alloc_list,
      i_return       TYPE STANDARD TABLE OF bapiret2,
      i_chars        TYPE STANDARD TABLE OF bapi_char,
      i_char_values  TYPE STANDARD TABLE OF bapi_char_values,
 
      wa_alloc_list  TYPE bapi1003_alloc_list,
      wa_char_values TYPE bapi_char_values,
      g_objectkey    TYPE bapi1003_key-object.
 
CALL FUNCTION 'BAPI_OBJCL_GETCLASSES'
  EXPORTING
    objectkey_imp   = 'XX01726138-206'
    objecttable_imp = 'MARA'
    classtype_imp   = 'Z01'
  TABLES
    alloclist       = i_alloc_list
    return          = i_return.
 
LOOP AT i_alloc_list INTO wa_alloc_list.
 
  CALL FUNCTION 'BAPI_CLASS_GET_CHARACTERISTICS'
    EXPORTING
      classnum        = wa_alloc_list-classnum
      classtype       = 'Z01'
    TABLES
      characteristics = i_chars
      char_values     = i_char_values.
 
  LOOP AT i_char_values INTO wa_char_values.
    WRITE: / 'Characteristic:', 20 wa_char_values-name_char,
             40 'Value:', 50 wa_char_values-char_value.
  ENDLOOP.
 
ENDLOOP.

Regards,

Satish

2 REPLIES 2

Former Member
0 Kudos

Hi Sameer,

To get the Characteristic Values of Equipment number you need to use 2 Function modules.

BAPI_OBJCL_GETCLASSES

BAPI_CLASS_GET_CHARACTERISTICS

This is the sample code to get the characteristic values for Material.

REPORT  ztemp.
 
DATA: i_alloc_list   TYPE STANDARD TABLE OF bapi1003_alloc_list,
      i_return       TYPE STANDARD TABLE OF bapiret2,
      i_chars        TYPE STANDARD TABLE OF bapi_char,
      i_char_values  TYPE STANDARD TABLE OF bapi_char_values,
 
      wa_alloc_list  TYPE bapi1003_alloc_list,
      wa_char_values TYPE bapi_char_values,
      g_objectkey    TYPE bapi1003_key-object.
 
CALL FUNCTION 'BAPI_OBJCL_GETCLASSES'
  EXPORTING
    objectkey_imp   = 'XX01726138-206'
    objecttable_imp = 'MARA'
    classtype_imp   = 'Z01'
  TABLES
    alloclist       = i_alloc_list
    return          = i_return.
 
LOOP AT i_alloc_list INTO wa_alloc_list.
 
  CALL FUNCTION 'BAPI_CLASS_GET_CHARACTERISTICS'
    EXPORTING
      classnum        = wa_alloc_list-classnum
      classtype       = 'Z01'
    TABLES
      characteristics = i_chars
      char_values     = i_char_values.
 
  LOOP AT i_char_values INTO wa_char_values.
    WRITE: / 'Characteristic:', 20 wa_char_values-name_char,
             40 'Value:', 50 wa_char_values-char_value.
  ENDLOOP.
 
ENDLOOP.

Regards,

Satish

former_member184551
Contributor
0 Kudos

Thanks Satish