Count of Sales Orders ?

Hello Experts,
I have Salesorder, customer, period infobjects in the ODS. In the report I need to show the Period, Customer, Number of sales orders.
Wondering if this possible. Could you please suggest me the methods to acheive this.
There is one 'Count' function in the CKF, Wondering if I can use that, in what way...
Thanks in advance.
BWer
Message was edited by: BWer

Create a new key figure (type number). Under the tab Aggregation, use SUM for Aggregation, Counter (values not =0) for Exception aggre and 0DOC_NUMBER for Agg.referen.char.
In the update rules, make 'Counter = 1'
On the front-end use 'exception aggregation' in the properties of this key figure.
That will give you a count of all unique occuences of the sales orders.
Kumar Gudiseva.

Similar Messages

  • Count on sales orders

    Hi All
       My requirement is result of report should display no. of sales orders per year/ Per sales organisation/per item. Anyone can suggest me how to proceed to create such type of report in BI7.0.
    Thanks
    Vani

    Hi Vani,
      If we have counter in cube for sales orders then we can create RKF on the counter by restricting it to year, sales org & material else what we can do is we can create a ckf or new formula to create counter for sales documents give exception aggregation as counter for all detailed values and take reference characteristic as sales document then restrict this key figure to year/sales org/item.
    we can achieve our requirement by doing this.
    Hope it helps,
    Thanks,
    Sathish.

  • Count the sales order changes

    Hi Experts,
    I want to count the number of times a perticular sales order has been changed.
    For example, If I change the item quantity, then not only the quantity changes the scedulelines changes new pricing will carryout.
    This means multiple changes will be recorded in CDPOS(Change history details) table. But I want to consider the above scenario as only one change.
    Please advice.
    Thanks,
    Mohammed.

    Dear Jaleel,
    In a sales order when you go to Envrironment--> Changes, you would find change in the schedule line.
    Select that schedule line and click on ---> List on top of your screen you would find exactly what was changed and how much.
    This should help solve your problem.
    Please reward if helpful.
    Thanks
    Murtuza

  • Unallocated sales order is out of Credit management

    Dear gurus
    On credit management, if inventory is NOT allocated to sales order
    (Ex. No inventory at storage location),
    warning or error message show up even if the credit amount is
    exceeded the limitation.
    After created sales order without inventory allocation, then inventory
    is  allocated later,  and error message show up
    as delivery, because the credit amount is exceeded the limiation.
    What is the concept of SAP behind this logic?
    Why SAP doesn't count unallocated sales order to credit management?
    Y.Kaneko

    if i understand you correctly, you need to know why an order does not have a allocated stock if it is credit blocked, & why does the order goes back to credit hold when it is released & availbility check is carried out.
    from a credit management view, allocation of stock to a blocked order is not followed in business, lets take a logic example if you have 100 qty in stock & u have order for 80 qty from a customer on normal scenario you will have this order confirmed, but since he is on credit block, the confirmation for him will not happen, there is no point in reserving the stock for a credit blocked customer, if at all it happens you may not be able to confirm a new order for 70 qty for a customer who is of cash sale type.
    next order going back to credit hold after confirmation : this may be a scenario in material determination, you might have entered say $5 manually for a material & you had saved the document that will be of $5 value, once you release the order ( you will release the value as $5 against the order), now the determined material will have a condition record of $6 & hence will go for a block,( means if the manually entered price is lesser than the condition value) you will have the order going for block again.
    let me know if my understanding on your question is right
    rgds
    ilango

  • I want to give sales discounts only for the first five sales order

    The scenario is that I have to limit the sales discount to first five sales order that is executed, from the 6th the system should not allow any sales discounts

    Hi,
    If I understand your requirement correclty you want to pass discount for a particular item for a customer only for the first five sales orders irrespective of the quantity you sell on this order. As I understand this way of limiting discount by way of the count of sales orders is not possible.
    What is though possible is to limit the discount per customer or per article or per customer and article combination to either a certain fixed value of discount or limit the discount to certain fixed quantity sold for that article.
    The config required is
    Condition type  : Scale basis -Either value scale or quantity scale. Scale type -leave this blank.
    Condition record  :Chose the scale type as "B- To Scale" and at the time of condition record creation you can define your own Calculation type -either fixed amount,percentage,quantity etc.
    All the best.
    Kartik Shah

  • How to count number of sales orders generated in a month in SAP SD

    Hi SD Gurus,
    I have a very strange query from client. I have to count the number of sales order created in a month for a z report. For example 30 in Jan, 25 in Feb etc. Could anyone suggest me How to count number of sales orders generated in a month in SAP SD.
    Regards
    Vinod Kumar

    Hi,
    Goto the T.Code "SE16" or "SE16n" or "SE11".
    Enter the table name as VBAK
    Enter the created on date as the starting date of the period and to date as the end date.
    Enter.
    Click on "Number of Entries".It will tell you the number of entries created in a particular period.
    If you want a report,goto the T.Code "VA05n".
    Regards,
    Krishna.

  • How to get COUNT of  Invoice No and  Sales Order No from Multiprovider

    Hello Guys,
    I have a scenario like below. I have 2 info cubes (1) Billing Item Info cube (2) Sales Order Item Infocube which stores Item level data in infocube. I created Multiprovider for these Sales Order Item Cube and Billing Item Info cube.
    Now in My Multiprovider, Invoice No and Sales Order No gets repeated no of times because one Invoice and One order will have no of Materials. I have a requirement to count Total No of Billing Document and Total No of Sales Document for a Day in the BEx Report. I was thinking to use COUNT function but if Sales Document or Billing Document gets repeated then it will count those records which i don't want. correct me if i am wrong. 
    How to get Total no of Billing Document and Total no of Sales Document from a Multiprovider where i have Item level data is stored ?
    Regards,
    Komik Shah
    Edited by: Komik Shah on Aug 20, 2011 5:33 PM

    Hi,
    Count can be achieved as per the following document. Create for Billing Doc and Sales Doc separately.
    http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/009819ab-c96e-2910-bbb2-c85f7bdec04a
    Regards,
    Suman

  • MIE1 :: Sale order cycle count issue

    Dear All,
    II am using transaction MIE1 to create inventory documents for sales order stock. I am receiving many more items to count than expected.  I checked the cycle count indicator and materials coded to be counted only once a year and last counted in February and March in table MSKA, but still when i executer IME1 system is picking it for cycle count.
    We are on SAP 4.67. Our fiscal year ended at the end of September.
    Anyone know why these materials would show as due to count now?
    Thanks,
    Chaithru

    Hi Terry,
    To be honest there is not normally any standard manipulation of the bin sequence in Physical Inventory, but here are a few places to look here (Grab a coffee first)
    Logistics > Warehouse Management > Strategies > Define Sort Sequence for Putaway >
    Logistics > Warehouse Management > Strategies > Define Sort Sequence for Removal >
    These two items determine the sort order priorty of your bin numbers, eg. if your bin numbers are 10 digits long, you could sort the bins in order using key co-ordinates with differing priority. So the second character of your bin could be sorted prior to the first character. (The logic here will be based upon the individual warehouse layout/rules)
    Next have a look in
    Logistics > Warehouse Management > Activities > Transfers > Processing Performance > Profiles (Have a look at Sort profile)
    Logistics > Warehouse Management > Activities > Transfers > Processing Performance > Control for Performance Data Processing / Define TO Split
    In these two you can manipulate the sort order of the bin numbers in TO and other documents, can look complex but is simple when you have understood the logic
    Good luck
    Steve

  • Count sales order of customer

    Hi All,
    In Sales Order, i want a UDF with Running serial No of document.
    For example if i add 10 sales order for customer C001 then UDF should contain 11.
    I try below FMS but not working.
    Declare @Var as nvarchar(10)
    select @Var = count(T0.DocNum)  FROM ORDR T0 where cardcode = $[ORDR.CARDCODE]
    Select @Var = @var+1
    Thanks
    Shiv

    Hi ShivSen.....
    Try This.....
    select Count(T0.DocNum)+1 FROM ORDR T0 where T0.cardcode = $[$4.0.0]
    Regards,
    Rahul

  • Count Sales order stock

    Hi All
    Can anyone tell me how to count Sales Order Stock, normally we use MI31 to create inventory count document (it is IM) but I can't see any Sales Order on the count document??
    BR
    Jakob

    MI01  sp stock E
    Or
    in
    MIE1
    U can not creat by mi31

  • How to count List of open sales orders?

    HI Gurus,
    Client requ: List of no of open sales orders?
    I used T.code: VA05, given date range as desired and selected radio button as OPEN SALES ORDERS. I got huge list of sales orders with line item wise. say for example in a sales order 100 line items, in the report i got line item wise. But client wants no of open sales orders ony, not by line item wise. So I converted into XLS and did it.
    Is there any way to find out no of open sales orders thru Table. (Like sales orders created - go to SE 16 (VBAK) , you get no of sales orders created)
    Please suggest me way out to find the same.
    Thanks a lot in advance.
    Regards,
    Vamsi.

    Hi,
    I can recommend you another solution (is what I'm doing usually ...) - I'm extracting the data in Excel and here I can do anything anything I want with the data (in your case I will run a pivot table on the resulting table with the sales orders no)
    In this case (transaction VA05) option to extract data using XXL Viewer from ALV grid was deactivated; I really don't know what was the reason ...
    You can still use the second option - to use Excel In-place. For this, after running your report go to Settings -> Layouts -> Current ... (in the menu).
    Go to "View" page.
    Here select "Excel" option.
    A list of available excel templates should be displayed (if they are made available by your basis).
    Select one of them and press OK.
    If everything is OK you should see your report open directly in your GUI as Excel.
    I hope this will help you,
    Valentin

  • Sales order Counter in Cube

    Dear Experts,
    I have a scenario, where I need to load the data from ODS to Cube to maintain No of sales orders in cube with out maintaining sales doc which is available as a key in ODS.
    Is there any solution, please provide your inputs.
    Thanks in advacnce.
    Sabbani

    Thanks for your inputs...
    The data is on Ord and Item level, But the requirement is to maintain aggregated information, leaving order number and item level information but no of orders information is required.
    Eg :
    SalesOrg     SO     POS     KF1
    100     1111     10     10
    100     1111     20     20
    100     1111     30     10
    100     1111     40     5
    110     2222     10     10
    110     2222     20     20
    110     2222     30     200
    The required data in Cube is
    SalesOrg     No of SO     KF1
    100     4     45
    110     3     230
    Please provide your inputs...
    Thanks in advance
    Sabbani

  • Change sales orders from report

    Hi there,
    My report shows grid_display,
    column1 is chechbox,
    column2 is Sales Order number,
    column3 is Sales Order description. here user has to check required sales Orders and press pushbutton in appl tool bar, all these Sales Orders(i.e. checked by user) have to be opend in changemode automatically one after another, where user can change accordingly. can anybody pls sugest logic for this.
    thanks in advance.
    Zakir.

    used bapi .
    pass those data to bapi.
    ** Program ID :
    ** Program Desc :              
    ** Process Overview :          SD
    ** Created By :                P.KARTHIKEYAN
    REPORT  ZBAPI_SALESORDER_CHANGE LINE-SIZE 132 MESSAGE-ID ZMMBAPI .
           Internal table definition                                     *
    *****<<<< BAPI Sales Order>>>>>>>>>>>>>>>>>>>>>>>
    DATA: GT_SALESDOCUMENT LIKE  BAPIVBELN-VBELN,
    ******<<<<Communication Fields: SD Order Header>>>
          GT_ORDER_HEADER_IN  LIKE BAPISDH1,
    ******<<<<<Checkbox List: SD Order Header>>>>>>>>>
          GT_ORDER_HEADER_INX LIKE BAPISDH1X,
    *****<<<Return Parameter>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
         GT_RETURN LIKE BAPIRET2 OCCURS 0 WITH HEADER LINE,
    *******<<<<<<<Communication Fields: Sales and Distribution Document Item>>
         GT_ORDER_ITEM_IN LIKE BAPISDITM OCCURS 0 WITH HEADER LINE,
    *******<<<<<<<Communication Fields: Sales and Distribution Document Item>>
         GT_ORDER_ITEM_INX LIKE BAPISDITMX OCCURS 0 WITH HEADER LINE,
    *******<<<<<<<<Communication Fields for Maintaining Conditions in the Order
         GT_CONDITIONS_IN LIKE BAPICOND OCCURS 0 WITH HEADER LINE,
    *******<<<<<<<<Communication Fields for Maintaining Conditions in the Order
         GT_CONDITIONS_INX LIKE BAPICONDX OCCURS 0 WITH HEADER LINE.
       FLAT FLIE Internal table definition                                     *
    DATA: BEGIN OF GT_FT_SALES OCCURS 0,
          SALESDOCUMENT(10), "SALESDOCUMENT
          SALES_ORG(4) , "Sales Organization
          DISTR_CHAN(2), "Sales Organization
          DIVISION(2) ,  " DIVISION
          PURCH_NO_C(35)  , "Customer purchase order number
          SALES_DIST(6) , "Sales district
          INCOTERMS1(3)  ,                                      "INCOTERMS1
          PMNTTRMS(4)  , "Terms of payment key
          ITM_NUMBER(6) ,   "Sales Document Item
          PO_ITM_NO(6)  ,   "Item Number of the Underlying Purchase Order
          MATERIAL(18), "Material Number
    END OF GT_FT_SALES,
    MSG(240) TYPE  C,  " Return Message
    E_REC(8) TYPE C,    " Error Records Counter
    REC_NO(8) TYPE C, " Records Number Indicator
    S_REC(8) TYPE C,   " Successful Records Counter
    T_REC(8) TYPE C,   " Total Records Counter
    ERR_ORDER(10) TYPE C.  " Order Number Indicator
    selection block for EXCEL UPLOAD FILE>>>>>>>>>>>>>>>>>>>>>>>>
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-000.
    PARAMETERS FILE TYPE  IBIPPARMS-PATH OBLIGATORY.
    SELECTION-SCREEN END OF BLOCK B1.
    *<<<<AT SELECTION-SCREEN ON VALUE-REQUEST FOR FILE .>>>>>>>>>>>>
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR FILE .
      CALL FUNCTION 'F4_FILENAME'
        EXPORTING
          PROGRAM_NAME  = SYST-CPROG
          DYNPRO_NUMBER = SYST-DYNNR
        IMPORTING
          FILE_NAME     = FILE.
    **<<<<<<<<<<<<<<<<<START-OF-SELECTION.>>>>>>>>>>>>>>>>>>>>>>>>>>>
    START-OF-SELECTION.
      CALL FUNCTION 'WS_UPLOAD'                                 "#EC *
        EXPORTING
          FILENAME                = FILE
          FILETYPE                = 'DAT'
        TABLES
          DATA_TAB                =  GT_FT_SALES
        EXCEPTIONS
          CONVERSION_ERROR        = 1
          FILE_OPEN_ERROR         = 2
          FILE_READ_ERROR         = 3
          INVALID_TYPE            = 4
          NO_BATCH                = 5
          UNKNOWN_ERROR           = 6
          INVALID_TABLE_WIDTH     = 7
          GUI_REFUSE_FILETRANSFER = 8
          CUSTOMER_ERROR          = 9
          NO_AUTHORITY            = 10
          OTHERS                  = 11.
      IF  SY-SUBRC <> 0  .
        MESSAGE E000.
      ENDIF.
      SKIP 3.
      FORMAT COLOR COL_HEADING INVERSE ON.
      WRITE 40 TEXT-001.
      FORMAT COLOR COL_HEADING INVERSE OFF.
      SKIP 1.
      FORMAT COLOR COL_NEGATIVE INVERSE ON.
      WRITE :/ TEXT-002, 13 SY-MANDT , 104 TEXT-003, 111 SY-UNAME,
                / TEXT-004, 13 SY-DATUM , 104 TEXT-005, 111 SY-UZEIT.
      FORMAT COLOR COL_NEGATIVE INVERSE OFF.
      SKIP 3.
      LOOP AT GT_FT_SALES.
        PERFORM UPLOAD_FILE.
      ENDLOOP.
      T_REC = E_REC + S_REC.
      SKIP 3.
      FORMAT COLOR COL_TOTAL INVERSE ON.
      WRITE: /38 TEXT-007, T_REC.
      FORMAT COLOR COL_TOTAL INVERSE OFF.
      FORMAT COLOR COL_NEGATIVE INVERSE ON.
      WRITE: /38 TEXT-008, E_REC.
      FORMAT COLOR COL_NEGATIVE INVERSE OFF.
      FORMAT COLOR COL_TOTAL INVERSE ON.
      WRITE: /38 TEXT-009, S_REC.
      FORMAT COLOR COL_TOTAL INVERSE OFF.
    *&      Form  UPLOAD_FILE
          text
    -->  p1        text
    <--  p2        text
    FORM UPLOAD_FILE .
    ********<<<< BAPI Sales Order>>>>>>>>>>>>>>>>>>>>>>>
      GT_SALESDOCUMENT = GT_FT_SALES-SALESDOCUMENT . " '0000000233' "Order Number
    ******<<<<Communication Fields: SD Order Header>>>
      GT_ORDER_HEADER_IN-SALES_ORG = GT_FT_SALES-SALES_ORG .   "'0001' "Sales Organization
      GT_ORDER_HEADER_IN-DISTR_CHAN = GT_FT_SALES-DISTR_CHAN . "Distribution Channel
      GT_ORDER_HEADER_IN-DIVISION = GT_FT_SALES-DIVISION .    "Division
      GT_ORDER_HEADER_IN-PURCH_NO_C = GT_FT_SALES-PURCH_NO_C . "Customer purchase order number
      GT_ORDER_HEADER_IN-SALES_DIST = GT_FT_SALES-SALES_DIST . " Sales district
      GT_ORDER_HEADER_IN-INCOTERMS1 = GT_FT_SALES-INCOTERMS1 . "Incoterms (part 1)
      GT_ORDER_HEADER_IN-PMNTTRMS = GT_FT_SALES-PMNTTRMS .      "Terms of payment key
    ******<<<<Communication Fields: SD Order Header FLAG>>>
      GT_ORDER_HEADER_INX-UPDATEFLAG = 'U'.
      GT_ORDER_HEADER_INX-SALES_ORG = 'X'. "Sales Organization
      GT_ORDER_HEADER_INX-DISTR_CHAN = 'X'. "Distribution Channel
      GT_ORDER_HEADER_INX-DIVISION = 'X'. "Division
      GT_ORDER_HEADER_INX-PURCH_NO_C = 'X' ."Customer purchase order number
      GT_ORDER_HEADER_INX-SALES_DIST = 'X'. " Sales district
      GT_ORDER_HEADER_INX-INCOTERMS1 = 'X'."Incoterms (part 1)
      GT_ORDER_HEADER_INX-PMNTTRMS = 'X'. "Terms of payment key
    *******<<<<<<<Communication Fields: Sales and Distribution Document Item>>
      GT_ORDER_ITEM_IN-ITM_NUMBER = GT_FT_SALES-ITM_NUMBER . "'000010' "Sales Document Item
      GT_ORDER_ITEM_IN-PO_ITM_NO   = GT_FT_SALES-PO_ITM_NO .  "'PO-129' "Item Number of the Underlying Purchase Order
      GT_ORDER_ITEM_IN-MATERIAL  = GT_FT_SALES-MATERIAL . "'M-24' "Material Number
      APPEND GT_ORDER_ITEM_IN.
    *******<<<<<<<Communication Fields: Sales and Distribution Document Item>>
      GT_ORDER_ITEM_INX-UPDATEFLAG  = 'U'.
      GT_ORDER_ITEM_INX-ITM_NUMBER = '000010'. "Sales Document Item
      GT_ORDER_ITEM_INX-PO_ITM_NO   = 'X'.  "Item Number of the Underlying Purchase Order
      GT_ORDER_ITEM_INX-MATERIAL  = 'X'. "Material Number
      APPEND GT_ORDER_ITEM_INX.
    *******<<<<<<<<Communication Fields for Maintaining Conditions in the Order>>>>
      GT_CONDITIONS_IN-ITM_NUMBER = GT_FT_SALES-ITM_NUMBER . "'000010'  "Condition item number
      APPEND GT_CONDITIONS_IN.
    *******<<<<<<<<Communication Fields for Maintaining Conditions in the Order FLAG>>>
      GT_CONDITIONS_INX-ITM_NUMBER = '000010' ."Condition item number
      APPEND GT_CONDITIONS_INX.
      CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
        EXPORTING
          SALESDOCUMENT    = GT_SALESDOCUMENT
          ORDER_HEADER_IN  = GT_ORDER_HEADER_IN
          ORDER_HEADER_INX = GT_ORDER_HEADER_INX
        TABLES
          RETURN           = GT_RETURN
          ORDER_ITEM_IN    = GT_ORDER_ITEM_IN
          ORDER_ITEM_INX   = GT_ORDER_ITEM_INX
          CONDITIONS_IN    = GT_CONDITIONS_IN
          CONDITIONS_INX   = GT_CONDITIONS_INX.
      IF GT_RETURN-TYPE EQ 'E'.
        ERR_ORDER = GT_RETURN-MESSAGE_V1.
        READ TABLE GT_RETURN WITH KEY ID = 'V1'.
        E_REC = E_REC + 1.
        CONCATENATE TEXT-006 ERR_ORDER ':' GT_RETURN-MESSAGE INTO MSG SEPARATED BY SPACE .
        CONDENSE MSG.
        FORMAT COLOR COL_NEGATIVE INVERSE ON.
        WRITE / MSG  .
        FORMAT COLOR COL_NEGATIVE INVERSE OFF.
      ELSEIF GT_RETURN-TYPE EQ 'S'.
        S_REC = S_REC + 1.
        FORMAT COLOR COL_POSITIVE INVERSE ON.
        WRITE / GT_RETURN-MESSAGE .
        FORMAT COLOR COL_POSITIVE INVERSE OFF.
        CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
          EXPORTING
            WAIT   = 'X'
          IMPORTING
            RETURN = GT_RETURN.
      ENDIF.
    ENDFORM.                    " UPLOAD_FILE

  • How to change pricing Conditions in Sales order in change sales order bapi

    Hi Experts,
    How to change pricing Conditions in Sales order in change sales order bapi.
    I have used the 2 function modules bapi-changesalesorder and sd salesdocument change, But it is creating the new record , instead of changing the existing one, Could please assist regarding the same
    Thanks in Advance .
    NLN

    HI NLN
      I have just tried on my system and managed to overwrite the existing price by passing the following parameters.
      <b>Import Paramters:</b>
         SALESDOCUMENT - Sales Document Number
         ORDER_HEADER_INX - UPDATEFLAG as <b>'U'</b>.
         LOGIC_SWITCH - Import Structure - Pass 'X' to LOGIC_SWITCH-COND_HANDL.
      <b>Tables:</b>
         CONDITIONS_IN - ITM_NUMBER,
                         COND_COUNT, -> Condition counter same as KONV-ZAEHK generally it is <b>'01'</b>
                         COND_TYPE,
                         COND_VALUE,
                         CURRENCY.
         CONDITIONS_INX - ITM_NUMBER,
                          COND_COUNT,
                          COND_TYPE,
                          UPDATEFLAG as <b>'U'</b>,
                          CURRENCY.
       Hope i have clarified your query.
    Kind Regards
    Eswar

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

Maybe you are looking for

  • Compatibility of photoshop cs5.1 with yosemite

    Is anyone else having an issue opening Adobe Photoshop cs5.1 in Yosemite.  I keep on getting this message and then it quits. I have had not problems before with it.  I have tried to find any updates or comments on Adobe's website but there is nothing

  • Cracked N96 Screen, Bought Replacement, Now no Bac...

    The other day my N96 slipped out of my hand, and fell on the concrete, cracking the screen......I went on Ebay and bought a replacement screen.....I got the screen in today, took the old one out and replaced it.....Now I can see the phone turning on,

  • Problem with to_date function

    Hi everbody, please I need some help with this: I need to convert to date the result of the concatenation of several columns of a table. For example: select feriado||' '||mes||' '||ano from calendario; 1 ENERO 1997 28 MARZO 1997 4 ENERO 1997 5 ENERO

  • Oracle or MS SQL Server, EJB Models and Web Dynpro Application

    Hi I've a table in MS SQL database. I've created in Visual Admin, the datasource(jdbc/MyAlias) for the above. SQL Server has Employee Table with EmpId, FirstName, LastName and Description as its Columns. I want to display, modify , insert and delete

  • Click to show/hide content?

    Hi. Using asp/vbscript/access Can anyone explain me how I can make the function often seen in webshops, Click to view addidional content on a page, click again to hide the same info. Like a drop down, show/hide. Any? Bjørn.