2014 Feb 25 6:28 AM
Dear All,
I'm cerating batchin using above bapi with combination of material, batch, plant , S.L through se37 option ...that time batch is creating also allocates to that material also ...
suppose if i'm creating using se38 .. by calling in editor ... this time oly batch is creating ... but its not maintaing for that material ....
if i see in tcode msc2n .. it showing error
pls help me where i'm missing
regards,
Anbu
2014 Feb 25 7:39 AM
Hi Anbu
The message seems to be
It arises from sub check_import_data of FM VB_BATCH_DETERMINATION.
Debug in front end and see what is missing in import.
regards,
Modak
2014 Feb 25 7:59 AM
Hi Anbu
Did you call BAPI_TRANSACTION_COMMIT after the call of the BAPI..? Does RETURN tbale shows all sucess messages
Nabheet
2014 Feb 25 9:00 AM
if its error then oly it returns .. elso return table is initial only
2014 Feb 25 9:15 AM
craeting batch using this BAPI
CALL FUNCTION 'BAPI_BATCH_SAVE_REPLICA'
EXPORTING
material = lv_matnr
batch = lv_charg
plant = lv_werks
batchattributes = lw_batchatt
batchattributesx = lw_batchattx
batchstatus = lw_batchstatus
batchstatusx = lw_batchstatusx
batchcontrolfields = lw_batchcontrolfields
batchstoragelocation = lv_lgort
TABLES
return = lt_return
classallocations = lt_classallocations
classvaluationschar = lt_classvaluationschar.
IF lt_return IS INITIAL.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
WAIT = 'X'
IMPORTING
RETURN = lW_return
.
** CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
** EXPORTING
** wait = 'X'.
ENDIF.
CLEAR : gw_item.
ENDLOOP.
BATCH is saved in DB without any error
again updating stock in mb1c using created batch .. document number also creating successfully ..
my issue is .. if i see in msc2n .. that time BATCH is not allocated for material i'm facing error...
but if i try creating using mb1c transaction itself ... with i/p mov type .. S.L ,Plant , Material , Quan, Batch... document also creating .. same time batch is also maintaing for that material ...
same input passing to this bapi ... oly document creating .. batch is not maintaining to that material
CALL FUNCTION 'BAPI_GOODSMVT_CREATE'
EXPORTING
goodsmvt_header = gw_head
goodsmvt_code = gw_code
* TESTRUN = ' '
* GOODSMVT_REF_EWM =
IMPORTING
goodsmvt_headret = gw_headret
materialdocument = gw_mat
* MATDOCUMENTYEAR =
TABLES
goodsmvt_item = gt_item
* GOODSMVT_SERIALNUMBER =
return = lt_return
* GOODSMVT_SERV_PART_DATA =
* EXTENSIONIN =
.
IF sy-subrc = 0.
IF lt_return IS INITIAL.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'
* IMPORTING
* RETURN = lt_return
.