Not able to create rows in a table with dependent columns in an OAF page.

We have a table in an OAF page which has the property "Records Displayed" set as "10". Hence pagination kicks in for more than 10 rows in the table. "Add rows" is enabled in this table. The table also has 'detail' component.
In this table, we have created 2 new columns (dropdowns) using personalization. Dropdown 2 is dependent on the value selected in Dropdown1. Both are required fields.
We are able to add new rows to the table. All the columns render properly. Dropdown 2 also renders properly depending on the values selected in Dropdown1. There is no issue until we add the 10th row (remember the number of displayed records in the tabble is 10). When we add the 10th row, the fields appear properly. Dropdown1 values are displayed as expected. But when we select a value in Dropdown1, Dropdown2 does not refresh and get populated with the expected values (depending on Dropdown1 values). Dropdown2 remains blank. But this happens only when the 10th row is added. Since Dropdown2 is a required field and since Dropdown2 is not refreshed with values depending on Dropdown1, the records cannot be saved.
There seems to be a problem with refresh when the nth row is added to the table where 'n' is the Records displayed in the table (pagination).
If we change the Records Displayed to say 15 then we have the above problem when adding the 15th row. 14 rows can added to the table without an issue.
Can a workaround (other than increasing the number of displayed records) be provided for this issue?

Hi,
I suspect you have written a method having String return type but the method does not have return statement.
Go to the Catalogue component->BPM Object->Right click on the BPM object and select New Method->Give the method name. Now the method window will be opened. Go to the propertied tab of the right most panel. Set the return type as string. In the method window editor write your business logic. The below mentioned code is for sample one.
String msg = "Hello World";
return msg;
Bibhu

Similar Messages

  • Error inserting a row into a table with identity column using cfgrid on change

    I got an error on trying to insert a row into a table with identity column using cfgrid on change see below
    also i would like to use cfstoreproc instead of cfquery but which argument i need to pass and how to use it usually i use stored procedure
    update table (xxx,xxx,xxx)
    values (uu,uuu,uu)
         My component
    <!--- Edit a Media Type  --->
        <cffunction name="cfn_MediaType_Update" access="remote">
            <cfargument name="gridaction" type="string" required="yes">
            <cfargument name="gridrow" type="struct" required="yes">
            <cfargument name="gridchanged" type="struct" required="yes">
            <!--- Local variables --->
            <cfset var colname="">
            <cfset var value="">
            <!--- Process gridaction --->
            <cfswitch expression="#ARGUMENTS.gridaction#">
                <!--- Process updates --->
                <cfcase value="U">
                    <!--- Get column name and value --->
                    <cfset colname=StructKeyList(ARGUMENTS.gridchanged)>
                    <cfset value=ARGUMENTS.gridchanged[colname]>
                    <!--- Perform actual update --->
                    <cfquery datasource="#application.dsn#">
                    UPDATE SP.MediaType
                    SET #colname# = '#value#'
                    WHERE MediaTypeID = #ARGUMENTS.gridrow.MediaTypeID#
                    </cfquery>
                </cfcase>
                <!--- Process deletes --->
                <cfcase value="D">
                    <!--- Perform actual delete --->
                    <cfquery datasource="#application.dsn#">
                    update SP.MediaType
                    set Deleted=1
                    WHERE MediaTypeID = #ARGUMENTS.gridrow.MediaTypeID#
                    </cfquery>
                </cfcase>
                <cfcase value="I">
                    <!--- Get column name and value --->
                    <cfset colname=StructKeyList(ARGUMENTS.gridchanged)>
                    <cfset value=ARGUMENTS.gridchanged[colname]>
                    <!--- Perform actual update --->
                   <cfquery datasource="#application.dsn#">
                    insert into  SP.MediaType (#colname#)
                    Values ('#value#')              
                    </cfquery>
                </cfcase>
            </cfswitch>
        </cffunction>
    my table
    mediatype:
    mediatypeid primary key,identity
    mediatypename
    my code is
    <cfform method="post" name="GridExampleForm">
            <cfgrid format="html" name="grid_Tables2" pagesize="3"  selectmode="edit" width="800px" 
            delete="yes"
            insert="yes"
                  bind="cfc:sp3.testing.MediaType.cfn_MediaType_All
                                                                ({cfgridpage},{cfgridpagesize},{cfgridsortcolumn},{cfgridsortdirection})"
                  onchange="cfc:sp3.testing.MediaType.cfn_MediaType_Update({cfgridaction},
                                                {cfgridrow},
                                                {cfgridchanged})">
                <cfgridcolumn name="MediaTypeID" header="ID"  display="no"/>
                <cfgridcolumn name="MediaTypeName" header="Media Type" />
            </cfgrid>
    </cfform>
    on insert I get the following error message ajax logging error message
    http: Error invoking xxxxxxx/MediaType.cfc : Element '' is undefined in a CFML structure referenced as part of an expression.
    {"gridaction":"I","gridrow":{"MEDIATYPEID":"","MEDIATYPENAME":"uuuuuu","CFGRIDROWINDEX":4} ,"gridchanged":{}}
    Thanks

    Is this with the Travel database or another database?
    If it's another database then make sure your columns
    allow nulls. To check this in the Server Navigator, expand
    your DataSource down to the column.
    Select the column and view the Is Nullable property
    in the Property Sheet
    If still no luck, check out a tutorial, like Performing Inserts, ...
    http://developers.sun.com/prodtech/javatools/jscreator/learning/tutorials/index.jsp
    John

  • Not able to create a customer master record with US as the country code

    Hey All,
    I am not able to create customer master data in the Transaction Code XD01/FD01 with the country code as US.
    The error message for the same is *NO JURISDICTION CODE* COULD BE DETERMINED. I have checked the tax code settings but could not locate the problem.
    I have checked the field in the account group(OBD2) but tax code is in  optional status
    and also checked the country settings for US in the transaction code OY17 still the same error message,
    but when I tried checking the settings for a different company code's customer data base (us in county code)
    I can see that there is a number mentioned in the address tab under tax jurisdiction field (beside time zone) which is not populating for this company code.
    So, do anyone know where exactly we mention this number so that it populates in that field of address.
    Hope am clear.
    hope to receive a solution
    thanks & regards
    vinila

    Hi,
    You need to maintain the JURISDICTION CODE for country US. This  JURISDICTION CODE code mainatanance purely FI/CO part.. it depends on the country's tax procedures.. Better take the help from your FI/CO consultant..
    Menu path for Defining tax jurisdiction code
    IMG -- Financial accounting -- Financial accounting global settings -- tax on sales and purchases -- basic settings -- define tax jurisdiction
    reward if helps
    Muthu
    Edited by: Muthupandiyan on Mar 14, 2008 11:09 AM

  • Not able to create row in HANA via .create or ajax call (oData Services)

    Hello Experts,
    SYSTEM: AWS (Amazone Cloud with HANA SPS06), tunneling via VPN. My HANA-Studio is rev.70 with the "Kepler" addons. I´m the owner of this Schema and granted the necessary privliegues to the __SYS_REPO User.
    The following issues when I try to add a row with SAPUI5 - GUI:
    The following code are in the index.controller.js implemented and triggered by a button:
    Further to the developer guide (SAPUI5....) there is a create Statement to add rows into the Table in HANA. I tried the following:
    //Einfacher Datensatz welcher in die HANA geschrieben werden sollte:
    var oModel = new sap.ui.model.odata.ODataModel 
    ("..(censored)../BL_TI/2005/zaginfothek/Opportunities.xsodata", false);
    var oEntry = {};
    oEntry.id = 7777;
    oEntry.LfdNr=1;
    oEntry.Customer=2;
    oEntry.Thema=3;
    oEntry.Leadueber=4;
    oEntry.Owner=5;
    oEntry.MarketDeveloper=6;
    oEntry.ThemenfokusnachBL=7;
    oEntry.Industry=8;
    oEntry.PDs=9;
    oEntry.Revenue=0;
    oEntry.Probability=1;
    oEntry.ProbableRevenue=2;
    oEntry.Start=3;
    oEntry.Finish=4;
    oEntry.Duration=5;
    oEntry.Phase=6;
    oEntry.Status=7;
    oEntry.ATPDecision=8;
    oEntry.Date=9;
    oEntry.SupplyChain=0;
    oEntry.Technology=1;
    oEntry.Region=2;
    oEntry.Kontaktquelle=3;
    oEntry.CASStatus=4;
    oEntry.Angebotsnummer=5;
    oEntry.Archiv=6;
    oEntry.Angebotabgelegt=7;
    oEntry.LeadmeldunganSAP=8;
    oEntry.ArtderAnfrage=9;
    oEntry.tmstmp= "/Date(1390557603727)/";
    //Instantzierung mit Anhang Opportunities
    oModel.create('/Opportunities', oEntry, nullfunction(){
    alert("Create successful");
               },function(e){
    for (var property in e.d){
    alert(property + "=" + e.d[property] + oEntry + "failed"); 
    I get the following Errormessage:
    ERROR: 2014-03-17 12:51:52 The following problem occurred: HTTP request failed501,Not Implemented,<?xml version="1.0" encoding="utf-8" standalone="yes"?><error xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"><code/><message xml:lang="en-US">Feature not supported.</message></error> -
    After this I tried it with an ajax call:
    var aUrl = '..(censored)../BL_TI/2005/zaginfothek/Opportunities.xsodata/Opportunities';
    //all in one ajax – Statement included and tried to create the row via POST:
    jQuery.ajax({
    method:'POST',
    url: aUrl,
    data: {"id": "7778",
    "LfdNr" : "1" ,
    "Customer" : "2",
    "Thema" : "3" ,
    "Leadueber" : "4",
    "Owner" : "5",
    "MarketDeveloper" : "6",
    "ThemenfokusnachBL" : "7",
    "Industry" : "8",
    "PDs" : "9",
    "Revenue" : "0",
    "Probability" : "1",
    "ProbableRevenue" : "2",
    "Start" : "3",
    "Finish" : "4",
    "Duration" : "5",
    "Phase" : "6",
    "Status" : "7",
    "ATPDecision" : "8",
    "Date": "9",
    "SupplyChain" : "0",
    "Technology" : "1",
    "Region" : "2",
    "Kontaktquelle" : "3",
    "CASStatus" : "4",
    "Angebotsnummer" : "5",
    "Archiv" : "6",
    "Angebotabgelegt" : "7",
    "LeadmeldunganSAP" : "8",
    "ArtderAnfrage" : "9",
    "tmstmp": "/Date(1390557603727)/"
    contentType: 'application/json',
    dataType: 'json',
    success: function(e){
    alert(e.response + "success");
    error: function onErrorCall(jqXHR, textStatus, errorThrown){
    alert(jqXHR.status);
    alert(aUrl);
    sap.ui.commons.MessageBox.show(jqXHR.status,   
    "ERROR",  
    "Error in calling Service" );   
    // return;  
    The last statement with ajax send me a success message back, but there is still no row added in the HANA.
    Has anyone an idea what´s going wrong?
    I woulb be happy for any hints, thanks
    André

    Hi Ben,
    well I tried out your code and it works with an small correction of your insert:
    save: function(){
            var oData = new sap.ui.model.odata.ODataModel('...censored.../BL_TI/2005/TEST_USER/Opportunities.xsodata', true); 
            // New user panel 
    //        var pnlUser = new sap.ui.commons.Panel({text: "User-Data"}); 
    //        var tfUserId = new sap.ui.commons.TextField({placeholder: "User-Id"}); 
    //        var tfUserName = new sap.ui.commons.TextField({placeholder: "User-Name"}); 
    //        var btnSave = new sap.ui.commons.Button({text: "Save"}); 
    //        pnlUser.addContent(tfUserId).addContent(tfUserName).addContent(btnSave); 
    //        btnSave.attachPress(function() { 
            var entry = {}; 
            entry.ID = "3"; //tfUserId.getValue(); 
            entry.USERNAME = "4"; //tfUserName.getValue(); 
            oData.create('/USER', entry, null, 
                    function() { 
                alert("Create successful"); 
            function() { 
                alert("Create failed"); 
    Try to write your id instead of  3 -> "3" That was the only what I´ve changed.
    Greetz,
    André

  • Not Able to create ADF Table In the Multiple model enviorment

    Hi All
    I am not able to create ADF Table or ADF Read-only Table
    I am having following thinks in my JWS Project
    2, Model Project(Different different name)
    2,faces-config.xml(Different different name)
    1 web Project (View Controller)
    and one Databinding.cpx file
    i am using following version of jdeveloper to develop application
    ADF Business Components     10.1.3.41.57
    BPEL Designer     10.1.3.3.0 (Build 070615.0525)
    Java(TM) Platform     1.5.0_06
    Oracle IDE     10.1.3.41.57
    Struts Modeler Version     10.1.3.41.57
    UML Modelers Version     10.1.3.41.57
    Versioning Support     10.1.3.41.57

    Are you dragging from the data control? what technologies did you use for the data controls?Ans:I am using data controll as ADF BC
    Are the two faces-config.xml files in your web project?
    Ans:Yes with one name with faces-config.xml and antoher with different name

  • Not able to create new entry in RSADMIN Table

    Hi All,
            I am going thru the OSS note 1275837  (Note 1275837 - PrecServer: process based load distribution (ABAP part)), as it recommends
            add the entry "BWPREC_USE_NEW_LOAD" with value "X" in table "RSADMIN"
          When I check in SE11 and SE16 there is no option to create button for above entry in table RSADMIN.
          Please advise for any help to create above entry.
    Thanks
    Ganesh Reddy.
    Edited by: Ganesh Reddy on Jan 11, 2010 4:20 PM
       I got access key from our basis team. But still not able to create new entry as mentioned in OSS note. Any further help....
    Thanks
    Ganesh Reddy.
    Edited by: Ganesh Reddy on Jan 11, 2010 9:13 PM

    Hi
    Goto SM30 - Table Maintanance Generator and enter the table name and click on button maintain ,it will show the error message
    "The maintenance dialog for RSADMIN is incomplete or not defined" because the table maintenance is not allowed manually.
    First Option
    When you double click the error message  a performance assistant screen will open in that you can see Procedure
    "Generate the required maintenance dialog" click on that and try to maintain the table using Access Key, as i dont have access key i have not tried this option.
    Second Option
    You can write an SE38 program with an insert statement.
    TABLES rsadmin.
    DATA: wa TYPE rsadmin.
    wa-object = 'object name'.
    wa-value = 'X'.
    INSERT into rsadmin values wa.
    Thanks

  • ** Not able to create Value Mapping Table in Integration Directory

    Hi friends,
        I am not able to create value mapping entries like below in ID.
    Agency :    Computer1                Agency : Computer2
    Scheme:    Country                     Scheme: CountryCode
    Value for Computer1                   Value for Computer2
    Australia                                     AU
    India                                           IN
    Austria                                       AU
    Note that I have assigned the same country code 'AU' for the Countries 'Australia' & 'Austria'. But, when we assign 'AU' to 'Austria', the system asks question as below:
    Value mapping already exists
              Australia | AU
              Austria | AU
    Do you want to delete it from the existing group and assign it to the current group instead?
                       Continue       Cancel
    Though choose any of the option, I am not able to assign 'AU' to 'Austria'.
    Friends, this is my requirement. How do we solve this ?
    Kindly help me.
    Kind Regards,
    Jeg P.

    Hi Koen,
        I tried this. Its working fine now. Thanks for giving guidance to me. Then, I have another doubt. Suppose if we create 2 sets of VM table, (First Receiver will act as 2nd one how do we achieve this). For Ex:
    Set 1:
           Source Agency: SYS1              Target Agency: SYS2
           Source Scheme: CODE             Scheme : DEPT
             A                                            HR
             B                                            Accts
             C                                            Finance
    Set 2:
           Source Agency: SYS2              Target Agency: SYS3
           Source Scheme: DEPT             Scheme : GRADE
             HR                                             Second
             Accts                                          First
             Finance                                       First
    In this case, I followed the same logic which you said, but I am not able to create. I think the main point is GUID here. If you have any idea, kindly tell me.
    Kind Regards,
    Jegathees

  • Not Able to Create database objects(Tables, etc) in Oracle 12c

    Hello Sir,
    Recently, I have installed oracle 12c in my PC. And I am able to connect with the ANONYMOUS user and connection name ORCL.
    But I am not able to create any objects in database like tables creation, it's just showing the error message like- you don't have sufficient privileges.
    Could you please help on this? How to start the work on oracle 12c database as I have worked on Oracle 11g with the SCOTT user and connection name ORCL.It was working fine. But SCOTT user is not present in 12c. Is there any other USER in 12c with the default tables like EMP table in 11g in the SCOTT USER schema?
    Please suggest, what to do?
    Thanks In Advance!!

    Hi Nishant ,
    Thanks for the reply.
        I have done all the steps as you mentioned above. I am not able to create HR user. Please check the below errors and
    please guide me on this.
    SQL*Plus: Release 12.1.0.1.0 Production on Sat Oct 5 23:46:38 2013
    Copyright (c) 1982, 2013, Oracle.  All rights reserved.
    Enter user-name: anonymous
    Enter password:
    Last Successful login time: Sat Oct 05 2013 23:46:58 +05:30
    Connected to: Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
    SQL> connect sys as sysdba;
    Enter password:
    Connected.
    SQL> CREATE USER  hr IDENTIFIED BY Password#123
      2  DEFAULT TABLESPACE  hr_users
      3  TEMPORARY TABLESPACE  hr_temp
      4  QUOTA  5000k ON  hr_users
      5  QUOTA unlimited ON hr_temp
      6  PROFILE  enduser  ;
    CREATE USER  hr IDENTIFIED BY Password#123
    ERROR at line 1:
    ORA-65096: invalid common user or role name
    SQL> SELECT NAME, CDB FROM V$DATABASE;
    NAME      CDB
    ORCL      YES
    SQL> SHO CON_ID CON_NAME
    CON_ID
    1
    CON_NAME
    CDB$ROOT
    SQL> SET LINE 150
    SQL> SELECT NAME, OPEN_MODE, OPEN_TIME FROM V$PDBS;
    NAME                           OPEN_MODE  OPEN_TIME
    PDB$SEED                   READ ONLY  04-OCT-13 08.57.50.461 PM
    PDBORCL                        MOUNTED
    SQL> CONN HR/HR@PDBORCL
    ERROR:
    ORA-12154: TNS:could not resolve the connect identifier specified
    SQL> SHO CON_ID CON_NAME
    SP2-0640: Not connected
    SP2-0641: "SHOW CONTAINER" requires connection to server
    Thanks in advance!!
    Regards,
    Dharmendra Verma

  • Re: Not Able to Create database objects(Tables, etc) in Oracle 12c

    In addition to what Nishant said, the PDB databases are not opened by default.
    You must open them manually or create a trigger to do it.

    Hi Nishant ,
    Thanks for the reply.
        I have done all the steps as you mentioned above. I am not able to create HR user. Please check the below errors and
    please guide me on this.
    SQL*Plus: Release 12.1.0.1.0 Production on Sat Oct 5 23:46:38 2013
    Copyright (c) 1982, 2013, Oracle.  All rights reserved.
    Enter user-name: anonymous
    Enter password:
    Last Successful login time: Sat Oct 05 2013 23:46:58 +05:30
    Connected to: Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
    SQL> connect sys as sysdba;
    Enter password:
    Connected.
    SQL> CREATE USER  hr IDENTIFIED BY Password#123
      2  DEFAULT TABLESPACE  hr_users
      3  TEMPORARY TABLESPACE  hr_temp
      4  QUOTA  5000k ON  hr_users
      5  QUOTA unlimited ON hr_temp
      6  PROFILE  enduser  ;
    CREATE USER  hr IDENTIFIED BY Password#123
    ERROR at line 1:
    ORA-65096: invalid common user or role name
    SQL> SELECT NAME, CDB FROM V$DATABASE;
    NAME      CDB
    ORCL      YES
    SQL> SHO CON_ID CON_NAME
    CON_ID
    1
    CON_NAME
    CDB$ROOT
    SQL> SET LINE 150
    SQL> SELECT NAME, OPEN_MODE, OPEN_TIME FROM V$PDBS;
    NAME                           OPEN_MODE  OPEN_TIME
    PDB$SEED                   READ ONLY  04-OCT-13 08.57.50.461 PM
    PDBORCL                        MOUNTED
    SQL> CONN HR/HR@PDBORCL
    ERROR:
    ORA-12154: TNS:could not resolve the connect identifier specified
    SQL> SHO CON_ID CON_NAME
    SP2-0640: Not connected
    SP2-0641: "SHOW CONTAINER" requires connection to server
    Thanks in advance!!
    Regards,
    Dharmendra Verma

  • Not able to create a parameter of type STRING_TABLE in BOR

    Hi All,
    I want to send a table of type STRING_TABLE from webdynpro to workflow.
    I have created this table of type STRING_TABLE in webdynpro as well as in workflow successfully.
    But i am not able to create a parameter of type STRING_TABLE in BOR event as well as method.
    It is giving me error as "Data type STRING_TABLE can not be used".
    So how can i send my internal table value of STRING_TABLE type into workflow?
    Regards,
    Amar

    Hi,
    I agree Vinoth in certain aspects. It is not possibly the best idea to try to store a string table in workflow container. There are certain limitations in the container (255 characters) in certain situations and you might find yourself in problems in the future. So, consider converting the string data into some other format - OR you could also check if you can limit somehow the lenght in WDA (but of course then you will still have the same problem about the string table data type).
    If you want to try to it, you should be able to create your own table type of string. I don't remember the details but there might be something "special" about the STRING_TABLE (only available in WDA or whatever), and that's why you are seeing the error. So, try to create your own table type that has string data type as an row. Then use that.
    But as I said, you might see some problems. For example, if you try to read the container with SAP_WAPI_READ_CONTAINER, it will just return you the first 255 characters of each row, etc. There are ways to overcome these kind of problems, but just to let you know, they might not be that simple.
    Regards,
    Karri

  • Not able to create sales order  using BAPI - BAPI_SALESORDER_CREATEFROMDAT2

    Hi Experts,
    I am not able to create sales order . I am using BAPI - BAPI_SALESORDER_CREATEFROMDAT2
    to create sales order .I am passing external sales order number to the parameter
    SALESDOCUMENTIN.
    I am getting following error.
    "524   |Only quantity 1 EA is allowed (Item 00001"
    Here EA is UOM(Unit of measurement).
    Below is the sample program through which i am trying to create the sales order.
    *& Report  ZSDC_SALES_TEST
    report  zsdc_sales_test.
    *DATA: wa_bapi_header    TYPE bapisdhd1.
    Include Name    - ZSDC_SALES_ORD_UPLOAD_TOP
    Program Name    - ZSDC_SALES_ORD_UPLOAD_1393
    Program Title   - Include for Data Declaration  and selection screen
    Created by      - Lalitha W
    Created on      - 18-Nov-2008
    Object ID       - SD_C_1393_SALES_ORDER_UPLOAD
    Request Id      - SD3K905579
    Description - This is a common INCLUDE for data declarations and
    *selection screen details.
                            HISTORY
    Date    |Developer |Req by    | Description              |Reference ID
            |          |          |                          |
            |          |          |                          |
                               TYPE-POOLS
    *TYPE-POOLS: truxs, abap, slis.
                              TABLES
    *TABLES: t100.
                               TYPES
    types:begin of   ty_header,
            auart(4)    type c,    " Sales Order Type
            vkorg(4)    type c,    " Sales Organization
            vtweg(2)    type c,    " Distrubution Channel
            spart(2)    type c,    " Division
            kunnr_1(10) type c,    " Sold to Party
            kunnr_2(10) type c,    " Ship to Party
            augru(3)    type c,    " Order Reason
            bstkd(35)   type c,    " PO Number
            bstdk(10)   type c,    " PO Date
            ketdat(10)  type c,    " Required Delivery Date
            zterm(4)    type c,    " Payment Terms
            inco1(3)    type c,    " Inco Terms -1
            inco2(28)   type c,    " Inco Terms -2
            prsdt(10)   type c,    " pricing date
            waerk(5)    type c,    " Document Currency
            vkbur(4)    type c,    " Sales Office
            vkgrp(3)    type c,    " Sales group
            pltyp(2)    type c,    " Price List type
            kdgrp(2)    type c,    " Customer Group
            bstkd_e(35) type c,    " Ship-to-party PO number
            submi(10)   type c,    " Collective Number
            bname(35)   type c,    " Name
            ihrez(12)   type c,    " Your Reference
            kschl_1(4)   type c,    " Condition Type
            kbetr_1(11)  type c,    " Amount
            kschl_2(4)   type c,    " Condition Type
            kbetr_2(11)  type c,    " Amount
            kschl_3(4)   type c,    " Condition Type
            kbetr_3(11)  type c,    " Amount
           partner_1(25) TYPE c,    "  Partner(Bill To Party Number)
           partner_2(25) TYPE c,    "  Partner(Payer Number)
           partner_3(25) TYPE c,    "  Partner(Sales Responsible Number)
           partner_4(25) TYPE c,    "  Partner(Order admin)
           partner_5(25) TYPE c,    "  Partner(Contact person)
            partner_1(10) type c,    "  Partner(Bill To Party Number)
            partner_2(10) type c,    "  Partner(Payer Number)
            partner_3(10) type c,    "  Partner(Sales Responsible Number)
            partner_4(10) type c,    "  Partner(Order admin)
            partner_5(10) type c,    "  Partner(Contact person)
            tdspras_1(2)  type c,
            text_1(500)   type c,    " Text Before Items Z012
            tdspras_2(2)  type c,
            text_2(500)   type c,    " Invocie Up Z034
            tdspras_3(2)  type c,
            text_3(500)   type c,    " Invocie Down Z035
            tdspras_4(2)  type c,
            text_4(500)   type c,    " Customer Reference Continue Z018
            tdspras_5(2)  type c,
            text_5(500)   type c,    " Dispatch Marks/ Order Z019
            tdspras_6(2)  type c,
            text_6(500)   type c,    " Ordered By  Z003
            tdspras_7(2)  type c,
            text_7(500)   type c,    " Sales Parameters Z002
            kvgr1(3)      type c,    " Industry
            kvgr2(3)      type c,    " customer BU
    end of ty_header.
    types: begin of ty_item,
              bstkd(35)     type c,    " PO Number
              bstdk(10)     type c,    " PO Date
              bstkd_e(35)   type c,    " Ship-to-party PO number
              posnr(6)      type c,    " POSTION NUMBER
              matnr(18)     type c,    " Material Number
              kwmeng(18)    type c,    " Order Quantity
              pstyv(4)      type c,    " Sales doc. item categ
              kursk(18)     type c,    " EXCHANGE RATE****
              ffprf(8)      type c,    " DIP PROFILE
              werks(4)      type c,    " Delivering Plant
              vstel(4)      type c,    " SHIPPING POINT
              lgort(4)      type c,    " STORAGE LOCATION
              route(6)      type c,    " Route
              kurrf(18)     type c,    " EXCHANGE RATE-FI
              ntgew(18)     type c,    " Net Weight
              brgew(18)     type c,    " Gross Weight
              gewei(3)      type c,    " Weight Unit
              prctr(10)     type c,    " profit center
              abgrs(6)      type c,    " RESULT ANALYSIS KEY
              kalsm_k(4)    type c,    " COSTING SHEET
              kschl_1(4)    type c,    " Condition Type
              kbetr_1(11)   type c,    " Amount
              kschl_2(4)    type c,    " Condition Type
              kbetr_2(11)   type c,    " Amount
              kschl_3(4)    type c,    " Condition Type
              kbetr_3(11)   type c,    " Amount
              text_1(500)    type c,    " material Text 0001
              tdspras_1(1)   type c,
              text_2(500)    type c,    " Pr Text 9001
              tdspras_2(1)   type c,
           end of ty_item.
    types:  begin of ty_schedule_line,
             bstkd(35)       type c, "PO number
             bstdk(10)       type c, "PO date
             bstkd_e(35)     type c, "Ship-to-party PO number
             posnr(6)        type c, "sales doc.Item
             etdat(10)       type c, "Schedule line date
             wmeng(2)        type c, "Order Quantity
            end of ty_schedule_line.
    types: begin of ty_err  ,
            auart(4)    type c,    " Sales Order Type
            vkorg(4)    type c,    " Sales Organization
            vtweg(2)    type c,    " Distrubution Channel
            spart(2)    type c,    " Division
            kunnr_1(10) type c,    " Sold to Party
            kunnr_2(10) type c,    " Ship to Party
            augru(3)    type c,    " Order Reason
            bstkd(35)   type c,    " PO Number
            bstdk(10)   type c,    " PO Date
            ketdat(10)  type c,    " Required Delivery Date
            zterm(4)    type c,    " Payment Terms
            inco1(3)    type c,    " Inco Terms -1
            inco2(28)   type c,    " Inco Terms -2
            prsdt(10)   type c,    " pricing date
            waerk(5)    type c,    " Document Currency
            vkbur(2)    type c,    " Sales Office
            vkgrp(3)    type c,    " Sales group
            pltyp(2)    type c,    " Price List type
            kdgrp(2)    type c,    " Customer Group
            bstkd_e(35) type c,    " Ship-to-party PO number
            submi(10)   type c,    " Collective Number
            bname(35)   type c,    " Name
            ihrez(12)   type c,    " Your Reference
            kschl_1(4)   type c,    " Condition Type
            kbetr_1(11)  type c,    " Amount
            kschl_2(4)   type c,    " Condition Type
            kbetr_2(11)  type c,    " Amount
            kschl_3(4)   type c,    " Condition Type
            kbetr_3(11)  type c,    " Amount
            partner_1(25) type c,    "  Partner(Bill To Party Number)
            partner_2(25) type c,    "  Partner(Payer Number)
            partner_3(25) type c,    "  Partner(Sales Responsible Number)
            partner_4(25) type c,    "  Partner(Order admin)
            partner_5(25) type c,    "  Partner(Contact person)
            tdspras_1(2)  type c,
            text_1(500)   type c,    " Text Before Items Z012
            tdspras_2(2)  type c,
            text_2(500)   type c,    " Invocie Up Z034
            tdspras_3(2)  type c,
            text_3(500)   type c,    " Invocie Down Z035
            tdspras_4(2)  type c,
            text_4(500)   type c,    " Customer Reference Continue Z018
            tdspras_5(2)  type c,
            text_5(500)   type c,    " Dispatch Marks/ Order Z019
            tdspras_6(2)  type c,
            text_6(500)   type c,    " Ordered By  Z003
            tdspras_7(2)  type c,
            text_7(500)   type c,    " Sales Parameters Z002
            kvgr1(3)      type c,    " Industry
            kvgr2(3)      type c,    " customer BU
            message(600) type c,
      end of ty_err.
    types: begin of ty_t685a,
            kschl type kschl,
            krech type krech,
          end of ty_t685a.
                       INTERNAL TABLES
    ***header
    data:  g_krech_1(4)    type c,    " Calculation type for condition
           g_krech_2(4)    type c,    " Calculation type for condition
           g_krech_3(4)    type c.    " Calculation type for condition
          g_krech_4(4)    TYPE c,    " Calculation type for condition
          g_krech_5(4)    TYPE c,    " Calculation type for condition
          g_krech_6(4)    TYPE c,    " Calculation type for condition
          g_krech_7(4)    TYPE c,    " Calculation type for condition
          g_krech_8(4)    TYPE c,    " Calculation type for condition
          g_krech_9(4)    TYPE c,    " Calculation type for condition
          g_krech_10(4)   TYPE c,    " Calculation type for condition
          g_krech_11(4)   TYPE c,    " Calculation type for condition
          g_krech_12(4)   TYPE c,    " Calculation type for condition
          g_krech_13(4)   TYPE c,    " Calculation type for condition
          g_krech_14(4)   TYPE c,    " Calculation type for condition
          g_krech_15(4)   TYPE c,    " Calculation type for condition
          g_krech_16(4)   TYPE c,    " Calculation type for condition
          g_krech_17(4)   TYPE c,    " Calculation type for condition
          g_krech_18(4)   TYPE c,    " Calculation type for condition
          g_krech_19(4)   TYPE c,    " Calculation type for condition
          g_krech_20(4)   TYPE c.    " Calculation type for condition
    Items
    data:   g_krech_item_1(4)   type c,    " Calculation type for condition
            g_krech_item_2(4)   type c,    " Calculation type for condition
            g_krech_item_3(4)   type c.    " Calculation type for condition
           g_krech_item_4(4)   TYPE c,    " Calculation type for condition
           g_krech_item_5(4)   TYPE c,    " Calculation type for condition
           g_krech_item_6(4)   TYPE c,    " Calculation type for condition
           g_krech_item_7(4)   TYPE c,    " Calculation type for condition
           g_krech_item_8(4)   TYPE c,    " Calculation type for condition
           g_krech_item_9(4)   TYPE c,    " Calculation type for condition
           g_krech_item_10(4)  TYPE c,    " Calculation type for condition
           g_krech_item_11(4)  TYPE c,    " Calculation type for condition
           g_krech_item_12(4)  TYPE c,    " Calculation type for condition
           g_krech_item_13(4)  TYPE c,    " Calculation type for condition
           g_krech_item_14(4)  TYPE c,    " Calculation type for condition
           g_krech_item_15(4)  TYPE c,    " Calculation type for condition
           g_krech_item_16(4)  TYPE c.    " Calculation type for condition
    data: it_t685a  type standard table of ty_t685a.
    data: wa_bapi_header    type bapisdhd1,
         wa_bapi_headerx   TYPE bapisdhd1x,
          it_bapi_item      type table of bapisditm,
         it_bapi_itemx     TYPE TABLE OF bapisditmx,
          it_bapi_cond      type table of bapicond,
         it_bapi_condx     TYPE TABLE OF bapicondx,
          it_bapi_partner   type table of bapiparnr,
          it_bapi_shdl      type table of bapischdl,
         it_bapi_shdlx     TYPE TABLE OF bapischdlx,
         it_bapi_order_text type TABLE OF BAPISDTEXT,
          it_bapireturn     type table of bapiret2.
    data:  wa_bapi_item       like line of it_bapi_item,
          wa_bapi_itemx      LIKE LINE OF it_bapi_itemx,
           wa_bapi_cond       like line of it_bapi_cond,
          wa_bapi_condx      LIKE LINE OF it_bapi_condx,
           wa_bapi_partner    like line of it_bapi_partner,
           wa_bapi_shdl       like line of it_bapi_shdl,
          wa_bapi_shdlx      LIKE LINE OF it_bapi_shdlx,
          wa_bapi_order_text like LINE OF it_bapi_order_text,
           wa_bapireturn      like line of it_bapireturn.
    *DATA: zmode(1) VALUE 'N'.
    data: it_header      type standard table of ty_header.
    *DATA: it_temp_header TYPE STANDARD TABLE OF ty_header.
    data: it_item        type standard table of ty_item.
    *DATA: it_temp_item   TYPE STANDARD TABLE OF ty_item.
    data: it_err         type standard table of ty_err.
    data: it_fline1 type standard table of tline,
          wa_fline1 type tline.
    data: it_thead1 type thead.
    data: it_fline2 type standard table of tline,
          wa_fline2 type tline.
    data: it_thead2 type thead.
    data: it_fline3 type standard table of tline,
          wa_fline3 type tline.
    data: it_thead3 type thead.
    data: it_fline4 type standard table of tline,
          wa_fline4 type tline.
    data: it_thead4 type thead.
    data: it_fline5 type standard table of tline,
          wa_fline5 type tline.
    data: it_thead5 type thead.
    data: wa_header         like line of it_header,
          wa_item           like line of it_item,
          wa_err            type ty_err,
         wa_bill           LIKE LINE OF it_bill,
         wa_bill1          LIKE LINE OF it_bill,
          wa_iterr          like line of it_err,
          wa_t685a          like line of it_t685a.
         wa_bill_item TYPE ty_bill_item.
    data: it_schedule_line  type standard table of ty_schedule_line,
          wa_schedule_line type ty_schedule_line.
    data: sales_order_no     type bapivbeln-vbeln.
    data: ext_sales_order_no type bapivbeln-vbeln.
    Variable to be used to separate the fields which are concatenated by a
    runtime character
    *DATA: g_tabchar(1) TYPE c VALUE cl_abap_char_utilities=>horizontal_tab.
    *DATA: wa_truxs_t_text_data TYPE truxs_t_text_data.
    *DATA: g_filename      TYPE string,
         g_path          TYPE string,
         g_fullpath      TYPE string,
         g_user_action   TYPE i,
         g_file_encoding TYPE abap_encoding.
    *DATA : g_text(8192),
    data : g_mstring1(100) type c,
          g_mstring2(100) type c,
          g_mstring3(100) type c,
          g_mstring4(100) type c,
          g_mstring5(100) type c.
    data: g_count1 type ebelp,
          g_str_count1(6) type c.
    data: g_count type ebelp,
          g_str_count(6) type c.
    *DATA: f_subrc      LIKE sy-subrc,
         f_subrc1     LIKE sy-subrc,
         f_error(500) TYPE c,
         item1(27)    TYPE c,
         item2(27)    TYPE c,
         item3(27)    TYPE c,
         item4(27)    TYPE c,
         i            TYPE ekpo-ebelp.
    *DATA: g_billplan_header TYPE c,
         g_billplan_item TYPE c.
    data : g_external_so type vbak-vbeln. "SO
                          SELECTION-SCREEN
    selection-screen begin of block frame1 with frame title text-001 .
    parameters:p_file1 type rlgrap-filename, "OBLIGATORY, "Header data.
               p_file2 type rlgrap-filename, "OBLIGATORY, "Item Data.
               p_file3 type rlgrap-filename,            "Schedule line.
               p_file4 type rlgrap-filename ."OBLIGATORY. "Error file.
    selection-screen end of block frame1.
    start-of-selection.
      wa_bapi_header-doc_type     =  'Z0MX'. "order type
      wa_bapi_header-sales_org    =  '0130'."sales org
      wa_bapi_header-distr_chan   =  '13'.  "distr channel
      wa_bapi_header-division     =  '13'.  "division
    Old code from copied program
    wa_bapi_header-purch_no_s   =  wa_header-kunnr_2.  " Ship to party
    New code as required in Finland project
    We are using to Header ->Order Tab -> Ship to Party -> Purchase order no (BSTKD_E) to store Old legacy SO number
      wa_bapi_header-purch_no_s   =  'MX100443'.  "External SO i.e Old legacey SO number
      wa_bapi_header-ref_1_s      = '0000666666'. "Sold to party
    wa_bapi_header-ord_reason   =  wa_header-augru.
      wa_bapi_header-purch_no_c   =  'ddr1234'.    " PO number
      wa_bapi_header-purch_date   =  sy-datum.    " PO date
      wa_bapi_header-req_date_h   =  sy-datum.   " Required Delivery Date
      wa_bapi_header-pmnttrms     =  '01'.    " Payment Terms
    wa_bapi_header-incoterms1   =  wa_header-inco1.
    wa_bapi_header-incoterms2   =  wa_header-inco2.
    wa_bapi_header-price_date   =  wa_header-prsdt.    " Pricing date
    wa_bapi_header-currency     =  wa_header-waerk.    " Document Currency
    wa_bapi_header-sales_grp  =  wa_header-vkgrp. " Sales group
    wa_bapi_header-price_list   =  wa_header-pltyp. " Price list type
    wa_bapi_header-cust_group   =  wa_header-kdgrp.   " Cust Group
    wa_bapi_header-ship_type    =  wa_header-vsart.   " Shipping Type
    wa_bapi_header-purch_no_s   =  wa_header-bstkd_e. " Ship-to-party po number
    wa_bapi_header-collect_no   =  wa_header-submi.   " Collective No.
    wa_bapi_header-name         =  wa_header-bname.   " Name
    wa_bapi_header-ref_1        =  wa_header-ihrez.   " Your Reference
    wa_bapi_header-cust_grp1    =  wa_header-kvgr1.   " Industry
    wa_bapi_header-cust_grp2    =  wa_header-kvgr2.   " Customer BU
    *ENDFORM.                    " f_header
    IF wa_header-partner_1 IS NOT INITIAL.
        wa_bapi_partner-partn_role = 'AG'.
        wa_bapi_partner-partn_numb = '0000666666'.
        wa_bapi_partner-itm_number = '000000'.
        append wa_bapi_partner to it_bapi_partner.
        clear wa_bapi_partner.
    ENDIF.
      call function 'CONVERSION_EXIT_ALPHA_INPUT'
        exporting
          input  = wa_header-partner_2
        importing
          output = wa_header-partner_2.
    IF wa_header-partner_2 IS NOT INITIAL.
        wa_bapi_partner-partn_role = 'WE'.
        wa_bapi_partner-partn_numb = '0000666666'.
        wa_bapi_partner-itm_number = '000000'.
        append wa_bapi_partner to it_bapi_partner.
        clear wa_bapi_partner.
    ENDIF.
      perform f_item.
    data : order_items_inx type table of bapisditmx with header line.
      order_items_inx-material          = 'X'.  "
      order_items_inx-target_qty        = 'X'.  "
      order_items_inx-comp_quant        = 'X'.  "
      order_items_inx-trgqty_den        = 'X'.
      order_items_inx-rnddlv_qty        = 'X'.
    order_items_inx-updateflag = 'I'.
    order_items_inx-target_qu = 'X'.
      order_items_inx-plant             = 'X'.  "
      append order_items_inx.
      call function 'BAPI_SALESORDER_CREATEFROMDAT2'
        exporting
          salesdocumentin = 'MX11111152'
      order_header_in      = wa_bapi_header
             order_header_inx     = wa_bapi_headerx
      importing
      salesdocument        = sales_order_no
      tables
      return               = it_bapireturn
      order_items_in       = it_bapi_item
      order_items_inx      =  order_items_inx
      order_partners       = it_bapi_partner
       order_conditions_in  = it_bapi_cond.
      if sy-subrc is initial.
      commit work.
      endif.
    *&      Form  f_item
          text
    form f_item .
      call function 'CONVERSION_EXIT_ALPHA_INPUT'
        exporting
          input  = wa_item-posnr
        importing
          output = wa_item-posnr.
      wa_item-posnr = '000010'.
    IF sy-subrc EQ 0. "IS INITIAL.
      move wa_item-posnr to g_str_count."commented out by shakti
    ENDIF.
      wa_bapi_item-itm_number        =  wa_item-posnr.  " Line item
    WA_BAPI_ITEM-PO_ITM_NO         =  WA_ITEM-EBELP.
    wa_bapi_item-division          = wa_item-spart.
      wa_bapi_item-purch_no_c        = 'ddr1234'.   " po number
      wa_bapi_item-purch_date        = sy-datum.   " po date
      wa_bapi_item-purch_no_s        = 'MX11111112'. " Ship-to-party po number
      wa_item-matnr = 'MAXIMO_SERVICE'.
      call function 'CONVERSION_EXIT_MATN1_INPUT'
        exporting
          input        = wa_item-matnr
        importing
          output       = wa_item-matnr
        exceptions
          length_error = 1
          others       = 2.
      if sy-subrc is initial.
        wa_bapi_item-material        = wa_item-matnr.  "material
      endif.
      wa_bapi_item-target_qty        = '1'. " Order qty
      wa_bapi_item-comp_quant = '1'.
      wa_bapi_item-target_qu = 'EA'.
        wa_bapi_item-fixed_quan = '1'.
    wa_bapi_item-comp_quant        = wa_item-kwmeng.
    wa_bapi_item-trgqty_den        = '1'.
    wa_bapi_item-rnddlv_qty        = wa_item-kwmeng.
    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
       EXPORTING
         input  = wa_item-ps_psp_pnr
       IMPORTING
         output = wa_item-ps_psp_pnr.
    IF sy-subrc = 0.
       wa_bapi_item-wbs_elem          = wa_item-ps_psp_pnr.
    ENDIF.
      wa_bapi_item-item_categ        = 'ZMAX'.
    wa_bapi_item-ex_rate_fi        = wa_item-kurrf.
    wa_bapi_item-dli_profil        = wa_item-ffprf.   " Dynamic item processor profile
    wa_bapi_item-route             = wa_item-route.   " route
    wa_bapi_item-exchg_rate        = wa_item-kursk.
      wa_bapi_item-plant             = '2090'.   " Plant
      wa_bapi_item-ship_point        = 'FN11'.   " Shipping point
    wa_bapi_item-store_loc         = wa_item-lgort.   " stg loc
    REPLACE ALL OCCURRENCES OF  ',' IN wa_item-ntgew WITH '.'.
    REPLACE ALL OCCURRENCES OF  ',' IN wa_item-brgew WITH '.'.
    wa_bapi_item-net_weight        = wa_item-ntgew.  "
    wa_bapi_item-gross_wght        = wa_item-brgew.  "
      call function 'CONVERSION_EXIT_CUNIT_INPUT'
        exporting
          input    = wa_item-gewei
          language = sy-langu
        importing
          output   = wa_item-gewei.
       EXCEPTIONS
         unit_not_found = 1
         OTHERS         = 2.
    IF sy-subrc <> 0.
    ENDIF.
      wa_bapi_item-untof_wght        =  'KG'.  " weight unit
      replace all occurrences of  ',' in wa_item-kursk with '.'.
      replace all occurrences of  ',' in wa_item-kurrf with '.'.
    wa_bapi_item-profit_ctr        = wa_item-prctr.   " Profit center
    wa_bapi_item-resanalkey        = wa_item-abgrs.   " RESULT ANALYSIS KEY
    wa_bapi_item-cstg_sheet        = wa_item-kalsm_k. " COSTING SHEET
      append wa_bapi_item to it_bapi_item.
    endform.                    " f_item
    Thanks & regards,
    Chetan

    see the following to create sales order:-
    *& Report  ZSALESORDER
    *&DEVELOPED BY JANI KRUPA 4.10.2008
    REPORT  ZSALESORDER.
    Parameters
    Sales document type
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(20) v_text FOR FIELD p_auart.
    PARAMETERS: p_auart TYPE auart OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    Sales organization
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(20) v_text1 FOR FIELD p_vkorg.
    PARAMETERS: p_vkorg TYPE vkorg OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    Distribution channel
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(20) v_text2 FOR FIELD p_vtweg.
    PARAMETERS: p_vtweg TYPE vtweg OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    Division.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(20) v_text3 FOR FIELD p_spart.
    PARAMETERS: p_spart TYPE spart OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    SKIP 1.
    Sold-to
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(20) v_text4 FOR FIELD p_sold.
    PARAMETERS: p_sold  TYPE kunnr OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    Ship-to
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(20) v_text5 FOR FIELD p_ship.
    PARAMETERS: p_ship  TYPE kunnr OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    SKIP 1.
    Material
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(20) v_text6 FOR FIELD p_matnr.
    PARAMETERS: p_matnr TYPE matnr   OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    Quantity.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(20) v_text7 FOR FIELD p_menge.
    PARAMETERS: p_menge TYPE kwmeng  OBLIGATORY.
    SELECTION-SCREEN END OF LINE.
    Plant
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(20) v_text9 FOR FIELD p_plant.
    PARAMETERS: p_plant TYPE werks_d .
    SELECTION-SCREEN END OF LINE.
    Complete Deliver
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 2(20) v_text10 FOR FIELD p_autlf.
    PARAMETERS: p_autlf TYPE autlf DEFAULT 'X'.
    SELECTION-SCREEN END OF LINE.
    Data declarations.
    DATA: v_vbeln            LIKE vbak-vbeln.
    DATA: header             LIKE bapisdhead1.
    DATA: headerx            LIKE bapisdhead1x.
    DATA: item               LIKE bapisditem  OCCURS 0 WITH HEADER LINE.
    DATA: itemx              LIKE bapisditemx OCCURS 0 WITH HEADER LINE.
    DATA: partner            LIKE bapipartnr  OCCURS 0 WITH HEADER LINE.
    DATA: return             LIKE bapiret2    OCCURS 0 WITH HEADER LINE.
    DATA: lt_schedules_inx   TYPE STANDARD TABLE OF bapischdlx
                             WITH HEADER LINE.
    DATA: lt_schedules_in    TYPE STANDARD TABLE OF bapischdl
                             WITH HEADER LINE.
    DATA: lt_schedules_ink    TYPE STANDARD TABLE OF bapisdhead1
                             WITH HEADER LINE.
    Initialization.
    INITIALIZATION.
    v_text   = 'Order type'.
    v_text1  = 'Sales Org'.
    v_text2  = 'Distribution channel'.
    v_text3  = 'Division'.
    v_text4  = 'Sold-to'.
    v_text5  = 'Ship-to'.
    v_text6  = 'Material'.
    v_text7  = 'Quantity'.
    v_text9  = 'Plant'.
    v_text10 = 'Complete delivery'.
    Start-of-selection.
    START-OF-SELECTION.
    Header data
    Sales document type
      header-doc_type = p_auart.
      headerx-doc_type = 'X'.
    Sales organization
      header-sales_org = p_vkorg.
      headerx-sales_org = 'X'.
    Distribution channel
      header-distr_chan  = p_vtweg.
      headerx-distr_chan = 'X'.
    Division
      header-division = p_spart.
      headerx-division = 'X'.
      headerx-updateflag = 'I'.
    *Complete delivery
        header-COMPL_DLV = p_autlf.
        header-COMPL_DLV = 'X'.
    Partner data
    Sold to
      partner-partn_role = 'AG'.
      partner-partn_numb = p_sold.
      APPEND partner.
    Ship to
      partner-partn_role = 'WE'.
      partner-partn_numb = p_ship.
      APPEND partner.
    ITEM DATA
      itemx-updateflag = 'I'.
    Line item number.
      item-itm_number = '000010'.
      itemx-itm_number = 'X'.
    Material
      item-material = p_matnr.
      itemx-material = 'X'.
    Plant
      item-plant    = p_plant.
      itemx-plant   = 'X'.
    Quantity
      item-target_qty = p_menge.
      itemx-target_qty = 'X'.
    item category
      itemx-ITEM_CATEG = 'X'.
      APPEND item.
      APPEND itemx.
      ITEM DATA
      itemx-updateflag = 'I'.
    Line item number.
      item-itm_number = '000020'.
      itemx-itm_number = 'X'.
    Material
      item-material = p_matnr.
      itemx-material = 'X'.
    Plant
      item-plant    = p_plant.
      itemx-plant   = 'X'.
    Quantity
      item-target_qty = p_menge.
      itemx-target_qty = 'X'.
      APPEND item.
      APPEND itemx.
      Fill schedule lines
      lt_schedules_in-itm_number = '000010'.
      lt_schedules_in-sched_line = '0001'.
      lt_schedules_in-req_qty    = p_menge.
      APPEND lt_schedules_in.
      Fill schedule line flags
      lt_schedules_inx-itm_number  = '000010'.
      lt_schedules_inx-sched_line  = '0001'.
      lt_schedules_inx-updateflag  = 'X'.
      lt_schedules_inx-req_qty     = 'X'.
      APPEND lt_schedules_inx.
      Fill schedule lines
      lt_schedules_in-itm_number = '000020'.
      lt_schedules_in-sched_line = '0001'.
      lt_schedules_in-req_qty    = p_menge.
      APPEND lt_schedules_in.
      Fill schedule line flags
      lt_schedules_inx-itm_number  = '000020'.
      lt_schedules_inx-sched_line  = '0001'.
      lt_schedules_inx-updateflag  = 'X'.
      lt_schedules_inx-req_qty     = 'X'.
      APPEND lt_schedules_inx.
    Call the BAPI to create the sales order.
      CALL FUNCTION 'BAPI_SALESDOCU_CREATEFROMDATA1'
           EXPORTING
                sales_header_in     = header
                sales_header_inx    = headerx
           IMPORTING
                salesdocument_ex    = v_vbeln
           TABLES
                return              = return
                sales_items_in      = item
                sales_items_inx     = itemx
                sales_schedules_in  = lt_schedules_in
                sales_schedules_inx = lt_schedules_inx
                sales_partners      = partner.
    Check the return table.
      LOOP AT return WHERE type = 'E' OR type = 'A'.
        EXIT.
      ENDLOOP.
      IF sy-subrc = 0.
        WRITE: / 'Error in creating document'.
      ELSE.
    Commit the work.
        COMMIT WORK AND WAIT.
        WRITE: / 'Document ', v_vbeln, ' created'.
      ENDIF.

  • Not able to create Follow up transaction since it has been grayed out

    Hi Experts,
    We have a scenario where in we will create the Sales Transactions (OR) in ECC and then it will replicates to CRM.
    In CRM we wants to create Returns Order (RE) as a follow up Transaction to OR (which is replicated from ECC to CRM) .
    When I tried to create Returns Order (RE) in CRM as a follow up document to Sales Transaction (OR), the follow up Transaction CRM Returns (RE) has been grayed out. I mean it is in display mode only.
    And then I created Sales Transaction (OR) in CRM itself and then I tried to create follow up Returns Transaction (RE) I was able to create.
    But I am not able to Create Returns Order (RE) for the Sales Transactions (OR) that have been replicated from ECC to CRM.
    Can anybody help me in resolving this issue. Any help ful answer will be rewarded with points.
    Thanks in advance,
    -Frederick Johnson.

    Hi Fredrick,
    Please check, whether you have completed all the steps for Copying Control for Business Transactions in the following path in IMG:
    SPRO->Customer Relationship Management->Transactions->Basic Settings->Copying Control for Business Transactions:
    - Define Copying Control for Transaction Types
       In this step, you define the control for copying business transaction types.
       To do this, you enter a source tranaction type and a target transaction type, and define the corresponding conditions for this combination.
    - Define Copying Control for Item Categories
    In this step, you define the control for copying item categories.
    To do so, you enter a source item category and a target item category, and define the corresponding conditions.
    - Define Item Category Determination when Copying
    In this step, you define a specific item category determination which should be run during copying. The item category is used to find the target item category in the source transaction for the transaction type in the target transaction. This means that the transaction type for the source transaction is not relevant for the item category determination.
    If the system cannot find an entry for the copying transaction in this table, the item category is found in the target transaction using the normal item category determination.
    This might help you
    regards
    Srikantan

  • Not able to create index for organization

    in transaction ses_admin, i created an index for business object BAS_BUPA of type 1,ie individual account.
    However, i am not able to create index for BAS_BUPA of type 2
    It says "No entry in table SIC_INDEX_MAIN for index object BAS_BUPA and index 2"

    hi,
    The index is for Business Partner, so it includes both Persons and Organizations. So, only one index needs to be created for both.
    The functioning is correct, just that i missed it.

  • Not able to create EAR file for WAR file extracted project

    Hi Experts,
    I am trying to import a WAR file, make changes to the project and create an EAR file for the same. I am not able to remove import
    errors despite of adding required jar files to it.
    Also, I am not able to create an EAR file for the same.
    I have copied the steps here with screen shots. Below are the steps :
    Import WAR file in NWDS 7.3 – Enterprise Portal perspective
    Select WAR file to create WAR and EAR project for it.
      Project created with import errors.     e.g – com.sapportals.portal.prt*
    Found jar file from Class – target jar file table. 
    e.g – for Class com.sapportals.portal.prt.resource.IResource needed jar file is tc~epbc~prt~api.jar
    Copied required jar files in WEB-INF -> lib folder.
    Configure Build path and Add External jars.
    Portalapp file screen shot
    I think errors should go now, but they still exist.
    Next I right click on WAR project and tried updating related EAR project.
      Next, Export EAR file from EAR project.
       I have tried both EAR types.
    But EAR file is not created.
    Please help me in removing the errors.
    Thanks in advance :-)
    Anubha Pandey

    Hi Anubha,
    I feel that you're missing JAR dependencies and hence not able to resolve the above import errors.
    Please go through the below thread for the AFP Masthead customization and follow the same:
    How to download and change AFP Masthead on SAP Portal 7.3
    Hope, this will help!!!
    BR,
    Anurag

  • Not able to create J2EE user DDIC in portal

    Hi All,
    I am trying to configure the BI 7.0  system in EP 7.0. My systems are running on Windows 2003 32 bit edition. SP level is SPS11 & SP10
    I have configured the UME where datasource is ABAP system. After using the supportdesk tool I am getting the below three erros in the system.
    Import of Web Templates in active version will fail because the J2EE user DDIC is not properly mapped to an ABAP user other than DDIC Maintain a user mapping for J2EE user DDIC - see note 945055 for details
    Check could not be executed because retrieval of WebAS ABAP settings failed Check connectivity to WebAS ABAP and make sure the ABAP coding correction from note 937697 is applied in the latest version available
    Check could not be executed because retrieval of WebAS ABAP settings failed Check connectivity to WebAS ABAP and make sure the ABAP coding correction from note 937697 is applied in the latest version available
    To resolve these issues i tried to create user id DDIC in portal but I am not able to create it. It is giving below error
    A user with the specified logon ID already exists; choose a different, unique logon ID
    As it is trying to create this user id in ABAP datasource. Please let me know how to create DDIC in J2EE engine where ABAP is the datasource.
    Please help me resolve this issue.
    Thanks,
    Shambo

    Hi,
    In defaulttrace.trc I am getting the below errors
    #1.5#00055D4A98DC0061000004BC00001610000460FCEAE15F00#1232539295495#com.sap.ip.bi.preexecutionservices.PreexecutionservicesRfcService#sap.com/com.sap.prt.application.rfcframework#com.sap.ip.bi.preexecutionservices.PreexecutionservicesRfcService#Administrator#9873####403302b0e7b311ddbd4500055d4a98dc#SAPEngine_Application_Thread[impl:3]_27##0#0#Fatal#1#/Applications/BI#Plain###Exception caught: com.sap.ip.bi.base.exception.BIBaseRuntimeException: SAX Exception
    com.sap.ip.bi.base.exception.BIBaseRuntimeException: SAX Exception
         at com.sap.ip.bi.webapplications.runtime.preexecution.impl.PreexecutionDispatcher$DocumentAnalysis.createMutableDocument(PreexecutionDispatcher.java:93)
         at com.sap.ip.bi.webapplications.runtime.preexecution.impl.PreexecutionDispatcher.validateDocument(PreexecutionDispatcher.java:571)
         at com.sap.ip.bi.preexecutionservices.PreexecutionservicesRfcService.handleRequestForRSWR_PREEXECUTION_PROXY(PreexecutionservicesRfcService.java:109)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at com.sap.ip.bi.portalrfc.dispatcher.services.BIServicesRfcDispatcherService.handleServiceRequestGeneric(BIServicesRfcDispatcherService.java:283)
         at com.sap.ip.bi.portalrfc.dispatcher.services.BIServicesRfcDispatcherService.doHandleRequest(BIServicesRfcDispatcherService.java:177)
         at com.sap.ip.bi.portalrfc.services.BIRfcService.handleRequest(BIRfcService.java:235)
         at com.sapportals.portal.prt.service.rfc.RFCEngineService.handleEvent(RFCEngineService.java:341)
         at com.sapportals.portal.prt.service.rfc.PRTRFCBean.processFunction(PRTRFCBean.java:37)
         at com.sapportals.portal.prt.service.rfc.PRTRFCRemoteObjectImpl0_0.processFunction(PRTRFCRemoteObjectImpl0_0.java:118)
         at sun.reflect.GeneratedMethodAccessor299.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at com.sap.engine.services.ejb.session.stateless_sp5.ObjectStubProxyImpl.invoke(ObjectStubProxyImpl.java:187)
         at $Proxy119.processFunction(Unknown Source)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at com.sap.engine.services.rfcengine.RFCDefaultRequestHandler.call(RFCDefaultRequestHandler.java:284)
         at com.sap.engine.services.rfcengine.RFCDefaultRequestHandler.handleRequest(RFCDefaultRequestHandler.java:219)
         at com.sap.engine.services.rfcengine.RFCJCOServer$J2EEApplicationRunnable.run(RFCJCOServer.java:254)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
    Caused by: com.sap.engine.lib.xml.parser.NestedSAXParserException: Fatal Error: com.sap.engine.lib.xml.parser.ParserException: XMLParser: Bad attribute list. Expected WhiteSpace, / or >:(:main:, row:1, col:59)(:main:, row=1, col=59) -> com.sap.engine.lib.xml.parser.ParserException: XMLParser: Bad attribute list. Expected WhiteSpace, / or >:(:main:, row:1, col:59)
         at com.sap.engine.lib.xml.parser.DOMParser.parse(DOMParser.java:139)
         at com.sap.engine.lib.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:127)
         at com.sap.ip.bi.webapplications.runtime.preexecution.impl.PreexecutionDispatcher$DocumentAnalysis.createMutableDocument(PreexecutionDispatcher.java:85)
         ... 28 more
    Caused by: com.sap.engine.lib.xml.parser.ParserException: XMLParser: Bad attribute list. Expected WhiteSpace, / or >:(:main:, row:1, col:59)
         at com.sap.engine.lib.xml.parser.XMLParser.scanAttList(XMLParser.java:1590)
         at com.sap.engine.lib.xml.parser.XMLParser.scanElement(XMLParser.java:1710)
         at com.sap.engine.lib.xml.parser.XMLParser.scanDocument(XMLParser.java:2843)
         at com.sap.engine.lib.xml.parser.XMLParser.parse0(XMLParser.java:229)
         at com.sap.engine.lib.xml.parser.AbstractXMLParser.parseAndCatchException(AbstractXMLParser.java:145)
         at com.sap.engine.lib.xml.parser.AbstractXMLParser.parse(AbstractXMLParser.java:165)
         at com.sap.engine.lib.xml.parser.AbstractXMLParser.parse(AbstractXMLParser.java:245)
         at com.sap.engine.lib.xml.parser.Parser.parseWithoutSchemaValidationProcessing(Parser.java:280)
         at com.sap.engine.lib.xml.parser.Parser.parse(Parser.java:342)
         at com.sap.engine.lib.xml.parser.DOMParser.parse(DOMParser.java:101)
         ... 30 more
    #1.5#00055D4A98DC0061000004BF00001610000460FCEAE18738#1232539295511#com.sap.ip.bi.base.application.message.impl.MessageBase#sap.com/com.sap.prt.application.rfcframework#com.sap.ip.bi.base.application.message.impl.MessageBase#Administrator#9873####403302b0e7b311ddbd4500055d4a98dc#SAPEngine_Application_Thread[impl:3]_27##0#0#Error#1#/Applications/BI#Plain###A message was generated:
    ERROR
    Transformer exception while transforming BEx Web templates
    com.sap.ip.bi.deploytime.BISP2Jsp SAPXMLTransformer
    SAX Exception
    Transformer exception while transforming BEx Web templates
    com.sap.ip.bi.deploytime.BISP2Jsp SAPXMLTransformer
    SAX Exception#

Maybe you are looking for

  • Standard and free goods item category

    Hi I have created one standard materia XYZ. in MM01( for Sales org 1000/ Dist. channel 10/  plant 1000.) and i have assigned TAN to this . Now i also need to process XYZ as free goods in some transactions.If  I  extend this material for the same orga

  • Operation ' Modify attribute TSTATE ' could not be carried out for Petition

    Hi Experts, when try compress a infocube appear this error Operation ' Modify attribute TSTATE ' could not be carried out for Petition xxxx The petition status is green. Any idea? Enrique.

  • Volume License - Acrobat 9 pro - Launch Error

    Have Windows XP - new hard drive - Downloaded the "Download Manager"  but error message said to contact vendor to verify this is a legit download.

  • Exchange 2010 DAG's - 4 Mailbox Servers in 2 Datacenters with per site redundancy

    I recently came into a company with an Exchange 2010 sp1 environment where there are two data centers in two different subnets (10.70.62.0 and 10.80.56.0) Each datacenter has 2 mailbox servers (4 servers total) but their plan was to have only enough

  • Missing Text and Blank Menu Items

    I'm using the UK English version of Windows 8 64bit. The Creative Cloud Desktop app seems to suffer from a number of blank labels and menu items. Here's the main menu: By trial-and-error, I can find the prefences option, which presents me with this: