Partial Sales Order Confirmation from BAPI.

Hi,
I have B2C process to create order from internet. Right now we are able to create order but problem is if it confirms parital today and partialy in future then it confirm all in future.
e.g. - I have to create order for 10 quantity.
- from VA01 if i try to create
                    it will confirm for 4 for today(as 4 quantity available) and 6 for future(say 3/11/10)
but for the same case in BAPI
- it will create order for 10 as future confirm (3/11/10)
Is there any flag i need to set in BAPI.
I use BAPI - BAPI_SALESORDER_CREATEFROMDAT2

I already seen that but I think in that we have to use : BAPI_MATERIAL_AVAILABILITY  and it will add time for the creation of order.
Please let me know is there any other option.

Similar Messages

  • Sales Order Creation from BAPI Error

    Hi Friends,
    I am using BAPI_SALESORDER_CREATEFROMDAT1 to create the Sales Order. But I am getting an error when I am executing the FM. I am filling the following Information and passing on the information to the BAPI FM. Details:
    IMPORT PARAMETERS:
        ORDER_HEADER_IN:           
                DOC_TYPE:     OR
                SALES_ORG:   BP01
                DISTR_CHAN:   01
                DIVISION:         01
                REQ_DATE_H:  29.08.2008
                PURCH_DATE:  29.08.2008
                INCOTERMS1:  FH
                INCOTERMS2:  PALO ALTO
                PMNTTRMS:     0001
                SHIP_COND:    01
                CURRENCY:    USD
    TABLES:
         ORDER_ITEMS_IN:
                 ITM_NUMBER:    10
                 MATERIAL:         XXXX-6
                 PLANT:               BP01
                 REQ_QTY:          20
                 SALES_UNIT:      EA
                 ITEM_CATEG:     AGN
                 SHORT_TEXT:     TEST MATERIAL
          ORDER_PARTNERS:
                 PARTN_ROLE:     SH
                                            PY
                                            BP
                                            SP
                 PART_NUMB:      1000
                                            1000
                                            1000
                                            1000
    By using the above information, when I am executing the FM I am getting error
    EXPORT PARAMETERS
          RETURN:
                  TYPE:         E
                  ID               AM
                  NUMBER    216
                  MESSAGE  Incomplete address; enter country
    But when I am creating it from the VA01 Transaction, I am able to create Sales Order Successfully.
    Friends, please help me in this regard.
    Yours
    Pradeep Goli
    Edited by: Pradeep Goli on Sep 8, 2008 2:56 PM

    Hi,
    I hope the below link will help you.
    Help needed with BAPI_SALESORDER_CREATEFROMDAT1 parameters
    Thanks,
    Khushboo.

  • Change only material qunatity in sales order by using BAPI

    Hi All,
    How to change only the material quantity in existing sales order by using BAPI.
    Please help me in this regards.
    Regards
    Deekshitha.

    Hi
    See the sample code and do accordingly
    REPORT Z_SALES_ORDER_CHANGE
    NO STANDARD PAGE HEADING
    LINE-SIZE 132
    LINE-COUNT 65(0)
    MESSAGE-ID ZZ.
    TABLES: VBAP.
    DATA:
    V_FILEIN(90) TYPE C,
    V_RECIN TYPE I,
    V_RECVBAP TYPE I,
    V_RECORDER TYPE I,
    V_VBELN LIKE VBAP-VBELN,
    ORDERHEADERINX LIKE BAPISDH1X.
    DATA: BEGIN OF I_ORDERS OCCURS 0,
    VBELN LIKE VBAK-VBELN,
    POSNR LIKE VBAP-POSNR,
    BRGEW(18) TYPE C,
    VOLUM(18) TYPE C,
    END OF I_ORDERS.
    DATA: BEGIN OF I_OUTPUT OCCURS 0,
    VBELN LIKE VBAK-VBELN,
    POSNR LIKE VBAP-POSNR,
    GEWEI LIKE VBAP-GEWEI,
    BRGEW LIKE VBAP-BRGEW,
    VOLUM LIKE VBAP-VOLUM,
    CKWGT TYPE C,
    CKVOL TYPE C,
    END OF I_OUTPUT.
    DATA: BEGIN OF ORDERITEMIN OCCURS 0.
    INCLUDE STRUCTURE BAPISDITM.
    DATA: END OF ORDERITEMIN.
    DATA: BEGIN OF ORDERITEMINX OCCURS 0.
    INCLUDE STRUCTURE BAPISDITMX.
    DATA: END OF ORDERITEMINX.
    DATA: BEGIN OF RETURN OCCURS 0.
    INCLUDE STRUCTURE BAPIRET2.
    DATA: END OF RETURN.
    DATA: BEGIN OF BAPIRETURN OCCURS 0.
    INCLUDE STRUCTURE BAPIRET2.
    DATA: END OF BAPIRETURN.
    PARAMETERS:
    P_PATH(45) TYPE C DEFAULT '/usr/users/ftpsapom/' LOWER CASE,
    P_FNAME(32) TYPE C DEFAULT '/sweetjo.txt' LOWER CASE.
    START-OF-SELECTION.
    CONCATENATE PATH AND FILE NAME INTO ONE VARIABLE
    CONCATENATE P_PATH P_FNAME INTO V_FILEIN.
    OPEN DATASET
    IF V_FILEIN IS INITIAL.
    MESSAGE E002 WITH 'FILE' V_FILEIN 'DOES NOT CONTAIN ANY DATA!'.
    ELSE.
    OPEN DATASET V_FILEIN
    FOR INPUT
    IN TEXT MODE.
    IF SY-SUBRC = 0.
    READ DATASET
    DO.
    READ DATASET V_FILEIN INTO I_ORDERS.
    IF SY-SUBRC = 0.
    APPEND I_ORDERS.
    ELSE.
    EXIT.
    ENDIF.
    ENDDO.
    CLOSE DATASET
    CLOSE DATASET V_FILEIN.
    IF SY-SUBRC <> 0.
    MESSAGE E002 WITH 'ERROR - CLOSING' V_FILEIN.
    ENDIF.
    ELSE.
    MESSAGE E002 WITH 'ERROR - COULD NOT OPEN' V_FILEIN.
    ENDIF.
    ENDIF.
    SORT AND REMOVE DUPLICATES FROM I_ORDERS
    SORT I_ORDERS BY VBELN POSNR.
    DELETE ADJACENT DUPLICATES FROM I_ORDERS.
    POPULATE I_OUTPUT
    LOOP AT I_ORDERS.
    SHIFT I_ORDERS-POSNR LEFT DELETING LEADING SPACE.
    CONCATENATE '0' I_ORDERS-POSNR INTO I_ORDERS-POSNR.
    SELECT SINGLE BRGEW VOLUM
    FROM VBAP
    INTO (VBAP-BRGEW, VBAP-VOLUM)
    WHERE VBELN = I_ORDERS-VBELN
    AND POSNR = I_ORDERS-POSNR.
    IF SY-SUBRC = 0.
    IF VBAP-BRGEW = 0.
    I_OUTPUT-CKWGT = 'X'.
    ENDIF.
    IF VBAP-VOLUM = 0.
    I_OUTPUT-CKVOL = 'X'.
    ENDIF.
    I_OUTPUT-VBELN = I_ORDERS-VBELN.
    I_OUTPUT-POSNR = I_ORDERS-POSNR.
    I_OUTPUT-GEWEI = 'ST'.
    I_OUTPUT-BRGEW = I_ORDERS-BRGEW.
    I_OUTPUT-VOLUM = I_ORDERS-VOLUM.
    APPEND I_OUTPUT.
    CLEAR: I_OUTPUT.
    ENDIF.
    V_RECIN = V_RECIN + 1.
    ENDLOOP.
    POPULATE BAPI DATA AND RUN BAPI
    CLEAR: ORDERHEADERINX, ORDERITEMIN, ORDERITEMINX,
    RETURN, BAPIRETURN.
    REFRESH: ORDERITEMIN, ORDERITEMINX, RETURN, BAPIRETURN.
    ORDERHEADERINX-UPDATEFLAG = 'U'.
    LOOP AT I_OUTPUT WHERE CKWGT = 'X' OR CKVOL = 'X'.
    V_RECVBAP = V_RECVBAP + 1.
    IF I_OUTPUT-VBELN <> V_VBELN AND SY-TABIX <> 1.
    V_RECORDER = V_RECORDER + 1.
    CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
    EXPORTING
    SALESDOCUMENT = V_VBELN
    ORDER_HEADER_INX = ORDERHEADERINX
    TABLES
    RETURN = RETURN
    ORDER_ITEM_IN = ORDERITEMIN
    ORDER_ITEM_INX = ORDERITEMINX.
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
    EXPORTING
    WAIT = 'X'
    IMPORTING
    RETURN = BAPIRETURN.
    WRITE OUT RETURN
    LOOP AT RETURN.
    WRITE: / RETURN.
    ENDLOOP.
    WRITE: / BAPIRETURN.
    SKIP.
    CLEAR: ORDERITEMIN, ORDERITEMINX,
    RETURN, BAPIRETURN.
    REFRESH: ORDERITEMIN, ORDERITEMINX, RETURN, BAPIRETURN.
    ENDIF.
    ORDERITEMIN-ITM_NUMBER = I_OUTPUT-POSNR.
    ORDERITEMIN-UNTOF_WGHT = I_OUTPUT-GEWEI.
    IF NOT I_OUTPUT-CKWGT IS INITIAL.
    ORDERITEMIN-GROSS_WGHT = I_OUTPUT-BRGEW.
    ORDERITEMINX-GROSS_WGHT = 'X'.
    ENDIF.
    IF NOT I_OUTPUT-CKVOL IS INITIAL.
    ORDERITEMIN-VOLUME = I_OUTPUT-VOLUM.
    ORDERITEMINX-VOLUME = 'X'.
    ENDIF.
    APPEND ORDERITEMIN.
    ORDERITEMINX-ITM_NUMBER = I_OUTPUT-POSNR.
    ORDERITEMINX-UNTOF_WGHT = 'X'.
    ORDERITEMINX-UPDATEFLAG = 'U'.
    APPEND ORDERITEMINX.
    V_VBELN = I_OUTPUT-VBELN.
    ENDLOOP.
    RUN BAPI ON LAST ORDER
    IF NOT ORDERITEMIN IS INITIAL.
    V_RECORDER = V_RECORDER + 1.
    CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
    EXPORTING
    SALESDOCUMENT = V_VBELN
    ORDER_HEADER_INX = ORDERHEADERINX
    TABLES
    RETURN = RETURN
    ORDER_ITEM_IN = ORDERITEMIN
    ORDER_ITEM_INX = ORDERITEMINX.
    CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
    EXPORTING
    WAIT = 'X'
    IMPORTING
    RETURN = BAPIRETURN.
    WRITE OUT RETURN
    LOOP AT RETURN.
    WRITE: / RETURN.
    ENDLOOP.
    WRITE: / BAPIRETURN.
    SKIP.
    ENDIF.
    WRITE OUT RECORD COUNT FROM FILE
    WRITE: / 'RECORD COUNT FROM FILE ', V_RECIN.
    SKIP.
    WRITE OUT RECORD COUNT FROM FILE
    WRITE: / 'RECORD COUNT OF LINES TO CHANGE ', V_RECVBAP.
    SKIP.
    WRITE OUT RECORD COUNT FROM FILE
    WRITE: / 'RECORD COUNT OF ORDERS TO CHANGE ', V_RECORDER.
    SKIP.
    TOP OF PAGE
    TOP-OF-PAGE.
    WRITE:/1(5) TEXT-H01, 6(8) SY-DATUM MM/DD/YY,
    100(8) TEXT-H02, 126(8) SY-PAGNO.
    WRITE:/1(5) TEXT-H03, 6(8) SY-UZEIT USING EDIT MASK '__:__:__',
    20(77) TEXT-H04,
    100(8) TEXT-H05, 108(25) SY-REPID.
    WRITE:/1(6) TEXT-H06, 8(12) SY-UNAME,
    20(4) TEXT-H07, 25(32) SY-HOST,
    100(13) TEXT-H08, 121(8) SY-SYSID,
    129 '/', 130(3) SY-MANDT.
    ULINE.
    SKIP.
    Reward points if useful
    Regards
    Anji

  • How to tigger SISCSO01 Idoc for sales order confirmation

    Hello Experts,
    I have a requirement where in I need to send the sales order confirmation as an IDoc. I need to use SISCSO01 IDoc type for that.
    Can any please tell me how to configure SAP to trigger this IDoc when ever a sales order is confirmed.
    In which T-Code is this sales order confirmation is done? and how to trigger the IDoc?
    Thanks,
    Suma

    Hi Suma,
    We need to maintan BD64 and WE20 with the Idoc SISCSO01 type. This is will automatically trigger the Idoc when we create a sales order.
    You need to matain NACE for tiggering the IDoc. For that use BA00 in output types and configure program RSNASTED, from rotine as ALE_PROCESSING. In default values give transmission medium as ALE and parter function as SP.
    Then come back to NACE-Condtion records and maintain meduim as A and date as 4.
    Please reward if helpfull.
    Thanks,
    Srikanth

  • Reena Prabhakar - Sales order creation Using BAPI

    Hi Reena,
    This is Dinesh,i also face problem in Sales order creation using BAPI if you can send me the code it would be great help to me.
    Regards,
    Dinesh

    Anyhow, here is the code that I am using currently which works perfectly well. Not sure if it will be of any help to you, since the values to the BAPI come from the Webdynpro application. I have values stored in my "Test data directory" which I use for testing from the backend.
    FUNCTION ztest.
    Call the BAPI to create Sales Order
      CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'
        EXPORTING
          order_header_in     = l_order_header
        IMPORTING
          salesdocument       = l_salesdocument
        TABLES
          return              = it_return
          order_items_in      = it_order_items
          order_partners      = it_order_partners
          order_schedules_in  = it_order_schdl
          order_conditions_in = it_order_conditions
          order_text          = it_order_text.
      READ TABLE it_return WITH KEY type = 'E'.
      IF sy-subrc = 0.
    *-- error occured
        CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
      ELSE.
    *-- no error
        CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
      ENDIF.
    ENDFUNCTION.

  • Sales order confirmation form in Adobe Forms-Urgent

    Hi Experts,
    I have to create an adobe form for Sales order Confirmation.
    I have worked on ABAP but no idea about Adobe forms. I am new for this.
    Could you please tell me what are are the things required to delelop an adobe forms
    What are the steps i have to follow to create an adobe form.
    I have to do coading in ABAP DEV Workbench or somewhere else?
    If somewhere else then in which language and where ?
    If someone has created a sales order confirmation adobe forms earlier please send me the code for reference.
    Regards,
    Nik

    Thanks again Vinod for this input. I've already had a look into the form where nothing named as 'TITLE' appear. And frankly I'm not very strong in identifying the print program for a given form. I try with debug but taking into account my poor skills in ABAP I'm lost with all those function module. And the print program that I could get from [NACE] includes so many things that I'm still not able to find out the OPEN_FORM statement. But I keep on trying.
    Regards.
    Nozome.

  • Sales order copy via BAPI

    Hi developers,
                 does anybody know if there is a bapi to copy a sales order starting from a different order?
    What I'd like to do is calling a bapi with the document number of the sales order I have to copy as input and obtain a new one identical to the first.
    Is this possible?
    Thanx to all of you and have a nice day.

    Please check in to BAPI_SALESDOCUMENT_COPY.
    Regards,
    Rich HEilman

  • Sales Order data from CRM

    Hi all,
    I want to upload Sales Order data from CRM to BW with DataSource "0CRM_SALES_ORDER_I".
    The upload fails due to missing information that are needed in the first update rule of the Sales ODS "0CRM_SALO". In this update rule some formulars on data field level are created that require this information.
    Examples of fields that are not delivered from the CRM:
    0CRMLREQSCH     L. Req. Deliv. Date
    0CRM_DLVSCH     Last Delivery Date
    0CRMPAVSCHW     MAD (Requested)
    0CRMPAVSCHC     MAD (Confirmation)
    0CRMPGISCHW     Pl. GI Date (Req.)
    0CRMPGISCHC     Pl. GI Date (Conf.)
    So what is to do? Enhance the extractor or are there alternatives.
    Cheers
    jb

    Hello jb,
      Were you able to resolve your problems with Sale Order?
          thanks,
              dmitriy.

  • BA00 - Sales Order Confirmation Output

    Hi, can anyone advise why the std 'BA00' sales order confirmation output is not proposed automatically when i changed the item category of one of the sales order line to 'TAB' 'Individual PO'?  It was there initially when the item category is 'TAN'.
    Thanks
    PP

    Dear.
    I found the confirmation status(header, item) is appeared when the item category from TAB is used.
    The confirmation status is set to 'Not yet confirmed' when automatic purchase requisiton has been created. After creating PO based on the purchase requisition the confirmation status is changed to 'All items confirmed', then the output determination will be activated.
    SAP IMG control  data for 'Maintain Output Determination Procedure', requirement 2(order confirmation) is used. Belows are source code for requirement 2.
    The variable KOMKBV1-COSTA is set 'A' when PR is created, so the ouptput determination procedure can't be executed. After PO is created the value is set to 'C', ouptput determination procedure is executed.
    Hope this will hlep.
       FORM KOBED_002.
    * If the sales document is complete, then the output should be created.
      SY-SUBRC = 0.
      IF KOMKBV1-UVALL NE 'C'.
        SY-SUBRC = 4.
        EXIT.
      ENDIF.
      IF KOMKBV1-COSTA NE SPACE AND
         KOMKBV1-COSTA NE 'C'.
        SY-SUBRC = 4.
        EXIT.
      ENDIF.
      IF NOT KOMKBV1-LIFSK IS INITIAL.
        IF KOMKBV1-LIFSK NE TVLS-LIFSP.
          SELECT SINGLE * FROM TVLS WHERE LIFSP = KOMKBV1-LIFSK.
        ENDIF.
        IF SY-SUBRC = 0 AND
           TVLS-SPEDR NE SPACE.
          SY-SUBRC = 4.
          EXIT.
        ENDIF.
      ENDIF.
    * Kein Druck, wenn Kreditsperre sitzt
    * No output if the credit block is set.
      IF   KOMKBV1-CMGST CA 'BC'.
        SY-SUBRC = 4.
        EXIT.
      ENDIF.
    ENDFORM.

  • Sales Order confirmed date in work days

    Is there a way to change configuration so a Saler Order will confirm based on the Factory Calendar??
    I created a new Order Type (VOV8) but see no option to change from calendar days to work days.
    Bascially, I need the sales order confirmation date to be based on work days and not calendar days. 
    Is this possible???

    Hi,
    Sales Order is created for particular Sales Area i.e. SO + DC + Div. And Sales Org. is the highest org unit in SD.
    At Sales Organizational level you maintain Sales Org calendar and not factory calendar.
    Factory Calendar is basically used at plant level which comes under MM module.
    So, by SAP std practice i dont think it will be possible..............
    Or you can do one thing that is,........maintain the same sales org calendar as factory calendar..........so i think it will help you....
    But can you elaborate you point so that we can understand properly.............
    regards,
    Sagar

  • Syntax for commiet  for sales order creation from VB

    syntax for commit  for sales order creation from VB.
    i have created sales order from vb using "sap bapi control" object, i am getting message too that sales order created of this number
    BUT it will not reflect in particular table or tcode?
    what should i do to commiet that sales order creation from vb while using sap bapi control.
    i have tried sap function call too,
    now how to commiet or is there any other way?
    regards,
    dushyant.

    Hi,
    Check this link, explains step by step.
    http://abaplovers.blogspot.com/2008/02/bap-sales-order-create.html
    Thanks,
    Krishna

  • Sales Order confirmation through standard IDoc in Background

    Hi all,
    I want to send Order confirmation throough standard or existing IDoc.
    Can  you please help me the steps to configure the IDoc
    and also the standard program to fill the IDoc with the data and send as background job.
    It is also the case for
    Invoice
    and Shipping
    Can you please send me the steps to  configure and standard program to fill the IDoc with data.
    Hope you would respond me ASAP.
    Thanks and Regards,
    Shalem.

    Hi,
    After the sales order has been created, an ORDRSP IDoc is automatically created using message control.  This IDoc is sent from the vendor system to the retail system, which means that the outbound IDoc can usually be found in the vendor system and the inbound IDoc in the retail system.
    SAP menu -> Tools -> Business Communication -> IDoc Basis -> WE02 –> Display IDoc.
    Before this you need to complete NACE configuration Part.
    If you want to send the IDocs automatically while creating sales order, you can configure it using message control. The process code will be SD10, which is for sales order confirmation (called as EDI 855).
    Use NACE transaction to create output/message type with program as RSNASTED and form routine as EDI_PROCESSING and configure the condition record for your partner (profile). Also configure the same in your partner profile.
    <i>Hope This Info Helps YOU.</i>
    Regards,
    Raghav

  • Sales Order uplaod from JAVA to SAP R/3

    Hi all,
    My cousin is working on uploading Sales Order Document
    from java server to R/3.
    for that he is having a code from JCO jar.
    the below is the file from which one can upload his SO details from JAVA to R/3.
    But in this program he is  just able to upload one Item detail for one Sales document.
    but requirement is to upload 'n' item details for one Sales document.
    Here is the Java code.
    @author pega
    TODO To change the template for this generated type comment go to
    Window - Preferences - Java - Code Style - Code Templates
    Created on Jun 24, 2004
    To change the template for this generated file go to
    Window>Preferences>Java>Code Generation>Code and Comments
    package com.sap.satyam.salesorder;
    import java.sql.Timestamp;
    import java.util.Calendar;
    import com.sap.mw.jco.IFunctionTemplate;
    import com.sap.mw.jco.IRepository;
    import com.sap.mw.jco.JCO;
    public class SalesOrder {
         static final String SID = "R3";
         static final String errorID = "E";
         IRepository repository;
         //String orderNumber = orderCreation("M-01","3000","0002",3,"ST");
         int counter;
         public SalesOrder()
                   try {
                        // Add a connection pool to the specified system
                        JCO.addClientPool(SID,            // Alias for this pool
                                             10,            // Max. number of connections
                                             "800",           // SAP client
                                             "develop",  // userid
                                             "bslabap", // password
                                             "EN",         // language
                                             "172.18.33.20",    // host name
                                             "00");
                        // Create a new repository
                        repository = JCO.createRepository("MYRepository", SID);
                   catch (JCO.Exception ex) {
                        System.out.println("Caught an exception: \n" + ex);
         //     Retrieves and sales order Create
         public void createSalesOrder(String PO_NO, String MAT,String RQTY,String CUSTMAT, String SOLD_NAME, String SOLD_STREET,String SOLD_COUNTRY, String SOLD_POST_CODE,String SHIP_NAME, String SHIP_STREET,String SHIP_COUNTRY, String SHIP_POST_CODE)
              try {
                   // Get a function template from the repository
                   IFunctionTemplate ftemplate = repository.getFunctionTemplate("BAPI_SALESORDER_CREATEFROMDAT1");
                   JCO.MetaData so_metadata = new JCO.MetaData("BAPI_SALESORDER_CREATEFROMDAT1");
                   // Create a function from the template
                   JCO.Function function = new JCO.Function(ftemplate);
                   // Get a client from the pool
                   JCO.Client client = JCO.getClient(SID);
                   // Fill in input parameters
                   // Header
                   JCO.ParameterList input = function.getImportParameterList();
                   JCO.ParameterList tables = function.getTableParameterList();
                   JCO.Structure input_header = input.getStructure("ORDER_HEADER_IN");
                   // Item details
                   JCO.Table table_item = tables.getTable("ORDER_ITEMS_IN");
                   //JCO.Structure input_item = table_item.getStructure("ORDER_ITEMS_IN");
                   // Partner details
                   JCO.Table table_partner = tables.getTable("ORDER_PARTNERS");
                   // Populate the header details
                   input_header.setValue("ZAD5","DOC_TYPE"); // Document Type
                   input_header.setValue("3000","SALES_ORG"); // Sales Organization
                   input_header.setValue("10","DISTR_CHAN");  // Distribution Channel
                   input_header.setValue("00","DIVISION");  // Distribution Channel
                   input_header.setValue("20041212","REQ_DATE_H");// can be changed in yyyymmdd (Requested date)
                   input_header.setValue(PO_NO,"PURCH_NO_C");// can be changed ( Customer PO Number )
                   //Populate the item detalis
                   table_item.appendRow();
                   table_item.setRow(1);
                   table_item.setValue("000010","ITM_NUMBER");
                   table_item.setValue("AA01","PO_ITM_NO");// can be changed
                   table_item.setValue("IAD-SC3000","MATERIAL");
                   table_item.setValue(CUSTMAT,"CUST_MAT");// can be changed
                   table_item.setValue("20041212","REQ_DATE");// can be changed in yyyymmdd
                   table_item.setValue(RQTY,"REQ_QTY");// can be changed Qty * 1000
                   table_item.appendRow();
                   table_item.setRow(2);
                   table_item.setValue("000020","ITM_NUMBER");
                   table_item.setValue("AA01","PO_ITM_NO");// can be changed
                   table_item.setValue("IAD-SC3000","MATERIAL");
                   table_item.setValue(CUSTMAT,"CUST_MAT");// can be changed
                  table_item.setValue("20041212","REQ_DATE");// can be changed in yyyymmdd
                   table_item.setValue(RQTY,"REQ_QTY");// can be changed Qty * 1000
                   //Populate the Partner details
                   // Sold to Party
                   table_partner.appendRow();
                   table_partner.setRow(1);
                   table_partner.setValue("AG","PARTN_ROLE");
                   //table_partner.setValue("0000002007","PARTN_NUMB");
                   table_partner.setValue("0000100067","PARTN_NUMB");
                   table_partner.setValue(SOLD_NAME,"NAME");  // can be changed
                   table_partner.setValue(SOLD_STREET,"STREET"); // can be changed
                   table_partner.setValue(SOLD_COUNTRY,"COUNTRY");
                   table_partner.setValue(SOLD_POST_CODE,"POSTL_CODE"); // can be changed
                   // Ship to party
                  table_partner.appendRow();
                   table_partner.setRow(2);
                   table_partner.setValue("WE","PARTN_ROLE");
                   table_partner.setValue("0000100067","PARTN_NUMB");
                   table_partner.setValue(SHIP_NAME,"NAME");// can be changed
                   table_partner.setValue(SHIP_STREET,"STREET"); // can be changed
                   table_partner.setValue(SHIP_COUNTRY,"COUNTRY");
                   table_partner.setValue(SHIP_POST_CODE,"POSTL_CODE");// can be changed
                   // Call the remote system
                   client.execute(function);
                   // Print return message
                   JCO.Structure ret = function.getExportParameterList().getStructure("RETURN");
                   System.out.println("BAPI_SALES_ORDER_GETLIST RETURN: " + ret.getString("MESSAGE"));
                   // Get table containing the orders
                   //JCO.Table sales_orders = function.getTableParameterList().getTable("SALES_ORDERS");
                  JCO.Field sales_order = function.getExportParameterList().getField("SALESDOCUMENT");
                   // Print results
                   String so = sales_order.getString();
                   String message = ret.getString("MESSAGE");
                   String message_type = ret.getString("TYPE");
                   if  (message_type.equalsIgnoreCase("E"))  {
                        System.out.println("Error in Sales Order Creation:" + message);
                   else{
                        System.out.println("Sales Order " + so + " Created Succesfully");
                   // Release the client into the pool
                   JCO.releaseClient(client);
              catch (Exception ex) {
                   System.out.println("Caught an exception: \n" + ex);
         //     Retrieves and sales order Create
          public void listSalesOrders()
               try {
                    // Get a function template from the repository
                    IFunctionTemplate ftemplate = repository.getFunctionTemplate("BAPI_SALESORDER_GETLIST");
                    // Create a function from the template
                    JCO.Function function = new JCO.Function(ftemplate);
                    // Get a client from the pool
                    JCO.Client client = JCO.getClient(SID);
                    // Fill in input parameters
                    JCO.ParameterList input = function.getImportParameterList();
                    //input.setValue("0000002007", "CUSTOMER_NUMBER"   );
                    input.setValue(      "3000", "SALES_ORGANIZATION");
                    //input.setValue(         "0", "TRANSACTION_GROUP" );
                    //input.setValue("PO_NUMBER_JAVA01","PURCHASE_ORDER_NUMBER");
                    // Call the remote system
                    client.execute(function);
                    // Print return message
                    JCO.Structure ret = function.getExportParameterList().getStructure("RETURN");
                    System.out.println("BAPI_SALES_ORDER_GETLIST RETURN: " + ret.getString("MESSAGE"));
                    // Get table containing the orders
                    JCO.Table sales_orders = function.getTableParameterList().getTable("SALES_ORDERS");
                    // Print results
                    if (sales_orders.getNumRows() > 0) {
                         // Loop over all rows
                         do {
                             counter++;
                              System.out.println("--" + counter + "--
                              // Loop over all columns in the current row
                              for (JCO.FieldIterator e = sales_orders.fields(); e.hasMoreElements(); ) {
                                   JCO.Field field = e.nextField();
                                   System.out.println(field.getName() + ":\t" + field.getString());
                              }//for
                         } while(sales_orders.nextRow());
                    else {
                         System.out.println("No results found");
                    }//if
                    // Release the client into the pool
                    JCO.releaseClient(client);
               catch (Exception ex) {
                    System.out.println("Caught an exception: \n" + ex);
         public static void main(String[] argv) {
              SalesOrder so = new SalesOrder();
              so.createSalesOrder("PO_NUMBER_JAVA02", "","0000000020000","121-223-2332-1231", "SOFTWARE SYSTEME GMBH-WE", "STREET-SH","US", "53125","SOFTWARE SYSTEME GMBH-WE", "STREET-SH","US", "53125");
              //so.listSalesOrders();     
    >>>>Please if any of SDN users can help in resolving this issue. It will be very helpful to my cousin.

    Before:
    //Populate the item detalis
    table_item.appendRow();
    table_item.setRow(1);
    table_item.setValue("000010","ITM_NUMBER");
    table_item.setValue("AA01","PO_ITM_NO");// can be changed
    table_item.setValue("IAD-SC3000","MATERIAL");
    table_item.setValue(CUSTMAT,"CUST_MAT");// can be changed
    table_item.setValue("20041212","REQ_DATE");// can be changed in yyyymmdd
    table_item.setValue(RQTY,"REQ_QTY");// can be changed Qty * 1000
    table_item.appendRow();
    table_item.setRow(2);
    table_item.setValue("000020","ITM_NUMBER");
    table_item.setValue("AA01","PO_ITM_NO");// can be changed
    table_item.setValue("IAD-SC3000","MATERIAL");
    table_item.setValue(CUSTMAT,"CUST_MAT");// can be changed
    table_item.setValue("20041212","REQ_DATE");// can be changed in yyyymmdd
    table_item.setValue(RQTY,"REQ_QTY");// can be changed Qty * 1000
    Try to add:
    //Populate the item detalis
    table_item.appendRow();
    table_item.setRow(2);
    table_item.setValue("000020","ITM_NUMBER");
    table_item.setValue("AA01","PO_ITM_NO");// can be changed
    table_item.setValue("IAD-SC3000","MATERIAL");
    table_item.setValue(CUSTMAT,"CUST_MAT");// can be changed
    table_item.setValue("20041212","REQ_DATE");// can be changed in yyyymmdd
    table_item.setValue(RQTY,"REQ_QTY");// can be changed Qty * 1000
    table_item.appendRow();
    table_item.setRow(2);
    table_item.setValue("000020","ITM_NUMBER");
    table_item.setValue("AA01","PO_ITM_NO");// can be changed
    table_item.setValue("IAD-SC3000","MATERIAL");
    table_item.setValue(CUSTMAT,"CUST_MAT");// can be changed
    table_item.setValue("20041212","REQ_DATE");// can be changed in yyyymmdd
    table_item.setValue(RQTY,"REQ_QTY");// can be changed Qty * 1000
    Regards.

  • Which table I can get sales order no from delivery numbar.

    Hi,
    I want sales order no from delivery no. right now I am using table VBFA where I am passing VBELN and POSNN and geting sales order no. but performance of select query is very poor bcouse I am not passing first two key fields in the select query.
    Is there any other tablefrom where we can get sales order no. from delivery no. so that performance of report can be improved.
    Thanks,

    hi,
    sales doc header ( table VBAK ) copy to Delivery header table( LIKP)
    sales doc item table ( VBAP) copy to Delivery item table( LIPS)
    you can see this in copy control VTLA ,
    now u want slaes doc no. from dilv doc. no.
    so go to t-code se11.....
    fill table LIKP u will get VBELN field for deliv doc no, & TERNR field for sales doc. no.
    so if u want to call sales doc no from dilv doc no.. u can use table LIKP in ur report.
    i hope it will help u.

  • 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.

Maybe you are looking for

  • ITunes 9.1 causes Acrobat 9 Pro to crash

    Just installed iTunes 9.1 and excited to test out the Books functionality. Transferred over a PDF to iTunes, and double-clicked it. It started to open Acrobat Pro 9 (version 9.0.0) and then quit unexpectedly. Tried to open the application itself dire

  • Error on powershell: "Requested registry access is not allowed"

    Hi! Suddenly after reboot all runbooks fail on all .net activities. I tried even an empty powershell single activity, and that too fails with: "Requested registry access is not allowed" Please help! Egils Zonde from Technet

  • Adobe Presenter, Adobe Application Manager

    1. Adobe Presenter tab is not showing in PowerPoint; Presenter add-in not found in Options/Add-ins.  2. Possibly related:  Adobe Application Manager tries to update and reports error code A12E5. How do I activate Presenter in PowerPoint?

  • COPA Costing key for actual cost component split

    Hi, I would like to allow the users to specify different period/year in the following screen every month when they do the COPA revaluation. However i noticed this screen is part of customization and cannot be changed by the users without a transport.

  • Install and Run OS 9 on External USB HD to use with my MacBook?

    For some reason I think this is an obvious answer. . . . but I can't find anything definitive on the support pages. I need to use some software that only runs in OS 9. My idea was to install OS 9.x on my USB or Firewire Hard Drive, boot from there, t