Create POS Sales Orders

Hi all
can anyone send me the codes for creating POS sales order via BAPI. 
my Z* program should have the following featuer.:
1. Feature to get executed with read data from FILE and to get executed with read data from Z-Table
2. Create the SAP Sales Orders; Calling a BAPI: BAPI_SALESORDER_CREATEFROMDAT2 with respective parameters
3. Capture the messages returned by the BAPI
4. If Sales order created successfully, capture the new order number and report it
5. If any sales order creation fails, capture the data for that Sales order and insert the same in Z-table. And report the respective errors.
6. The data in Z-table that can be verified and reprocessed with step 1, here the successful records will be deleted from the z-table
7. If file is processed successfully, move it to the Archive folder in SAP Apps Server
any help from anyone..
will wait of reply

hi,
1. first you upload the file into internal file
2. define tables and structures as like in bapi for ex
   create_order_bapisdhd1    LIKE 
   bapisdhd1,item_data_bapisdhd        LIKE bapisdhd  
   OCCURS 0 WITH HEADER LINE,
3 in the itab you have all the values, using string / some manipulations assign all the fields to the relevant bapi structure / table
then call the bapi
     CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'
          EXPORTING
               order_header_in    = create_order_bapisdhd1
          IMPORTING
               salesdocument      = created_order_number
          TABLES
               return             = create_order_bapiret2
               order_items_in     = create_order_bapisditm
               order_schedules_in = create_order_bapischdl
               order_partners     = create_order_bapiparnr
               order_text         = create_order_bapisdtext.
in the importing - sales document you have the sales document number if the sales order created successfully.
else in the return you have all the error message for the sales order creation using return you can find out the whether sales order created successfull or not.
then move all the error order details to another internal table (say itab_error )
then finaly move the itab_error tab to application server using open dataset and transfer statements
cheers,
sasi

Similar Messages

  • Customer GL Account Updates by Creating a Sales Order

    Dear all,
    I would like to know detailed information about customer GL Account updates based on Sales Order creation.
    We have a POS system, there we are creating Sales Orders for the customers.
    As per my knowledge by creating a sales order system is performing the following jobs.
    Debiting Customer Account
    Crediting Sales Account.
    Please suggest me that my understanding is right or not.
    What else job is performed with regards to financial accounts for the customer.
    Where can I see these updations at each level starting from Sales Order creation, Delivery and Invoice.
    Please educate to get a clear idea of the process. your suggestions will be highly appreciated.
    Thank you
    Raghu Ram

    Hi,
    there will no accounting entry at sales order creation.
    Here is the sd cycle:
    sales order no accounting effect
    goods deleivery to customer
    COGS a/c dr
    to stock
    Billing to customer
    customer a/c dr
    to sales revenue
    Hope this is clear
    pls assign points if it was
    Thanks
    Vamsi

  • Creating a FM to create a Sales Order

    Hi All,
    I am not a CRM guy, so please ask for clarifications if my questions poses any confusion.
    And please suggest if I should post this question on some other forum for a better answer.
    I am trying to create a FM to create a BAPI Wrapper and for this I am callling a BAPI - BAPI_BUSPROCESSND_CREATEMULTI in my FM.
    There must be many (manadatory) parameters which must be passed to this BAPI for the successful creation of a Sales Order. (I am trying to create a Sales Order of the typse 'TA')
    Now I want to pass on the minimum parameters to this BAPI to create a Sales Order for a Particular BP and a Particular Product for a fixed quantity.
    Please let me know how shall I go about this, There are so many table parameters with so many fields that I am not sure how to and what to fill in them..
    I am waiting for help. Please ask me to be more specific if you need anything to know.
    Thanks
    Ankur
    and I am particularly interested in the Paratmeter - INPUT_FIELDS and what its fields mean.
    And Samples codes will be very helpful

    Hello Ankur,
    I attach you some code. I hope this helpful to you.
    * HEADER STRUCTURE.
      gs_orderadm_h-handle  = '0000000001'.
      gs_orderadm_h-guid = '00000000000000000000000000000000'.
      gs_orderadm_h-process_type = TYPE.
      gs_orderadm_h-description = DESCRITION.
      gs_orderadm_h-mode = 'A'.
      APPEND gs_orderadm_h to gt_orderadm_h.
      ls_input_field-ref_handle  = '0000000001'.
      ls_input_field-ref_kind  = 'A'.
      ls_input_field-ref_guid   = '00000000000000000000000000000000'.
      ls_input_field-logical_key   = '00000000000000000000000000000000'.
      ls_input_field-objectname  = 'ORDERADM_H'.
      ls_input_field_names-fieldname = 'PROCESS_TYPE'.
      INSERT ls_input_field_names INTO TABLE ls_input_field-field_names.
      INSERT ls_input_field  INTO TABLE  gt_input_fields.
      clear ls_input_field-field_names[].
    * You have to do the same with the another structrures..
      CALL FUNCTION 'CRM_ORDER_MAINTAIN'
    EXPORTING
      it_schedlin_i   = gt_schedlin_i_com
      it_partner      = gt_partner
      it_sales        = gt_sales
      it_pricing      = gt_pricing
      it_text         = gt_text
    CHANGING
      ct_orderadm_h   = gt_orderadm_h
      ct_orderadm_i   = gt_orderadm_i
      ct_input_fields = gt_input_fields.
      LOOP AT gt_orderadm_h INTO gs_orderadm_h.
        INSERT gs_orderadm_h-guid INTO TABLE gt_obj_guids.
      ENDLOOP.
      CALL FUNCTION 'CRM_ORDER_SAVE'
        EXPORTING
          it_objects_to_save = gt_obj_guids
          iv_no_bdoc_send    = ''
        IMPORTING
          et_saved_objects   = gt_saved_objects.
      read table gt_saved_objects index 1 into ls_saved_objects.
      ORDER = ls_saved_objects-object_id.
      COMMIT WORK.
    Regards...
    Mon

  • Error while creating a Sales Order

    Hi ,
    I have created a material master for a material Y-350 in my system.I have defined it for the Plant 1100 (Berlin), Sales Org 1020 , Distribution channel 22.When i try to create a sales order for a customer in Dusseldorf,Germanyy , i get an error saying "Material Y-350 is not defined for sales org 1020,distr.chann 22,language DE".It means that a short text with the appropriate language exists(a short text must be available in the language of either the customer or the sales organization).I had it maintained in English.From where do i go and maintain it in German ?Kindly let me know.Thanks.

    Hi,
    First check what's the sales area assigned to your customer in Dusseldorf,Germany. It has to be Sales Org 1020 , Distribution channel 22.
    To check that go to XD02 & enter customer number there and press "Customer Sales Areas" button. There you can view all sales areas available for your customer. Check whether Sales Org 1020 , Distribution channel 22. exists there. If not, from XD01, you have to extend your customer for that sales area again.
    If that's there, then check the language in Material Master.
    What you have to do is, go to MM02, give the Material number and go in by selecting Basic Data view.
    Once go in, select "Additional Data" button option from the top.
    Under "Descriptions" tab, maintain language "DE", since customer is from Germany.
    Now try & see.
    Best regards,
    Anupa

  • Automatic creation of intercompany PO when creating a Sales Order

    Hi Experts
    Is there a standard way of triggering an intercompany PO when creating a sales order to the final customer (or the other way around, triggering a sales order to the end customer upon creation of an intercompany PO)? Scenario: business has setup a logistics company (company code X), which its purpose is to deliver goods to the final customer (home customers). However, sales orders are created from seperate chain of stores which belong to another company code (company code Y). This chain of stores have one sales organisation (since there is over 1000 stores under a chain). I need a way to represent that a sale originated from a store/plant belonging to company Y to end customer A. Also, I need a billing document (intercompany) from company code X to store/plant beloning to company Y.
    Issues: in the intercompany config (assign intern customer numbers to sales org) - is there a way to assign a customer number at site/plant level so that when creating an intercompany billing it can be picked instead of the one assigned to the sales org and where can this be specified in the sales order (remember: in my scenario there are multiple stores/plants that belong to one sales organisation and it is not possible to use one customer number linked to the sales organisation.)
    Desired results:
    Sales order from store/plant YY belonging to company code Y to end customer A
    Intercompany billing from plant XX belonging to company code X to store/plant YY
    End customer billing from store/plant YY to end customer A
    Thank you in advance for your help.

    Hello Tsmash  
    I think you can acheive this with Regular Sales order + Inter Company STO combination.
    Maintain customer numbers for each of the Plants from Company Y for the sales area belonging to Company X.
    Then do the config for STO in MM using this menu path:
    SPRO/Materials Management/Purchasing/Purchase Order/Set up Stock Transport Order
    Here, in the activity 'Define Shipping Data for Plants',  enter each of the plant-customers and the Sales area belonging to Comany code Y. Carry out other activities in this area appropriately.
    Similarly set up Custom ( say Z1) Special Procurement type for Plant YY for stock transfer from XX using this menu path:
    SPRO/Production/Material Requirements Planning/Master Data/Define Special Procurement Type:
    Here maintain procurement type as F, Special procurement as U and plant as XX. You may need to repeat this config for each of the receiving plants (over 1000 stores under a chain)  from co code Y.
    In the material master MRP 2 for Plant YY,  maintain procurement type as F and Special Procurement as Z1.
    Sales order will be received under Co Code Y and sales area belonging to Y form customer A,
    Because of the MRP config, a PO (STO) requirement will be raised on Co code X and plant XX. XX will send the goods to YY via a STO delivery using the Shipping data from 'Set up STO' config,
    Plant YY will send the goods to A and bill that customer. Co Code X will raise an inter-comany bill on Co code Y.
    That's how it should work. Try it and revert with any issues.

  • How to create a Sales Order using BAPI_SALESORDER_CREATEFROMDAT1 in VC

    I am new to Visual Composer.
    I read the tutorial and created a Model which fetches the Sales Orders from the R/3 using <b>BAPI_SALESORDER_GETLIST</b>, every thing worked fine.
    I am trying to create a sales order in R/3 using <b>BAPI_SALESORDER_CREATEFROMDAT1</b>, following are the steps I did:
    1)Create a model
    2)Drag a model element(iView) on to the designer
    3)Double click the iView and Drag the function <b>BAPI_SALESORDER_CREATEFROMDAT1</b> on to the iView Designer
    Now my question is, for <b>BAPI_SALESORDER_CREATEFROMDAT1</b> there are some mandatory fields as mentioned in the document.
    1. Mandatory entries:
    ORDER_HEADER_IN :
    DOC_TYPE     Sales document type
    SALES_ORG    Sales organization
    DISTR_CHAN   Distribution channel
    DIVISION     Division
    ORDER_PARTNERS..:
    PARTN_ROLE   Partner functions, SP sold-to party
    PARTN_NUMB   Customer number
    ORDER_ITEMS_IN..:
    MATERIAL     Material number
    REQ_QTY      Order quantity in sales unit
    I can pass the values of structure <b>ORDER_HEADER_IN</b> from a input form but how should I pass mandatory values for tables <b>ORDER_PARTNERS</b> and <b>ORDER_ITEMS_IN</b>.
    Ideally I should have one form where I can send all the mandatory items in the form.
    Thank you,
    Vamsi

    Hi,
    how did you return the materials in the Table View. I tried to do it, but it only returns one material?
    Regards,
    Matthias

  • Sale Order Item Quantity Not Populating When Create A Sale Order Using BAPI

    I am having a problem when creating a sale order using BAPI
    BAPI_SALESORDER_CREATEFROMDAT2
    Problem is that sale order item quantity field is not populating
    code is as follows
    ORDER_ITEMS_IN-ITM_NUMBER = '0010'.
    ORDER_ITEMS_IN-MATERIAL = '000000000010000262'.
    ORDER_ITEMS_IN-TARGET_QU = 'LB'.
    ORDER_ITEMS_IN-TARGET_QTY = 1.

    Hi,
    Try populating ORDER_SCHEDULES_IN table in the bapi field REQ_QTY.
    Regds,
    Rudra

  • Purchase order created from sale order ( third party)

    Hi...
    In third party sale, when sale order is created in SAP system will automatically creates Purchase requisition which can be converted into Purchase order,
    My requirement is i need to identify against which sale order the above purchase order is created, do this purchase order has any reference of sale order.
    Is there any way where i can track the purchase order number entered while cretion of sale order in the purchase order generated after creation of sales order.
    Suggestion will be worth rewarding.
    Regards
    SARFARZ

    Hi
    I think you are little bit confused.The PO number entered while creating the Sales order is nothing but the customer Purchase order.This we may receive in different forms.Hard copy or Mail etc.We will give this number as a reference in sales order.
    Where as for third party orders, depending on the schedule line category (SD), PR will be generated.This will PR will be converted in to PO.In PO item detail, you can find account assignment tab, where you can find the sales order number.
    If you want to link customer PO to the SAP PO, then you need to link the two tables.
    Regards
    Ramakrishna

  • Creating SD Sales Orders from a Purchase Order

    Does anyone have any detail documentation for creating an SD Sales Order as an output message from a purchase order. We would like to implement a process where we generate a sales order to a specific sales organization automatically from a purchase order in a different company code.
    Any help would be appreciated.

    Hi,
    You can configure this scenario using ALE/IDOC . I dont have any docs but i remember that i had setup this few years ago.
    Create PO , attach output type , output type linked to process code , process code linked to sales order relevant IDOC Type and send to receiver as outbound IDOC ,
    The recepient receives this as an inbound and used this data to create a sales order in his company code.
    Thanks,
    Sudhi

  • Create multiple sales orders from single service notification?

    Is it possible to create multiple sales orders from a single notification (IW51)? 
    We currently create sales orders directly within transaction IW51 (Create Service Notification).  We kick off the sales order creation by pressing the "SALES ORD." button in the notification screen.  We're now interested in creating a 2nd Sales Order which would tie directly to the same Service Notification.  This is so that we can have the second order assigned to a different account assignment WBS (there are two different parties doing work on the service notification).
    I assume you would have to go to VA01 to create the Sales Order, but am not sure how to tie it directly to the service notification from here.  I treied to do a create with reference, but there is no ability to create with reference to a service notification.
    Do I have to create a second service notification for the 2nd Sales Order for this to work?  I want to avoid doing this if at all possible.
    I'm running SAP R/3 Enterprise
    Thanks for your help!

    Hi,
    go to vtaa- copy controls for sales document to sales document.
    select your combination of order and quotation go to item level. There select value 0(zero) in field positive/negative negative.
    No need to change update document flow.
    After setting zero in copy control that be told on above. create order with respective to the quotation.
    After saving the order.
    go to document flow to see the status in between quotation and order.
    If you placed setting right, then u certainly observe for quotation status will be open. so you can create no. of sales order with respect to that quotation..
    Have a good day..

  • Hi All, We are in to Release 11.5.10.2.There is a specific requirement to Prevent users from creating Manual Sales Orders in oracle and yet users should be able to book the Sales Orders Imported from CRM system into Orcale.Please advise.

    Hi All, We are in to Release 11.5.10.2.There is a specific requirement to Prevent users from creating Manual Sales Orders in Oracle and  yet users should be able to book the Sales Orders Imported from CRM system into Orcale.Please advise.

    Thanks for your advise.
    However, I missed to mention that we have two set of users  One is for Finished Goods and another for Spares.
    Only Spares users need to be prevented from creating Direct/Manual Sales Orders in Oracle.
    As you suggested, if this will be done at Form level, that may Disallow FG users also to create Manula Sales Orders which should not be the case.
    Further, I tried to test one scenario through Processing Constraints but it did not work.
    Application
    OM
    Validation Type
    Entity
    Temp
    Short Name
    TBL
    Validation Semantics
    Created By
    Equal To
    User(Myself)
    Processing Cosntraint
    Application
    OM
    Entity
    Order Header
    Constraint
    Operation
    User Action
    Create
    Not Allowed
    Conditions
    Group
    Scope
    Validation Entity
    Record Set
    Validation Template
    101
    Any
    Order Header
    Order
    Above Created
    Please advise.

  • Billing document should not be cancelled after creating return sales order

    Hi All,
    Billing document should not be cancelled after creating return sales order with reference to billing document. Please suggest configuration settings on the same.
    Sudheer.

    Hi,
    In SAP, when the sub-sequent document is existing , we can not cancel the preceeding document. Therefore if you want to cancel the billing document you need to calcel the documents which are created with reference to that.
    Check and confirm.
    Regards,
    Ravi Duggirala

  • Line item data is not saving while creating a Sales order using Interactive

    Hi all,
    I am creating a sales order Using Interactive forms. In the form i am having Header data and line item data.I had created two structures one for Header data and one for Line item data. For entering  the LINE ITEM DATA i had created a Dynamic table with Buttons ADD ROW and DELETE ROW.
    User will Add the Row or Delete the Row based on the requirement.
    My issue is When ever the user clicks the SUBMIT button after entering the header data and 3 line items data , Sales order has been created with only first line item and the remaining two line items are not created.
    My Interactive form is like below
    HEADER DATA
    DOC_TYPE
    SALES_ORG
    DIST_CHN
    DIVISION
    PURCH_NO
    PARTN_ROLE
    PART_NO
    LINE ITEM DATA
                             ITEM_NO      MATERIAL          PLANT          QTY        COND_TYPE            COND_VALUE
    ADD ROW
    DELETE ROW
                                                                                    SUBMIT
    My  code for the method ONACTIONCLICK is like below
    method ONACTIONCLICK .
    data:
          Node_Adobe       type ref to If_Wd_Context_Node,
          Node_Zsaleheader       type ref to If_Wd_Context_Node,
          Elem_Zsaleheader       type ref to If_Wd_Context_Element,
          Stru_Zsaleheader       type If_Main=>Element_Zsaleheader,
          Node_Zsaleitem       type ref to If_Wd_Context_Node,
          Elem_Zsaleitem       type ref to If_Wd_Context_Element,
          Stru_Zsaleitem       type If_Main=>Element_Zsaleitem.
      data: header_data type BAPISDHEAD.
      data: item_wa type BAPIITEMIN.
      data: item_data type table of BAPIITEMIN.
      data: partner_wa type BAPIPARTNR.
      data: partner_data type table of BAPIPARTNR.
      data: sales_order type BAPIVBELN-VBELN.
      data: Errorlog type BAPIRETURN1.
    navigate from <CONTEXT> to <ADOBE> via lead selection
      Node_Adobe = wd_Context->get_Child_Node( Name = IF_MAIN=>wdctx_Adobe ).
    navigate from <ADOBE> to <Zsaleheader> via lead selection
      Node_Zsaleheader = Node_Adobe->get_Child_Node( Name = IF_MAIN=>wdctx_Zsaleheader ).
      Node_Zsaleitem = Node_Adobe->get_Child_Node( Name = IF_MAIN=>wdctx_Zsaleitem ).
    get element via lead selection
      Elem_Zsaleheader = Node_Zsaleheader->get_Element(  ).
      Elem_Zsaleitem = Node_Zsaleitem->get_Element(  ).
    get all declared attributes
      Elem_Zsaleheader->get_Static_Attributes(
        importing
          Static_Attributes = Stru_Zsaleheader ).
      header_data-DOC_TYPE = Stru_Zsaleheader-DOC_TYPE.
      header_data-SALES_ORG = Stru_Zsaleheader-SALES_ORG.
      header_data-DISTR_CHAN   = Stru_Zsaleheader-DISTR_CHAN.
      header_data-DIVISION = Stru_Zsaleheader-DIVISION.
      header_data-PURCH_NO = Stru_Zsaleheader-PURCH_NO.
      partner_wa-PARTN_ROLE   = Stru_Zsaleheader-PARTN_ROLE.
      partner_wa-PARTN_NUMB = Stru_Zsaleheader-PARTN_NUMB.
       append partner_wa to partner_data.
        Elem_Zsaleitem->get_Static_Attributes(
        importing
          Static_Attributes = Stru_Zsaleitem ).
      item_wa-ITM_NUMBER = Stru_Zsaleitem-ITM_NUMBER.
      item_wa-MATERIAL   = Stru_Zsaleitem-MATERIAL.
      item_wa-PLANT = Stru_Zsaleitem-PLANT.
      item_wa-REQ_QTY = Stru_Zsaleitem-REQ_QTY.
      item_wa-COND_TYPE   = Stru_Zsaleitem-COND_TYPE.
      item_wa-COND_VALUE = Stru_Zsaleitem-COND_VALUE.
      append item_wa to item_data.
    CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT1'
      EXPORTING
        ORDER_HEADER_IN           = header_data
      WITHOUT_COMMIT            = ' '
      CONVERT_PARVW_AUART       = ' '
    IMPORTING
       SALESDOCUMENT             = sales_order
      SOLD_TO_PARTY             =
      SHIP_TO_PARTY             =
      BILLING_PARTY             =
       RETURN                    = errorlog
      TABLES
        ORDER_ITEMS_IN            = item_data
        ORDER_PARTNERS            = partner_data
      ORDER_ITEMS_OUT           =
      ORDER_CFGS_REF            =
      ORDER_CFGS_INST           =
      ORDER_CFGS_PART_OF        =
      ORDER_CFGS_VALUE          =
      ORDER_CCARD               =
      ORDER_CFGS_BLOB           =
      ORDER_SCHEDULE_EX         =
    endmethod.
    PLEASE SUGGEST ME IF ANY CODE CHANGE IS REQUIRED
    Thanks in advance
    Ajay

    Hi,
    The item data is not read because, the dynamically added rows should also reflect back to the Web Dynpro context. When the user clicks on Add Row, use the Onsubmit event to add a empty line to internal table and then bind it to the context. And if the user removes a row, remove a row from internal table and bind it back to the context.
    You may refer this article.
    http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/802f0ed1-a17a-2c10-7db4-d515a5b047ed
    Regards,
    Runal

  • Scenario to read from txt-file and create a sales order

    Hi,
    i have started creating a scenario to read from an txt-file and to create a sales order.
    When i activate my scenario, i get the following message :
        no scenario step (vBIU) associated for this step for the incoming system (SysId)
    When i look into the detailed xml-file i see that all the records are read from the file, but there is no next step to be treated.
    Has somebody any idea how this come ?
    -<Msg MessageLog="true" msglogexcl="false" logmsg="0009" recording="true" BeginTimeStamp="20111202095144" MessageId="11120209514499820828C0A801674F24" xmlns="urn:com.sap.b1i.vplatform:entity">-<Header><msglog b1ifactive="true" always="false" step="Default message log"/>-<Resumption><starter ipo="/vP.0010000138.in_FEAN/com.sap.b1i.vplatform.runtime/INB_FI_EXST_ASYN_NAM/INB_FI_EXST_ASYN_NAM.ipo/proc"/></Resumption><IPO tid="11120205535899820808C0A801678C54" Id="INB_FI_EXST_ASYN_NAM"/><Sender Id="0010000138"/><Inbound file="ORDERS_TEST" ext="csv" path="C:\TEMP\In" pltype="txt" wrap="" deli=";"/></Header>-<Body><Payload Type="File exist" Role="T"/>-<Payload Role="S">-<io xmlns="urn:com.sap.b1i.bizprocessor:bizatoms" pltype="txt">
    -<row>
    <col>OH</col>
    <col>0000087077</col>
    <col>201110041205</col>
    <col>220</col>
    <col>9</col>
    <col>201110191702</col>
    <col>8710624300012</col>
    <col>8714252008609</col>
    <col>8710624300012</col>
    <col>8714252008609</col>
    <col>8710624300012</col>
    <col>N</col>
    <col>N</col>
    <col>N</col>
    </row>
    -<row>
    <col>OL</col>
    <col>1</col>
    <col>8711715844378</col>
    <col>20</col>
    </row>-<row>
    <col>OL</col>
    <col>2</col>
    <col>8711715844392</col>
    <col>60</col>
    </rowrow>
    <col>OL</col>
    <col>16</col>
    <col>8710251791092</col>
    <col>280</col>
    </row>
    </io>
    </Payload>
    </Body>
    </Msg>
    This is my final atom :
    <?xml version="1.0" encoding="UTF-8"?><xsl:stylesheet xmlns:b1e="urn:com.sap.b1i.sim:b1event" xmlns:b1ie="urn:com.sap.b1i.sim:b1ievent" xmlns:bfa="urn:com.sap.b1i.bizprocessor:bizatoms" xmlns:jdbc="urn:com.sap.b1i.adapter:jdbcadapter" xmlns:rfc="urn:sap-com:document:sap:rfc:functions" xmlns:sim="urn:com.sap.b1i.sim:entity" xmlns:utils2="com.sap.b1i.bpc_tools.Utilities" xmlns:vpf="urn:com.sap.b1i.vplatform:entity" xmlns:xci="urn:com.sap.b1i.xcellerator:intdoc" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" bfa:force="" vpf:force="" jdbc:force="" rfc:force="" b1ie:force="" b1e:force="" xci:force="" sim:force="" utils2:force=""><xsl:output method="xml" encoding="UTF-8" indent="yes"></xsl:output><xsl:param name="atom"></xsl:param><xsl:param name="sessionid"></xsl:param><xsl:variable name="msg" select="/vpf:Msg/vpf:Body/vpf:Payload[./@Role=&apos;S&apos;]"></xsl:variable><xsl:variable name="vpSender" select="/vpf:Msg/vpf:Header/vpf:Sender/@Id"></xsl:variable><xsl:variable name="vpObject" select="/vpf:Msg/vpf:Header/vpf:Sender/@ObjId"></xsl:variable><xsl:variable name="vpReceiver" select="/vpf:Msg/vpf:Header/vpf:ReceiverList/vpf:Receiver[./@handover=&apos;P&apos;]/@Id"></xsl:variable><xsl:template match="/">
    <Msg xmlns="urn:com.sap.b1i.vplatform:entity">
    <xsl:copy-of select="/vpf:Msg/@*"></xsl:copy-of>
    <xsl:copy-of select="/vpf:Msg/vpf:Header"></xsl:copy-of>
    <Body>
    <xsl:copy-of select="/vpf:Msg/vpf:Body/*"></xsl:copy-of>
    <Payload Role="R" id="{$atom}">
    <xsl:call-template name="transform"></xsl:call-template>
    </Payload>
    </Body>
    </Msg>
    </xsl:template><xsl:template name="transform">
    <FinalAtomResult xmlns="">
    <BOM>
    <BO>
    <AdmInfo>
    <Object>17</Object>
    <Version>2</Version>
    </AdmInfo>
         <Documents>
         <row>
         <DocDate>
              <xsl:copy-of select="$msg/io/row[0]/col[2]/text()"></xsl:copy-of>
         </DocDate>
         <DocDueDate>
              <xsl:copy-of select="$msg/io/row[0]/col[5]/text()"></xsl:copy-of>
         </DocDueDate>
         <CardCode>KD10251</CardCode>
         <NumAtCard>
              <xsl:copy-of select="$msg/io/row[0]/col[1]/text()"></xsl:copy-of>
         </NumAtCard>
         <U_PMX_JD_COMP>32</U_PMX_JD_COMP>
         </row>
                          </Documents>
         <Document_Lines>
         <xsl:for-each select="$msg/io/row">
         <row>
         <BarCode>
              <xsl:copy-of select="$msg/io/row[*]/col[2]/text()"></xsl:copy-of>
         </BarCode>
         <Quantity>
              <xsl:copy-of select="$msg/io/row[*]/col[3]/text()"></xsl:copy-of>
         </Quantity>
         </row>
         </xsl:for-each>
         </Document_Lines>

    Mike,
    you were right, you may not specify the extension of a file.
    Another thing i detected is that the loop of my data start with the index 1 instead of 0 !!!
    In this scenario, i have to read all the lines of the file and each time i should do a SQL-query,
    so that i can use the result to build my sales document.
    Do you know if it this is possible or have you any idea how to do this ?
    thx,
    Mario

  • Create a Sales Order with Reference to Contract using IDoc / LSMW  ( AFS )

    Hi Gurus,
    I need to crate a Sales Order with reference to a Contract. I need to upload Sales Orders with reference to contract via LSMW.
    So far, I've been able to create the Sales Order with ref to contract. But, the Sales Order Quantity is not getting deducted from the Original Qty in Referred Contract ( When try to create another Sales Order referring to the same Contract.) When a Sales Order is created manually, this is working fine.
    Please tell me if I've missed some parameter which stopping it create the link to exact schedule line ( Sizes level )
    The Details of the IDoc which is been created via LSMW are as follows;
    Message Type: ORDERS
    Basic Type     : /AFS/ORDERS05
    Process Code : ORDE / DELO
    ( Tried with both process codes.  But the Identification is the same for both: IDOC_INPUT_ORDERS )
    *_In Header;_
    Segment : E1EDK02  - IDoc: Document header reference data *
    Qualifier : '043' - Vendor Contract Number ( Tried with ' 005' - Customer Contract, but it's not working )
    Contract Order is mapped for field BELNR
    *_In Item;_
    Segment : E1EDP02  - IDoc: Document Item Reference Data *
    Qualifier : '043' - Vendor Contract Number ( Tried with ' 005' - Customer Contract, but it's not working )
    Contract Order is mapped to field BELNR
    Line Item of the Contract is mapped to field ZEILE
    I also tried passing the Schedule line of Contract in Segment :  E1J3P01 AFS IDoc: Doc.item general data
    to following fields;
    J_3AETENV
    J_3AVGETE
    /AFS/UETENR
    Still its not getting updated in the VBEP also..
    Please help me with regard to this. Points will be awarded for your valuable contribution.
    Thanks.

    Hi,
    This issue is been resolved.
    One of my friend helped me with resolving this issue..
    Once the below mentioned configurations were done on SPRO, the Sales Order was created with reference to Contract and the Qty was reflected when tried to create a new Order referring the same contract.;
    u2022     SPRO --> SD  -->Sales  --> Sales Documents  --> Sales Document Header  --> Define Sales Document Types  --> Field : Outline agreement message; from blank to u201CBu201D.
    u2022     SPRO  -->SD  -->Sales  --> Sales Documents  --> Sales Document Header  --> Maintain Sales Document Types for AFS  --> Field : Outline agreement message; from blank to u201CAu201D

Maybe you are looking for

  • After using VMware once, boot camp partition fails to start up

    Start up repair also failed. I just installed Windows 7 64-bit onto my brand new macbook pro using boot camp. Everything went fine, I installed the drivers and everything worked perfectly. I then installed a couple games (Maplestory and L4D) Neither

  • (Solved) Calling a different page using HTML Region as a part of other page

    Hi All, I want to open a page as a part of other page as it is done using frames in HTML. For example : <html> <head> </head> <frameset cols="30%,*"> <frame src="menu.html"> <frame src="content.html"> </frameset> </html> Now I want to use the HTML Re

  • How do I have a disclamer at the bottom of all my emails

    How do I have a disclamer at the bottom of all my emails, somthing like "Please note: Under Florida law (Fla.Stat. 668.6076 - effec. 07-01-06), e-mail addresses are public records. If you do not want your e-mail address released in response to a publ

  • SOLVED - modifying the arch .iso

    Hi all. Apologies if I'm doing something obviously wrong. I'm trying to copy EFI/BOOT/loader.efi to EFI/BOOT/boot on the downloaded arch iso. Reason for this is to boot the iso on my lennovo e71 which even with a BIOS update refuses to boot with the

  • Why aren't my second level pages showing up in nav bar

    I have been using Muse for a while and use the menu widget. On the curent site I am using the horizontal menu widget, when I added second level pages in plan view they aren't showing in the nav bar in master view. I have only added sublevel pages to