BAPI for goods receipt for subcontracting PO

Dears,
I Just want to confirm that whether BAPI "BAPI_GOODSMVT_CREATE " will do the goods receipt for the subcontracting PO. SInce  I will be passing only 101 mvy type in BAPi, will the system automatically call 543 mvt type and post the consumption.
Require suggestions
Regards
Kamesh

Hi,
Yes, BAPI_GOODSMVT_CREATE will work for subcontracting GR as well.
It all depends on the parameters you pass to the BAPI.
Example give below:
*Item Parameters to be passed:     
Ordered (Subcontracting) Material:
Parameter     Field     Description     Value
GOODSMVT_ITEM     MATERIAL     Material Number     100-200
     PLANT     Plant     1000
     ENTRY_QNT     Quantity in Unit of Entry     0.000
     MOVE_TYPE     Movement Type     121
     PO_NUMBER     Purchase Order Number     4500000007
     PO_ITEM     Item Number of Purchasing Document     00010
     MVT_IND     Movement Indicator     O
     LINE_ID     Unique identification of document line     000001
     PARENT_ID     Identifier of immediately superior line     000000
Note: Quantity of ordered material must be zero.
Component Material 1:
Parameter     Field     Description     Value
GOODSMVT_ITEM     MATERIAL     Material Number     100-100
     PLANT     Plant     1000
     ENTRY_QNT     Quantity in Unit of Entry     2.000
     LINE_ID     Unique identification of document line     000002
     PARENT_ID     Identifier of immediately superior line     000001
Note: LINE_ID should be incremented for each component and the PARENT_ID remains same for all the components of an ordered material. Component negative quantity can be given in case of Under Consumption.
Component Material 2:
Parameter     Field     Description     Value
GOODSMVT_ITEM     MATERIAL     Material Number     100-100
     PLANT     Plant     1000
     ENTRY_QNT     Quantity in Unit of Entry     3.000
     LINE_ID     Unique identification of document line     000003
     PARENT_ID     Identifier of immediately superior line     000001

Similar Messages

  • Menu path - for goods receipt for purchase order (MB01)

    Hi
    What is the menu path for Goods receipt for purchase order (MB01) - ECC6.0

    hi
    the path is too deep
    plz just log in ur system and find MB01
    Materials Management >  Purchasing  >  Master Data   > Subsequent Settlement >  Vendor Rebate Arrangements  >  Environment   > Condition/Arrangement  > Environment   >Pricing  > Environment    Value assignment  >  Inventory management  > Goods receipt  >For purchase order   >  MB01 - PO number known
    regards
    KI

  • Problem for Goods Receipt for Subcontracting Purchase Order

    Dear all,
    Presently, we are using SAP version 4.6C and we need to introduce GR for
    Subcontracting Purchase Order. We have developed a ABAP program to handle
    subcon Goods Receipt by uploading flat-files from our subcontractor. The
    scenario is as follows :
    Goods Receipt for Subcontracting Purchase Order
    1. In the ABAP program, function BAPI_GOODSMVT_CREATE will be used for goods
    movement.
    2. Data provided to the function are as follows :
    - Posting date
    - Document date
    - Material number
    - Plant
    - Storage location
    - Batch
    - Movement type (101)
    - Quantity
    - Purchase order number
    - Purchase order item
    - Movement indicator (B - Goods receipt for purchase order)
    3. The function will do data verification and automatically determine GI
    item for subcon stock:
    - Movement type (543)
    - Special stock (O - parts prov. vendor)
    - Material
    - Quantity
    - Plant
    Our problem is that :
    Only the GR item in the interface is to be transferred and the GI item is
    determined by the system. So, the quantity for subcon stock cannot be
    changed using this BAPI. Then the system will continue processing the goods
    receipt and create material document.
    Manually, by using transaction code MIGO, the user can display the subcon
    stock data and then change the quantity.
    By using transaction code MB01, after the user fills in all the GR fields,
    the system comes to line item 002 (subcon stock data) and then quantity can
    be changed.
    As per user requirement, quantity for GI item must be same with the quantity
    that has been transferred to subcon vendor in Delivery for Subcon
    (transaction code VL02N).
    We cannot achieve this requirement by using the BAPI mentioned above. Would
    appreciate any valuable help from anyone who is able to help us on this
    matter. Are there any other BAPI's that can help us to achieve the same
    result ?
    Thank you in advance and best regards.

    As far as i understood the problem I suggest u to create the
    BDC according to user actions that are performed in he manual
    operation.
    I can't say that the BAPI performs the exac solution what you want.
    I have done some BDC work using MB01 and suggest you to be careful
    and try to keep the complete in the logic as some chages in rows in BDC will
    change the complete scenario.And throw correct quantity val in correct
    material
    row.
    This methodology will help u even in mass uploads.
    Or in case of automation u can perform the call transaction BDC in
    background mode.
    so As per my understanding bdc program is the solution. pls try and let me
    know.

  • BAPI/FM for goods receipt for a Sub Contracting PO

    Hi All,
    Is there a BAPI/FM to perform goods receipt for a sub contracting PO? BAPI_GOODSMVT_CREATE can not perform goods receipt for sub contracting PO.
    My purpose would be served if I can know how to find the component material of a subcontrcting PO.
    Please help.
    Thanks,
    Rana

    Thanks for your input
    Well, I wanted to ask if the BAPI is capable of performing GR for SC PO. Instead of a question, that went as a statement :-). Your recommendation helped me to find answer to my question.
    Thanks again.

  • BAPI needed for goods receipt for delivery created from sales order

    Hi experts,
    I need help.
    I want to post goods receipt for the delivery created from sales order. I have tried out BAPI BAPI_GOODSMVT_CREATE but I am not able to post it.
    Is there any way to post this? I need BAPI and not FM MB_*....
    Thanks & REgards,
    Bhavin A. Shah

    Hi,
    Please refer to link,
    https://wiki.sdn.sap.com/wiki/display/Snippets/BAPI_GOODSMVT_CREATE-ABAP
    Regards
    Shree

  • Steps For Goods Receipt For Work Order Using Handling Units

    Hello MM gurus,
    I'm new to HU Management.  Can you please share with me the steps for executing a "Goods Receipt For Work Order" using Handling Units?
    I created a HU (1000000026), and then using transaction COWBHUWE I tried using that HU to create a goods receipt, but I keep getting the message below:
    Handling unit 1000000026 is not provided for goods receipt
    Message no. VHURM046
    Do you have to assign/plan HUs to Process Orders first? I think the problem is that I'm not understanding the process or the requirements for a goods receipt for work order using HU.

    Hello Manish Kumar,
    I've been doing Handling Units testing in our sandbox environment and I've been trying to Pack a Finished Product for a Process Order using
    1-Transaction code HU02 to create the Handling Unit
    2-Transaction COWBHUE after creating the HU to enter the production order number and the HU number and propose it, but the it doesn't work. When I propose it, nothing happens.
    3.-I also tried COWBPACK, but for some reason, when I go into COWBPACK, key in the Process Order, and then press enter, I get the following message:
    You do not have authorization to create handling units for plant BP08
    Message no. VHUPD500
    Do you know how to solve this issue?

  • The tcode for goods receipt for PO

    Hi Experts,
    Could you tell me is the tcode 'MIGO' is for the 'Goods Receipt'?
    Thnx,

    Hi all,
    I have checked in MB03, MIGO, MIGO_GR....but it's not showing up anywhere in these transactions.
    Is it storing in any other place in SAP, please advise me.
    Thnx much,

  • Output Determination - Goods receipt for Subcon PO

    Hi experts,
    I have configured output for Goods receipt for PO. Its working fine for standard PO.
    But not working for Goods receipt for Subcon PO.
    In MN21 - i maintained condition record -
    Trans / Event Type  - WO
    Print Version - 3
    Could you help me to resolve this issue.
    Regards,
    Jackie

    Hi,In MN21 you need to do the settings for Output types 'WLB1' for Individual Slip or 'WLB3' for Collective Slip for the Subcontracting Mat Doc. for 541,
    Similarly for 101 you need to do the settings for output type WA01, also check in MIGO the 101 document in display, the tick is marked for getting the output. without that tick you will not be able to see & print the Mat. Doc. in MB90.

  • Regarding Outbound IDOC for Goods Receipt with MBGMCR03

    Hi Experts,
    Please let me know ,how to handle TYPE QUANT fields when i am generating an Outbound IDOC for Goods receipt for message type MBGMCR with the IDOC type MBGMCR03.
    At item level when passing the value for quantity received field ,the QUAN value into NUMC or CHAR before MASTER_IDOC_DISTRIBUTE to pass it to data record it is showing correctly in my BADI .
    after generating the idoc , the field value is appended with next field value passed.
    before generating IDOC
    erfmg( 60.000) - ENTRY_QTY(060)
    efrme (EA)       - ENTRY-UOM(EA)
    after generating IDOC
    IN WE02
    ENTRY_QTY-060EA
    later field values are mismatching .
    Please let me know the resolution.
    Thanks & regards
    Vishnu

    Hi,
         Standard Idoc types for invoice is  INVOIC01 and INVOIC02.
    - Use WE30 for seeing Idoc types with segment.
    Or otherwise go for Custom Idoc
               Create Custom Idoc type with required fields,custom output type and assign it to partner profiles.(If there is no std idoc type or output type)
              Use Funtion module MASTER_IDOC_DISTRIBUTE to generate Idocs while saving MIRO, for this you need to find exit or implement implicit enhancement while saving MIRO.
    http://wiki.sdn.sap.com/wiki/display/ABAP/StepstocreatecustomIDOC - Creating Custom idocs

  • Output type for goods receipt

    Hi guys,
    Can any one lemme know what is the output  type we can use for goods receipt- for generating a  goods receipt smartform output?
    and can u also lemme know the standard print program also.
    if u have written any zprint program plz send it ASAP.
    thanks n regards,
    Bhargava.

    u can see the output types for Goods Receipt in Transaction NACE. Application M1
    Output type        Name
    CHKL     Count List ( Program RTCHECKL, form RT_CHECK_LIST)
    GRPL     Pallet Sticker ( Pro RTCHECKL, form RT_PALLET_LABEL)
    The Form names mentioned are SAPSCRIPTS not smartforms.
    Also Bhargava, chk out with ur Consultant wat output type suits ur requirement coz there r multiple options as u can see for urself in NACE under Applications M1/ME.
    Hope it helps.
    Regards,
    Bikash
    Message was edited by: Bikash  Agarwal
    Message was edited by: Bikash  Agarwal

  • Goods receipt for subcontracting order! BAPI_GOODSMVT_CREATE

    I wanna use BAPI "BAPI_GOODSMVT_CREATE"  to create goods receipt for subcontracting order.
    But it says that this combination is not possible.  Combination of my movement type and this BAPI.
    What can i do to solve it?
    thanks in advance.

    >
    Julia Nikiforva wrote:
    > I wanna use BAPI "BAPI_GOODSMVT_CREATE"  to create goods receipt for subcontracting order.
    > But it says that this combination is not possible.  Combination of my movement type and this BAPI.
    >
    > What can i do to solve it?
    >
    > thanks in advance.
    Might work
    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.

  • Goods receipt for subcontract does not erase requirement in MD04

    Hi,
    I have a subcontract material for example X which is built of 3 components - A,B & C.
    Initially the BOM in the Purchase Order of X did not have any component. I mistakenly posted a goods receipt and realized that the requirement were not getting deleted from MD04 of the components. There after to correct this, I reversed the goods receipt and populated the BOM with components A, B & C and again posted goods receipt for the subcontract material X.
    When I receive material X, the requirement still exists in the stock requirement list (MD04) of A, B & C.  I also went to Transaction ME2O and saw that the stock at the vendor did not get reduced.
    I have checked the Goods Receipt material document and the components A, B & C have a movement type of 543 O. In MB51 Goods movement for the components, I can see the deduction from the vendor.
    Why are the requirements not getting deleted from MD04 of A, B & C and why is not  the component stock at the vendor getting reduced?
    For all other orders, the requirements get erased in MD04 of A, B & C when I receive X
    Please help me out with this issue.
    Sincerely,
    Ketan

    thread closed

  • Goods Receipt for PO using BAPI

    Hello,
    I need to do a goods receipt for a purchase order using bapi_goodsmvt_create for movement type 101. My function module does not return the material document number. Can someone help me with my code?
    Thanks,
    A.P.
    FUNCTION Z_GR_BAPI.
    ""Local interface:
    *"  IMPORTING
    *"     REFERENCE(I_CODE) TYPE  GM_CODE
    *"     REFERENCE(I_MOVE_TYPE) TYPE  CHAR3
    *"     REFERENCE(I_EKKO) TYPE  EKKO
    *"  EXPORTING
    *"     REFERENCE(E_DOCUMENT) TYPE  BAPI2017_GM_HEAD_RET-MAT_DOC
    *"     REFERENCE(E_RETURN) TYPE  BAPIRET2
    *"  TABLES
    *"      T_EKPO STRUCTURE  EKPO
    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.
      data: gm_retmtd  type bapi2017_gm_head_ret-mat_doc.
      data: x_ekpo type table of ekpo with header line.
       x_ekpo[] = t_ekpo[].
      clear: gm_return, gm_retmtd.
      refresh gm_return.
      gm_code-gm_code = i_code.
      gm_header-pstng_date = sy-datum.
      gm_header-doc_date = sy-datum.
      gm_header-pr_uname = sy-uname.
      loop at x_ekpo.
        gm_item-material = x_ekpo-matnr.
        gm_item-plant = x_ekpo-werks.
        gm_item-stge_loc = x_ekpo-lgort.
        gm_item-move_type = i_move_type.
        gm_item-mvt_ind = 'B'.
        gm_item-stck_type = space.
        gm_item-entry_qnt = x_ekpo-menge.
        gm_item-entry_uom = x_ekpo-meins.
      append gm_item.
      endloop.
      CALL FUNCTION 'BAPI_GOODSMVT_CREATE'
        EXPORTING
          GOODSMVT_HEADER             = gm_header
          GOODSMVT_CODE               = gm_code
         TESTRUN                     = ' '
        IMPORTING
          GOODSMVT_HEADRET            = gm_headret
          MATERIALDOCUMENT            = gm_retmtd
        MATDOCUMENTYEAR             =
        TABLES
          GOODSMVT_ITEM               = gm_item
        GOODSMVT_SERIALNUMBER       =
          RETURN                      = gm_return.
    e_document = gm_retmtd.
      CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
          EXPORTING
             WAIT          = 'X'.
         IMPORTING
            RETURN        =
    ENDFUNCTION.

    Hi,
    This piece of code may be helpful.
    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.
      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      = '06'.                              " MB11
    Write 551 movement to table
      clear gm_item.
      move '551'        to gm_item-move_type     .
      move '000000000040001234' to gm_item-material.
      move '1'        to gm_item-entry_qnt.
      move 'EA'       to gm_item-entry_uom.
      move '0004'     to gm_item-plant.
      move '4000'     to gm_item-stge_loc.
      move '201'      to gm_item-move_reas.
    Determine cost center per plant
      case xresb-werks.
        when '0004'.
          move '0000041430' to gm_item-costcenter.
        when '0006'.
          move '0000041630' to gm_item-costcenter.
        when '0007'.
          move '0000041731' to gm_item-costcenter.
        when '0008'.
          move '0000041830' to gm_item-costcenter.
      endcase.
      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.
       call function 'BAPI_TRANSACTION_COMMIT'
           exporting
                wait = 'X'.
    regards,
    keerthi.

  • Production operation external processing goods receipt for subcontract PO

    Hi PP/MM experts,
    I searched for existing forum entries but no luck or final answer.
    I have a question about the goods receipt for a subcontracting PO that is account assigned to an operation of a production order (external processing for operation).
    The following situation:
    Production order type PP02 - external processing
    There is only one operation in the production order with control key PP02 - external processing. I marked the control key PP02 in configuration for 'Automatic goods receipt'.
    I created a PO for the PR is the operation
    When I'm doing the goods receipt of the subcontrating PO a 101 posting is triggered for the finished product and components are consumed by 543 O movements. So far so good. But the inventory for the finished style is not increased. In MIGO I even see that even a batch number for the finished product is determined. Looks like that only the service is posted but not the inventory. I assumed when I mark the operation contol key for 'goods receipt' that the MIGO will also post the inventory for the finished style.
    Reason for PP order and not only subcontract order is that we want to manage capacities of external suppliers with PP capacity planning.
    Is that a bug in our system or normal behaviour? We use SAP ERP 6.5 with IS AFS.
    Thanks in advance for your answers.
    Best Regrads,
    Harry

    Hi Rizzi and all others,
    thanks for your replies.
    I'm using a production order for the following reasons:
    We want to use capacity planning for external suppliers. At least to have some overview of work they have to do in a month
    The external assembly can also be changed to internal assmebly and for that reason we will start always with the same kind of document -> production order.
    But one more thing what is really confusing. In the materials document list MB51 the 101 movement for the service is listed even if the inventory was not increased. That is really confusing for the users.
    Best Regards,
    Harry

  • BAPI needed  for  Goods Receipt Purchase Order(Transaction : MIGO)

    Hi all,
    We have a requirement where in we need to post the documents throuh BAPI for Goods receipt Purchase order(Transaction: MIGO).
    Any inputs on this..is highly appreciable...
    thanks in advance...
    regards..
    prathima.

    Hi,
    use 'BAPI_GOODSMVT_CREATE'
    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.
    [/code]
    Also check the Bapis
    BAPI_PO_CREATE --> To create Purchase Order
    BAPI_PO_CHANGE --> To change Purchase Order
    BAPI_PO_GETDETAIL --> Todisplay Purchase Order
    Regards,
    Raj.

Maybe you are looking for