Mb1c ; BAPI_GOODSMVT_CREATE

Hallo Friends,
In my code using Batch-input for the SAP T_code: MB1C, I am having problem at Dynpro 410: Field: Production date and Self life expiration date. So Idecided to change and use the
bapi: BAPI_GOODSMVT_CREATE.
my itab type:
TYPES: BEGIN OF TY_ITAB,
      MATERIAL                       "Materialnummer
      PLANT                           "Plant
      STGE_LOC                     "Storage Location
      BATCH                          "Batch Number
      MOVE_TYPE                   "Movement Type
      STCK_TYPE                "Stock Type
      SPEC_STOCK                  "Special Stock Indicator
      VENDOR                          "Vendor
      CUSTOMER                      "Customer#
      SALES_ORD                   "Sales Order Nr.
      S_ORD_ITEM                     "Item Number in Sales Order
      ENTRY_QNT                    "Quantity in Unit of Entry
      ENTRY_UOM_ISO        "UoM (ISO)
      ITEM_TEXT                   "item text
      ORDERID                     "Order Number
      ORDER_ITNO                   "Order item Pos
      EXPIRYDATE                     "Shelf Life Expiration or Best-Before Date
      PROD_DATE                     "Date of Manufacture
      VENDRBATCH(15),                     "Vendor Batch Number
      END OF TY_ITAB.
movement type = 561
for the SAP T_code MB1C, I choose bapi: GOODSMVT_CODE = 05 (other goods receipt)
at execution / Call bapi, I am getting error message: No items were transferred
Please, has someone used this bapi in regards of the t_code MB1C before?
Can someone help me with codes and Itab inputs?
Thanks in advance. Points will be given to very usefull answer.
Blacky.

Hi
kindly find semple code for the same.
See the following sample code
Moderator message.  The sample code was cut and pasted from here: http://www.sap-img.com/abap/bapi-goodsmvt-create-to-post-goods-movement.htm  Cut and pasting from anywhere without giving credit is contrary to forum rules.  Please do not do it again.  Your points have been removed.
Regards,
Hiren Patel

Similar Messages

  • BAPI_GOODSMVT_CREATE for MB1C

    Hi all,
    i need the sample code for the BAPI_GOODSMVT_CREATE for Goods Receipts.
    Document Date,
    Posting Date,
    Movement Type
    Plant
    Storage Location
    GL Account
    Material and
    Quantity.
    regards
    Shareef

    Please search the forum or do a where used list for "sample code".
    Post locked.
    Rob

  • BAPI_GOODSMVT_CREATE Classify batch (Like MB1C)

    I'm trying to post a MM documents using Movement Type 561. I have some information to post on Classify batch to some characteristics, but in this BAPI or using recording (SM35) I don't have any fields to fill with this information, using MB1C this fields are open to fill but when I'm using SM35 it is inactive.
    When I call the BAPI it has a error:
    ID: 12126 : Inconsistency in classification data => transaction terminated.
    Regards,
    Alfredo

    Hi,
    If your material is "batch managed" you have to supply the bacth number in BAPI.
    The BAPI does not search automatically for a batch number like MB1A.
    Best regards,
    Leandro Mengue

  • Error while posting a document using  the  BAPI_GOODSMVT_CREATE

    Hi,
    i was trying to post the Goods Receipt document ( Tcode MB1C) using the bapi  BAPI_GOODSMVT_CREATE
    i am passing the item details and Serial number details.
    the error triggered was Maintain Serial Numbers for Total Quantity
    but i am passing the quantity as 1 ( in item data) and passing one serial number.
    is this error because of data problem or am i missing to pass the value to  some dependent parameter..?
    Please help me out.
    Thanks in advance.
    Sriram

    Hi David,
    i was tring to pass the same.
    in item table we have we have four item details ( below)
    RES_ITEM - Item Number of Reservation/Dependent Requirement
    ORDER_ITNO - Order Item Number
    S_ORD_ITEM - Item Number in Sales Order ( length mismatch with serial  item number)
    PO_ITEM  - Item Number of Purchasing Document ( length mismatch with serial  item number)
    out 4 , 2 are ruled out because of length mismatch. and in the reaming two are
    RES_ITEM - Item Number of Reservation/Dependent Requirement
    ORDER_ITNO - Order Item Number
    this is a Goods receipt document, please let me know which field is required to map with item number in the above two.
    Regards,
    Sriram.

  • BAPI_GOODSMVT_CREATE - Error while posting a Material Document

    Hi Experts,
    We are  trying to do the material document posting using the transaction "MB1C" manually in SAP. The movement type which we are using for the same is "261".  While doing this is, it is asking for a work order number and the Recipient number. We gave the Recipient Number as "123". Material document is created successfully.
    Again using the same transaction  "MB1C" , we are trying to do the reversal of the material document which we posted previously against another work order number for the same material and the serial number if the material is serialised and as well as for the non serialised material.
    Both this case, in SAP the material document is created succesfully. This is done manually in SAP.
    When we are trying to create the material document using the BAPI 'BAPI_GOODSMVT_CREATE', for the above scenario, posting the material document '261' movement type for one work order and the reversal for another work order '262' movement type for the same material (whether it is a serialised or non serialised) we are getting the eror as "RE Qty. transferred exceeded 1 PC: 50,003,695 C001 USED 1200".
    We are passing the following at the item level. MATERIAL Number, Plant, STGE_LOC, ENTRY_QNT, MOVE_TYPE, BATCH, ORDERID, RESERV_NO,  RES_ITEM, ACTIVITY, XSTOB for reversal.
    We are passing the GM_CODE as '05'.
    Please let us know what needs to be changed inorder to create the material document properly without getting errors.
    Thanks in Advance,
    Mohan.

    Hi,
    We fixed this issue by removing the reservation number of the material when we are trying to post the material document with the movement type "262".
    The reason for removing the reservation number for the movement type "262"
    The reservation number is getting created against a work order when we trying to create the work order in IW32. This reservation number is used for validating the stock while we are trying to consume and doing the reversal.
    SAP is allowing us to reverse the consumed quantities only based on the reservartion number and hence we got this error.
    To fix this error, if we are trying to reverse a particular material against a different work order for which it has been consumed previiously, remove the reservation number and item number and try posting the material document.
    Hope this solution will solve your issue:)
    Thanks and Regards,
    Mohan.

  • BAPI_GOODSMVT_CREATE ERROR: A System Error Has Occurred While Locking

    Hi All,
    I am having a problem with a Z program that I am writing.
    Basically, it uses the BAPI mentioned in the title. The program will read excel file that is being uploaded, and then will segregate the line items by 200 lines.
    That means, if I were to upload 1000 line items, the BAPI will be called and executed 5 times (1000/200 = 5).
    However, when trying to upload 10000 line items, I received this error after around 3000 line items.
    "A system error has occurred while locking".
    This happens when IMPORT parameter TEST_RUN is set to 'X'.
    I found this after some googling: http://sap.ittoolbox.com/groups/technical-functional/sap-basis/lock-entry-system-error-1674434
    I am hoping for your expert thoughts on this.
    Thank you.

    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.
    Code Formatted by: Alvaro Tejada Galindo on Dec 26, 2008 10:20 AM

  • BAPI_GOODSMVT_CREATE - Error Storage location not supported...

    Dear All
    I am creating the material movement documetn 561 (MB1C) using BAPI_GOODSMVT_CREATE.
    Howeever, the BAPI returns me the error saying
    Storage location not supported. 
    What is this about.  Can someone give me hint
    I searched the forum and not able to find it.
    Regards,
    Venky

    Hi Venky,
    Are you creating a goods issue with reference to a reservation? If so, the documentation states that the storage location is only needed if it's not in the reservation.
    The following fields may have to be populated in some cases (this is not a complete list):
    Storage location (if not planned in the reservation)
    Brenda

  • BAPI_GOODSMVT_CREATE - Error - RE Qty. transferred exceeded 1 PC

    Hi Experts,
    We are  trying to do the material document posting using the transaction "MB1C" manually in SAP. The movement type which we are using for the same is "261".  While doing this is, it is asking for a work order number and the Recipient number. We gave the Recipient Number as "123". Material document is created successfully.
    Again using the same transaction  "MB1C" , we are trying to do the reversal of the material document which we posted previously against another work order number for the same material and the serial number if the material is serialised and as well as for the non serialised material.
    Both the case is done manually in SAP, and the material document is created succesfully.
    When we are trying to create the material document using the BAPI 'BAPI_GOODSMVT_CREATE', for the above scenario, posting the material document '261' movement type for one work order and the reversal for another work order '262' movement type for the same material (whether it is a serialised or non serialised) we are getting the eror as "RE Qty. transferred exceeded 1 PC: 50,003,695 C001 USED 1200".
    We are passing the following at the item level. MATERIAL Number, Plant, STGE_LOC, ENTRY_QNT, MOVE_TYPE, BATCH, ORDERID, RESERV_NO,  RES_ITEM, ACTIVITY, XSTOB for reversal.
    We are passing the GM_CODE as '05'.
    Please let us know what needs to be changed inorder to create the material document properly without getting errors.
    It is urgent since we are at the production stage.
    Thanks in Advance,
    Mohan

    Hi Sagar,
    Thanks for your reply.
    We tried with the option what you have suggested. If we use the movement type 262 and if we remove the XSTOB flag, the material document is created for the movement type 261 and not for the reversal movement type 262. This is the standard behaviour of the BAPI.
    If we pass the movement type as 261 and the flag as 'X', it is throughing the same error as we were mentioning. If we use the movement type as 262 and the flag as 'X' still the same error is returned by the BAPI.
    We tried with the GM_CODE as well. Presently we are using '05' and we tried with '06' as well. Still we are getting the same issue.
    Please suggest some other options to fix this bug.
    Thanks,
    Mohan.

  • BAPI_GOODSMVT_CREATE Movement Type 641

    Hi All
    I was wondering if it is possible to do a Stock Transfer posting using Movement type 641 in the BAPI, BAPI_GOODSMVT_CREATE.
    I am trying to replicate the VL02N functionality using this BAPI.
    No matter what I do I keep getting the error "For item 00001 of purch. order 80000274, no goods issue can be posted"  M7 152
    Is this even possible, if yes, what am I doing wrong ?
    Thanks
    Aju Paul

    Hi,
    You need to change your GMCODE to 03 for GOODS ISSUE.
    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
    Regards,
    Gilberto Li

  • Error: RE Qty. transferred exceeded 1 PC in BAPI_GOODSMVT_CREATE

    Hi,
    We are doing a reversal for a work order using the movement type 'Z62' which is a customised movement type for a material from the syclo mobile. While doing the reversal, we are getting this error in the return table paramater of the BAPI "BAPI_GOODSMVT_CREATE".
    Example: The work order number is 2000001181, the material number is 50014360, movement type 'Z62', Quantity 1, GM_CODE is '05'. For this scenario we are getting the above error.
    We also tried with the following option as well with the BAPI_GOODSMVT_CREATE. Example: The work order number is 2000001181, the material number is 50014360, movement type '262', Quantity 1, GM_CODE is '03'. For this scenario we are getting the same error only. We are not able to post the material document succesfully through the BAPI call.
    When we create a material document for the above test case in SAP manually, we are able to post the material document for the movement type '262' as well as for 'Z62'.
    We are doing the reversal and not the cancel of the material document which is being posted already in SAP. We are sending the details of the material and the work order at the item table parameter and the GM_CODE as '05' at the header level. We tried with the GM_CODE '03' as well.
    For both GM_CODE we are getting the same error as "RE Qty. transferred exceeded 1 PC". The materials against which we are doing the reversal are already consumed in another work order. We want to reverse the consumed material with the new work order number. The work order number is alone is different but not the material number and the quantity.
    If we try to do the same with the BAPI: BAPI_GOODSMVT_CREATE we are facing issue.
    Please let us know the best way to pass the movement type 'Z62' which is similar to the movement type '262' in functioanlity in the backend in the BAPI to create the material document.
    Thanks,
    Mohan.

    Hi Max,
    The values which we are passing to the BAPI are as follows:
    *IS_GOODSMVT_HEADER*
                            PSTNG_DATE -- System Date from Mobile
                            DOC_DATE     -- Same
    IV_GOODSMVT_CODE
                            GM_CODE   --- '05'
    IT_GOODSMVT_ITEM
                             MATERIAL        --- 50014369
                             PLANT              --- 1200
                             STGE_LOC       --- C001
                             BATCH              --- USADO/NEUVO
                             MOVE_TYPE     --- 262 / Z62
                             ENTRY_QNT     --- 1
                             ENTRY_UOM     --- PC
                             ORDERID           --- 20001181
                             RESERV_NO     --- Material's  Reservation number
                             ACTIVITY          --- Task ID of the order
                             RES_ITEM          --- Material reservation item number
                             XSTOB -- This flag will be set to true 'X' if the movement type is '262' and blank for rest of the movement types
    We used the transaction 'MB1C' for posting the material document manually in SAP.
    IT_GOODSMVT_SERNO
                            MATDOC_ITM   
                            SERIALNO
                            UII
    These are the values which are being passed from the client to SAP. This BAPI is called when we do the goods issue (Consumption) in the mobile device.
    We tried with the GM_CODE - '03' as well. At this point of time also, we are getting the same error. We tried doing the material document posting for 'Z62' it is getting converted into '261' or '262' movement type in MIGO transaction in SAP. Because of this only, we changed the GM_CODE to '05'. In MB1C, we are able to post the material document with the movement type as such what we are passing from the client.
    Please let me know, if there is any change that needs to be done in the way we are calling the BAPI for posting the Material document.
    Thanks,
    Mohan.

  • Can any one say What are the mandatory parameters in BAPI_GOODSMVT_CREATE

    Hi,
    Can any one say What are the mandatory parameters in
    BAPI_GOODSMVT_CREATE.
    Helpful answer will be rewarded.

    Hi,
    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 for useful answers.
    Regards,
    Raj.

  • FM/BAPI for creation of Material Document (similar to Transaction MB1C)

    Hi Gurus,
    Good day.
    Are you guys aware of FMs / BAPIs that can produce Material Documents (similar to the Function of Transaction MB1C)?
    Thank you very much!
    Best regards.
    Brando

    hi
    in addition to BAPI_GOODSMVT_CREATE ,you can try user exits as well like
    MBCF0005 Material document item for goods receipt/issue slip
    MBCF0002 Customer function exit: Segment text in material document item
    MB_CF001 Customer Function Exit in the Case of Updating a Mat. Doc
    hope this helps
    regards
    Aakash Banga

  • BDC For Transaction MB1C

    Hi all
    i want bdc program and flat file structure for transaction MB1C to upload stock.
    If anyone have then please send me at [email protected]
    Its urgent.
    Thanks

    Hi
    use the BAPI
    BAPI_GOODSMVT_CREATE
    see the 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.
    Reward points if useful
    Regards
    Anji

  • 'BAPI_GOODSMVT_CREATE' - problem in stock update

    Hi,
    I am using 'BAPI_GOODSMVT_CREATE' for 561 movement type.
    it is getting posted properly in MB1C.
    But i am not able to see it in MMBE - stocl overview.
    i am using 'BAPI_TRANSACTION_COMMIT' also.
    Can anyone tell me how to solve this.
    Vikki.

    Hi,
    Refer this
    http://www.sap-img.com/abap/bapi-goodsmvt-create-to-post-goods-movement.htm
    http://www.erpgenie.com/forum/viewtopic.php?f=1&t=10510
    http://www.sapfans.com/forums/viewtopic.php?p=925476&sid=415fd2798415f993930d39cf9b3a81fb

  • Bapi for transaction 'MB1C' -'Enter other goods receipt...'

    Hi,
    Please suggest the BAPI for the transaction 'MB1C'.
    thanks

    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
               call function 'BAPI_GOODSMVT_CREATE'
               exporting
                   goodsmvt_header             =
                   goodsmvt_code               =
                 *   TESTRUN                     = ' '
              IMPORTING
                  goodsmvt_headret            =
             *   MATERIALDOCUMENT            =
      MATDOCUMENTYEAR             =
               tables
                 goodsmvt_item               =
      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.
                move errmsg-message to i_msg1.
                append i_msg1.
                move errmsg-message to i_msg2.
                append i_msg2.
              endloop.
              if errflag is initial.
                CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
              EXPORTING
                WAIT          =
              IMPORTING
                RETURN        =
         endif.

Maybe you are looking for

  • How do I use my iphone 4S wifi on my laptop via USB cable

    Hi with my HTC when I connected it to my laptop via USB cable a list of options came up on my phones screen and one of them was to tethering. But when I do the same with my iPhone no options come up on my screen, so how do I use my iPhones wifi on on

  • Dark screen remains after waking from sleep mode

    Whilst using Safari Version 3.1.2, Mac OS 10.4.11 on my Powerbook G4 (aluminum, 1.5 ghz), my screen remains dark upon waking from sleep mode. Trying to increase screen brightness is ineffectual for some reason likely related to this problem. My only

  • How do i get the back button on my android device to function right?

    How do i get the back button to got back to the previous screnn I was on?

  • Portal Follow-Up doc

    hi all, i integrated Portal EP7.0 with CRM5.0 system,when it comes to portal side, in which for all the User like <b>Sales Manager</b> i assigned Stanted <b>CRM User</b> role which contain Home workset,which contain some workset like Work,Mail and Ca

  • Row headers for details section columns

    Post Author: Shawn Weaver CA Forum: General I'm new to Crystal Reports, and I'm recreating some old reports in Crystal. I'm currently working on a report that shows record detail in columns, with a header for each row at the start of the row (on the