Creating a service order in a BAPI

Hi all,
I'm trying working on a BAPI to create a service order using FM crm_service_order_create and crm_order_maintain. When I call the BAPI outside CRM the SO gets created but with a created_by user  "RFC_DIAL" although the call was originally made with a different user. Is there a way to force the creation with a different user than the "RFC_DIAL"?

Hello,
When you call the BAPI outside the CRM system (eg from R/3) the system will use the RFCs connection user to execute the FM call. You can prevent this behaviour by making the systems "trusted systems", in that case your username will be used when calling the FM from outside CRM.
Take a look at SM59 and look for the RFC connection that is used when calling the FM from outside CRM. In the details of that RFC connection you'll probably see that the RFC connection uses the "RFC_DIAL" user. In order to change this you must select "Current user" and (optionally) create a trusted connection between both systems.
Hope this helps,
Kind regards,
Joost

Similar Messages

  • BAPI or Function Module for Creating a service order

    Dear developers,
    i want to create a service order in CRM from a web-based BSP application. Which function modules or bapi's can be used for this?
    Has anybody still did something like this?
    Regards,
    Jens

    Hi,
    U can use CRMXIF_ORDER_SAVE FM to create the service Order.
    Regards,
    Ajay Gupta
    Reward points only if it helps

  • Service order creation using bapi with repair order number

    Hi experts,
    Pls suggest me a BAPI to create a service order for those repair orders where a PGR has been done(for return delivery type : LR).
    The plant should be 0260 with storage location wh01 and item category ZRRE
    Creation of a service order with repair order type SM03 is not allowed in iw31.
    thanks and regards,
    Vijayb.

    Hi prakash,
    Thank u for the BAPI
    But an error is being displayed saying that the REFURBISHMENT ORDERS CANNOT BE PROCESSED USING BAPI.
    ERROR DURING PROCESSING OF BAPI METHODS.
    This is while u pass the order type as either ZM03 or SM01or SM02 or SM03.
    pls help me on that.
    thanks and regards,
    Vijayb.

  • Creating a Service Order automatically when saving a Sales Order

    Hello SDN,
    I'm trying to have SAP automatically create a Service Order when a Sales Order is created. To this end, I've tried implementing BADI workitem_template and have been using method before_update. I've been using BAPI BAPI_ALM_ORDER_MAINTAIN to create the service order.
    The problem is that in order for the BAPI to save the service order, the sales order needs to be fully saved and operational. Otherwise it just keeps saying 'sales order does not exist'. So the problem is that the BADI is intervening too soon in the saving process. The temporary sales order numbers have been replaced with actual ones, but the records do not show in the database just yet. I think there's a commit that still needs to be done or something.
    However, I cannot find a BADI or user exit that intervenes after the sales order is saved into the database, so this leaves me stranded.
    Any suggestions would be heartily apprechiated.
    Kind Regards,
    Niels.
    Edited by: Niels Ruelens on Feb 20, 2008 4:20 PM
    Edited by: Niels Ruelens on Feb 20, 2008 4:22 PM

    Following your suggestions, I've created an update function module and inserted it into the USEREXIT_SAVE_DOCUMENT. In this function module, I'm calling the BAPI.
    Problem with this approach is that I cannot debug, nor is he actually doing anything. Here's the code that is put in the function. Is there anything wrong with the way I call the BAPI perhaps?
      DATA:
        lt_srule     TYPE TABLE OF bapi_alm_order_srule,
        lt_bheader   TYPE TABLE OF bapi_alm_order_headers_i,
        lt_srule_up  TYPE TABLE OF bapi_alm_order_srule_up,
        lt_methods   TYPE TABLE OF bapi_alm_order_method,
        lt_return    TYPE TABLE OF bapiret2,
        ls_vbak      TYPE vbak,
        ls_vbap      TYPE vbap,
        ls_bheader   TYPE bapi_alm_order_headers_i,
    *    ls_header    TYPE cobai_s_header,
        ls_prps      TYPE prps,
        ls_srule     TYPE bapi_alm_order_srule,
        ls_srule_up  TYPE bapi_alm_order_srule_up,
        ls_methods   TYPE bapi_alm_order_method.
    *    ls_item      TYPE cobai_s_item.
      SELECT SINGLE * INTO ls_vbak
      FROM vbak
      WHERE vbeln = vbeln.
      SELECT SINGLE * INTO ls_vbap
      FROM vbap
      WHERE vbeln = vbeln.
      FREE: lt_methods, lt_bheader, lt_srule.
    * Fill methods
      CLEAR ls_methods.
      ls_methods-refnumber  = 1.
      ls_methods-objecttype = 'HEADER'.
      ls_methods-method     = 'CREATE'.
      ls_methods-objectkey  = '%00000000001'.
      APPEND ls_methods TO lt_methods.
    *  CLEAR ls_methods.
    *  ls_methods-refnumber  = 1.
    *  ls_methods-objecttype = 'SRULE'.
    *  ls_methods-method     = 'CREATE'.
    *  ls_methods-objectkey  = '%00000000001'.
    *  APPEND ls_methods TO lt_methods.
      CLEAR ls_methods.
      ls_methods-refnumber  = 1.
      ls_methods-objecttype = ''.
      ls_methods-method     = 'SAVE'.
      ls_methods-objectkey  = '%00000000001'.
      APPEND ls_methods TO lt_methods.
    * Fill header
      CLEAR ls_bheader.
      ls_bheader-orderid    = '%00000000001'.
      ls_bheader-order_type = 'ZM02'.
      ls_bheader-funct_loc  = 'FERBL_TD5C_DER'.
      ls_bheader-planplant  = 'B006'.
      ls_bheader-sales_ord  = vbeln.
      ls_bheader-s_ord_item = '00010'.
      APPEND ls_bheader TO lt_bheader.
    ** Convert the internal WBS to an external WBS element
    *  SELECT SINGLE * INTO ls_prps
    *  FROM prps
    *  WHERE pspnr = ls_vbap-ps_psp_pnr.
    **   Fill settlement rules
    *  ls_srule-objnr =   ls_item-aufnr.
    ****    ls_srule-sales_ord = caufvd_imp-kdauf_aufk.
    ****    ls_srule-s_ord_item = caufvd_imp-kdpos_aufk.
    *  ls_srule-wbs_element = ls_item-projn.
    *  ls_srule-settl_type = 'FUL'.
    *  ls_srule-percentage = 100.
    *  ls_srule-extnr = 1.
    *  APPEND ls_srule TO lt_srule.
    *  ls_srule_up-wbs_element = 'X'.
    *  ls_srule_up-sales_ord = 'X'.
    *  ls_srule_up-s_ord_item = 'X'.
    *  ls_srule_up-orderid = 'X'.
    *  ls_srule_up-settl_type = 'X'.
    *  ls_srule_up-percentage = 'X'.
    *  ls_srule_up-extnr = 'X'.
    *  APPEND ls_srule_up TO lt_srule_up.
      CALL FUNCTION 'BAPI_ALM_ORDER_MAINTAIN'
        TABLES
          it_methods              = lt_methods
          it_header               = lt_bheader
    *          IT_HEADER_UP            =
    *          IT_HEADER_SRV           =
    *          IT_HEADER_SRV_UP        =
    *          IT_USERSTATUS           =
    *          IT_PARTNER              =
    *          IT_PARTNER_UP           =
    *          IT_OPERATION            =
    *          IT_OPERATION_UP         =
    *          IT_RELATION             =
    *          IT_RELATION_UP          =
    *          IT_COMPONENT            =
    *          IT_COMPONENT_UP         =
    *          IT_OBJECTLIST           =
    *          IT_OBJECTLIST_UP        =
    *          IT_OLIST_RELATION       =
    *          IT_TEXT                 =
    *          IT_TEXT_LINES           =
    *     it_srule                = lt_srule
    *     it_srule_up             = lt_srule_up
    *          IT_TASKLISTS            =
    *          EXTENSION_IN            =
             return                  = lt_return.
    *          ET_NUMBERS              =.
      IF sy-subrc = 0.
      ENDIF.
    Edited by: Niels Ruelens on Feb 20, 2008 4:58 PM

  • Problems while creating local service order on client in MAM

    I have MAM2.5 on PC. I have created a local notification and synced it. based on that notif , I am trying to create a service order.But after Sync , I get following error in monitor (merep_mon on MI server) under MAM_001:
    Return code from RFC BAPI Wrapper call:Business area required (Please enter)
    Return code from RFC BAPI Wrapper call:Service/maintenance order type PM02 not completelymaintained in plant 4510
    Return code from RFC BAPI Wrapper call:Business area required (Please enter)
    While creating service order on backend , we have to fill in the business area. but I dont see any such option on client. may be it picks up the business area from some other detail ( like equipment / personnal number ) ..If so , which from where does it pick that?
    Regards
    Rucha Atre

    Hi,
    You may try this option which might allow you to create orders without business area in the client;
    In the back-end, Goto,
    SPRO>Plant Maint. & customer service>maintenance & service orders>Define field selection for order header data.
    Uncheck the business area from required field.
    If it still doesnt work, goto tcode KOT2_OPA and click on change field selection and then remove the required check from business area.
    Regards
    Boby
    Regards.

  • Create a Purchase order using the BAPI using the data in the XML file.

    Hello Gurus,
    here is the scenario can anyone help me how to proceed explaining the procedure?
    Create a Purchase order using the BAPI using the data in the XML file.
    comprehensive explanations are appreciated.
    thanks in advance.

    hi,
      first use fm "bapi_po_create".
      then use fm "BAPI_ACC_GL_POSTING_POST"
    The demo environment was made with real business scenario in mind, but following subjects need to be addressed in a live implementation:
    •     No exceptions and error handling is implemented, except the order rejection (e.g. partly delivery);
    •     In Navision both XML Ports and the XML DOM has been used to integrate with SAP XI, because XML ports has some drawbacks regarding to Namespaces in XML Documents (mandatory in SAP XI);
    •     A minimum of SAP and Navision customization is required to implement this solution. (e.g. user exit in SAP, Navision XML DOM).

  • Creating a service order using FM

    Hello everyone,
    I am new to CRM technical. I have a requirement to create a service order using standard function module passing only 3 parametrs like category1, category2 and short text. How should I start the report. Can anyone help me in posting the code and the approach.
    Thanks in advance!

    Hi Sandeep,
    The best approach to learn this development is to debug the standard functionality by providing the data which you need in your requirement. Then you will get familiar with what are structures which needs to be populated and send to One Order API - CRM_ORDER_MAINTAIN.
    This above mentioned API will be the one which you need to use in the creation of Service Order. So, you can also search with the above mentioned Module.
    Hope this helps. Scan the Forum for FAQ's on problems that you might get in the development.
    Thanks,
    Samantak.

  • Error in creating a Service Order in the transaction CRMD_ORDER

    Hello,
    We are trying to create a service order in CRM and it shows no errors on CRM side while it is processing and saving it. But after the save is complete, it returns a error from the connected R/3 side tht says "An error occurred in system D19CLNT100 during account assignment".
    Any ideas as to how can this be corrected.
    The  details are as under:
    Diagnosis
    Errors occurred when assigning an account assignment object to a business transaction. To view the error message, see the accompanying log file.
    Transfer Log
    Business partner with GUID 4459115E6EAB014100000000099A6565 does not exist (Notification E R11 124)
    Business partner with GUID 4459115E6EAB014100000000099A6565 does not exist (Notification E R11 124)
    Characteristic "Sold-to party" for business scenario "CRM Service" is missing (Notification E IAOM 007)
    Characteristics for Controlling object have errors (Notification E IAOM 034)
    Characteristic "Sold-to party" for business scenario "CRM Service" is missing (Notification E IAOM 007)
    Characteristics for Controlling object have errors (Notification E IAOM 034)
    The BP exists on both CRM and R/3 side in both tables CRMKUNNR and CRM_BUT_CUSTNO.
    But probably some problem with Costing.
    Any ideas are highly appreciated. Thanks.
    Rgds
    Priyanka

    Hello Priyanka,
    I have the same problem by using Service Ticket in SAP CRM 5.0.
    Did you already solved this issue? If so, can you please provide the solution!?
    How can I activate and check the transfer log?
    Thanks and regards
    Alex

  • Create a work order using the BAPI for IW31

    Hi,
          I want to create a work order using the BAPI for IW31 tr. can any one help me with the program description.
    Full points will be awarded for the useful answers.
    Thanks and regards,
    Sunil

    hi,
      first use fm "bapi_po_create".
      then use fm "BAPI_ACC_GL_POSTING_POST"
    The demo environment was made with real business scenario in mind, but following subjects need to be addressed in a live implementation:
    •     No exceptions and error handling is implemented, except the order rejection (e.g. partly delivery);
    •     In Navision both XML Ports and the XML DOM has been used to integrate with SAP XI, because XML ports has some drawbacks regarding to Namespaces in XML Documents (mandatory in SAP XI);
    •     A minimum of SAP and Navision customization is required to implement this solution. (e.g. user exit in SAP, Navision XML DOM).

  • How to create a service order and check the internal order in R/3

    Required Solution:
    1. How to copy existing service order and create new one and check the internal order in R/3, whether the certain service order is correctly created in r/3, can you polease explain the steps plz.
    2. If i am creating service order by service template finally the service order is getting created but it is not showing me in the table iaom_crm_aufk, how to check this.
    can any one help me in this issues as soon as possible.

    Hello Zita,
    Try to restart your portal after creating <b>ServiceUser</b> in both UME and KM.
    One more major difference between ServiceUser and normal portal user is that a ServiceUser does not have a UserAccount (IUserAccount)
    Object serviceContext = null;
            try {
                serviceContext = AccessController.doPrivileged(new PrivilegedExceptionAction() {
                    public Object run() throws WcmException {
                        return ResourceFactory.getInstance().getServiceContext(CONTRACT_SERVICE_USER);
            } catch (PrivilegedActionException e) {
                logger.severe(e, "ResourceContext for the technical " + serviceUser +
                     " user could not be retrieved.");
    IResourceContext resCtx = (IResourceContext) serviceContext;
    So I modify all KM resources with this resCtx.
    Hope this helps ...
    Greetings,
    Praveen Gudapati
    p.s. Points are always welcome for helpful answers

  • How to change Service order quantity using BAPI/FM

    Hi All,
    Can any body tell me how to change the Service Order quantity (in IW32) using a FM or a BAPI.
    I tried using the BAPI: BAPI_ALM_ORDER_MAINTAIN but I am unable to change the quantity. May be I might be missing some parameter. If anybody has done this please let me know the parameters that needs to be passed or if there is any other way out.
    Points will be rewarded to useful answers!!
    Thanks,
    Susanth.

    Hi!
    I have used this BAPI.read the documentation properly and after calling this bapi call BAPI_TRANSACTION_COMMIT then only expected results com n get saved.
    for ex:
    call function 'BAPI_ALM_ORDER_MAINTAIN'
        tables
          it_methods              = itab_methods
          it_header               = itab_header
      IT_HEADER_UP            =
          it_header_srv           = itab_header_srv
      IT_HEADER_SRV_UP        =
          it_userstatus           = itab_userstatus
          it_partner              = itab_partner
      IT_PARTNER_UP           =
          it_operation            = itab_operation
      IT_OPERATION_UP         =
          it_relation             = itab_relation
      IT_RELATION_UP          =
          it_component            = itab_component
      IT_COMPONENT_UP         =
          it_objectlist           = itab_objectlist
      IT_OBJECTLIST_UP        =
          it_olist_relation       = itab_olist_relation
          it_text                 = itab_text
          it_text_lines           = it_text_lines
          it_srule                = itab_srule
      IT_SRULE_UP             =
          it_tasklists            = itab_tasklists
          extension_in            = itab_extension_in
          return                  = itab_return
          et_numbers              = itab_et_numbers
      call function 'BAPI_TRANSACTION_COMMIT'
       exporting
         wait          = 'X'
    IMPORTING
      RETURN        =
    reward points if helpful.

  • Sub contracting Purchase requisition not created thru Service Order

    Hi Experts,
    I configured to create Service order automatically from Customner service.
    Now we have the SM03 repair service order .When we try to create Sub contracting Purchase requisition.
    (Selecting Subcontr tick in External tab of Components tab)system gives error saying  --
    Op. 0010 must have exactly one component as 'Rework Material to Subcontr.'
    Message no. AD_SUBCON109
    I checked the notes and It was not help ful.I understand I was doing something wrong in creation.
    The control key used is SM03. Can any body help me in the above problem.
    Regards
    Rammohan.

    Dear Sen,
    The same error message refers to one of the following material provision indicators getting to me also:
    "S" - an entry within table T417 is missing where KZBRS (A&D-Specific Material Provision) is not set
    "X" - an entry within table T417 is missing where KZBLF (Rework Material from Subcontractor) is not set
    "F" - an entry within table T417 is missing where field ADSUB_DEFDLV (Deferred Delivery) is not set
    also, i Insert a row with S and keep MPCust and MPVend blank and Check the A&D MP box
    getting following error "
    Op. 0010 must have exactly one component as 'Rework Material to Subcontr.'"
    Can u tell me the config for MPI??

  • How to create the service order using CRMXIF_ORDER_SAVE

    Hi Friends,
    I want to create service order using thsis function module
    CRMXIF_ORDER_SAVE and quantity also in this service order transaction.
    Any body please explain the above question

    Hi Friends,
    I want to create service order using thsis function module
    CRMXIF_ORDER_SAVE and quantity also in this service order transaction.
    Any body please explain the above question

  • Creating the Sales Order using the bapi BAPI_SALESORDER_CREATEFROMDAT2

    Hi,
    My problem is , i have created one module pool program for accelerating the Sales Order creation.
    I am using the bapi BAPI_SALESORDER_CREATEFROMDAT2 for sales order creation. After executing the program
    bapi is given an errot that, incomplete sales order document is saved.
    Can any body tell me plz what are the necessary fields i need to take in the header and item level , so that the complete
    document will be saved through BAPI.
    <removed_by_moderator>
    Thanks
    Edited by: Julius Bussche on Jan 11, 2010 12:09 PM

    TABLES: VBAK,                             "Sales Document: Header Data
            VBAP.                             "Sales Document: Item Data
    *************************************WORK AREA DECELERATION************************
    DATA: BEGIN OF WA_HEADER,
            LI    TYPE I,                      "LINE TYPE
            AUART TYPE VBAK-AUART,             "Sales Document Type
            VKORG TYPE VBAK-VKORG,             "Sales Organization
            VTWEG TYPE VBAK-VTWEG,             "Distribution Channel
            SPART TYPE VBAK-SPART,             "Division
            KUNNR TYPE BAPIPARNR-PARTN_NUMB,   "Customer number
          END OF WA_HEADER.
    DATA: BEGIN OF WA_ITEM,
            LI     TYPE I,
            MATNR  TYPE VBAP-MATNR,            "MATERIAL NUMBER
            ZMENG  TYPE VBAP-ZMENG,           "QUANTITY
          END OF WA_ITEM.
    ***********************************INTERNAL TABLE DECELERATION***************************************
    DATA: IT_HEADER      LIKE TABLE OF WA_HEADER WITH HEADER LINE.                   "IT FOR HEADER
    DATA: IT_ITEM        LIKE TABLE OF WA_ITEM WITH HEADER LINE.                     "IT FOR ITEM
    DATA: IT             LIKE VBAK OCCURS 0 WITH HEADER LINE.
    ***************************SALES ORDER INTERNAL TABLE DECELERATION********************************
    DATA:
          HEADER  TYPE TABLE OF BAPISDHEAD WITH HEADER LINE,        "SALES HEADER DATA
          ITEMS   TYPE TABLE OF BAPIITEMIN WITH HEADER LINE,         "SALES ITEM DATA
          PARTNERS TYPE TABLE OF BAPIPARTNR WITH HEADER LINE.      "SALLES PARTNERS
    ***********************************DYNAMIC FIEL PATH GETTING DECELERATION************************
    DATA : HL_FIELD_NAME TYPE DYNPREAD-FIELDNAME VALUE 'G_P_SPATH',              "SCREEN FIELD NAME
           HL_FILE_NAME  TYPE IBIPPARMS-PATH VALUE 'G_P_SPATH',                  "Local file for upload/download
           IL_FIELD_NAME TYPE DYNPREAD-FIELDNAME VALUE 'G_P_EPATH',              "SCREEN FIELD NAME
           IL_FILE_NAME  TYPE IBIPPARMS-PATH VALUE 'G_P_EPATH',                  "Local file for upload/download
           FL_FIELD_NAME TYPE DYNPREAD-FIELDNAME VALUE 'G_P_EPATH',              "SCREEN FIELD NAME
           FL_FILE_NAME  TYPE IBIPPARMS-PATH VALUE 'G_P_EPATH'.                  "Local file for upload/download
    DATA : CTR TYPE I .
    DATA : CTR2 TYPE STRING.
    DATA : CTR1 TYPE STRING.
    Sales document number
    DATA : L_VBELN LIKE BAPIVBELN-VBELN.
    SELECTION-SCREEN : BEGIN OF BLOCK B1 WITH FRAME TITLE T1.
    SELECTION-SCREEN : SKIP.
    PARAMETER        : P_HPATH TYPE STRING.
    PARAMETER        : P_IPATH TYPE STRING.
    SELECTION-SCREEN : SKIP.
    SELECTION-SCREEN : END OF BLOCK B1.
    SELECTION-SCREEN : BEGIN OF BLOCK B2 WITH FRAME TITLE T2.
    SELECTION-SCREEN : SKIP.
    SELECTION-SCREEN : BEGIN OF LINE.
    SELECTION-SCREEN : PUSHBUTTON 10(14) UPLOAD USER-COMMAND CLICK1.
    SELECTION-SCREEN : END OF LINE.
    SELECTION-SCREEN   END OF BLOCK B2.
    ******************************************INITIALIZATION.***************************************************
    INITIALIZATION.
      T1       = 'Putchase Order Source File Path'.
      T2       = 'Push Button'.
      UPLOAD   = 'Upload'.
    *******************************************AT SELECTION SCREE EVENT********************************************
    AT SELECTION-SCREEN.
      CASE SY-UCOMM.
        WHEN 'CLICK1'.
          IF P_HPATH IS INITIAL AND P_IPATH IS INITIAL.      "CHECKING BTHE THE TEXT BOX
            MESSAGE I009.
          ELSE.
            PERFORM SELECT.                                  "CALLING THE SELECT SUBROUTINE
          ENDIF.
        WHEN OTHERS.
          MESSAGE 'PRESS FORM BUTTON' TYPE 'I'.      "WHEN EXECUTE BUTTON IS PRESSED
      ENDCASE.
    ***********************************GETTING HEADER FIEL PATH*******************************************
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_HPATH.
      CALL FUNCTION 'F4_FILENAME'
        EXPORTING
          PROGRAM_NAME  = SYST-CPROG
          DYNPRO_NUMBER = SYST-DYNNR
          FIELD_NAME    = HL_FIELD_NAME
        IMPORTING
          FILE_NAME     = HL_FILE_NAME.
      P_HPATH = HL_FILE_NAME.
    ***********************************GETTING ITEM FIEL PATH*******************************************
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_IPATH.
      CALL FUNCTION 'F4_FILENAME'
        EXPORTING
          PROGRAM_NAME  = SYST-CPROG
          DYNPRO_NUMBER = SYST-DYNNR
          FIELD_NAME    = IL_FIELD_NAME
        IMPORTING
          FILE_NAME     = IL_FILE_NAME.
      P_IPATH = IL_FILE_NAME.
    START-OF-SELECTION.
    *&      Form  SELECT
          text
    -->  p1        text
    <--  p2        text
    FORM SELECT .
      CALL FUNCTION 'GUI_UPLOAD'             " function resposible to get the local flat
          EXPORTING                          " and upload it in a internal table
            FILENAME            = P_HPATH
            FILETYPE            = 'ASC'
            HAS_FIELD_SEPARATOR = '#'
          TABLES
            DATA_TAB            = IT_HEADER.
      CALL FUNCTION 'GUI_UPLOAD'             " function resposible to get the local flat
          EXPORTING                          " and upload it in a internal table
            FILENAME            = P_IPATH
            FILETYPE            = 'ASC'
            HAS_FIELD_SEPARATOR = '#'
          TABLES
            DATA_TAB            = IT_ITEM.
      LOOP AT IT_HEADER.
        Initialize Header values
        HEADER-DOC_TYPE     =  IT_HEADER-AUART.
        HEADER-SALES_ORG    =  IT_HEADER-VKORG.
        HEADER-DISTR_CHAN   =  IT_HEADER-VTWEG.
        HEADER-DIVISION     =  IT_HEADER-SPART.
        APPEND HEADER.
        PARTNERS-PARTN_ROLE = 'WE'.
        PARTNERS-PARTN_NUMB = IT_HEADER-KUNNR.
        APPEND PARTNERS.
        CTR = 10.
        LOOP AT IT_ITEM WHERE LI = IT_HEADER-LI.
          CTR2 = CTR.
          CONCATENATE '0000' CTR2 INTO CTR1.
    ***Initialize Item values
         ITEMS-ITM_NUMBER   = IT_ITEM-ITEM.
          ITEMS-ITM_NUMBER   = CTR1.
          ITEMS-MATERIAL     = IT_ITEM-MATNR.
          ITEMS-REQ_QTY   = IT_ITEM-ZMENG.
          APPEND ITEMS.
          CTR = CTR + 10.
        ENDLOOP.
        CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT1'
          EXPORTING
            ORDER_HEADER_IN = HEADER                      "SALES HEADER DATA
          IMPORTING
            SALESDOCUMENT   = L_VBELN                        "RETRIEVED SALES DOCUMENT NUMBER
          TABLES
            ORDER_ITEMS_IN  = ITEMS                       "SALES ITEM LEVEL DATA
            ORDER_PARTNERS  = PARTNERS.                    "SAKES PARTNERS
        APPEND L_VBELN TO IT.
        COMMIT WORK AND WAIT.
        CLEAR : HEADER , ITEMS[] ,PARTNERS,CTR,CTR1,CTR2.
        REFRESH : ITEMS.
      ENDLOOP.
      IF IT[] IS NOT INITIAL.
        LOOP AT IT.
          WRITE: / 'SALES ORDER', IT-VBELN , 'CREATED'.
        ENDLOOP.
        LEAVE TO LIST-PROCESSING.
        SET PF-STATUS SPACE.
      ELSE.
        MESSAGE I044.
      ENDIF .
    ENDFORM.                    " SELECT

  • Creating/confirming transfer order (WM) using bapi/function modules

    Hi,
    I usually use BDC to create transfer orders or other documents in WM, but i've been told that using BAPI is more correct. I'm new to this concept, so could you please tell me how i can find the apropriate BAPI/function modules available for this purpose in 46C ?
    I thank you in advance,
    Bruno

    Hi Gisk,
    i am trying ot create a TO based on a material document and year. Same function as transaction LB12. Do you know which function module i can use for this.
    I am trying to use the function module L_TO_CREATE_SINGLE, i fill in the T_LTAK-MBLNR and T_LTAK-MJAHR. But do not know which fields to fill in.
    Hope you can help me.
    Grtz
    Coeno

Maybe you are looking for

  • POST GOODS ISSUE in Delivery Order

    Dear Friends: After going to Delivery Order,Vl02n, I clicked on Post Goods Issue and I am getting this error. Delivery has not yet been completely processed by WM. Delivery has not yet been put away / picked (completely) How to Overcome this problem?

  • Merge Join Occuring

    I have query whch when I do showplan ... It show merge join is happening at client place and not at mine.... Can anybody suggest as what is reason behind this merge join to occur. Merge join should not occur at any cost... It is slowing down my perfo

  • Transport Zone in Customer Master

    Hi All Can any one explain me how the trasport zone assign in customer master I configared the trsport zone in customisation I also find it help in customer master but Transport Zone fild is disable so can't update it in customer master Pl help

  • How to implement app integration and sso on nw04

    Hi, I'm migrating several EP5 applications to the nw04 platform which integrate 3rd party applications via single sign on (SSO). My first attempt was to follow the "Application Integrator" howto which provides an example par file that is supposed to

  • Checking WSDL / XML - SOAP

    Hi folks ! I have created a web-service.xml which i have added some restriction for complex datatypes. If i call the standard mechanism from BEA (WLS 7.0) for testing the service, the restrictions are not used. I would expect an XML - error if i pass