Skip to Content
0
Former Member
Sep 08, 2005 at 08:45 AM

{SOLVED] Create characteristics with BAPI_CREATE_BATCH

1110 Views

Hello,

In my program I create a batch before a good receipt. This good receipt is created with the bapi 'BAPI_GOODSMVT_CREATE'. In this last bapi I'm able to add the batch number.

If I create the batch I have also to add some characteristics. So I have looked for an example and found one. The example I follow is "Batch create and characteristics via BAPI (example)".

http://www.sapfans.com/forums/viewtopic.php?t=125320&highlight=bapibatchcreate.

The creation of the batch number and the creation of the objectkey works fine but when I come to the form 'extract_original_batch' with the bapi 'BAPI_OBJCL_GETDETAIL' I receive the following error message "Assignment does not exist or is not valid on".

The class it self is valid till 31129999 and I'm able to assign values during a good receipt with MIGO.

What could be wrong or has an other example to find out what's the problem.

This is what I inserting into the bapi:

p_matnr = '0000010393' a valid materialnumber

p_werks = '0010'

p_charg = '0001000125'

w_object = 00000000000001039300100001000125

p_class = 'ZMMGASOPSLAG'

p_klart = '023'

Here is a part of the program.

----


  • FORM build_object_key *

----


FORM build_object_key

TABLES

p_it_messages LIKE it_messages[]

p_it_object STRUCTURE bapi1003_object_keys

USING

P_WERKS LIKE EKPO-werks

P_MATNR LIKE EKPO-matnr

P_WA_ONTV_BEST_LGORT LIKE EKPO-lgort

P_charg LIKE mcha-charg

p_ebeln LIKE EKPO-ebeln

p_ebelp LIKE EKPO-ebelp

CHANGING

p_object LIKE bapi1003_key-object.

DATA: BEGIN OF XEMSEG OCCURS 1.

INCLUDE STRUCTURE BAPIRET2.

DATA: END OF XEMSEG.

CLEAR XEMSEG.

  • build the object key

CLEAR: it_object.

REFRESH: it_object.

it_object-key_field = 'MATNR'.

it_object-value_int = p_matnr.

APPEND it_object.

it_object-key_field = 'WERKS'.

it_object-value_int = p_werks.

APPEND it_object.

it_object-key_field = 'CHARG'.

it_object-value_int = p_charg.

APPEND it_object.

CALL FUNCTION 'BAPI_OBJCL_CONCATENATEKEY'

EXPORTING

objecttable = 'MCHA'

IMPORTING

objectkey_conc = p_object

TABLES

objectkeytable = it_object

return = XEMSEG.

IF not xemseg is initial.

PERFORM ins_errors

TABLES

it_messages

xemseg

USING

p_ebeln

p_ebelp.

ENDIF.

ENDFORM.

Kind regards,

Richard Meijn

Message was edited by: R. Meijn