Application Development and Automation 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: 
Read only

BAPI_GOODSMVT_CREATE erorr

Former Member
0 Likes
850

Hi,

i want to transfer some of the materials from second quality storage location to packaging storage location(because it is iron and if necessities are not matched while producing the material, then we can use this material for packaging purposes).

İ got error about spec_stock that y is not defined. when i use 'E' instead of y, it wants me to enter sales order and item.

could you write me about this, thanks.

st_gmhead-pstng_date = sy-datum.

st_gmhead-doc_date = sy-datum.

st_gmhead-header_txt = text-m01.

*

LOOP AT gt_out where statu eq 'A'.

va_gmcode = '04'.

tb_gmitem-material = gt_out-matnr.

tb_gmitem-plant = '0006'."st_mch1-werks.

tb_gmitem-stge_loc = gt_out-lgort.

tb_gmitem-batch = gt_out-charg.

  • tb_gmitem-val_sales_ord = st_mch1-vbeln.

  • tb_gmitem-val_s_ord_item = st_mch1-posnr.

tb_gmitem-move_type = '311'.

tb_gmitem-spec_stock = 'Y'.

  • tb_gmitem-sales_ord = st_mch1-vbeln.

  • tb_gmitem-s_ord_item = st_mch1-posnr.

tb_gmitem-move_mat = gt_out-matnr.

tb_gmitem-move_plant = '0006'."st_mch1-werks.

tb_gmitem-move_stloc = '0098'."pn_lgort.

tb_gmitem-move_batch = gt_out-charg.

tb_gmitem-entry_qnt = gt_out-clabs.

APPEND tb_gmitem.

CLEAR: tb_message.

tb_message-msgty = 'I'.

tb_message-msgid = 'FB'.

tb_message-msgno = '899'.

tb_message-msgv1 = gt_out-charg.

tb_message-msgv2 = 'New location : '.

tb_message-msgv3 = '0098'."pn_lgort.

tb_message-msgv4 = 'Taransfer complete!'.

APPEND tb_message.

ENDLOOP.

*

IF NOT tb_gmitem[] IS INITIAL.

CALL FUNCTION 'BAPI_GOODSMVT_CREATE'

EXPORTING

goodsmvt_header = st_gmhead

goodsmvt_code = va_gmcode

IMPORTING

materialdocument = va_matdoc

matdocumentyear = va_matdyr

TABLES

goodsmvt_item = tb_gmitem

return = tb_return.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

EXPORTING

wait = 'X'.

endif.

5 REPLIES 5
Read only

Former Member
0 Likes
689

Any idea or offer?

i am waiting for your responses...

thanks.

Read only

0 Likes
689

Hi

can you post the message error? I mean class and number

Max

Read only

0 Likes
689

Hi,

thanks for your interest.

Message id : M7 and number 146

thanks

Read only

0 Likes
689

Hi

have you tried to post the document online? I mean by transaction?

Try to check if the special stock exists, but I suppose yes because it's a standard one

Max

Read only

Former Member
0 Likes
689

Hi,

special stock means that it is assigned to something, a sales order, a project or something else. So you either need to find out:

  • what kind of special stock this is

  • can you move the material without special stock indicator (just 311)

  • you are using the proper movement type

I think you can best look into this with the help of a functional consultant.

Roy