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 With Movement Type 309

Former Member
0 Likes
4,013

Hi Experts,

I'm tryng to use the FM BAPI_GOODSMVT_CREATE to enter transfer posting via MB1B.

If I take all the quantity of material g_tc01_wa-matnr in MCHB-CLABS, and I can't get post the movement.

However, if I take a quantity less than in MCHB-CLABS, the BAPI works perfectly. But my will is post a movement with entire quantity.

I attached the SC below.

If any tip is found, tell me <<removed by moderator>>.

    wa_header-pstng_date      = zpp_st_tc01-budat.
    wa_header-doc_date        = zpp_st_tc01-bldat.
    wa_header-pr_uname        = sy-uname.
    wa_header-ver_gr_gi_slip  = 2.
    wa_header-ver_gr_gi_slipx = 'X'.

    LOOP AT g_tc01_itab INTO g_tc01_wa.
      ti_item-material   = g_tc01_wa-matnr.
      ti_item-plant      = zpp_st_tc01-werks.
      ti_item-stge_loc   = g_tc01_wa-lgort.
      ti_item-batch      = g_tc01_wa-charg.
      ti_item-move_type  = zpp_st_tc01-bwart. "309
      ti_item-entry_qnt  = g_tc01_wa-erfmg.
      ti_item-entry_uom  = g_tc01_wa-erfme.
      ti_item-move_mat   = g_tc01_wa-matn2.
      ti_item-move_plant = zpp_st_tc01-werks.
      ti_item-move_stloc = zpp_st_tc01-umlgo.
      ti_item-move_batch = g_tc01_wa-charg.

      APPEND ti_item.
      CLEAR ti_item.
    ENDLOOP.
    CALL FUNCTION 'BAPI_GOODSMVT_CREATE'
      EXPORTING
        goodsmvt_header  = wa_header
        goodsmvt_code    = lv_tcode                "MB1B
      IMPORTING
        materialdocument = lv_matdoc
      TABLES
        goodsmvt_item    = ti_item
        return           = ti_return. 

Thanks in advance and best Regards

JORGE R.

Moderator Message: Moved to right forum. Removed ASAP words and added code tags. Please take care of these yourself in the future.

Edited by: kishan P on Nov 12, 2010 9:31 AM

Hi Experts,

I'm tryng to use the FM BAPI_GOODSMVT_CREATE to enter transfer posting via MB1B.

If I take all the quantity of material g_tc01_wa-matnr in MCHB-CLABS, and I can't get post the movement.

However, if I take a quantity less than in MCHB-CLABS, the BAPI works perfectly. But my will is post a movement with entire quantity.

I attached the SC below.

If any tip is found, tell me <<removed by moderator>>.

    wa_header-pstng_date      = zpp_st_tc01-budat.
    wa_header-doc_date        = zpp_st_tc01-bldat.
    wa_header-pr_uname        = sy-uname.
    wa_header-ver_gr_gi_slip  = 2.
    wa_header-ver_gr_gi_slipx = 'X'.

    LOOP AT g_tc01_itab INTO g_tc01_wa.
      ti_item-material   = g_tc01_wa-matnr.
      ti_item-plant      = zpp_st_tc01-werks.
      ti_item-stge_loc   = g_tc01_wa-lgort.
      ti_item-batch      = g_tc01_wa-charg.
      ti_item-move_type  = zpp_st_tc01-bwart. "309
      ti_item-entry_qnt  = g_tc01_wa-erfmg.
      ti_item-entry_uom  = g_tc01_wa-erfme.
      ti_item-move_mat   = g_tc01_wa-matn2.
      ti_item-move_plant = zpp_st_tc01-werks.
      ti_item-move_stloc = zpp_st_tc01-umlgo.
      ti_item-move_batch = g_tc01_wa-charg.

      APPEND ti_item.
      CLEAR ti_item.
    ENDLOOP.
    CALL FUNCTION 'BAPI_GOODSMVT_CREATE'
      EXPORTING
        goodsmvt_header  = wa_header
        goodsmvt_code    = lv_tcode                "MB1B
      IMPORTING
        materialdocument = lv_matdoc
      TABLES
        goodsmvt_item    = ti_item
        return           = ti_return. 

Thanks in advance and best Regards

JORGE R.

Moderator Message: Moved to right forum. Removed ASAP words and added code tags. Please take care of these yourself in the future.

Edited by: kishan P on Nov 12, 2010 9:31 AM

6 REPLIES 6
Read only

former_member451655
Active Participant
0 Likes
2,121

Hi ,

In your FM

Import Parameter . --->

goodsmvt_code = lv_tcode "MB1B

Should be

lv_tcode = '01'. not the T code , Movement type will handle the Transaction internally .

Please update the progress.

Thx ,

Dilum

Read only

0 Likes
2,121

Hi,

The MB1B tag is only to referrence the use of this Tcode. Previously, I've seeked in table T158G for the relevant code for MB1B.

No problem with this.

Thanks a lot for your answer, but my problem remains unsolved.

JORGE R.

Read only

0 Likes
2,121

Hi,

Can you also check the in field MVT_IND(Movement Indicator) is passing. You have to check the below codes for the posting.

Goods movement w/o reference

B Goods movement for purchase order

F Goods movement for production order

L Goods movement for delivery note

K Goods movement for kanban requirement (WM - internal only)

O Subsequent adjustment of "material-provided" consumption

W Subsequent adjustment of proportion/product unit material

Regards

Bhavesh

Read only

Former Member
0 Likes
2,121

Can anyone help me with this thread?

Thanks

JORGE ROJAS

Read only

JL23
Active Contributor
0 Likes
2,121

what error do you get?

have you tried the same manually in MB1B transaction?

Read only

Former Member
0 Likes
2,121

Hi experts,

For accounting determination issues, I have to delete/block this post.

Once problems are solved, I'll try to test the Tx.

Thanks so much to all of you.

Jorge Rojas