0% found this document useful (0 votes)
245 views

Bapi Goodsmvt Create SCN

The document discusses using the BAPI_GOODSMVT_CREATE to do a material stock movement between batches. It includes an example code for a 551 movement and discusses issues with a 309 movement returning deficit messages. Links to additional examples are also provided.

Uploaded by

Johnbrockly
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
245 views

Bapi Goodsmvt Create SCN

The document discusses using the BAPI_GOODSMVT_CREATE to do a material stock movement between batches. It includes an example code for a 551 movement and discusses issues with a 309 movement returning deficit messages. Links to additional examples are also provided.

Uploaded by

Johnbrockly
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

GettingStarted Newsletters

Hi,Guest

LogOn

JoinUs

Products

Services&Support

AboutSCN

Downloads

Industries

Training&Education

Partnership

DeveloperCenter

Activity

LinesofBusiness

UniversityAlliances

Events&Webinars

Innovation

Browse

4Replies Latestreply:26Jun200815:57byKavithaK

Share

Tweet

Like

SebastianArrieta

19Mar200601:06

BAPI_GOODSMVT_CREATE
ThisquestionisAssumedAnswered.
Hi,Ihavetodoamaterialstockmovementfromonebatchtoanother.I'mtryingtousetheBAPI
'BAPI_GOODSMVT_CREATE'thatwillallowmeto
doa309movement.Anyonehasdonesomethingsimilarorhasanexampletoshare?AlsoIwantto
knowwhatdataarenecessary,andwhatfieldsaremandatorytoassignintheitemtable?.Helpwill
beappreciated.Thanksinadvance.

Sebastian.

HelpfulAnswerbyRichHeilman

37002Views

Topics:abap

AverageUserRating
(0ratings)

RichHeilman 19Mar200601:48 (inresponsetoSebastianArrieta)

HelpfulAnswer Re:BAPI_GOODSMVT_CREATE
Hereissomesamplecodefromoneofmyprograms,whichdoesa551movementtype.Thisshould
getyoustarted.JustchecktheRETURNtableformessages,theyshouldtellyouwhatyouare
missing.

*StructuresforBAPI
data:gm_headertypebapi2017_gm_head_01.
data:gm_codetypebapi2017_gm_code.
data:gm_headrettypebapi2017_gm_head_ret.
data:gm_itemtypetableof
bapi2017_gm_item_createwithheaderline.
data:gm_returntypebapiret2occurs0.
data:gm_retmtdtypebapi2017_gm_head_retmat_doc.
clear:gm_return,gm_retmtd.refreshgm_return.

*SetupBAPIheaderdata.
gm_headerpstng_date=sydatum.
gm_headerdoc_date=sydatum.
gm_codegm_code='06'."MB11
*Write551movementtotable
cleargm_item.
move'551'togm_itemmove_type.
move'000000000040001234'togm_itemmaterial.
move'1'togm_itementry_qnt.
move'EA'togm_itementry_uom.
move'0004'togm_itemplant.
move'4000'togm_itemstge_loc.
move'201'togm_itemmove_reas.
*Determinecostcenterperplant

Store

SearchtheCommunity

Communications

Actions

casexresbwerks.
when'0004'.
move'0000041430'togm_itemcostcenter.
when'0006'.
move'0000041630'togm_itemcostcenter.
when'0007'.
move'0000041731'togm_itemcostcenter.
when'0008'.
move'0000041830'togm_itemcostcenter.
endcase.
appendgm_item.
*CallgoodsmovementBAPI
callfunction'BAPI_GOODSMVT_CREATE'
exporting
goodsmvt_header=gm_header
goodsmvt_code=gm_code
importing
goodsmvt_headret=gm_headret
materialdocument=gm_retmtd
tables
goodsmvt_item=gm_item
return=gm_return.
callfunction'BAPI_TRANSACTION_COMMIT'
exporting
wait='X'.

WelcometoSDN!Pleaseremembertoawardpointsforhelpfulanswersandmarkyoupostassolved
whensolvedcompletely.Thanks.

REgards,
RichHeilman

Like(1)

SebastianArrieta 20Mar200615:20 (inresponsetoRichHeilman)

Re:BAPI_GOODSMVT_CREATE
HiRich,thanksforyouranswer.Inmycase,IguessImustcalltheMB1Btransactionassigning
04asthegm_codebecauseisatransferposting(amaterialquantitymovementfromonebatch
toanother).TheBAPIreturnthismessages:

DeficitofBAUnrestr.prev.90ST:5150104U0502800LOTE2
DeficitofBAUnrestricteduse80ST:5150104U0502800V

Andbelowisthecode.Wherecouldbemymistake?

GOODSMVT_ITEMMATERIAL='000000000005150104'.
GOODSMVT_ITEMPLANT='U050'.
GOODSMVT_ITEMSTGE_LOC='2800'.
GOODSMVT_ITEMBATCH='LOTE2'."originalbatch
GOODSMVT_ITEMMOVE_MAT='000000000005150104'.
GOODSMVT_ITEMMOVE_PLANT='U050'.
GOODSMVT_ITEMMOVE_STLOC='2800'.
GOODSMVT_ITEMMOVE_BATCH='V'."receivingbatch
GOODSMVT_ITEMMOVE_TYPE='309'.
GOODSMVT_ITEMENTRY_QNT=90
APPENDGOODSMVT_ITEM.

GOODSMVT_ITEMMATERIAL='000000000005150104'.
GOODSMVT_ITEMPLANT='U050'.
GOODSMVT_ITEMSTGE_LOC='2800'.
GOODSMVT_ITEMBATCH='V'."receivingbatch
GOODSMVT_ITEMMOVE_MAT='000000000005150104'.
GOODSMVT_ITEMMOVE_PLANT='U050'.
GOODSMVT_ITEMMOVE_STLOC='2800'.
GOODSMVT_ITEMMOVE_BATCH='LOTE2'."originalbatch
GOODSMVT_ITEMMOVE_TYPE='309'.
GOODSMVT_ITEMENTRY_QNT=90.
APPENDGOODSMVT_ITEM.

Regards,
Sebastian.

Like(0)

KavithaK 26Jun200815:57 (inresponsetoRichHeilman)

Re:BAPI_GOODSMVT_CREATE
Hisir,

Iamusing311movementtypeforstoretostoremovement.

Like(0)

FerryLianto 19Mar200605:43 (inresponsetoSebastianArrieta)

Re:BAPI_GOODSMVT_CREATE
HiSebastian,

WelcometoSDN.

PleasetakealookatthislinksforsamplecodingofBAPI_GOODSMVT_CREATE.

http://www.sapimg.com/abap/bapigoodsmvtcreatetopostgoodsmovement.htm
http://www.4ap.de/abap/bapi_goodsmvt_create.php

Hopethiswillhelp.

Regards,
FerryLianto

Like(0)

Share

SiteIndex
Privacy

Tweet

ContactUs
TermsofUse

Like 0

SAPHelpPortal
LegalDisclosure

Copyright

FollowSCN

You might also like