Skip to Content
0
Former Member
Nov 08, 2007 at 12:43 AM

Please Reply

25 Views

Hi gurus,

I am working on this 'BAPI_GOODSMVT_CREATE' for Goods Issue, but my return statement returns this error message <b>"You have entered an external value"</b>. Can you please tell me where I am wrong.

loop at it_input_file.

move: v_doc_date to GOODSMVT_HEADER-DOC_DATE,

v_pos_date to GOODSMVT_HEADER-pstng_date,

syst-uname to GOODSMVT_HEADER-pr_uname.

move: '03' to GOODSMVT_CODE-GM_CODE.

move: it_input_file-matnr to GOODSMVT_ITEM-material,

it_input_file-werks to GOODSMVT_ITEM-plant,

it_input_file-st_loc to GOODSMVT_ITEM-stge_loc,

it_input_file-batch to GOODSMVT_ITEM-batch,

it_input_file-uoe_qty to GOODSMVT_ITEM-entry_qnt,

c_mov_type2 to GOODSMVT_ITEM-move_type,

it_input_file-account to GOODSMVT_ITEM-costcenter,

it_input_file-uoe_uom to GOODSMVT_ITEM-entry_uom,

it_input_file-amount to GOODSMVT_ITEM-AMOUNT_LC,

' ' to GOODSMVT_ITEM-MVT_IND.

  • 'X' to GOODSMVT_ITEM-NO_MORE_GR.

append goodsmvt_item.

move 1 to goodmvt_serialnumber-MATDOC_ITM.

append goodmvt_serialnumber.

move: 1 to goodsmvt_item_cwm-MATDOC_ITM,

it_input_file-uoe_qty to goodsmvt_item_cwm-QUANTITY_PME,

it_input_file-uoe_uom to goodsmvt_item_cwm-BASE_UOM_PME.

append goodsmvt_item_cwm.

CALL FUNCTION 'BAPI_GOODSMVT_CREATE'

EXPORTING

GOODSMVT_HEADER = GOODSMVT_HEADER

GOODSMVT_CODE = GOODSMVT_CODE

IMPORTING

GOODSMVT_HEADRET = GOODSMVT_HEADRET

MATERIALDOCUMENT = MATERIALDOCUMENT

MATDOCUMENTYEAR = MATDOCUMENTYEAR

TABLES

GOODSMVT_ITEM = GOODSMVT_ITEM

GOODSMVT_SERIALNUMBER = goodmvt_serialnumber

RETURN = RETURN

GOODSMVT_ITEM_CWM = goodsmvt_item_cwm.

if NOT return is initial.

LOOP AT return INTO ls_return.

if ls_return-type = 'E' OR

ls_return-type = 'A' OR

ls_return-type = 'X'.

move: it_input_file-matnr to it_bapi_errlog-matnr,

it_input_file-werks to it_bapi_errlog-werks,

it_input_file-st_loc to it_bapi_errlog-st_loc,

it_input_file-seq_num to it_bapi_errlog-seq_num,

ls_return-message to it_bapi_errlog-msg_text.

append it_bapi_errlog.

clear it_bapi_errlog.

endif.

ENDLOOP.

else.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

IMPORTING

RETURN = return2.

move: materialdocument to it_bapi_suclog-mblnr,

it_input_file-matnr to it_bapi_suclog-matnr,

it_input_file-werks to it_bapi_suclog-werks,

it_input_file-st_loc to it_bapi_suclog-st_loc,

it_input_file-seq_num to it_bapi_suclog-seq_num,

ls_return-message to it_bapi_suclog-msg_text.

append it_bapi_suclog.

clear it_bapi_suclog.

endif.

clear: GOODSMVT_HEADER, GOODSMVT_ITEM, goodmvt_serialnumber, RETURN, goodsmvt_item_cwm.

refresh: GOODSMVT_ITEM, goodmvt_serialnumber, RETURN, goodsmvt_item_cwm.

endloop.

endif.

Thanks

Rajeev