Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

PRoblem when posting more than one document

Hi all,

I'm using BAPI BAPI_GOODSMOVEMENT_CREATE to post the documents for PO_GR.when i post one document through text file it is done succesfuully. when i'm posting more than one document it is giving error "posting not possible".

My code is as follows:

loop at i_data.

concatenate '0' i_data-stor_loc into i_data-stor_loc.

concatenate '00' i_data-plant into i_data-plant.

i_item-po_number = i_data-po_no.

i_item-po_item = i_data-po_item.

i_item-move_type = i_data-mvt_type.

i_head-doc_date = doc_date.

i_head-pstng_date = post_date.

i_head-ref_doc_no = i_data-del_note.

i_item-entry_qnt = i_data-entry_qty.

i_item-stge_loc = i_data-stor_loc.

i_item-plant = i_data-plant.

i_item-stck_type = i_data-stk_type.

i_item-batch = i_data-batch.

  • I_ITEM-move_val_type = i_data-move_batch.

APPEND: i_item,i_head.

CLEAR:i_item.

ENDLOOP.

CALL FUNCTION 'BAPI_GOODSMVT_CREATE'

EXPORTING

goodsmvt_header = i_head

goodsmvt_code = i_code

  • TESTRUN = ' '

IMPORTING

  • GOODSMVT_HEADRET =

MATERIALDOCUMENT = matdoc

  • MATDOCUMENTYEAR =

tables

goodsmvt_item = i_item

  • GOODSMVT_SERIALNUMBER =

return = return

.

IF return IS INITIAL.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.

ENDIF.

LOOP AT return.

WRITE: return-message.

ENDLOOP.

WRITE: matdoc.

PLease specify where i'm going wrong.

Regards,

SImha.

Tags:
Not what you were looking for? View more on this topic or Ask a question