Register Login

FM or BAPI to recreate the tcode "MFBF" but I'm having a dificulty in filling the data.

Updated May 18, 2018

Hi there,

I would like to use a FM or BAPI to recreate the tcode "MFBF" but I'm having a dificulty in filling the data.

Would you be so kind to give an example on how did you fill the structures for it to work ? There might be something that I'm missing because I only get a confirmation number, but no material movement and no error.

This is my code:

ls_bflushflags-bckfltype = '11'.

ls_bflushdatagen-materialnr = 'P02321801'.
ls_bflushdatagen-prodplant = '1100'.
ls_bflushdatagen-prodversion = '0001'.
ls_bflushdatagen-postdate = sy-datum.
ls_bflushdatagen-docdate = sy-datum.
ls_bflushdatagen-backflquant = '2.000'.

ls_goodsmovements-material = 'p02321801'.
ls_goodsmovements-plant = '1100'.
ls_goodsmovements-move_type = '131'.
ls_goodsmovements-base_uom = 'BUC'.
ls_goodsmovements-quantity = '2.000'.

APPEND ls_goodsmovements TO lt_goodsmovements.

CALL FUNCTION 'BAPI_REPMANCONF1_CREATE_MTS'
EXPORTING
bflushflags = ls_bflushflags
bflushdatagen = ls_bflushdatagen
IMPORTING
confirmation = lv_confirmation
return = ls_return
TABLES
goodsmovements = lt_goodsmovements.

IF NOT lv_confirmation IS INITIAL.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'
IMPORTING
return = ls_return.
ENDIF.

I even tried to use FM "RM_BACKFLUSH_GO" and "RM_BACKFLUSH_CHECK_AO" with some more data, but I still get the same result.

Can you guys help? :D

Thank you,
Marius


×