Skip to Content

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

bapi

this is my program

&----


*& Report YUPLOAD

*&

&----


*&

*&

&----


REPORT YUPLOAD.

TABLES : zmassmove.

PARAMETER DAT TYPE SY-DATUM.

data : gt_header type BAPI2017_GM_HEAD_01,

gwa_header type BAPI2017_GM_HEAD_01,

gt_item type standard table of BAPI2017_GM_ITEM_CREATE,

gwa_item type BAPI2017_GM_ITEM_CREATE,

GM_CODE TYPE BAPI2017_GM_CODE,

GT_RETURN TYPE STANDARD TABLE OF BAPIRET2,

GWA_RETURN TYPE BAPIRET2,

GT_TEST TYPE BAPI2017_GM_GEN-TESTRUN.

data: begin of mthead.

include structure bapi2017_gm_head_ret.

data: end of mthead.

DATA : GT_MASS TYPE STANDARD TABLE OF ZMASSMOVE WITH HEADER LINE.

GWA_ITEM-MATERIAL = '16500019'.

gwa_item-PLANT = '0005'.

gwa_item-stge_loc = '0001'.

GWA_ITEM-MOVE_TYPE = '301'.

gwa_item-entry_qnt = '1'.

APPEND GWA_ITEM TO GT_ITEM.

GT_HEADER-PSTNG_DATE = '20070807'.

GT_HEADER-DOC_DATE = '20070807'.

.

CALL FUNCTION 'BAPI_GOODSMVT_CREATE'

EXPORTING

goodsmvt_header = GT_HEADER

goodsmvt_code = '04'

TESTRUN = ' '

IMPORTING

GOODSMVT_HEADRET = MTHEAD

tables

goodsmvt_item = GT_ITEM

return = GT_RETURN.

READ TABLE gt_return INTO Gwa_return WITH KEY type = 'E'.

IF sy-subrc eq 0.

write:/'Error in function', Gwa_return-message.

.

ELSE.

write:/ Gwa_return-message.

.

endif.

i am getting an error as 'Material 16500019 not maintained in plant 0005'

but it is there in my database.

please help me

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