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_REPMANCONF1_CREATE_MTS for Posting 261 MT.

Former Member
0 Kudos

Hi,

I am using the BAPI 'BAPI_REPMANCONF1_CREATE_MTS' for performing the component backflush for the movement type '261'.But the bapi is yielding me a cofirmation number but there is no material document is getting created.

By using the MFBF transaction using the same input which i use for populating the BAPI structures is working fine with the direct input to the MFBF.The material document is getting created.

If anyone had used the BAPI for the movement type '261' and was successful in creating the material document for the same.Kindly let me know.

PFB is the data which i was populating for the bapi.Thanks in advance.Expecting a reply.

x_BFLUSHFLAGS-BCKFLTYPE = '11'.

x_bflushdatamts-REPPOINT = '0160'.

x_bapi_rm_datgen-materialnr = '3000-000-000'.

x_bapi_rm_datgen-prodplant = 'CRA1'.

x_bapi_rm_datgen-planplant = 'CRA1'.

x_bapi_rm_datgen-storageloc = 'FG01'.

x_bapi_rm_datgen-prodversion = 'P001'.

x_bapi_rm_datgen-batch = 'CPUTEST03'.

x_bapi_rm_datgen-postdate = '20080125'.

x_bapi_rm_datgen-docdate = '20080125'.

x_bapi_rm_datgen-backflquant = '1.000'.

x_bapi_rm_datgen-unitofmeasure = 'ST'.

x_bapi_rm_datgen-ordercosts = 'X'.

x_gm-material = '3000-000-001'.

x_gm-plant = 'CRA1'.

x_gm-stge_loc = 'MFG2'.

x_gm-batch = 'CPUASSY05'.

x_gm-move_type = '261'.

x_gm-base_uom = 'ST'.

x_gm-QUANTITY = '3.000'.

append x_gm to i_gm.

*

  • x_gm-material = '3000-000-001'.

  • x_gm-plant = 'CRA1'.

  • x_gm-stge_loc = 'SS'.

  • x_gm-batch = 'TV07071901'.

  • x_gm-move_type = '261'.

  • x_gm-base_uom = 'ST'.

  • x_gm-QUANTITY = '3.000'.

  • append x_gm to i_gm.

CALL FUNCTION 'BAPI_REPMANCONF1_CREATE_MTS'

EXPORTING

bflushflags = x_BFLUSHFLAGS

bflushdatagen = x_bapi_rm_datgen

BFLUSHDATAMTS = x_bflushdatamts

IMPORTING

CONFIRMATION = bfno

RETURN = x_re

TABLES

GOODSMOVEMENTS = i_gm

.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

EXPORTING

wait = '1'.

Thanks and regards,

~Karthik

3 REPLIES 3

Former Member
0 Kudos

Hi Karthik,

I`m facing the same problem.

Could you share how did you solve it pls?

Thanks in advance.

Regards,

Andre

Edited by: André Zorba on Jun 17, 2010 3:09 PM

0 Kudos

I have solve it as follow:

i_bflushflags-bckfltype = '11'

i_bflushflags-components_type = '1'.

is_bapi_rm_datgen-materialnr = rm61b-matnr.

is_bapi_rm_datgen-prodplant = rm61b-werks.

is_bapi_rm_datgen-planplant = rm61b-plwerk.

" is_bapi_rm_datgen-storageloc = '1201'.

is_bapi_rm_datgen-prodversion = rm61b-verid.

" is_bapi_rm_datgen-batch = ps_mcha-charg.

is_bapi_rm_datgen-postdate = rm61b-budat.

is_bapi_rm_datgen-docdate = rm61b-bldat.

is_bapi_rm_datgen-backflquant = rm61b-refmg.

is_bapi_rm_datgen-unitofmeasure = rm61b-erfme.

is_bapi_rm_datgen-docheadertxt = rm61b-bktxt.

CLEAR: lt_item[],g_message.

LOOP AT gt_bom INTO ls_bom.

ls_item-material = ls_bom-matnr.

ls_item-plant = ls_bom-werks..

ls_item-stge_loc = ls_bom-lgort.

ls_item-batch = ls_bom-charg.

ls_item-move_type = ls_bom-bwart.

  • ls_item-base_uom = ls_bom-erfme.

  • ls_item-quantity = ls_bom-erfmg_r.

ls_item-entry_qnt = ls_bom-erfmg_r.

ls_item-entry_uom = ls_bom-erfme.

APPEND ls_item TO lt_item.

ENDLOOP.

CALL FUNCTION 'BAPI_REPMANCONF1_CREATE_MTS'

EXPORTING

bflushflags = i_bflushflags

bflushdatagen = is_bapi_rm_datgen

IMPORTING

confirmation = e_bfno " bflushdatamts = is_bflushdatamts

return = e_ret

TABLES

goodsmovements = lt_item.

IF e_ret IS INITIAL.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

EXPORTING

wait = ''

IMPORTING

return = ls_return.

endif.

0 Kudos

hai can u send me complete program for this BAPI