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 Error

Former Member
0 Likes
8,075

Hi

I am using

BAPI_GOODSMVT_CREATE

for transfer order of 311 Q.

i am passing these values to bapi

But am getting Error enter the Purcharse Order

*to update picklsit no in doc header text of MIGO

        lv_code =
'04' ..

        lv_header-pstng_date = wa_mat_issue-issued_date.

        lv_header-doc_date = wa_mat_issue-issued_date.



       
clear var_listno.

        var_list = wa_mat_issue-rslistno.

       
shift var_list left deleting leading '0'.

       
concatenate 'Offcut trans pk lst' var_list into var_listno separated by space.

        lv_header-header_txt = var_listno.

       
clear var_listno.



        it_goodsmvt_item-res_type =
' '.

        it_goodsmvt_item-stge_loc = wa_mat_issue-lgort.

        it_goodsmvt_item-move_stloc = wa_mat_issue-rlgort.

        it_goodsmvt_item-gr_rcpt = wa_mat_issue-aufnr.

        it_goodsmvt_item-entry_uom = wa_mat_issue-meins.

        it_goodsmvt_item-entry_uom_iso = wa_mat_issue-meins.
        it_goodsmvt_item-res_item = wa_mat_issue-rspos.
it_goodsmvt_item-entry_qnt = wa_mat_issue-issued_qty.

       it_goodsmvt_item-move_type = wa_mat_issue-bwart.

       
if wa_mat_issue-charg is not initial.

          it_goodsmvt_item-batch = wa_mat_issue-charg.

        endif.

        it_goodsmvt_item-spec_stock =
'Q'.

        it_goodsmvt_item-wbs_elem = wa_mat_issue-posid.

        it_goodsmvt_item-mvt_ind =
'B'.

        
append it_goodsmvt_item.

1 ACCEPTED SOLUTION
Read only

venkateswaran_k
Active Contributor
5,568

Dear Arun,

You need not to set the movement indicator. 

Code = 04 - as you selected for transfer posting

* GMCODE Table T158G - 01 - MB01 - Goods Receipts for Purchase Order

*                      02 - MB31 - Goods Receipts for Prod Order

*                      03 - MB1A - Goods Issue

*                     04 - MB1B - Transfer Posting

*                      05 - MB1C - Enter Other Goods Receipt

*                      06 - MB11

Indicator should be Blank   without reference

*      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

since you said 'B' it is looking for PO

Chane your code as

it_goodsmvt_item-mvt_ind = ' '.        "remove B


REgards,

Venkat

14 REPLIES 14
Read only

nabheetscn
SAP Champion
SAP Champion
0 Likes
5,568

Please pass in item field PO_NUMBER this is what is needed

Read only

0 Likes
5,568

Hi nabheet

This is for TransferOrder - Others Catergory in MIGO

PO Number is non mandatory one.

I need to create without PO Number.

Read only

0 Likes
5,568

Then can you please check via debugging where is this message thrown. Can you please paste the message id and number

Read only

0 Likes
5,568

M7  018 Enter Purchase Order is the message ID

Read only

former_member188827
Active Contributor
0 Likes
5,568
  • First change the movement indicator 'B' and use appropriate one or leave it blank.

          it_goodsmvt_item-mvt_ind = 'B'. "Change this

     Movement indicator "B" is for movement against Purchase order ,so change this.

  • Also, go to transaction "MIGO" and try creating transfer posting manually by passing same data which you are passing through BAPI and check if it gets created.

Regards

Read only

venkateswaran_k
Active Contributor
5,569

Dear Arun,

You need not to set the movement indicator. 

Code = 04 - as you selected for transfer posting

* GMCODE Table T158G - 01 - MB01 - Goods Receipts for Purchase Order

*                      02 - MB31 - Goods Receipts for Prod Order

*                      03 - MB1A - Goods Issue

*                     04 - MB1B - Transfer Posting

*                      05 - MB1C - Enter Other Goods Receipt

*                      06 - MB11

Indicator should be Blank   without reference

*      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

since you said 'B' it is looking for PO

Chane your code as

it_goodsmvt_item-mvt_ind = ' '.        "remove B


REgards,

Venkat

Read only

0 Likes
5,568

KI  - 180 - You must
enter a company code for transaction Goods Movement

this is the message when i removed Movement Indiactor and left it blank

Then i passed werks

But am getting error -

Check
table XMRES: entry 0000000000 0001   does not exist

Read only

0 Likes
5,568

Please share message class and ID.

Regards

Read only

0 Likes
5,568

ID    Num    Message
M71Check table
  XMRES: entry 0000000000 0001   does not
  exist
Read only

0 Likes
5,568

Have you tried created transfer posting through MIGO first by using values which you are passing through BAPI?

Read only

0 Likes
5,568

Please post material document manually in MIGO by passing your BAPI values. If it's posting successfully obviously there is no problem with the data.

-Venkat

Read only

0 Likes
5,568

Also, why are you passing this?

     it_goodsmvt_item-res_item = wa_mat_issue-rspos.

Are you creating transfer posting with reference to reservation. If not, remove the above line. Also go through the documentation of BAPI which describes the required fields that need to be passed on basis of header code '04'.

GM_Code 04: Transfer posting

Transfer posting without reference to a reservation

The following fields must be populated:

  • Material number
  • Plant
  • Storage location
  • Movement type
  • Movement indicator
  • Quantity in unit of entry
  • ISO code unit of measurement for unit of entry
  • The following fields may have to be populated in some cases (this is not a complete list):
  • Receiving material
  • Receiving plant
  • Receiving storage location
  • Receiving batch (if material is handled in batches and you want to change batches)
  • Receiving/issuing special stock (e.g. sales order, project, vendor etc.)
  • Minimum shelf life expiration date (if set up in the system)
  • Reason for movement (if set up in the system)
  • Batch (if the material is handled in batches and automatic batch number assignment is not set)

The following fields can be populated (this is not a complete list):

  • Special stock indicator
  • Item text
  • Account assignment fields (for automatic posting lines: expense/income from stock transfer)

The following fields cannot be populated (this is not a complete list):

  • Reservation

Transfer posting with reference to a reservation

  • See goods issue with reference to a reservation


Read only

0 Likes
5,568

Hi Guru's

Thanks For Replies.

The Mistake I did was passing

mvt_ind = 'B'

res_item = rspos.

I removed Both and left those Blank which solve my problem and posted Succesfully.

Read only

Former Member
0 Likes
5,568

Hi ,

Can you post you code , i mean how to commit or capture messages, Including which BAPI Parameter you use  during transfer order?

Regard's

Smruti