MB_CREATE_GOODS_MOVEMENT - GI with reference to a reservation; Movement 261

I have data coming inbound in EDI 944. This data is supposed to come and post as a good's issue and creating a material doc. number in the process. The reservation number and reservation item number field in my IDOC are blank. So, I fill them up in a user exit - EXIT_SAPLLMDE_002 after quering RESB table with my production #,material and plant combination. An IDOC is created. But the reservation # that i filled in the user exit is still blank.Also in MB51, the reservation tab shows up as blank . But there are entries for reservation in MSEG table for the material document number just created. I am trying to make this work for only movement types 261 and 262. Here is the code of my user exit..
***   INCLUDE ZXLIDU10
***"*"Globale Schnittstelle:
***"       IMPORTING
***"             VALUE(I_IDOC_CONTROL) LIKE  EDIDC STRUCTURE  EDIDC
***"             VALUE(X_XALLR) LIKE  RLREO-XFELD
***"             VALUE(X_XALLP) LIKE  RLREO-XFELD
***"             VALUE(X_TCODE) LIKE  SY-TCODE
***"             VALUE(X_IMKPF) LIKE  IMKPF STRUCTURE  IMKPF
***"       EXPORTING
***"             VALUE(X_XALLR) LIKE  RLREO-XFELD
***"             VALUE(X_XALLP) LIKE  RLREO-XFELD
***"             VALUE(X_TCODE) LIKE  SY-TCODE
***"             VALUE(X_IMKPF) LIKE  IMKPF STRUCTURE  IMKPF
***"       TABLES
***"              T_IMSEG STRUCTURE  IMSEG
***"              T_IDOC_DATA STRUCTURE  EDIDD
*Capture Reservation Number & Qty record related to Prod. Ord.
*Component
*for Movement type 261/262.
DATA:   BEGIN OF e1mbxyh.  "Goods movements for mobile data entry
        INCLUDE STRUCTURE e1mbxyh.
DATA END OF e1mbxyh.
DATA:   BEGIN OF e1mbxyi.   "Add goods mvment from external systm:
        INCLUDE STRUCTURE e1mbxyi.
DATA END OF e1mbxyi.
tables : resb .
clear e1mbxyi.
*T_IMSEG-WENUM = X_IMKPF-XABLN.
check i_idoc_control-mestyp eq 'ZMMBXY'.
check i_idoc_control-idoctp eq 'WMMBID01'.
check i_idoc_control-direct eq '2'.
loop at t_idoc_data.
  case t_idoc_data-segnam.
    when 'E1MBXYI'.
      e1mbxyi = t_idoc_data-sdata.
      if e1mbxyi-bwart eq '261' or e1mbxyi-bwart eq '262'.
        clear resb.
        select single rsnum rspos bdmng from resb into (resb-rsnum,
      resb-rspos,resb-bdmng) where matnr eq e1mbxyi-matnr and aufnr eq e1mbxyi-aufnr
      and
        werks eq e1mbxyi-werks .
        if sy-subrc eq 0 and e1mbxyi-bwart eq '261'.
          e1mbxyi-rsnum = resb-rsnum.
          e1mbxyi-rspos = resb-rspos.
        loop at t_imseg.
*          clear t_imseg.
          t_imseg-rsnum = resb-rsnum.
          t_imseg-rspos = resb-rspos.
          t_imseg-xrere = 'X'.               "Read this in some OSS note that I need to have it as X
          modify t_imseg .
        endloop.
        endif.
        if sy-subrc eq 0 and e1mbxyi-bwart eq '262'.
          e1mbxyi-rsnum = resb-rsnum.
          e1mbxyi-rspos = resb-rspos.
          e1mbxyi-bdmng = e1mbxyi-erfmg.
          e1mbxyi-enmng = e1mbxyi-erfmg.
        endif.
        t_idoc_data-sdata = e1mbxyi.
        modify t_idoc_data.
      endif.
  endcase.
endloop.
After it comes out of the user exit, in SAP it passes through the FM MB_CREATE_GOODS_MOVEMENT, thats where the real Goods movement takes place..
Any idea guys why the newly generated IDOC doesn't have reservation number and item field filled ?

Hello Shareen
I am not really sure where the problem might be yet I would like to suggest some improvements to your coding.
DATA: ls_edidd    TYPE edidd.  " I do not work anymore with header lines but exclusively with work areas
DATA: ld_idx        TYPE i.
loop at t_idoc_data INTO ls_edidd
                            WHERE ( segnam = 'E1MBXYI'  ).
  ld_idx = syst-tabix.
      e1mbxyi = ls_edidd-sdata.
      CHECK ( e1mbxyi-bwart eq '261' or e1mbxyi-bwart eq '262' ).
        clear resb.
        select single rsnum rspos bdmng from resb into (resb-rsnum,
      resb-rspos,resb-bdmng) where matnr eq e1mbxyi-matnr and aufnr eq e1mbxyi-aufnr
      and
        werks eq e1mbxyi-werks .
       LOG-POINT <name of checkpoint group>
         FIELDS e1mbxyi-matnr e1mbxyi-aufnr e1mbxyi-werks
                     syst-subrc resb.
       CHECK ( syst-subrc = 0 ).
        CASE e1mbxyi-bwart.
          WHEN '261'.
          e1mbxyi-rsnum = resb-rsnum.
          e1mbxyi-rspos = resb-rspos.
        loop at t_imseg.
*          clear t_imseg.
          t_imseg-rsnum = resb-rsnum.
          t_imseg-rspos = resb-rspos.
          t_imseg-xrere = 'X'.               "Read this in some OSS note that I need to have it as X
          modify t_imseg.
        endloop.
        WHEN '262'.
          e1mbxyi-rsnum = resb-rsnum.
          e1mbxyi-rspos = resb-rspos.
          e1mbxyi-bdmng = e1mbxyi-erfmg.
          e1mbxyi-enmng = e1mbxyi-erfmg.
        WHEN OTHERS.
          CONTINUE.
        ENDCASE.
        ls_edidd-sdata = e1mbxyi.
        modify t_idoc_data FROM ls_edidd INDEX ld_idx.
endloop.
If you have checkpoint groups available on your SAP release then I would use them to support debugging.
Regards
  Uwe

Similar Messages

  • BAPI or FM for creating transfer order with reference to reservation

    hi
    i need a BAPI or FM to create a transfer order with reference to a reservation. I tried BAPI_GOODSMVT_CREATE but the problem is it does not support movement type '311'. is there any FM or BAPI to use movement type '311' and create a transfer order with reference to a reservation? pls help

    Hi,
    Try Using WM_CREATE_GOODS_MOVEMENT first use this and later use any of the TO create FM.
    Thanks & Regards,
    YJR

  • GI with reference to internal order

    Hello,
    We want to make a GI 261 with reference to an internal order using MIGO and get the error message:
    Order xxxxxx not found or not permitted for goods movement
    Message no. C6001
    Diagnosis
    Either the order xxxxxx does not exist or you have specified an order for which the function you want cannot be executed. For example, no goods receipt for a CO internal order or no goods issue with reference to a reservation can be carried out.
    Procedure
    Check your entries and select an order for which the desired function is permitted.
    I would appreciate any suggestions as I have no idea how to post it.
    Regards,
    Grzegorz Skorus

    Hi Gurus,
    I am also getting same ERROR while doing Goods issue with reference to the Internal order with 261 movement type
    Order 920040 not found or not permitted for goods movement
    Message no. C6001
    Diagnosis
    Either the order 920040 does not exist or you have specified an order for which the function you want cannot be executed. For example, no goods receipt for a CO internal order or no goods issue with reference to a reservation can be carried out.
    Procedure
    Check your entries and select an order for which the desired function is permitted
    Please give the T-code and detailed description for below solution
    the configuration of Field Selection Comparison: moment Type - G/L Account sap sdn

  • Goods Issue with reference to Material document

    Hello,
    I would like to create Goods Issue with reference to material document (Transfer Posting document) , but the following message appears :
    "Selected material document does not correspond with action to be executed".
    Is it possible to create Goods Issue with reference to Transfer Posting (mov.type 311 - from stor.loc. to stor.loc.)  ?
    Thanks

    Thanks,
    probably I'll have to find another way to solve this business requirement of copying the transfer document data in GI.
    We have an auto created transfer postings via interface from another system and the main idea was to use already entered fields in transfer posting document such as material , quantity , text , goods recepient , etc. and not to enter them twice when GI should be created. In our case (it's a case for certain materials) it's always 1:1 relationship, so the idea was to facilitate the job of creating the GI, because GI should contain the same data as in transfer posting document.

  • Error GI with reference to Reservation

    Hi Folks,
    I facing an error while posting Goods Issue with reference to Reservation Movement type 201,
    i tried SE16 for table XMRES but i did not any table, system through a error message is
    Please through some lights
    Regards,
    B V

    Hi Dev sir,
    I am using MIGO --> goods Issuw --> Reservation. Mvt Type 201.
    please see the screen shot
    and please see SAP Release
    Regards,
    B V

  • PGI with reference to Reservations.

    Hi Gurus,
    Can we do the Outbound Delivery or PGI with reference to reservations...  IF we can how to do that.. pls help me..
    Thanks in advance.
    subbu

    Hi,
    Go to t-code CO09 and check whether the material has some reservations at delivery level ATP or not. I am sure that the required qty is been reserved for some deliveries or something else.This happens becasue of ATP check at delivery level, which means if ATP check at delivery level is active then eventhough you see the qty available at sales order level its not available at delivery creation level.
    Regards
    Gaurav

  • BAPI for Goods Issue (MIGO) movement type 351 with reference to PO

    Hi,
    Is there an BAPI for Goods issue in MIGO with reference to PO movement type 351, i tried using "BAPI_GOODSMVT_CREATE", but there is no PO field in this, is there any other BAPI's available for the same?
    Thanks in Advance,
    Santosh

    for goods mvt type , the available is that itself . for 351 mvt type Po number is not required .
    if its a must , create a Z bapi with additional field  for PO and make it as reference .

  • PROBLEM IN TRANSFER POSTING WITH REF. TO RESERVATION

    Dear cons
            I have been facing a problem in t- code- MB1B. I have configured for p.o field  in mb1b . in screen layout of transfer posting I have done.because we want a p.o no. field in MB1B.So we generally transfer the material with reference to reservation. so we created a reservation with t-code- mb21 with movement type-415. after that we want to transfer with reference to reservation. but the system gives an error message that
        CHECK TABLE XMRES : ENTRY 0000000000   0001DOESNOT EXIST.
    MESSAGE NO. M7001
    DIAGONISIS ; IN TABLE XMRES THE ENTRY 0000000000  0001 IS MISSING
    PL. LOOK INTO THIS MATTER.
    THANKS
    NRK

    Hi,
    How you are configured the new PO field.
    in OMJJ, the system given the what are the possible options, otherwise its very diffcult to configure.
    So check at :OMJJ
    regards

  • Transfer Stock to subcontractor with reference of Sales order

    Hi,
    Scenario:
    MTO strategy
    We have one operation is subcontracting. When we take MRP run all PurReq. & PLOrd are reference to sales order. But  when we want to transfer material to subcontractor through TCode MB1B Mvt type 541 that time system issue the following message.
    Deficit of SL Unrestricted-use 3,150 KG : 119 1002 RM
    Then we have to transfer stock reserved against sale order to unrestricted.
    Requirement:
    Can we transfer stock to subcontractor with reference to sales order.
    Pl tell me how I resolved this issue.
    Thanks & Regards
    Dhamane

    Hello....
    You can not transfer material from Sales order Stock by movement type 541 as both stocks are Special stocks &  has not recommend to transfer between two special stocks.
    For this Solution ,  Transfer posting to transfer the provided components to a new storage location (for example, 9999) by using movement type 311. This enables you to obtain an overview of those stocks that are physically located at the subcontractor. This information is particularly important when you carry out a physical inventory of the sales order stocks.
    Rajiv

  • Transfer Posting 311 Mvt. with reference doc.

    Hi dear,
    My clients have one requirment i.e. they requires transfer posting 311 Mvt. should be update with some refernce document.
    For Example : Stores team are transfering material to shop floor by 311 Mvt. but instead of such direct posting can production team give requistion through SAP for 311 Mvt. ?
    Please reply, Waiting.........
    Santosh G.

    Hi
    You can use reservations, instead of requisitions and make reservation number as manadatory for the 311 movement type , so that they can be always created with reference to a document only.
    Thanks & Regards
    KK

  • How to remove the option GR with reference to PO from MIGO?

    Hi All,
    We are doing the Goods receipt with reference to Inbound Delivery (in T code MIGO).
    And never use the option Goods receipt with reference to Purchase Order.
    So, we want to remove this option Goods receipt with reference to Purchase Order.
    Is it possible and how?

    Dear,
    Goto - SPRO - MATERIAL MANAGEMENT - INVENTORY MANAGEMENT AND PHYSICAL INVENTORY - SETTINGS FOR ENJOY TRANSACTIONS - SETTINGS FOR GOODS MOVEMENTS - SETTINGS FOR TRANSACTIONS AND REFERENCE DOCUMENTS.
    Once select this option, from the next window open - select the appropriate action usually - MIGO-GR.
    Then select Transaction / Event.
    Then select again GOODS RECEIPT and double click on REFERENCE DOCUMENTS.
    DE-ACTIVATE purchase order check box and save.
    No need to delete purchase order option, just de-activate it.
    Try this.
    Regards,
    Syed Hussain.
    Edited by: Syed Hussain on Aug 29, 2009 10:37 AM

  • Re: Creating credit memo with reference to Sales Order in ICWC

    Hello gurus
    I am new to CRM and we hv ECC 6.0 & CRM 6.0 in our environment.
    We have a process where a Credit Memo Request is created with reference to a Sales Order.
    Now till this point we had launched VA01 in the ICWC and were creating the CMR with reference to the Standard Order.
    Henceforth we want to move this to the CRM ICWC.
    In ICWC we create Standard Sales order using Work Center IC_BT_SLO tied to the Navigation profile.
    I am looking for some way of copying this order to a Credit Memo Request in the ICWC.
    I tried adding the Complaints button on the navigation profile ... however it creates a new CMR ... not sure how to enable copying it from the Original Sales order in ICWC
    Any thoughts ?
    Thanks
    Vinit

    closed
    Edited by: vinit parkar on Sep 1, 2011 4:25 PM

  • Error in modifying Schedule Agreement with reference to contract

    I have created a Schedule Agreement with reference to a contract manually.The contract is of type MK, while the SA is of type LP.
    The contract contains one Material which was successfully added to the SA.
    Now I am trying to automate the same using BAPI BAPI_SAG_CHANGE. This causes a short dump in the system -
    Runtime Errors       MOVE_CAST_ERROR
    Exception              CX_SY_MOVE_CAST_ERROR
    Short text              Dynamic type conflict when assigning references
    Error analysis
        An exception occurred that is explained in detail below.
        The exception, which is assigned to class 'CX_SY_MOVE_CAST_ERROR', was not caught in procedure "GET_CREQS" "(METHOD)", nor was it propagated by a RAISING clause. Since the caller of the procedure could not have anticipated that the exception would occur, the current program is terminated. The reason for the exception is: It was tried to assign a reference to a rereference variable using the
        'CAST' operation ('?=' or 'MOVE ?TO'). However, the current content of the source variable does not fit into the target variable.
        source type: "\FUNCTION-POOL=MEOUT \CLASS=LCL_OUT_ITEM_SA"
        target type: "\FUNCTION-POOL=MEOUT\CLASS=LCL_OUT_ITEM_CON"
    Information on where terminated:
        Termination occurred in the ABAP program "SAPLMEOUT" - in "GET_CREQS". The main program was "RS_TESTFRAME_CALL". In the source code you have the termination point in line 105 of the (Include) program "LMEOUTP2F". The termination is caused because exception "CX_SY_MOVE_CAST_ERROR" occurred in procedure "GET_CREQS" "(METHOD)", but it was neither handled locally nor declared in the RAISING clause of its signature. The procedure is in program "SAPLMEOUT "; its source code begins in line 101 of the (Include program "LMEOUTP2F ".
    The following data was populated before calling the BAPI:(along with itemx table also)
    item-item_no
    item-agreement
    item-agmt_item
    The entire logic consists of updating the contract first with a new line item and then adding a line item in SA with reference to the new item in the contract.
    The contract updation is working correctly [BAPI_CONTRACT_CHANGE].

    Hi Bahrat,
    I am also facing the same issue now. Is this issue resolved for you?
    Please send the threads if any.
    Can anyone plz respond for the issue?

  • Problem with BAPI_GOODSMVT_CREATE not updating Reservation

    Hi,
    When i do a manual MB1A 'Goods issue' with reference to Work Order it is posting the goods issue and updating the RESB ,but when i do the same through the bapi code 03 Table i was not able to post the goods issue at all. am i missing a input field in the bapi .Plz help me out.
    My code.
    gf_goodsmvt_code-gm_code       = '03'. "GI
      gf_goodsmvt_header-pstng_date  = sy-datum.
      gf_goodsmvt_header-doc_date    = sy-datum.
      LOOP AT it_details INTO gf_details .
        MOVE :gf_details-matnr TO gf_goods-material,
              gf_details-werks TO gf_goods-plant,
              rm07m-lgort      TO gf_goods-stge_loc,
              gf_details-charg TO gf_goods-batch,
              rm07m-bwart      TO gf_goods-move_type.
          MOVE gf_details-issue_qty TO gf_goods-entry_qnt .
          MOVE gf_details-meins TO gf_goods-entry_uom.
       gf_goods-mvt_ind = 'F'.
        gf_goods-reserv_no = gf_details-rsnum.
        gf_goods-res_item = gf_details-posnr.
        gf_goods-res_type = gf_details-rsart.
        gf_goods-withdrawn = 'X'.
       gf_goods-orderid = rm07m-aufnr.
       gf_goods-order_itno = 1.
        APPEND gf_goods TO it_goodsmvt_item.
        CLEAR gf_goods.
      ENDLOOP.
      IF NOT it_goodsmvt_item[] IS INITIAL.
        CALL FUNCTION 'BAPI_GOODSMVT_CREATE'
          EXPORTING
            goodsmvt_header             = gf_goodsmvt_header
            goodsmvt_code               = gf_goodsmvt_code
      TESTRUN                     = ' '
         IMPORTING
      GOODSMVT_HEADRET            =
           materialdocument            = g_mat_doc
      MATDOCUMENTYEAR             =
          TABLES
            goodsmvt_item               = it_goodsmvt_item
      GOODSMVT_SERIALNUMBER       = 'X'
            return                      = it_return.

    check below Threads :
    Issue related to EXIT statement
    and see the sample program :
    Structures for BAPI
    data: gdsmt_header   like bapi2017_gm_head_01.
    data: gdsmt_code like bapi2017_gm_code.
    data: gdsmt_headret like bapi2017_gm_head_ret.
    data: gdsmt_item like bapi2017_gm_item_create occurs 1 with header line.
    data: return like bapiret2 occurs 0.
    data: retmatdoc like bapi2017_gm_head_ret-mat_doc.
    Setup BAPI header data.
      gdsmt_header-pstng_date = sy-datum.
      gdsmt_header-doc_date = sy-datum.
      gdsmt_code-gm_code = '06'.                                " MB11
    Write 262 movement to table.
      clear gdsmt_item.
      move '262'         to gdsmt_item-move_type.
      move i_resb-matnr  to gdsmt_item-material.
      move p_bdmng      to gdsmt_item-entry_qnt.
      move i_resb-meins to gdsmt_item-entry_uom.
      move i_resb-werks to gdsmt_item-plant.
      move i_resb-lgort to gdsmt_item-stge_loc.
      move i_afko-aufnr to gdsmt_item-orderid.
      append gdsmt_item.
    Determine cost center
        move '0000041430' to gdsmt_item-costcenter.
      append gdsmt_item.
    Call goods movement BAPI
      call function 'BAPI_GOODSMVT_CREATE'
           exporting
                goodsmvt_header  = gdsmt_header
                goodsmvt_code    = gdsmt_code
           importing
                goodsmvt_headret = gdsmt_headret
                materialdocument = retmatdoc
           tables
                goodsmvt_item    = gdsmt_item
                return           = return.
    Reward Points if it is helpful
    Thanks
    Seshu

  • Create a sales order with reference to another one. (BAPI)

    Hi everybody,
    I'm trying to create a new sales order with reference to another one (That's important because of the documents flow).
    I'm using 'BAPI_SALESORDER_CREATEFROMDAT2' but I couldn´t do it yet. I've read some ideas about this kind of creation in this forum; but I still haven´t found the solution yet.
    Some ideas about the BAPI parameters I nedd to complete?
    Thanks in advance!!

    Hi,
    Go through this one
    *& Report ZSD_R_SALESORDER
    report zsd_r_salesorder1 line-size 132 message-id zmmbapi .
    *& Created By : shailaja
    *& Created on : 13.10.2007
    *& Requested By : vardhman
    *& Description of program :
    Internal table definition *
    data: gt_order_header_in like bapisdhead occurs 0 with header line,
    gt_return like bapireturn1 occurs 0 with header line, " Return Messages
    gt_order_items_in like bapiitemin occurs 0 with header line, " Item Data
    gt_salesdocument like bapivbeln-vbeln , "Number of Generated Document
    gt_order_partners like bapiparnr occurs 0 with header line, "Document Partner
    gt_return1 like bapiret2 occurs 0 with header line.
    Data definition *
    types: begin of ty_gt_ft_sales ,
    partn_numb(10) type n ,"Customer Number 1
    partn_role(2) ,"Partner function
    sales_org(4) , "Sales Organization
    distr_chan(2) , "Distribution Channel
    division(002), "DIVISION
    doc_type(4) , "Sales Document Type
    purch_no(020), "Purchase order
    material(18), "MATERIAL
    targetquantity(020),"Target quantity
    reqqty(020), "Req quantity
    reqdate(010), "req date
    *REQ_DATE_H(010),
    ref_1(012), "Ref
    unload_pt(025),
    *PARTN_ROLE(2) ,"Partner function
    *PARTN_NUMB(10) ,"Customer Number 1
    end of ty_gt_ft_sales,
    begin of ty_header ,
    partn_numb(10) ,"Customer Number 1
    partn_role(2) ,"Partner function
    sales_org(4) , "Sales Organization
    distr_chan(2) , "Distribution Channel
    division(002), "DIVISION
    doc_type(4) , "Sales Document Type
    purch_no(020), "Purchase order
    unload_pt(025),
    req_date_h(010),
    end of ty_header,
    begin of ty_item,
    material(18), "MATERIAL
    targetquantity(020),"Target quantity
    reqqty(020), "Req quantity
    reqdate(010), "req date
    ref_1(012), "Ref
    *UNLOAD(025),
    end of ty_item.
    data : msg(240) type c, " Return Message
    e_rec(8) type c, " Error Records Counter
    rec_no(8) type c, " Records Number Indicator
    s_rec(8) type c, " Successful Records Counter
    t_rec(8) type c, " Total Records Counter
    v_matnr like mara-matnr,
    v_parvw type parvw.
    data : gt_ft_sales type standard table of ty_gt_ft_sales with header line.
    data : wa_gt_ft_sales type ty_gt_ft_sales,
    wa_order_items_in like gt_order_items_in,
    wa_gt_ft_sales1 type ty_gt_ft_sales,
    wa_header type ty_header,
    salesdocument like bapivbeln-vbeln.
    selection block for EXCEL UPLOAD FILE
    selection-screen begin of block b1 with frame title text-000.
    parameters file type ibipparms-path obligatory.
    selection-screen end of block b1.
    *<<<<AT SELECTION-SCREEN ON VALUE-REQUEST FOR FILE .
    at selection-screen on value-request for file .
    perform getname.
    form getname.
    call function 'F4_FILENAME'
    exporting
    program_name = syst-cprog
    dynpro_number = syst-dynnr
    importing
    file_name = file.
    endform.
    *TOP-OF-PAGE.
    top-of-page.
    skip 3.
    format color col_heading inverse on.
    write 40 text-001.
    format color col_heading inverse off.
    skip 1.
    format color col_negative inverse on.
    write :/ text-002, 13 sy-mandt , 104 text-003, 121 sy-uname,
    / text-004, 13 sy-datum , 104 text-005, 121 sy-uzeit.
    format color col_negative inverse off.
    skip 3.
    *START-OF-SELECTION.
    start-of-selection.
    perform get_data.
    perform bapi.
    *end-of-page.
    perform result.
    form result.
    t_rec = e_rec + s_rec.
    skip 3.
    format color col_total inverse on.
    write: /38 text-007, t_rec.
    format color col_total inverse off.
    format color col_negative inverse on.
    write: /38 text-008, e_rec.
    format color col_negative inverse off.
    format color col_total inverse on.
    write: /38 text-009, s_rec.
    format color col_total inverse off.
    endform.
    *& Form get_data
    text
    --> p1 text
    <-- p2 text
    form get_data .
    call function 'WS_UPLOAD' "#EC *
    exporting
    filename = file
    filetype = 'DAT'
    tables
    data_tab = gt_ft_sales
    exceptions
    conversion_error = 1
    file_open_error = 2
    file_read_error = 3
    invalid_type = 4
    no_batch = 5
    unknown_error = 6
    invalid_table_width = 7
    gui_refuse_filetransfer = 8
    customer_error = 9
    no_authority = 10
    others = 11.
    if sy-subrc 0 .
    message e000.
    endif.
    endform. " get_data
    *& Form BAPI
    form bapi .
    loop at gt_ft_sales into wa_gt_ft_sales.
    wa_gt_ft_sales1 = wa_gt_ft_sales.
    at new partn_numb.
    wa_header-doc_type = wa_gt_ft_sales1-doc_type..
    wa_header-sales_org = wa_gt_ft_sales1-sales_org . "'0001'
    wa_header-distr_chan = wa_gt_ft_sales1-distr_chan. "'01'
    wa_header-division = wa_gt_ft_sales1-division. " '01'
    wa_header-purch_no = wa_gt_ft_sales1-purch_no.
    wa_header-req_date_h = wa_gt_ft_sales1-reqdate.
    call function 'CONVERSION_EXIT_PARVW_INPUT'
    exporting
    input = wa_gt_ft_sales1-partn_role
    importing
    output = v_parvw.
    wa_header-partn_role = v_parvw.
    wa_header-partn_numb = wa_gt_ft_sales1-partn_numb.
    wa_header-unload_pt = wa_gt_ft_sales1-unload_pt.
    move-corresponding wa_header to gt_order_partners.
    move-corresponding wa_header to gt_order_header_in.
    append gt_order_header_in.
    append gt_order_partners.
    endat.
    call function 'CONVERSION_EXIT_CCMAT_INPUT'
    exporting
    input = wa_gt_ft_sales1-material
    importing
    output = v_matnr.
    gt_order_items_in-material = v_matnr .
    gt_order_items_in-target_qty = wa_gt_ft_sales1-targetquantity . "'1000'
    gt_order_items_in-req_qty = wa_gt_ft_sales1-reqqty.
    gt_order_items_in-req_date = wa_gt_ft_sales1-reqdate.
    *GT_ORDER_ITEMS_IN-BILL_DATE = wa_GT_FT_SALES1-REQDATE.
    gt_order_items_in-ref_1 = wa_gt_ft_sales1-ref_1.
    append gt_order_items_in.
    clear : wa_gt_ft_sales1,wa_header.
    at end of partn_numb.
    call function 'BAPI_SALESORDER_CREATEFROMDAT1'
    exporting
    order_header_in = gt_order_header_in
    WITHOUT_COMMIT = ' '
    CONVERT_PARVW_AUART = 'X'
    importing
    salesdocument = salesdocument
    SOLD_TO_PARTY =
    SHIP_TO_PARTY =
    BILLING_PARTY =
    return = gt_return
    tables
    order_items_in = gt_order_items_in
    order_partners = gt_order_partners.
    ORDER_ITEMS_OUT =
    ORDER_CFGS_REF =
    ORDER_CFGS_INST =
    ORDER_CFGS_PART_OF =
    ORDER_CFGS_VALUE =
    ORDER_CCARD =
    ORDER_CFGS_BLOB =
    ORDER_SCHEDULE_EX =
    if gt_return-type eq 'E' .
    e_rec = e_rec + 1.
    read table gt_return with key id = 'V1'.
    format color col_negative inverse on.
    rec_no = e_rec + s_rec.
    concatenate text-006 rec_no ':'
    gt_return-message into msg separated by space .
    condense msg.
    write: / msg.
    format color col_negative inverse off.
    elseif gt_return-number = '000'.
    s_rec = s_rec + 1.
    format color col_positive inverse on.
    msg = 'SUCCESS'.
    condense msg.
    write: / msg .
    format color col_positive inverse off.
    write :/ salesdocument, 'Has been created'.
    perform commit_mm.
    endif.
    clear: gt_return[], msg.
    endat.
    endloop.
    endform. " SLALE_UPLOAD_DATA
    *& Form COMMIT_MM
    text
    --> p1 text
    <-- p2 text
    form commit_mm .
    call function 'BAPI_TRANSACTION_COMMIT'
    exporting
    wait = 'X'
    importing
    return = gt_return1.
    clear: gt_order_items_inhttp://].\"GT_ORDER_CONDITIONS_IN[.
    endform. " COMMIT_MM
    inthis pass re_doc field in header...
    Edited by: Naresh kumar

Maybe you are looking for

  • Command link used as tree node

    I'm using an ADF Tree where one of my nodes is a command link. I've given the link an id="myLink". When I run the page, the tree shows up fine with just one node. But the View Page source does not contain any entry that says id="mylink". Where could

  • Standard versus Professional

    I have tested a feature in Acrobat Professional 9  which "Extend[s] Features in Adobe Reader".  I am wondering if this feature was available in Acrobat 9 Standard? Also whether this feature is new to 9.0 or was it available in earlier versions and wh

  • Dynamically changing Restricted List

    Hi, We have a requirment, Two team IT and HR are there. Each has it's own set of Reviewers and Approvers. We have created a custom profile form where we have a metadata field for reviewers and approvers. Based on user role, i am able to set up defaul

  • Migration of  7.0 Extractor to 3.x

    Hi All,      I have an extractor which i replicated in 7.0 and created transformations and all, now i want to convert it to a 3.x DS without deleting the transformations and all. Is it possible ? Regards: Jitendra

  • Need to install Adobe Document Services in ABAP system

    Hi Experts, We have a requirement for installing ADS on a SAP SRM ABAP NW7.4 system. I have seen the installation guide but it refers to a JAVA system. Can you please guide me regarding the same? I have seen this doc as well as it refers to JAVA and