Goods Movement - BAPI_GOODSMVT_CREATE - input parameters

Hi,
I have to create a goods movement with movement type 343 and 344.
While using the transaction MB1B (Tranfer Posting), I give the following parameters.
Header
1. Document Date              2. Posting Date
Item
1. Movement Type              2. Plant                  3. Storage Location
4. Material                         5. Quantity
But while using the BAPI for creating the goods movement, it creates material document. But I am neither able to view the document nor see any change in the good movement of the material. The quantity remains same in transaction MMBE.
I feel that item details given as input to the BAPI needs changes. Can anyone suggest the fields to which each of the above item details needs to be given.
Thanks.
Regards,
Senthil G.

Hello Senthil,
Check this sample code
REPORT ZRICH_0001 .
* Structures for BAPI
DATA: GM_HEADER  TYPE BAPI2017_GM_HEAD_01.
DATA: GM_CODE    TYPE BAPI2017_GM_CODE.
DATA: GM_HEADRET TYPE BAPI2017_GM_HEAD_RET.
DATA: GM_ITEM    TYPE TABLE OF
                 BAPI2017_GM_ITEM_CREATE WITH HEADER LINE.
DATA: GM_RETURN  TYPE BAPIRET2 OCCURS 0 WITH HEADER LINE.
DATA: GM_RETMTD  TYPE BAPI2017_GM_HEAD_RET-MAT_DOC.
CLEAR: GM_RETURN, GM_RETMTD. REFRESH GM_RETURN.
* Setup BAPI header data.
GM_HEADER-PSTNG_DATE = SY-DATUM.
GM_HEADER-DOC_DATE   = SY-DATUM.
GM_CODE-GM_CODE      = '04'.                                " MB1A
* Write 971 movement to table
CLEAR GM_ITEM.
MOVE '412'                 TO GM_ITEM-MOVE_TYPE     .
MOVE 'Q'                 TO GM_ITEM-SPEC_STOCK.
MOVE '3800533484'  TO GM_ITEM-MATERIAL.
MOVE '1'     TO GM_ITEM-ENTRY_QNT.
*MOVE 'PC'    TO GM_ITEM-ENTRY_UOM.
MOVE '1060'  TO GM_ITEM-PLANT.
MOVE '0007'  TO GM_ITEM-STGE_LOC.
*MOVE '0901'   TO GM_ITEM-MOVE_REAS.
MOVE 'P203601001' TO GM_ITEM-WBS_ELEM.
MOVE 'P203601001' TO GM_ITEM-VAL_WBS_ELEM.
APPEND GM_ITEM.
* Call goods movement BAPI
CALL FUNCTION '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.
IF NOT GM_RETMTD IS INITIAL.
  COMMIT WORK AND WAIT.
  CALL FUNCTION 'DEQUEUE_ALL'.
ELSE.
  COMMIT WORK AND WAIT.
  CALL FUNCTION 'DEQUEUE_ALL'.
ENDIF.
WRITE:/ GM_RETMTD.
LOOP AT GM_RETURN.
  WRITE:/ GM_RETURN.
ENDLOOP.
" Also after iu call the BAPI use the FM BAPI_TRANSACTION_COMMIT
If useful reward.
Vasanth

Similar Messages

  • Error in Goods movement BAPI_GOODSMVT_CREATE

    I am using the BAPI_GOODSMVT_CREATE.
    I am appendign 10 records to my table and executing the BAPI.
    It is executing successfully for the first 2 records.But for rest 8  records i am getting an error "Content of order 1000030903 : 6211300 transferred to interfa (IMSEG): 6211301"
    where 1000030903 is my Order number and 6211301 is my Material Number.
    Can somebody has got this kind of error.

    Hi,
    Please check and format your table data before sending it to bapi. I mean to say u might be missing conversions or validations for some fields.
    I guess the data you are passing in first two lines meets thee bapi requirement without any conversions, whereas same is not the case with other lines od data.
    I hope this will help you in resolving this issue and close it.
    Appreciate if found helpful!!!
    Regards,
    Vinit

  • Why do we configure Record resaon for goods movement?

    Hi,
    I have seen the settings for "Record reason for goods movement" in customizing for different movement types. it can be optional , suppressed or required.
    Can somebody please let me know what is the effect of this setting? what it does at the front end or rather user level, what transaction does it effect?
    Thanks
    Regards

    Hi,
    We define Record reason for goods movement to input reason for material rejection to vendor or material srapped etc.
    By means of displaying the mtl doc anyone get idea why this mtl is rejected.
    Regards,
    Sandeep

  • BAPI_GOODSMVT_CREATE: Transport Order Goods Movements

    Hi
    I have a transport order  (move material from plant A to plant B) and a outbound delivery already created on SAP.
    From xMII using FMu2019s o BAPIu2019s I need to update the picking and also confirm the outbound delivery in order to register the goods movement, the good movement that I need to create itu2019s 641 type.
    We are using quite well the BAPI_GOODSMVT_CREATE to move materials for Purchase Orders and Process Orders, but with movement type 641 I always get the following error message u201CGoods movement not possible with mvmt type 641u201D; so I began to search on the SAP SDN about this.
    Is there another BAPI for create a 641 movement?
    What are the BAPI or FM that I need to use?
    Any help?
    Best Regards and Thanks in advance

    Finally I've managed to create movement type 641...
    Let explain how:
    First its to update the outbound delivery using the BAPI_OUTB_DELIVERY_CHANGE where you can assign a storage location for a position, the delivered quantity, net weight, gross weigth, volume and also conversion factor between units of measure.
    The we need to do the picking and the post good issue (PGI) by WS_DELIVERY_UPDATE where you define the picking qty, date and time for the post good issue, etc. This is the one that creates a movement 641.
    Here you can see an example of the two BAPI/FM request that you need:
    <?xml version="1.0" encoding="UTF-8"?>
    <BAPI_OUTB_DELIVERY_CHANGE>
         <INPUT>
              <DELIVERY></DELIVERY>
              <HEADER_CONTROL>
                   <DELIV_NUMB></DELIV_NUMB>
                   <GROSS_WT_FLG/>
                   <NET_WT_FLG/>
                   <VOLUME_FLG/>
                   <DELIV_DATE_FLG/>
                   <DOCK_FLG/>
                   <DLV_DEL/>
                   <INCO1_FLG/>
                   <INCO2_FLG/>
                   <ROUTE_FLG/>
                   <SHIP_COND_FLG/>
                   <DLV_PRIO_FLG/>
                   <UNLOAD_PT_FLG/>
                   <PICK_DATE_FLG/>
                   <TRSP_DATE_FLG/>
                   <LOAD_DATE_FLG/>
                   <GDSI_DATE_FLG/>
                   <SIMULATE/>
                   <NO_LOCK/>
                   <SPLIT_DONE_FLG/>
                   <DLV_BLOCK_FLG/>
                   <DLV_CHANGE_OFF/>
              </HEADER_CONTROL>
              <HEADER_CONTROL_SPL>
                   <SENDER_METHOD/>
                   <DELIV_NUMB></DELIV_NUMB>
                   <GEOROUTE_FLG/>
                   <BOP_GUID/>
                   <INITIATOR_PROCESS/>
              </HEADER_CONTROL_SPL>
              <HEADER_DATA>
                   <DELIV_NUMB>2030000016</DELIV_NUMB>
                   <GROSS_WT/>
                   <NET_WEIGHT/>
                   <UNIT_OF_WT/>
                   <UNIT_OF_WT_ISO/>
                   <VOLUME/>
                   <VOLUMEUNIT/>
                   <VOLUMEUNIT_ISO/>
                   <DOOR/>
                   <INCOTERMS1/>
                   <INCOTERMS2/>
                   <ROUTE/>
                   <SHIP_COND/>
                   <DLV_PRIO/>
                   <UNLOAD_PT/>
                   <DLV_BLOCK/>
              </HEADER_DATA>
              <HEADER_DATA_SPL>
                   <DELIV_NUMB></DELIV_NUMB>
                   <GEOROUTE/>
              </HEADER_DATA_SPL>
              <SENDER_SYSTEM/>
              <TECHN_CONTROL>
                   <DEBUG_FLG/>
                   <UPD_IND/>
                   <RECV_WHS_NO/>
                   <RECV_SYS/>
                   <DLV_TYPE/>
              </TECHN_CONTROL>
         </INPUT>
         <TABLES>
              <COLLECTIVE_CHANGE_ITEMS>
                   <item>
                        <DELIV_NUMB></DELIV_NUMB>
                        <DELIV_ITEM/>
                        <DLV_QTY_FROM/>
                        <BASE_UOM/>
                        <BASE_UOM_ISO/>
                   </item>
              </COLLECTIVE_CHANGE_ITEMS>
              <EXTENSION1>
                   <item>
                        <FIELD1/>
                        <FIELD2/>
                        <FIELD3/>
                        <FIELD4/>
                   </item>
              </EXTENSION1>
              <EXTENSION2>
                   <item>
                        <PARAM/>
                        <ROW/>
                        <FIELD/>
                        <VALUE/>
                        <TYPE/>
                        <LENGTH/>
                   </item>
              </EXTENSION2>
              <HEADER_DEADLINES>
                   <item>
                        <DELIV_NUMB></DELIV_NUMB>
                        <TIMETYPE/>
                        <TIMESTAMP_UTC/>
                        <TIMEZONE/>
                   </item>
              </HEADER_DEADLINES>
              <HEADER_PARTNER>
                   <item>
                        <UPD_MODE_PARTN/>
                        <DELIV_NUMB></DELIV_NUMB>
                        <ITM_NUMBER/>
                        <PARTN_ROLE/>
                        <PARTNER_NO/>
                        <ADDRESS_NO/>
                        <DESC_PARTN/>
                        <MANUAL_ADDR/>
                        <SCA_CODE/>
                   </item>
              </HEADER_PARTNER>
              <HEADER_PARTNER_ADDR>
                   <item>
                        <UPD_MODE_ADR/>
                        <ADDR_NO/>
                        <FORMOFADDR/>
                        <NAME/>
                        <NAME_2/>
                        <NAME_3/>
                        <NAME_4/>
                        <C_O_NAME/>
                        <CITY/>
                        <DISTRICT/>
                        <CITY_NO/>
                        <POSTL_COD1/>
                        <POSTL_COD2/>
                        <POSTL_COD3/>
                        <PO_BOX/>
                        <PO_BOX_CIT/>
                        <DELIV_DIS/>
                        <STREET/>
                        <STREET_NO/>
                        <STR_ABBR/>
                        <HOUSE_NO/>
                        <STR_SUPPL1/>
                        <STR_SUPPL2/>
                        <LOCATION/>
                        <BUILDING/>
                        <FLOOR/>
                        <ROOM_NO/>
                        <COUNTRY/>
                        <LANGU/>
                        <REGION/>
                        <SORT1/>
                        <SORT2/>
                        <TIME_ZONE/>
                        <TAXJURCODE/>
                        <ADR_NOTES/>
                        <COMM_TYPE/>
                        <TEL1_NUMBR/>
                        <TEL1_EXT/>
                        <FAX_NUMBER/>
                        <FAX_EXTENS/>
                        <STREET_LNG/>
                        <DISTRCT_NO/>
                        <CHCKSTATUS/>
                        <PBOXCIT_NO/>
                        <TRANSPZONE/>
                        <HOUSE_NO2/>
                        <E_MAIL/>
                        <STR_SUPPL3/>
                        <TITLE/>
                        <COUNTRYISO/>
                        <LANGU_ISO/>
                        <BUILD_LONG/>
                        <REGIOGROUP/>
                        <HOME_CITY/>
                        <HOMECITYNO/>
                        <PCODE1_EXT/>
                        <PCODE2_EXT/>
                        <PCODE3_EXT/>
                        <PO_W_O_NO/>
                        <PO_BOX_REG/>
                        <POBOX_CTRY/>
                        <PO_CTRYISO/>
                        <HOMEPAGE/>
                        <DONT_USE_S/>
                        <DONT_USE_P/>
                   </item>
              </HEADER_PARTNER_ADDR>
              <ITEM_CONTROL>
                   <item>
                        <DELIV_NUMB>2030000016</DELIV_NUMB>
                        <DELIV_ITEM>0010</DELIV_ITEM>
                        <CHG_DELQTY>X</CHG_DELQTY>
                        <DEL_ITEM/>
                        <VOLUME_FLG>X</VOLUME_FLG>
                        <NET_WT_FLG>X</NET_WT_FLG>
                        <GROSS_WT_FLG>X</GROSS_WT_FLG>
                   </item>
              </ITEM_CONTROL>
              <ITEM_DATA>
                   <item>
                        <DELIV_NUMB>2030000016</DELIV_NUMB>
                        <DELIV_ITEM>0010</DELIV_ITEM>
                        <MATERIAL>000000000211000001</MATERIAL>
                        <BATCH/>
                        <HIERARITEM/>
                        <USEHIERITM/>
                        <DLV_QTY>2</DLV_QTY>
                        <DLV_QTY_IMUNIT>2</DLV_QTY_IMUNIT>
                        <FACT_UNIT_NOM>2</FACT_UNIT_NOM>
                        <FACT_UNIT_DENOM>2</FACT_UNIT_DENOM>
                        <CONV_FACT>1</CONV_FACT>
                        <GROSS_WT>2000</GROSS_WT>
                        <NET_WEIGHT>2000</NET_WEIGHT>
                        <UNIT_OF_WT>KG</UNIT_OF_WT>
                        <UNIT_OF_WT_ISO>KG</UNIT_OF_WT_ISO>
                        <VOLUMEUNIT>M3</VOLUMEUNIT>
                        <VOLUMEUNIT_ISO/>
                        <SALES_UNIT>TO</SALES_UNIT>
                        <SALES_UNIT_ISO>TO</SALES_UNIT_ISO>
                        <BASE_UOM>TO</BASE_UOM>
                        <BASE_UOM_ISO>TO</BASE_UOM_ISO>
                        <DEL_QTY_FLO></DEL_QTY_FLO>
                        <DLV_QTY_ST_FLO></DLV_QTY_ST_FLO>
                        <STOCK_TYPE/>
                        <VAL_TYPE/>
                        <MATERIAL_EXTERNAL></MATERIAL_EXTERNAL>
                        <MATERIAL_GUID></MATERIAL_GUID>
                        <MATERIAL_VERSION/>
                        <INSPLOT/>
                        <VOLUME>2000</VOLUME>
                   </item>
              </ITEM_DATA>
              <ITEM_DATA_SPL>
                   <item>
                        <DELIV_NUMB>2030000016</DELIV_NUMB>
                        <DELIV_ITEM>0010</DELIV_ITEM>
                        <STGE_LOC>CT2A</STGE_LOC>
                        <PICK_DENIAL/>
                   </item>
              </ITEM_DATA_SPL>
              <ITEM_SERIAL_NO>
                   <item>
                        <DELIV_NUMB></DELIV_NUMB>
                        <ITM_NUMBER/>
                        <SERIALNO/>
                   </item>
              </ITEM_SERIAL_NO>
              <RETURN>
                   <item>
                        <TYPE/>
                        <ID/>
                        <NUMBER/>
                        <MESSAGE/>
                        <LOG_NO/>
                        <LOG_MSG_NO/>
                        <MESSAGE_V1/>
                        <MESSAGE_V2/>
                        <MESSAGE_V3/>
                        <MESSAGE_V4/>
                        <PARAMETER/>
                        <ROW/>
                        <FIELD/>
                        <SYSTEM/>
                   </item>
              </RETURN>
              <SUPPLIER_CONS_DATA>
                   <item>
                        <DELIV_NUMB></DELIV_NUMB>
                        <ITM_NUMBER/>
                        <SPEC_STOCK/>
                        <SP_STCK_NO/>
                        <REF_QTY/>
                        <BASE_UOM/>
                        <BASE_UOM_ISO/>
                        <DLV_QTY/>
                        <SALES_UNIT/>
                        <SALES_UNIT_ISO/>
                   </item>
              </SUPPLIER_CONS_DATA>
              <TOKENREFERENCE>
                   <item>
                        <TR_EXT/>
                   </item>
              </TOKENREFERENCE>
         </TABLES>
    </BAPI_OUTB_DELIVERY_CHANGE>
    <?xml version="1.0" encoding="UTF-8"?>
    <WS_DELIVERY_UPDATE>
         <INPUT>
              <COMMIT>X</COMMIT>
              <DELIVERY>2030000016</DELIVERY>
              <IF_CONFIRM_CENTRAL> </IF_CONFIRM_CENTRAL>
              <IF_DATABASE_UPDATE>1</IF_DATABASE_UPDATE>
              <IF_ERROR_MESSAGES_SEND_0>X</IF_ERROR_MESSAGES_SEND_0>
              <IF_GET_DELIVERY_BUFFERED> </IF_GET_DELIVERY_BUFFERED>
              <IF_LATE_DELIVERY_UPD> </IF_LATE_DELIVERY_UPD>
              <IF_NO_BUFFER_REFRESH> </IF_NO_BUFFER_REFRESH>
              <IF_NO_GENERIC_SYSTEM_SERVICE> </IF_NO_GENERIC_SYSTEM_SERVICE>
              <IF_NO_INIT> </IF_NO_INIT>
              <IF_NO_MES_UPD_PACK> </IF_NO_MES_UPD_PACK>
              <IF_NO_READ> </IF_NO_READ>
              <IF_NO_REMOTE_CHG></IF_NO_REMOTE_CHG>
              <IF_WMPP> </IF_WMPP>
              <NICHT_SPERREN>X</NICHT_SPERREN>
              <NO_MESSAGES_UPDATE> </NO_MESSAGES_UPDATE>
              <SYNCHRON>X</SYNCHRON>
              <UPDATE_PICKING>X</UPDATE_PICKING>
              <VBKOK_WA>
                   <VBELN_VL>2030000016</VBELN_VL>
                   <VBTYP_VL/>
                   <VBELN/>
                   <LGNUM/>
                   <TANUM/>
                   <KODAT/>
                   <KOUHR/>
                   <BRGEW/>
                   <KZBRG></KZBRG>
                   <KZNTG></KZNTG>
                   <NTGEW></NTGEW>
                   <GEWEI/>
                   <VOLUM/>
                   <KZVOL></KZVOL>
                   <VOLEH/>
                   <KOMUE/>
                   <WABUC>X</WABUC>
                   <WADAT_IST/>
                   <KZWAD>X</KZWAD>
                   <WADAT>20080812</WADAT>
                   <WAUHR>115436</WAUHR>
                   <KZLFD></KZLFD>
                   <LFDAT></LFDAT>
                   <LFUHR></LFUHR>
                   <KZTOR></KZTOR>
                   <LGTOR/>
                   <KZLSP></KZLSP>
                   <LIFSK/>
                   <LIKP_DEL/>
                   <PACKING_REFRESH/>
                   <PACKING_FINAL/>
                   <PODAT/>
                   <POTIM/>
                   <KZPOD/>
                   <LIFEX/>
                   <BOLNR/>
                   <PRVBE/>
                   <XWMPP/>
                   <TRATY/>
                   <TRAID/>
                   <KZKODAT/>
                   <KZEBU/>
                   <INCO1/>
                   <INCO2/>
                   <ROUTE/>
                   <LPRIO/>
                   <VSBED/>
                   <LDDAT>20080812</LDDAT>
                   <LDUHR>115436</LDUHR>
                   <TDDAT/>
                   <TDUHR/>
                   <ABLAD/>
                   <KZINCO1/>
                   <KZINCO2/>
                   <KZROUTE/>
                   <KZLPRIO/>
                   <KZVSBED/>
                   <KZLDDAT>X</KZLDDAT>
                   <KZTDDAT/>
                   <KZABLAD/>
                   <KZLIFEX/>
                   <DECSPLI/>
                   <KZCHGOFF/>
                   <IMWRK/>
                   <KZREG/>
                   <KZLGBZO/>
                   <LGBZO/>
                   <SPE_ORIG_SYS/>
                   <SPE_CHNG_SYS/>
                   <SPE_TMPID/>
                   <SPE_LOEKZ/>
                   <SPE_NO_HU_CONS_CHECK/>
                   <SPE_LOGSYS/>
                   <SPE_RET_HU_UPDATE_REQUEST/>
                   <SPE_GEN_PROCESS/>
                   <SPE_WAUHR_IST/>
                   <SPE_WAZONE_IST/>
                   <SPE_LOC_SEQ/>
                   <SPE_ACC_APP_STS/>
                   <SPE_ACC_APP_STS_F/>
                   <SPE_SHP_INF_STS/>
                   <SPE_SHP_INF_STS_F/>
                   <SPE_RET_CANC/>
                   <SPE_RET_CANC_F/>
                   <SPE_QI_STATUS/>
                   <SPE_QI_STATUS_F/>
                   <SPE_GEOROUTE/>
                   <SPE_GEOROUTEIND/>
                   <SPE_CARRIER_IND/>
                   <SPE_GTS_REL/>
                   <SPE_GTS_RT_CDE/>
                   <GTS_CUSREF_NO/>
                   <BOP_GUID/>
                   <SPE_DIRECT_BILLING/>
                   <SPE_BILLING_WAIT/>
                   <SPE_PRINTER_PROF/>
                   <SPE_KZGEOROUTE/>
                   <SPE_KZGEOROUTEIND/>
                   <SPE_KZCARRIER_IND/>
                   <SPE_KZGTS_REL/>
                   <SPE_KZGTS_RT_CDE/>
                   <SPE_INITIATOR_PROCESS/>
                   <SPE_RESET_VLSTK/>
                   <SPE_KZTRAID/>
                   <SPE_KZTRATY/>
                   <SPE_INB_DLV/>
                   <SPE_DIST_PROC_CODE/>
                   <NO_TEXT_INIT/>
                   <NO_MESSAGE_INIT/>
                   <BLDAT/>
                   <KZBLD/>
                   <ANZPK/>
                   <KZAPK/>
                   <BORGR_KZWAD/>
                   <BORGR_KZABL/>
                   <MDIFF_BUCH/>
                   <MDIFF_STORNO/>
                   <KZTXT/>
                   <TXTOLD_DEL_ALL_LANG/>
                   <SPE_MDNUM_EWM/>
                   <SPE_OMDNUM_EWM/>
                   <SPE_CD_PLANT/>
                   <SPE_CD_PLANTF/>
                   <SPE_PRO_NUMBER/>
                   <SPE_KZ_PRO_NUMBER/>
                   <SPE_RED_IND/>
                   <SPE_AUTO_GR/>
                   <VORNU/>
                   <VORPA/>
                   <EXPVZ/>
              </VBKOK_WA>
         </INPUT>
         <TABLES>
              <ET_CREATED_HUS>
                   <item>
                        <MANDT/>
                        <VENUM/>
                        <EXIDV/>
                        <EXIDA/>
                        <VSTEL/>
                        <LSTEL/>
                        <BRGEW/>
                        <NTGEW/>
                        <MAGEW/>
                        <TARAG/>
                        <GEWEI/>
                        <BTVOL/>
                        <NTVOL/>
                        <MAVOL/>
                        <TAVOL/>
                        <VOLEH/>
                        <ANZGL/>
                        <ERNAM/>
                        <ERDAT/>
                        <ERUHR/>
                        <AENAM/>
                        <AEDAT/>
                        <AEZET/>
                        <SORTL/>
                        <VEGR1/>
                        <VEGR2/>
                        <VEGR3/>
                        <VEGR4/>
                        <VEGR5/>
                        <VHILM/>
                        <LAENG/>
                        <BREIT/>
                        <HOEHE/>
                        <MEABM/>
                        <ERLKZ/>
                        <GEWTO/>
                        <VOLTO/>
                        <MEINS/>
                        <VOLEH_MAX/>
                        <GEWEI_MAX/>
                        <VBELN_GEN/>
                        <POSNR_GEN/>
                        <INHALT/>
                        <VHART/>
                        <KAPPL/>
                        <KALSM/>
                        <KSCHL/>
                        <MAGRV/>
                        <WERKS/>
                        <PSTYV/>
                        <VKORG/>
                        <VTWEG/>
                        <LADLG/>
                        <LADEH/>
                        <FARZT/>
                        <FAREH/>
                        <ENTFE/>
                        <EHENT/>
                        <LGORT/>
                        <GEWFX/>
                        <VELTP/>
                        <EXIDV2/>
                        <LANDT/>
                        <LANDF/>
                        <NAMEF/>
                        <NAMBE/>
                        <VHILM_KU/>
                        <VPOBJ/>
                        <VPOBJKEY/>
                        <HANDLE/>
                        <WMSTA/>
                        <LGNUM/>
                        <SAPRL/>
                        <KZGVH/>
                        <ADGE_DG/>
                        <ADGE_DGPR/>
                        <UEVEL/>
                        <PACKVORSCHR/>
                        <PACKVORSCHR_ST/>
                        <LABELTYP/>
                        <ZUL_AUFL/>
                        <STATUS/>
                        <HU_LGORT/>
                        <HU_SYSTEM/>
                        <SPE_HDALL/>
                        <SPE_VLSTK/>
                        <SPE_DELDEC/>
                        <SPE_IDART_01/>
                        <SPE_IDENT_01/>
                        <SPE_IDART_02/>
                        <SPE_IDENT_02/>
                        <SPE_IDART_03/>
                        <SPE_IDENT_03/>
                        <SPE_IDART_04/>
                        <SPE_IDENT_04/>
                        <SPE_LOGPOS/>
                        <SPE_CHK_COUNTER/>
                        <EPC1/>
                        <EPC2/>
                        <PACKAGE_CAT/>
                        <TRANSP_INDEX/>
                        <CRIT_SAF_INDEX/>
                        <LYARD/>
                        <YLCCL/>
                        <YLOCT/>
                        <STATS/>
                        <PRRTY/>
                        <FWAGN/>
                        <SCACD/>
                        <OWNER/>
                        <TRNPD/>
                        <SEALN1/>
                        <SEALN2/>
                        <SEALN3/>
                        <SEALN4/>
                        <SEALN5/>
                        <BLIND/>
                        <RSNCD/>
                        <RFTYP/>
                        <REFER/>
                        <PTMST/>
                        <ATMST/>
                        <YDOOR/>
                        <YSTGA/>
                        <URGFL/>
                        <PRFLG/>
                        <SLFLG/>
                        <SIGNI/>
                        <LTEXT/>
                        <UPDKZ/>
                        <KZTRA/>
                        <VEBEZ/>
                        <SORTF/>
                        <AENDB/>
                        <AENDB_WV/>
                        <AENDB_QUAN/>
                        <AENDB_STATUS/>
                        <KZUNT/>
                        <KZOBE/>
                        <FRGEW/>
                        <GEWEI_FR/>
                        <FRVOL/>
                        <VOLEH_FR/>
                        <KZPGN/>
                        <WERFD/>
                        <SELKZ/>
                        <LE_LGPLA/>
                        <LE_LGTYP/>
                        <WM_VERW/>
                        <MTPOS/>
                        <DEST_LGNUM/>
                        <DEST_LGTYP/>
                        <DEST_LGPLA/>
                        <OBJNR/>
                        <KUNNR/>
                        <LIEFNR/>
                        <TARAVAR/>
                        <STSMA/>
                        <HISTU/>
                        <ACTIVITY/>
                        <OBJECT/>
                        <HU_STATUS_INIT/>
                        <LOGSYS/>
                        <HU_LOCKED/>
                        <LETYP_WM/>
                        <TOP_HU_DLVRY/>
                        <KZEBU/>
                        <VWPOS/>
                   </item>
              </ET_CREATED_HUS>
              <IT_BAPIADDR1>
                   <item>
                        <ADDR_NO/>
                        <FORMOFADDR/>
                        <NAME/>
                        <NAME_2/>
                        <NAME_3/>
                        <NAME_4/>
                        <C_O_NAME/>
                        <CITY/>
                        <DISTRICT/>
                        <CITY_NO/>
                        <POSTL_COD1/>
                        <POSTL_COD2/>
                        <POSTL_COD3/>
                        <PO_BOX/>
                        <PO_BOX_CIT/>
                        <DELIV_DIS/>
                        <STREET/>
                        <STREET_NO/>
                        <STR_ABBR/>
                        <HOUSE_NO/>
                        <STR_SUPPL1/>
                        <STR_SUPPL2/>
                        <LOCATION/>
                        <BUILDING/>
                        <FLOOR/>
                        <ROOM_NO/>
                        <COUNTRY/>
                        <LANGU/>
                        <REGION/>
                        <SORT1/>
                        <SORT2/>
                        <TIME_ZONE/>
                        <TAXJURCODE/>
                        <ADR_NOTES/>
                        <COMM_TYPE/>
                        <TEL1_NUMBR/>
                        <TEL1_EXT/>
                        <FAX_NUMBER/>
                        <FAX_EXTENS/>
                        <STREET_LNG/>
                        <DISTRCT_NO/>
                        <CHCKSTATUS/>
                        <PBOXCIT_NO/>
                        <TRANSPZONE/>
                        <HOUSE_NO2/>
                        <E_MAIL/>
    &nb

  • Input parameters for BAPI_GOODSMVT_CREATE --MIGO--GR for Outbound Delivery

    Hi Friends,
      We have to create a Goods Receipt against an Outbound Delivery ( movement type "101" ) using the BAPI <b>BAPI_GOODSMVT_CREATE</b>.
    In online the user is using <b>MIGO</b> transaction for the same. There he will choose the GOODS RECEIPT for OUTBOUND DELIVERY and enters the delivery number. The movement type "101" is used.
      Could you please tell me the GM code and the required fields to be passed for the above scenario.
    I have gone through the example program in the link...
    http://www.sap-img.com/abap/bapi-goodsmvt-create-to-post-goods-movement.htm
    <b>but unable to find how to use this BAPI for simulating MIGO transaction.</b>
    <b>The fields available are with us are...</b>
    Delivery. No. --- Doc. Date - Posting Date-Quantity-Storage Location-
    Reason for movement-External qty-External qty unit-Goods recipient-Excise Selection
    Are these fields sufficient for doing MIGO with this BAPI or do we require more fields???
    Thanks and Regards,
    Bharat

    see the following code. it may be useful.
      LOOP AT I_TAB.
          count = sy-tabix.
          SELECT SINGLE * FROM ZMM_GR_UPLOAD1
                                    WHERE SOLOMON_GR = I_TAB-SOLOMON_GR AND
                                    SOLOMON_GRDAT = I_TAB-SOLOMON_GRDAT.
          IF SY-SUBRC = 0.
            I_TAB-FLAG = 'C'.
            modify i_tab index count.
            concatenate 'File Name : ' name into i_msg1.
            append i_msg1.
            CONCATENATE 'ERROR  PO : ' I_TAB-SOL_PONO
                '  WAS ALREADY UPLOADED' INTO I_MSG1.
            APPEND I_MSG1.
            CLEAR I_TAB-FLAG.
            CONTINUE.
          ELSE.
            REFRESH I_ITEMS.
            CLEAR I_ITEMS.
            CONCATENATE I_MAIN-SOLOMON_GRDAT+4(4)
                        I_MAIN-SOLOMON_GRDAT+2(2)
                        I_MAIN-SOLOMON_GRDAT+0(2) INTO G_DATE.
            gmhead-pstng_date = G_DATE.
            gmhead-doc_date = sy-datum.
            gmhead-pr_uname = sy-uname.
    "01 - MB01 - Goods Receipts for Purchase Order
            gmcode-gm_code = '01'.
            refresh itab.
            clear itab.
            SORT I_MAIN BY SOLOMON_GR.
            LOOP AT I_MAIN WHERE SOLOMON_GR = I_TAB-SOLOMON_GR.
              itab-move_type  = '101'.
              itab-mvt_ind    = 'B'.
              itab-plant      = I_MAIN-WERKS.
              itab-material   = I_MAIN-MATNR.
              itab-entry_qnt  = I_MAIN-ERFMG.
             itab-stge_loc   = 'OMR1'.
    itab-move_stloc = pcitab-recv_loc.
             itab-REF_DOC = 'exnum123'.
              itab-NO_MORE_GR = 'X'.
              itab-WITHDRAWN = ''.
              itab-stge_loc   = I_MAIN-LGOBE.
              itab-po_number  = I_MAIN-EBELN.
              itab-po_item    = I_MAIN-EBELP.
              itab-unload_pt  = I_MAIN-ABLAD2.
              append itab.
            ENDLOOP.
            if not itab[] is initial.
              call function 'BAPI_GOODSMVT_CREATE'
               exporting
                   goodsmvt_header             = gmhead
                   goodsmvt_code               = gmcode
                 *   TESTRUN                     = ' '
              IMPORTING
                  goodsmvt_headret            = mthead
             *   MATERIALDOCUMENT            =
      MATDOCUMENTYEAR             =
               tables
                 goodsmvt_item               = itab
      GOODSMVT_SERIALNUMBER       =
                return                      = errmsg.
              clear errflag.
              loop at errmsg.
                if sy-tabix = 1.
                  concatenate 'File Name : ' name into i_msg1.
                  append i_msg1.
                  concatenate 'Sol PO : ' I_TAB-SOL_PONO ' '
                   I_TAB-SOL_PODT into i_msg1.
                  append i_msg1.
                endif.
                if errmsg-type eq 'E'.
                  write:/'Error in function', errmsg-message.
                  errflag = 'X'.
                else.
                  write:/ errmsg-message.
                endif.
                move errmsg-message to i_msg1.
                append i_msg1.
              endloop.
              if errflag is initial.
                CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
              EXPORTING
                WAIT          =
              IMPORTING
                RETURN        =
               commit work and wait.
                if sy-subrc ne 0.
                  write:/ 'Error in updating'.
                  exit.
                else.
                  concatenate 'File Name : ' name into i_msg1.
                  append i_msg1.
                  concatenate 'Sol PO : ' I_TAB-SOL_PONO ' '
                   I_TAB-SOL_PODT into i_msg1.
                  append i_msg1.
                  write:/ mthead-mat_doc, mthead-doc_year.
                  ZMM_GR_UPLOAD1-SOLOMON_GR = I_TAB-SOLOMON_GR.
                 CONCATENATE I_TAB-SOLOMON_GRDAT+4(4)
                       I_TAB-SOLOMON_GRDAT+2(2)
                       I_TAB-SOLOMON_GRDAT+0(2) INTO
                        ZMM_GR_UPLOAD1-SOLOMON_GRDAT.
                  ZMM_GR_UPLOAD1-SOLOMON_GRDAT = I_TAB-SOLOMON_GRDAT.
                  INSERT ZMM_GR_UPLOAD1.
                  COMMIT WORK.
                  I_TAB-FLAG = 'C'.
                  MODIFY I_TAB INDEX COUNT.
                  CONCATENATE mthead-mat_doc  mthead-doc_year
                             into i_msg1.
                  append i_msg1.
                 perform upd_sta.
                endif.
              endif.
            endif.
          ENDIF.
        ENDLOOP.

  • Goods movement in IS OIL

    Hi,
    I am using BAPI 'BAPI_GOODSMVT_CREATE' to create goods receipt.
    I want to make goods movement for IS OIL materials - meaning those materials that carry a UoM group in the oil-specific view in the material master data, MARA-CMETH = 1 or 2.
    I have read that we can make that happen using function MB_CREATE_GOODS_MOVEMENT through the IS-OIL specific table parameters:
    T_MS1INT and T_MS2INT.
    I have tried that, but it doesn't work. Does anyone know how to fill out these tables?
    Or any other good tips on how to make Goods movement on IS-OIL materials in a report. Batch input on MIGO is not possible.
    Best Regards,
    Anne M Johannessen

    We are using BAPI_GOODSMVT_CREATE_OIL  for MARA-MATKL 
    And  BAPI_GOODSMVT_CREATE for Non IS oil material
    U can try.
    Thanx
    Dipak
    [email protected]

  • Goods movement not possible with mvmt type 991

    Hi,
                As per requirement I need to create a GR for Purchase order wise. I tried to create using BAPI BAPI_GOODSMVT_CREATE but It returns the error message.
    error:  Goods movement not possible with mvmt type 991
    LOOP AT gt_outtab1.
      gt_outtab1-gr_wght       =   gt_outtab1-gr_wght.
       MOVE: gt_outtab1-matnr            TO gt_item-material,
              gt_zseed_po_qty-werks       TO gt_item-plant,
              gt_zseed_po_qty-lgort       TO gt_item-stge_loc,
             '901'                        TO gt_item-move_type,
              gt_outtab1-gr_wght          TO gt_item-entry_qnt,
              'B'                         TO gt_item-mvt_ind,
              '1'                         TO gt_item-stck_type,
              v_lifnr                     TO gt_item-vendor,
              gt_outtab1-ebeln            TO gt_item-po_number,
              gt_outtab1-ebelp            TO gt_item-po_item.
    APPEND gt_item.
    ENDLOOP.
    CLEAR gt_item.
      LOOP AT gt_outtab3 WHERE bqty IS NOT INITIAL.
        MOVE: gt_outtab3-bmatnr           TO gt_item-material,
              gt_zseed_po_qty-werks        TO gt_item-plant,
              gt_zseed_po_qty-lgort      TO gt_item-stge_loc,
             '991'                        TO gt_item-move_type,
              gt_outtab3-bqty             TO gt_item-entry_qnt,
              ''                          TO gt_item-mvt_ind,
              '1'                         TO gt_item-stck_type,
              v_lifnr                     TO gt_item-vendor.
        APPEND gt_item.
      ENDLOOP.
    CLEAR gt_item.
      LOOP AT gt_outtab3 WHERE pqty IS NOT INITIAL.
        MOVE: gt_outtab3-bmatnr           TO gt_item-material,
             gt_zseed_po_qty-werks        TO gt_item-plant,
              gt_zseed_po_qty-lgort      TO gt_item-stge_loc,
             '942'                        TO gt_item-move_type,
              gt_outtab3-pqty             TO gt_item-entry_qnt,
              ''                          TO gt_item-mvt_ind,
              '1'                         TO gt_item-stck_type,
              v_lifnr                     TO gt_item-vendor.
        APPEND gt_item.
      ENDLOOP.
    ***********Call goods movement BAPI
      CALL FUNCTION 'BAPI_GOODSMVT_CREATE'
        EXPORTING
          goodsmvt_header  = gs_header
          goodsmvt_code    = gs_code
        IMPORTING
          goodsmvt_headret = gs_headret
          materialdocument = gs_retmtd
          matdocumentyear  = gs_year
        TABLES
          goodsmvt_item    = gt_item
          return           = gt_return. 
    so could you please let me know which are the parameters I need to pass to create GR?
    regards,
    tarun

    Hi,
    Go to T.code OMJJ . Give your your movement type 991. Check the allowed transaction and all the details  in your left hand side and the settings done.
    Thanks
    Arbind

  • Incorrect goods movements

    0 successful and 1 incorrect goods movements
    Message no. VLA019
    System Response
    The system reports back as incorrect only those goods movements that could not be carried out.
    If the goods issue or goods receipt for one of the deliveries selected has already been posted by way of the subsequent function Post goods issue or Post goods receipt, the corresponding delivery will be reported back as successful.
    Note that for partial goods receipt the posted items and not the posted deliveries are counted.
    >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<
    well i am doing good issue to out bound delivery in T code Vl06.
    regard
    nabil

    Refer SAP Note 416150 - VL06: Posting of goods movement in background terminates
    Reason and Prerequisites
    The problem is caused by a program error.
    During background processing a batch input is used for the posting of the goods movement in the standard transactions for inbound or outbound delivery.
    However, the batch input processing terminates if dialog boxes or warning messages are sent during the posting from delivery processing.
    The termination occurs because no input parameters are provided in the used batch input session for the additional screens.
    The problem can also occur during interactive processing when the process mode 'Foreground for error' is used.
    Thanks & Regards
    JP

  • Goods Movement through order confirmation for IS oil material

    Hello Experts,
    I am doing the goods issue posting through the confirmation transaction CORK for process order.  The materials that I am posting are IS oil relevant.
    When Iam trying to save the confirmation, system is taking to the screen of additional quantity calculation for each materials. When I maintain the details, system is saving the confirmation. But in case if there is a change in the parameters mentioned for additional quantity calculation, system is not giving any option.
    In other goods issue transactions, we can see a calculator button which will take us to the quantity calculation screen, if we double click a line item. But I dont find this option in the goods movement screen through order confirmation transactions.
    Is there any way to activate it in confirmation screen also, so that we can individually maintain the qty calculation parameters of each goods issue item?.
    Appreciate your earliest reply
    Thanks & Regards
    Prathib

    No Inputs?????

  • GOODS ISSUE BAPI_GOODSMVT_CREATE problem

    Hii Alll,
    BAPI_GOODSMVT_CREATE is not posting my document but its creating material document
    and doc year.
    n i hv tested in se37 same  prob .
    its not posting production  order

    hi
    good
    go through this below code and use the functionmodule accordingly,
    The following is an abap program making used of the BAPI function BAPI_GOODSMVT_CREATE to do Goods Receipts for Purchase Order after importing the data from an external system.
    BAPI TO Upload Inventory Data
    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
    Domain: KZBEW - Movement Indicator
         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
    report zbapi_goodsmovement.
    parameters: p-file like rlgrap-filename default
                                     'c:\sapdata\TEST.txt'.
    parameters: e-file like rlgrap-filename default
                                     'c:\sapdata\gdsmvterror.txt'.
    parameters: xpost like sy-datum default sy-datum.
    data: begin of gmhead.
            include structure bapi2017_gm_head_01.
    data: end of gmhead.
    data: begin of gmcode.
            include structure bapi2017_gm_code.
    data: end of gmcode.
    data: begin of mthead.
            include structure bapi2017_gm_head_ret.
    data: end of mthead.
    data: begin of itab occurs 100.
            include structure bapi2017_gm_item_create.
    data: end of itab.
    data: begin of errmsg occurs 10.
            include structure bapiret2.
    data: end of errmsg.
    data: wmenge like iseg-menge,
          errflag.
    data: begin of pcitab occurs 100,
            ext_doc(10),           "External Document Number
            mvt_type(3),           "Movement Type
            doc_date(8),           "Document Date
            post_date(8),          "Posting Date
            plant(4),              "Plant
            material(18),          "Material Number
            qty(13),               "Quantity
            recv_loc(4),           "Receiving Location
            issue_loc(4),          "Issuing Location
            pur_doc(10),           "Purchase Document No
            po_item(3),            "Purchase Document Item No
            del_no(10),            "Delivery Purchase Order Number
            del_item(3),           "Delivery Item
            prod_doc(10),          "Production Document No
            scrap_reason(10),      "Scrap Reason
            upd_sta(1),            "Update Status
          end of pcitab.
    call function 'WS_UPLOAD'
      exporting
        filename                      = p-file
        filetype                      = 'DAT'
    IMPORTING
      FILELENGTH                    =
      tables
        data_tab                      = pcitab
    EXCEPTIONS
      FILE_OPEN_ERROR               = 1
      FILE_READ_ERROR               = 2
      NO_BATCH                      = 3
      GUI_REFUSE_FILETRANSFER       = 4
      INVALID_TYPE                  = 5
      OTHERS                        = 6
    if sy-subrc <> 0.
      message id sy-msgid type sy-msgty number sy-msgno
              with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      exit.
    endif.
    gmhead-pstng_date = sy-datum.
    gmhead-doc_date = sy-datum.
    gmhead-pr_uname = sy-uname.
    gmcode-gm_code = '01'.   "01 - MB01 - Goods Receipts for Purchase Order
    loop at pcitab.
      itab-move_type  = pcitab-mvt_type.
      itab-mvt_ind    = 'B'.
      itab-plant      = pcitab-plant.
      itab-material   = pcitab-material.
      itab-entry_qnt  = pcitab-qty.
      itab-move_stloc = pcitab-recv_loc.
      itab-stge_loc   = pcitab-issue_loc.
      itab-po_number  = pcitab-pur_doc.
      itab-po_item    = pcitab-po_item.
      concatenate pcitab-del_no pcitab-del_item into itab-item_text.
      itab-move_reas  = pcitab-scrap_reason.
      append itab.
    endloop.
    loop at itab.
      write:/ itab-material, itab-plant, itab-stge_loc,
              itab-move_type, itab-entry_qnt, itab-entry_uom,
              itab-entry_uom_iso, itab-po_number, itab-po_item,
                                                  pcitab-ext_doc.
    endloop.
    call function 'BAPI_GOODSMVT_CREATE'
      exporting
        goodsmvt_header             = gmhead
        goodsmvt_code               = gmcode
      TESTRUN                     = ' '
    IMPORTING
        goodsmvt_headret            = mthead
      MATERIALDOCUMENT            =
      MATDOCUMENTYEAR             =
      tables
        goodsmvt_item               = itab
      GOODSMVT_SERIALNUMBER       =
        return                      = errmsg
    clear errflag.
    loop at errmsg.
      if errmsg-type eq 'E'.
        write:/'Error in function', errmsg-message.
        errflag = 'X'.
      else.
        write:/ errmsg-message.
      endif.
    endloop.
    if errflag is initial.
      commit work and wait.
      if sy-subrc ne 0.
        write:/ 'Error in updating'.
        exit.
      else.
        write:/ mthead-mat_doc, mthead-doc_year.
        perform upd_sta.
      endif.
    endif.
          FORM UPD_STA                                                  *
    form upd_sta.
      loop at pcitab.
        pcitab-upd_sta = 'X'.
        modify pcitab.
      endloop.
      call function 'WS_DOWNLOAD'
        exporting
          filename                      = p-file
          filetype                      = 'DAT'
    IMPORTING
      FILELENGTH                    =
        tables
          data_tab                      = pcitab
    EXCEPTIONS
      FILE_OPEN_ERROR               = 1
      FILE_READ_ERROR               = 2
      NO_BATCH                      = 3
      GUI_REFUSE_FILETRANSFER       = 4
      INVALID_TYPE                  = 5
      OTHERS                        = 6
    endform.
    *--- End of Program
    reward point if helpful.
    thanks
    mrutyun^

  • Goods movement not possible with mvmt type 966 .

    Hi guys....'
    i use BAPI_GOODSMVT_CREATE to do goods receive without PO into unrestricted use...
    these are the parameters
    HEADER:
    PSTNG_DATE: 30.09.2004
    DOC_DATE: 30.09.2004
    HEADER4_TXT: XXXXXX
    GOODSMVT_CODE: 03
    GOODSMVT_ITEM:
    MATERIAL: XXXXXX
    PLAN: 8000
    STGE: 80FG
    BATCH: AQ305
    MOV: 966
    ENTRY_QNT: 1
    ENT_UOM: EA
    ENT_UOM_ISO: EA
    ITEM_TXT: XXXXXX
    GR_RCPT: XXXX
    COSTCENTER: 22000
    the rest... empty....
    Thank you for your help....
    How to find out  GOODSMVT_CODE  relationship with the good movement ?
    Message was edited by: Kokwei Wong

    You can find the relation of GM_CODE and Transaction in table 'T158G'.
    And you can see the further information about this function in BAPI Explorer -> Select your method -> Select tab 'Documentation'.
    Cheers,
    Thitima

  • How to log input parameters for Function Modules?

    Hi,
    I need to create a Logging system to trace input parameters for function modules.
    The log functionality could be done by developing a class method or a function module (For example 'write_log'), and calling it within each function module that I want to log. The 'write_log' code should be independent from the interface of the Function Module that I want to log.
    For example, I'd like to write a function/class method that can log both these functions modules:
    Function DummyA
       Input parameters: A1 type char10, A2 type char10.
    Function DummyB
       Input parameters: B1 type char20, B2 type char20, B3 type char20, B4 type Z_MYSTRUCTURE
    Now the questions...
    - Is there a "standard SAP" function that provide this functionality?
    - If not, is there a system variable in which I can access runtime all parameters name, type and value for a particular function module?
    - If not, how can I loop at Input parameters in a way that is independent from the function module interface?
    Thank you in advance for helping!

    check this sample code. here i am capturing only parameters (import) values. you can extend this to capture tables, changin, etc.
    FUNCTION y_test_fm.
    *"*"Local Interface:
    *"  IMPORTING
    *"     REFERENCE(PARAM1) TYPE  CHAR10
    *"     REFERENCE(PARAM2) TYPE  CHAR10
    *"     REFERENCE(PARAM3) TYPE  CHAR10
      DATA: ep TYPE STANDARD TABLE OF rsexp ,
            ip TYPE STANDARD TABLE OF rsimp ,
            tp TYPE STANDARD TABLE OF rstbl ,
            el TYPE STANDARD TABLE OF rsexc ,
            vals TYPE tihttpnvp ,
            wa_vals TYPE ihttpnvp ,
            wa_ip TYPE rsimp .
      FIELD-SYMBOLS: <temp> TYPE ANY .
      CALL FUNCTION 'FUNCTION_IMPORT_INTERFACE'
        EXPORTING
          funcname                 = 'Y_TEST_FM'
    *   INACTIVE_VERSION         = ' '
    *   WITH_ENHANCEMENTS        = 'X'
    *   IGNORE_SWITCHES          = ' '
    * IMPORTING
    *   GLOBAL_FLAG              =
    *   REMOTE_CALL              =
    *   UPDATE_TASK              =
    *   EXCEPTION_CLASSES        =
        TABLES
          exception_list           = el
          export_parameter         = ep
          import_parameter         = ip
    *   CHANGING_PARAMETER       =
          tables_parameter         = tp
    *   P_DOCU                   =
    *   ENHA_EXP_PARAMETER       =
    *   ENHA_IMP_PARAMETER       =
    *   ENHA_CHA_PARAMETER       =
    *   ENHA_TBL_PARAMETER       =
    *   ENHA_DOCU                =
       EXCEPTIONS
         error_message            = 1
         function_not_found       = 2
         invalid_name             = 3
         OTHERS                   = 4
      IF sy-subrc = 0.
        LOOP AT ip INTO wa_ip .
          MOVE: wa_ip-parameter TO wa_vals-name .
          ASSIGN (wa_vals-name) TO <temp> .
          IF <temp> IS ASSIGNED .
            wa_vals-value = <temp> .
          ENDIF .
          APPEND wa_vals TO vals .
        ENDLOOP .
      ENDIF.
    ENDFUNCTION.

  • Goods movement document based on stock determination

    All,
    I am trying to create goods movement document using BAPI_GOODSMVT_CREATE based on production order for movement type '261'. Before to that we have to use the function module BF_STOCK_DETERMINATION to pick the stock from appropriate storage location( for example: if order quantity is 3; then quantity 2 will be picked from
    Un-restricted stock and 1 qty will be picked from consignment stock). What happens is when it gets into MB_CREATE_GOODS_ISSUE_ITEM inside the BAPI, at the routine "MM07MMFF0_FUSSZEILE_WA_PRUEFEN" there is a routine called "FORM WERK_PRUEFEN(sapfm07m) when it gets into this routine the values in the internal table"T158"
    losses its visiblity. so i get an error "document type" missing, when the function module"FI_DOCUMENT_TYPE_CHECK"
    is called as part of the routine.
    But if i call the BAPI_GOODSMVT_CREATE without calling BF_STOCK_DETERMINATION material document is get created.
    If any one worked on this please help me i tried for more than week but i couldn't solve it. I really highly appreciate you help.
    With regards,
    Shiva.

    Called in two different program and it worked. In the first program i call "BF_STOCK_DETERMINATION" and export the values to memory and then i call the second porgram using "submit...and return"; import the values and called
    "BAPI_GOODSMVT_CREATE".  Material document is created.
    Regards,
    Shiva.

  • Unable to do goods movement when calling BAPI_PRODORDCONF_CREATE_TT

    Hi,
    I have used BAPI_PRODORDCONF_CREATE_TT as RFC.
    When I run the bapi with that of input payload seperately production order confirmation and goodsmovement  are done successfully.
    But when I run the interface then only production order confirmation is successfull while goodsmovement is unsuccessfull.
    Any help on this please?
    Thanks in advance,
    Rohan.

    Hello Rohan,
    I you are using BPM to call two RFC's seperately for prd.conf and goods movement, then, try to incorporate a Wait step in the BPM!
    Regards,
    Jilan

  • Automatic goods movement at the time of confirmation in IW42

    Hey gurus,
    In a maintenance order i ve reserved some materials to be issued from the stores. Now i am not issuing the reserved materials from the stores and going to iw42 for confirming the operations of the order. If i select the item overview of the operation line against which we have booked the material, in the goods movement section i can see my reserved material which hasn't been issued from the stores. Now when i'm saving the confirmation, goods movement of the unissued material is automatically taking place and the cost of the material is getting booked in the order. How do i stop this automatic posting of material?
    Regards,
    Abhishek

    Hi friend
               in spro
    Plant Maintenance and Customer Service-Maintenance and Service ProcessingMaintenance and Service OrdersCompletion ConfirmationsDefine Control Parameters for Completion Confirmations
    you can define the setting of goods movements
    jitender

Maybe you are looking for