Problem in Creation of two Statement Obj

Hello firends,
i have a problem regarding Creating two Statement obj
its not allowing me to do
<%!
Statement stmt1;
Statement stmt1;
Connection con;
dbcon db;
%>
<%
db=new dbcon(); (its database connection class which m importing)
try
con= db.getDbCon();(method of dbcon class)
stmt1=con.createStatement();
stmt2=con.createStatement();
in above two line its giving me error
And when i use
con1= db.getDbCon();(method of dbcon class)
con2= db.getDbCon();(method of dbcon class)
stmt1=con1.createStatement();
stmt2=con2.createStatement();
then its working fine
so i know this is not the proper way to doing thing so how should i solve this problem
plz help me
}catch(SQLException)
}

Thanaks for reply but my that problem is solved,i would like to ask u
i have following simple code
<%@ page import="java.sql.*,com.example.model.*" session="true" %>
<%!
ResultSet rs;
Statement stmt;
Connection con;
%>
<%
dbcon cn=new dbcon();
          con=cn.connectdb();
          try
stmt=con.createStatement();
rs=stmt.executeQuery("select mf_id,mf_lr_id,mf_origin,mf_destination from Manifest");
if(rs.next())
out.println(rs.getInt("mf_id")+"<br/>");
out.println(rs.getInt("mf_lr_id")+"<br/>");
out.println(rs.getInt("mf_destination")+"<br/>");
out.println(rs.getInt("mf_origin")+"<br/>");
}catch(SQLException se)
out.println(se);
}finally
try
if(rs!=null)
rs.close();
if(stmt!=null)
stmt.close();
if(con!=null)
con.close();
}catch(SQLException se1)
%>
in this code m just fetching "mf_destination" field before "mf_origin"
thien its giving Error Msg
89
58
14 java.sql.SQLException: [Microsoft][ODBC SQL Server Driver]Invalid Descriptor Index
and suppose i fetch it in sequence as define in select stmt then its working fine.
so this sequence i can maintain in small data but if i use
Select * from ........
then should i fetch all data as its sequence in database Table

Similar Messages

  • Problem in creation of HUs through FM HU_REPACK and HU_POST

    Hi Experts
    This is regarding the problem in creation of HUs with function modules HU_REPACK and HU_POST.
    I am sending two Unique Sources HUs with single destination HU for the same material and batch into HU_REPACK and it shows that it is successfully repacked and soon as the HU_REPACK function module passess I have called HU_POST without any parameters except messages..As the data will be picked up auomatically from the internal memory as these function module are related same function group.
    Even the HU_POST FM passes successfully and also it creates a Transfer order but the problem is that THe HU is created with the MULTIPLE LINE ITEMS for the same material and Batch which should not be done at all .
    Please find the example of the HU created in the system
    0 10020000038479 S-DISP 1 EA S DISPNSARY
    1 0024632192 000004 810062 0.250 KG L0533A4172 Lactose
    1 0024632192 000004 810062 24.900 KG L0533A4172 Lactose
    Material is 810062
    Batch is L0533A4172
    Can you please assist me how to acheive single line item HU when we are trying to repack the data for same material and batch as it does while you create the HU through Manual processing i.e HU02 etc

    Hi Sailaja,
    I have similar requirements like this before with HU_PACKING_AND_UNPACKING FM. It was a tough debugging before I came up with the right solution. Unfortunately, I was not able to document that code..
    But here is what I have been doing.
    Youre on track with the solution below, never use BDC as it will only limit the Handling units that you wish to put into.
    The function modules that starts with V5_ plays important role as you need to initialize the global variables and table of this function group with values before calling HU_PACKING_AND_UNPACKING FM
    Debug inside the Function module, and look for the FM that returns SY-SUBRC <> 0 then set a breakpoint.
    Restart the program then debug inside that FM again (and I do not want to go further on the details, I give you the presumption of literacy)
    You will find some items that has no value, try to initialize everything by utilizing the FM for this function group V51S.
    Happy Debugging.

  • Problem in Creation of Handling Units through HU_REPACK and HU_POST FM

    Hi Experts
            This is regarding the problem in creation of HUs with function modules HU_REPACK and HU_POST.
    I am sending two Unique Sources HUs  with single destination HU for the same material and batch into HU_REPACK  and it shows that it is successfully repacked and soon as the HU_REPACK function module passess I have called HU_POST without any parameters except messages..As the data will be picked up auomatically from the internal memory as these function module are related same function group.
      Even the HU_POST FM passes successfully and also it creates a Transfer order but the problem is that THe HU is created with the MULTIPLE LINE ITEMS for the same material and Batch which should not be done at all .
    Please find the example of the HU created in the system
        0     10020000038479     S-DISP     1     EA          S DISPNSARY
        1     0024632192 000004     810062     0.250     KG     L0533A4172     Lactose
        1     0024632192 000004     810062     24.900     KG     L0533A4172     Lactose
    Material is 810062
    Batch    is L0533A4172
    Can you please assist me how to acheive single line item HU  when we are trying to repack the data for  same material and batch as it does while you create the HU through Manual processing i.e HU02 etc

    *

  • Problems with explain plan and statement

    Hi community,
    I have migrated a j2ee application from DB2 to Oracle.
    First some facts of our application and database instance:
    We are using oracle version 10.2.0.3 and driver version 10.2.0.3. It runs with charset Unicode 3.0 UTF-8.
    Our application is using Tomcat as web container and jboss as application server. We are only using prepared statements. So if I talk about statements I always mean prepared statements. Also our application is setting the defaultNChar property to true because every char and varchar field has been created as an nchar and nvarchar.
    We have some jsp sites that contains lists with search forms. Everytime I enter a value to the form that returns a filled resultset, the lists are performing great. But everytime I enter a value that returns an empty resultset, the lists are 100 times slower. The jsp sites are running in the tomcat environment and submitting their statements directly to the database. The connections are pooled by dbcp. So what can cause this behaviour??
    To anaylze this problem I started logging all statements and filled-in search field values and combinations that are executed by the lists described above. I also developed a standalone helper tool that reads the logged statements, executes them to the database and generates an explain plan for every statement. But now there appears a strange situation. Every statement, that performs really fast within our application, is now executed by the helper tool extremely slow. So I edited some jsp pages within our application to force an explain plan from there (tomcat env). So when I'm executing the same statement I'm getting with the exactly same code two completely different explain plans.
    First the statement itself:
    select LINVIN.BBASE , INVINNUM , INVINNUMALT , LINVIN.LSUPPLIERNUM , LSUPPLIERNUMEXT , LINVIN.COMPANYCODE , ACCOUNT , INVINTXT , INVINSTS , INVINTYP , INVINDAT , RECEIPTDAT , POSTED , POSTINGDATE , CHECKCOSTCENTER , WORKFLOWIDEXT , INVINREFERENCE , RESPONSIBLEPERS , INVINSUM_V , INVINSUMGROSS_V , VOUCHERNUM , HASPOSITIONS , PROCESSINSTANCEID , FCURISO_V , LSUPPLIER.AADDRLINE1 from LINVIN, LSUPPLIER where LINVIN.BBASE = LSUPPLIER.BBASE and LINVIN.LSUPPLIERNUM = LSUPPLIER.LSUPPLIERNUM and LINVIN.BBASE = ? order by LINVIN.BBASE, INVINDAT DESC
    Now the explain plan from our application:
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
    | 0 | SELECT STATEMENT | | 101 | 28583 | 55 (0)| 00:00:01 |
    | 1 | NESTED LOOPS | | 101 | 28583 | 55 (0)| 00:00:01 |
    | 2 | TABLE ACCESS BY INDEX ROWID| LINVIN | 93709 | 12M| 25 (0)| 00:00:01 |
    |* 3 | INDEX RANGE SCAN | LINV_INVDAT | 101 | | 1 (0)| 00:00:01 |
    | 4 | TABLE ACCESS BY INDEX ROWID| LSUPPLIER | 1 | 148 | 1 (0)| 00:00:01 |
    |* 5 | INDEX UNIQUE SCAN | PK_177597 | 1 | | 1 (0)| 00:00:01 |
    Predicate Information (identified by operation id):
    3 - access("LINVIN"."BBASE"=:1)
    filter("LINVIN"."BBASE"=:1)
    5 - access("LSUPPLIER"."BBASE"=:1 AND "LINVIN"."LSUPPLIERNUM"="LSUPPLIER"."LSUPPLIERNUM")
    Now the one from the standalone tool:
    | Id | Operation | Name | Rows | Bytes |TempSpc| Cost (%CPU)| Time |
    | 0 | SELECT STATEMENT | | 93773 | 25M| | 12898 (1)| 00:02:35 |
    | 1 | SORT ORDER BY | | 93773 | 25M| 61M| 12898 (1)| 00:02:35 |
    |* 2 | HASH JOIN | | 93773 | 25M| 2592K| 7185 (1)| 00:01:27 |
    | 3 | TABLE ACCESS BY INDEX ROWID| LSUPPLIER | 16540 | 2390K| | 332 (0)| 00:00:04 |
    |* 4 | INDEX RANGE SCAN | LSUPPLIER_HAS_BASE_FK | 16540 | | | 11 (0)| 00:00:01 |
    | 5 | TABLE ACCESS BY INDEX ROWID| LINVIN | 93709 | 12M| | 6073 (1)| 00:01:13 |
    |* 6 | INDEX RANGE SCAN | LINVOICE_BMDT_FK | 93709 | | | 84 (2)| 00:00:02 |
    Predicate Information (identified by operation id):
    2 - access("LINVIN"."BBASE"="LSUPPLIER"."BBASE" AND "LINVIN"."LSUPPLIERNUM"="LSUPPLIER"."LSUPPLIERNUM")
    4 - access("LSUPPLIER"."BBASE"=:1)
    6 - access("LINVIN"."BBASE"=:1)
    The size of the tables are: LINVIN - 383.692 Rows, LSUPPLIER - 115.782 Rows
    As you can see the one executed from our application is much faster than the one from the helper tool. So why picks oracle a completely different explain plan for the same statement? An why is a hash join much slower than a nested loop? Because If I'm right a nested loop should only be used when the tables are pretty small..
    I also tried to play with some parameters:
    I set optimizer_index_caching to 100 and optimizer_index_cost_adj to 30. I also changed optimizer_mode to FIRST_ROWS_100.
    I would really appreciated, if somebody can help me with this issue, because I'm really getting more and more distressed...
    Thanks in advance,
    Tobias
    Edited by: tobiwan on Sep 3, 2008 11:49 PM
    Edited by: tobiwan on Sep 3, 2008 11:50 PM
    Edited by: tobiwan on Sep 4, 2008 12:01 AM
    Edited by: tobiwan on Sep 4, 2008 12:02 AM
    Edited by: tobiwan on Sep 4, 2008 12:04 AM
    Edited by: tobiwan on Sep 4, 2008 12:06 AM
    Edited by: tobiwan on Sep 4, 2008 12:06 AM
    Edited by: tobiwan on Sep 4, 2008 12:07 AM

    tobiwan wrote:
    Hi again,
    Here ist the answer:
    The problem, because I got two different explain plans, was that the external tool uses the NLS sesssion parameters coming from the OS which are in my case "de/DE".
    Within our application these parameters are changed to "en/US"!! So if I'm calling in my external tool the java function Locale.setDefault(new Locale("en","US")) before connecting to the database the explain plans are finally equal.That might explain why you got two different execution plan, because one plan was obviously able to avoid a SORT ORDER BY operation, whereas the second plan required to run SORT ORDER BY operation, obviously because of the different NLS_SORT settings. An index by default uses the NLS_SORT = 'binary' order whereas ORDER BY obeys the NLS_SORT setting, which probably was set to 'GERMAN' in your "external tool" case. You can check the "NLS_SESSION_PARAMETERS" view to check your current NLS_SORT setting.
    For more information regarding this issue, see my blog note I've written about this some time ago:
    http://oracle-randolf.blogspot.com/2008/09/getting-first-rows-of-large-sorted.html
    Now let me make a guess why you observe the behaviour that it takes so long if your result set is empty:
    The plan avoiding the SORT ORDER BY is able to return the first rows of the result set very quickly, but could take quite a while until all rows are processed, since it requires potentially a lot of iterations of the loop until everything has been processed. Your front end probably by default only display the first n rows of the result set and therefore works fine with this execution plan.
    Now if the result set is empty, depending on your data, indexes and search criteria, Oracle has to work through all the data using the inefficient NESTED LOOP approach only to find out that no data has been found, and since your application attempts to fetch the first n records, but no records will be found, it has to wait until all data has been processed.
    You can try to reproduce this by deliberately fetching all records of a query that returns data and that uses the NESTED LOOP approach... It probably takes as long as in the case when no records are found.
    Note that you seem to use bind variables and 10g, therefore you might be interested that due to the "bind variable peeking" functionality you might potentially end up with "unstable" plans depending on the values "peeked" when the statement is parsed.
    For more information, see this comprehensive description of the issue:
    http://www.pythian.com/blogs/867/stabilize-oracle-10gs-bind-peeking-behaviour-by-cutting-histograms
    Note that this changes in 11g with the introduction of the "Adaptive Cursor Sharing".
    Regards,
    Randolf
    Oracle related stuff blog:
    http://oracle-randolf.blogspot.com/
    SQLTools++ for Oracle (Open source Oracle GUI for Windows):
    http://www.sqltools-plusplus.org:7676/
    http://sourceforge.net/projects/sqlt-pp/

  • Two statement in one connection

    Can anyone tell me is it possible to create two statements in only one connection?
    I would like to execute two query in two different table but I need to make use of one record from a column of table one to select another record from second table....
    If I create two connection for the query of these two tables...it will be very lengthy code and not professional...
    Can anyone suggest a good solution or the ways to do that?
    Thanks in advanced

    I'm no JDBC pro, but I use PreparedStatement. This will let you reuse the statement. As far as reusing a connection, I've never had a problem doing that. You can do it like this (i left the try/catch statements out for clarity):
    Connection connection = null;
    PreparedStatement statement = null;
    ResultSet results = null;
    String userName = null;
    connection = DriverManager.getConnection(dburl, dbuser, dbpassword);
    connection.setAutoCommit(false); //turn autocommit off, lets us execute all queries at once
    //select info from table1
    statement = connection.prepareStatement("SELECT user_name FROM table1 WHERE user_id = ?");
    statement.setInt(1, someUserId); //put this value where the question mark is
    results = statement.executeQuery(); //execute this query...but not until it is committed
    if(results.next())
    { userName = results.getString(user_name); }
    results = null; //reset results for the fun of it...don't know if necessary
    //use that data to get info from table2 ...using the same connection and statement
    statement = connection.prepareStatement("SELECT * from user_info WHERE user_name = ?");                               
    statement.setString(1, userName); //use the info we just got to form this query
    statement.executeQuery(); //fire this one off too
    if(results.next()) //now print all the info we got from table2 out
    { System.out.println(results.getString("field1"));
    System.out.println(results.getString("field2"));
    System.out.println(results.getString("field3"));
    connection.commit() //NOW execute both queries in sequential order
    statement.close();
    connection.close();
    //end
    Hope that helps.
    -Matt

  • How to assign two states in the Withholding Info W4/W5 US(IT0210)

    Hi,
    I am using SAP ECC6.0, I am trying to assign two states in the Withholding Info W4/W5 US(IT0210) (one state where he resides and another is work state). i am able to create for one and if i create another one record, the tax area or state field is not enabled only the withholding allowance field is enabled. Can anyone provide me a solution for this.
    Lakshmi

    Lakshmi,
    Tax Area/State field is always not allowed for modification, basically you need to select the state (Subtype) before creating the record in PA30.
    Let me know still you are facing the same problem.
    Thanks,
    Kiran.
    Reward points are appreciated.

  • Two statements for one report (Analysis)

    Hi all,
    please help me understand the behavior of OBIEE.
    When I open my Analysis, it asks for input parameters. These parameters are collumn prompts with checked "require user input". Sure, user can't run Analysis without any parameters.
    Now what is strange. In Administration -> Manage sessions I can see TWO statements, created by me. I didn't run this report twice. This happens often. It's not all. These two statements are not equal. One of them has WHERE clause with my parameters I've set, but another statement DOESN'T have any WHERE clause. Actually, the first statement runs for a minute or like that. But the second statement can run for an hour and longer. But this is not just my observation, users complain about slow performance. The Analysis DOESN'T return any result untill both statements end their work although the first statement with WHERE clause is already finished.
    How I deal with it... I perform cansel in Administration -> Manage sessions and then run Analysis again with the same input parameters. It returns result in few seconds, it seems like using cache (but repository object is not cashable).
    What is wrong here? This looks like inappropriate behavior. This is not huge problem for business, because we have only few users at this stage. Most of users still use SAP Business Objects. So I can waste my time for canselling of statements for these few users. But the question is what will be in the future. Please, help me.
    Oracle Business Intelligence 11.1.1.6.6

    Remove a column at a time, and see if that makes BI fire only one query. Once you identify column forcing query to split, check RPD model for the logical table for that field. Check content level, logical sources, physical and logical diagrams etc. Also perform consistency check.

  • This problem has troubled me two days!class cant visit class between jars;

    I set classpath: CLASSPATH:C:\Documents and Settings\xxxx
    in this directory,I have a jdbc.jar and a sub directory named t,Test class in t ;
    Test class code here:
    package t;
    import jdbc.DateParser;
    public class Test{
        public static void main(String[] args){
            DateParser parser=new DateParser();
            String s=parser.formatDate("1987/9/9");
           System.out.println(s);
    }I do this:
    C:\Documents and Settings\xxxx>java t.Test
    1987/09/09 00:00:00
    this Test class run successfully
    and I do this(note: in MANIFEST.MF,just only this words at first line : Main-Class: t.Test) :
    C:\Documents and Settings\xxxx>jar cvfm t.jar MANIFEST.MF t
    list (manifest)
    add&#65306;t/(read= 0) (write= 0)(stored 0%)
    add&#65306;t/Test.java(read= 237) (write= 159)(compressed 32%)
    add&#65306;t/Test.class(read= 524) (write= 347)(compressed 33%)
    C:\Documents and Settings\xxxx>java -jar t.jar
    Exception in thread "main" java.lang.NoClassDefFoundError: jdbc/DateParser
    at t.Test.main(Test.java:5)
    this execution is failed?
    why??
    this problem has troubled me two days!I really need help!

    C:\Documents and Settings\xxxx>jar tvf jdbc.jar
    0 Thu Nov 04 21:16:20 CST 2004 META-INF/
    91 Thu Nov 04 21:16:20 CST 2004 META-INF/MANIFEST.MF
    0 Tue Nov 02 23:32:50 CST 2004 jdbc/
    547 Sun Oct 31 18:54:08 CST 2004 jdbc/Blob.class
    4280 Fri Oct 29 23:28:40 CST 2004 jdbc/ResultSet.class
    2100 Sun Oct 31 23:45:56 CST 2004 jdbc/Statement.class
    2438 Thu Oct 28 22:22:32 CST 2004 jdbc/Connection.class
    1384 Thu Oct 28 22:11:42 CST 2004 jdbc/HStream.class
    2172 Thu Oct 28 22:20:08 CST 2004 jdbc/Test.class
    3347 Sun Oct 17 21:23:38 CST 2004 jdbc/DateParser.class
    4495 Wed Oct 20 17:19:26 CST 2004 jdbc/Sorter.class
    Actually, ignore that. I think the problem is you are using "java -jar xxx". This runs the JAR in encapsulated mode, which ignores any classpath setting.you mean using "java -jar xxx" cant let xxx visit a class that in another jar?
    if that,what command shoud I use?

  • Problem in creation of FSV regarding where to assign the specific GL acct

    Dear All,
    Currently i am working on creation of Financial Statement Version, and have some doubt regarding some of GL account as to where it will get assigned.
    1.Consumption of RM or SFG
    2. Cost of Production of FG
    3. Cost of Good Sold.
    Kindly also tell the relation between the above GL and how it will effect the Balance sheet. and why this is used for.
    Example is below
    1. At the time of issue of RM material to Production order
    Consumption of RM  100
      To Inventay of RM          100
    2.*At the time of Confirmation of FG *
    Inventory of FG                           120               
      To Cost of Production of FG              120
    3. At the time of PGI
    Cost of Good Sold     120
      To Inv of FG                      120
    Thanks in advance
    Regards
    Shayam
    Edited by: Shayam_210 on Aug 9, 2010 9:33 AM

    hi,
    These are all P&L GL accounts and need to be allocated under profit and loss accounts node.
    Under that profit and loss node, there may be diff sub items also.
    Sub item has to be decide d by you depending upon the FSV structure in your org.
    Regards,
    Srinu

  • Problem in  creation of Customer Master

    Hi gurus,
    I am facing problem in creation of customer master.
    I have created a account group zz01 copying from 0001.which has internal no. assignement for the customer.
    Now i am trying to create a customer master, at partner functions level under sales area data...  the system is asking for the no. for each partner functions.. when i tried to manually enter, the system is not taking any number nor it is letting me save the data.
    Please help me out in acertaining,  what could be the issue.
    regards
    Gupta
    [email protected]

    its due to the number ranges that is specified in the partner determination ... chech what is the number range assigned in the parner determination ,,, so once u check that u have to manually enter the number between that range only .. this should solve ur problem...
    path to check the number range is as below :
    spro-img-logistic generalbusiness partner-customers---define account groups and field selection ---    
    at this point click position button at the bottom and give ur account group .. select ur account group and click detail button .. now inside that u can see the specified number range .. dafault is 08 ( means u can specify between 400000 to 499999)..
    and some times  u may not have defined number range... check urs and create accordingly ... this should solve ur problem...
    rewards if solved ..
      thank you
    madhan

  • Problem in creation of SOAP massage

    hi
    I am using JDeveloper (version 11.0) to create the proxy classes from WSDL
    but i am getting an exception as following
    SOAPFaultException
    this exception indicate that there is some problem in creation of SOAP massage internally
    so can anyone help me to know what is the problem?
    If u want to see the code then i can display here.
    thanks in advance

    its due to the number ranges that is specified in the partner determination ... chech what is the number range assigned in the parner determination ,,, so once u check that u have to manually enter the number between that range only .. this should solve ur problem...
    path to check the number range is as below :
    spro-img-logistic generalbusiness partner-customers---define account groups and field selection ---    
    at this point click position button at the bottom and give ur account group .. select ur account group and click detail button .. now inside that u can see the specified number range .. dafault is 08 ( means u can specify between 400000 to 499999)..
    and some times  u may not have defined number range... check urs and create accordingly ... this should solve ur problem...
    rewards if solved ..
      thank you
    madhan

  • Problem in creation of STO(stock transport order)

    hi all SAP gurus,
    i am facing the problem in creation of stock transport order with ME21N code. i m getting the error msg of "Not possible to determine shipping data for material in STO "
    i have checked the stock transport order setup in customization. but not getting the clear idea to come out from this problem.
    if anybody have the idea of " how to do the customization of stock transport order setup, pls. let me explain.
    thnx in advance.
    rgrds,
    rajesh

    Hi Rajesh,
    when ur creating STO with UB doc type, then you have to maintain material in both the plants.
    Regarding the error which is comming for you, you have to check the settings at
    SPRO- IMG- MM-Purchasing-Set up stock transport order- Assign delivery type & Checking rule
    here for document type UB and your supplying plant-XXXX select nothing for Dlv type(delivery type) and chr - 01 and after this save.
    After this you create STO as you are doing and see what the system is prompting.
    For any further clarification let me know.
    Regards,
    NJ

  • Problem in  creation of any purchasing doc  against plant 0001

    Hi MM Experts,
    I am facing problem in creation of any purchasing doc (i.e: PR or PO) against plant 0001.This is available in the system and assigned to company code. I can create Material master with this plant 0001 and copy to create new plant. But Can't create any pur doc? also in plant list in pur doc showing the rest of the plant except plant 0001.
    I m working on ECC 6.0.
    Regards,

    Dear Sairam/Steve,
    I got solution for my problem. The problem is that address number not maintained for 0001 plant.This solution available from the following note. please go thro...
    Note 433997 introduced a new logic for the F4 help for plants.
    solution proposed in note 433997 :
    To maintain the address number of a plant subsequently, startTransaction OX10 for the affected plant ('Change plants') view. Click the 'Address' pushbutton (envelope) or (shiftF5). In the subsequent screen ('Change address'), press Enter or click the 'Copy' pushbutton and save using the 'Save' pushbutton (disk) or (CtrlS).
    Then the plant should have an address number and should also be displayed in the search help.
    Thank you all
    Regards,

  • Problem in creation of order relevant - intercompany invoice

    Dear all ,
    I am facing problem in creation of intercompany invoice which is sales order relevant . Please tell which settings is required to resolve this as all the settings has been made.
    Send ur email id so that the problem can be described if required....
    Thanks .........

    Hi,
    while creating inter company sales order give the delivering plant in the overview screen. so that enables the system and tells that that is inter company sales order . u can verify whether the system takes which sales order whether it is standard order or inter company? by going to the conditions in the item overview in that u can find the "pi01" or "pi02" and select the delivery details there u can find the delivering plant which is supplying plant and the shipping point of the supplying plant..
    in case of doubt u can mail me at [email protected]
    Reward if Helpful..
    Regards,
    Praveen Kumar.D

  • Problem with the control break statement  - AT END OF

    data : IT_DATA   TYPE STANDARD TABLE OF /BIC/OH0SPA_OHD WITH  KEY /B28/S_D1DVOX5 ,
    FIELD-SYMBOLS :   <ls_data> TYPE any,
    SELECT * FROM (c_open_hub) INTO TABLE IT_DATA .
    *IF sy-subrc = 0.
    *ENDIF.
    Create the GUID for header
    CALL FUNCTION 'GUID_CREATE'
      IMPORTING
        EV_GUID_32 = LV_GUID.
    TRY.
        CALL METHOD CL_GDT_CONVERSION=>GUID_OUTBOUND
          EXPORTING
            IM_GUID_C = LV_GUID
          IMPORTING
            EX_VALUE  = LV_UUID.
      CATCH CX_GDT_CONVERSION  INTO go_exc .
        gv_text = go_exc->get_text( ).
    Application log for errors
        IF gv_text IS NOT INITIAL.
          PERFORM add_msg_to_log CHANGING lt_return.
          CALL FUNCTION '/SPA/APPL_LOG'
            EXPORTING
              LV_OBJECT    = '/SPA/APPL'
              LV_SUBOBJECT = '/SPA/ESOA'
              IT_RETURN    = lt_return.
        ENDIF.
    ENDTRY.
    OUTPUT-TRADE_PROMOTION_CRMBULK_CREATE-MESSAGE_HEADER-ID-CONTENT = LV_GUID.
    OUTPUT-TRADE_PROMOTION_CRMBULK_CREATE-MESSAGE_HEADER-UUID-CONTENT = LV_UUID.
    SELECT * FROM DD03T INTO TABLE lt_dd03t WHERE TABNAME = c_open_hub AND DDLANGUAGE = 'E' AND AS4LOCAL = 'A'.
    *IF sy-subrc = 0.
    *ENDIF.
    Sort the delta table
    SORT it_data.
    populate the output structure
    LOOP AT IT_DATA ASSIGNING <ls_data>.
    READ TABLE lt_dd03t INTO ls_dd03t with KEY DDTEXT = c_keyfigures.
    ASSIGN COMPONENT ls_dd03t-FIELDNAME OF STRUCTURE <ls_data> to <l_keyfigures>.
    READ TABLE lt_dd03t INTO ls_dd03t with KEY DDTEXT = c_signdata.
    ASSIGN COMPONENT ls_dd03t-FIELDNAME OF STRUCTURE <ls_data> to <l_signdata>.
    READ TABLE lt_dd03t INTO ls_dd03t with KEY DDTEXT = c_bbtype.
    ASSIGN COMPONENT ls_dd03t-FIELDNAME OF STRUCTURE <ls_data> to <l_bbtype>.
    READ TABLE lt_dd03t INTO ls_dd03t with KEY DDTEXT = c_customer.
    ASSIGN COMPONENT ls_dd03t-FIELDNAME OF STRUCTURE <ls_data> to <l_customer>.
    READ TABLE lt_dd03t INTO ls_dd03t with KEY DDTEXT = c_product.
    ASSIGN COMPONENT ls_dd03t-FIELDNAME OF STRUCTURE <ls_data> to <l_product>.
    READ TABLE lt_dd03t INTO ls_dd03t with KEY DDTEXT = c_territory.
    ASSIGN COMPONENT ls_dd03t-FIELDNAME OF STRUCTURE <ls_data> to <l_territory>.
    READ TABLE lt_dd03t INTO ls_dd03t with KEY DDTEXT = c_time.
    ASSIGN COMPONENT ls_dd03t-FIELDNAME OF STRUCTURE <ls_data> to <l_time>.
      CASE <l_keyfigures>.
        WHEN c_sd.
          PERFORM DATE_CALC USING <l_signdata> CHANGING  LV_DATE.
          ls_period_term-start_date = lv_date.
        WHEN c_ed.
          PERFORM DATE_CALC USING <l_signdata> CHANGING  LV_DATE.
          ls_period_term-end_date = lv_date.
        WHEN c_uplift.
          LS_PRODUCT_KF-ID-CONTENT = c_uplift_qyts.
          LS_PRODUCT_KF-VALUE = <l_signdata>.
         LS_PRODUCT_KF-YEAR = lv_week(4).
         LS_PRODUCT_KF-CALENDAR_PERIOD_ORDINAL_NUMBER = lv_week+4.
          APPEND LS_PRODUCT_KF TO LT_PRODUCT_KF.
        WHEN OTHERS.
        PERFORM DATE_CALC USING <l_signdata> CHANGING  LV_DATE.
         ls_period_term-start_date = lv_date.
    Get week
         CALL FUNCTION 'DATE_GET_WEEK'
           EXPORTING
             DATE = LS_PERIOD_TERM-START_DATE
           IMPORTING
             WEEK = LV_WEEK.
    append Keyfigure
          LS_PRODUCT_KF-ID-CONTENT = <l_keyfigures> .
          LS_PRODUCT_KF-VALUE = <l_signdata>.
         LS_PRODUCT_KF-YEAR = lv_week(4).
         LS_PRODUCT_KF-CALENDAR_PERIOD_ORDINAL_NUMBER = lv_week+4.
          APPEND LS_PRODUCT_KF TO LT_PRODUCT_KF.
    append tradespend
          SELECT SINGLE * FROM /SPA/SPEND_MAP INTO CORRESPONDING FIELDS OF LV_/SPA/SPEND_MAP
                 WHERE KEY_FIGURE = <l_keyfigures>.
          IF sy-subrc = 0.
            LS_TRADE_SPEND-TYPE_CODE-CONTENT = LV_/SPA/SPEND_MAP-SPEND_TYPE.
            LS_TRADE_SPEND-CATEGORY_CODE-CONTENT = LV_/SPA/SPEND_MAP-SPEND_CATEGORY.
            LS_TRADE_SPEND-METHOD_CODE-CONTENT = LV_/SPA/SPEND_MAP-SPEND_METHOD.
            APPEND LS_TRADE_SPEND TO LT_TRADE_SPEND.
          else.
            lv_flg = 'X'.
          ENDIF.
      ENDCASE.
    AT END OF /B28/S_D1DVOX5.   "
        SELECT SINGLE * FROM  /SPA/SO_TER_MAP INTO LS_/SPA/SO_TER_MAP WHERE TERRITORY = <l_territory>.
        IF sy-subrc = 0 AND lv_flg IS INITIAL.
    Create the GUID for TP's
          CALL FUNCTION 'GUID_CREATE'
            IMPORTING
              EV_GUID_32 = LV_GUID_MESSAGE.
          TRY.
              CALL METHOD CL_GDT_CONVERSION=>GUID_OUTBOUND
                EXPORTING
                  IM_GUID_C = LV_GUID_MESSAGE
                IMPORTING
                  EX_VALUE  = LV_UUID_MESSAGE.
            CATCH CX_GDT_CONVERSION .
          ENDTRY.
    populate the product
          LS_PRODUCT-ID-CONTENT = <l_product>.
          LS_CUSTOMER-ID-CONTENT = '300022'.
          LS_CUSTOMER-ROLE_CODE = '00000105'.
          LS_PRODUCT-KEY_FIGURE = LT_PRODUCT_KF.
          APPEND LS_PRODUCT TO LT_PRODUCT.
          APPEND LS_CUSTOMER TO LT_CUSTOMER.
          APPEND LS_DESCRIPTION TO LT_DESCRIPTION.
          APPEND LS_PERIOD_TERM TO LT_PERIOD_TERM.
          LS_TRADE_PROMOTION-TRADE_PROMOTION-SALES_AREA-ORGANISATIONAL_CENTRE_ID = LS_/SPA/SO_TER_MAP-SALES__ORG.
          LS_TRADE_PROMOTION-TRADE_PROMOTION-SALES_AREA-DISTRIBUTION_CHANNEL_CODE-CONTENT = LS_/SPA/SO_TER_MAP-DIST_CHANNEL.
          LS_TRADE_PROMOTION-TRADE_PROMOTION-PLANNING_ACCOUNT-CUSTOMER_INTERNAL_ID = <l_customer>.
          LS_TRADE_PROMOTION-TRADE_PROMOTION-PLANNING_PROFILE_GROUP_CODE-CONTENT = '4TPM'.
          LS_TRADE_PROMOTION-TRADE_PROMOTION-TYPE_CODE-CONTENT = 'Z002'.
          LS_TRADE_PROMOTION-TRADE_PROMOTION-UPLIFT_ACTIVE_INDICATOR = 'X'.
          LS_TRADE_PROMOTION-TRADE_PROMOTION-PLANNING_INFORMATION-MARKETING_PROJECT_PLANNING_PRO = '5'.
          LS_TRADE_PROMOTION-TRADE_PROMOTION-PLANNING_INFORMATION-CALENDAR_UNIT_CODE = 'WEE'.
          LS_TRADE_PROMOTION-TRADE_PROMOTION-TRADE_SPEND = LT_TRADE_SPEND.
          LS_TRADE_PROMOTION-TRADE_PROMOTION-PARTY = LT_CUSTOMER.
          LS_TRADE_PROMOTION-TRADE_PROMOTION-DESCRIPTION = LT_DESCRIPTION.
          LS_TRADE_PROMOTION-TRADE_PROMOTION-PLANNING_INFORMATION-PRODUCT = LT_PRODUCT.
          LS_TRADE_PROMOTION-TRADE_PROMOTION-PERIOD_TERM = LT_PERIOD_TERM.
          LS_TRADE_PROMOTION-MESSAGE_HEADER-ID-CONTENT = LV_GUID_MESSAGE.
          LS_TRADE_PROMOTION-MESSAGE_HEADER-UUID-CONTENT = LV_UUID_MESSAGE.
          LS_/SPA/REPORT_TAB-SPA_TP_ID = <l_bbtype>.
          LS_/SPA/REPORT_TAB-MESSAGE_ID = LV_GUID_MESSAGE.
          LS_/SPA/REPORT_TAB-CREATE_DATE = SY-DATUM.
          INSERT /SPA/REPORT_TAB FROM LS_/SPA/REPORT_TAB.
          APPEND LS_TRADE_PROMOTION TO LT_TRADE_PROMOTION.
          OUTPUT-TRADE_PROMOTION_CRMBULK_CREATE-TRADE_PROMOTION_CRMCREATE_REQU = LT_TRADE_PROMOTION.
          CLEAR : LT_DESCRIPTION, LT_PERIOD_TERM,LT_CUSTOMER, LT_PRODUCT, LT_PRODUCT_KF, LT_TRADE_SPEND,LS_/SPA/HEADER_TAB.
        ENDIF.
        CLEAR lv_flg .
      ENDAT.
    ENDLOOP.
    My problem is AT-END OF STATEMENT IS executing for each and every record of same /B28/S_D1DVOX5.
    Please help me from this problem

    Hello,
    First of all to know clearly about AT END.
    Let's say In IT_DATA fields are F1 F2 F3 /B28/S_D1DVOX5 F5.
    then AT END of /B28/S_D1DVOX5 means for each new value of this field at the end it will trigger.
    Please ensure thet IT_DATA is sorted by this field and then used Control break.
    Thanks,
    Pramod

Maybe you are looking for

  • PASSING INTERNAL TABLE IN SMARTFORM

    HI' I M NEW TO SMARTFORMS, MY PROBLEM IS =THAT I'VE CREATED A NEW TYPE(SAY TY_BKPF) IN THE DRIVER PROGRAM. THEN I'VE DECLARED AN INTERNAL TABLE OF THIS TYPE. TO PASS THIS INTERNAL TABLE INTO MY SMARTFORM I'VE PASSED THE INTERNAL TABLE'S NAME INTO THE

  • Employee as vendor - PRAA

    Hi We have a rek to create vendor from Employee..which is taken care by PRAA..which is good.. But its creating the Batch input Session everytime we try to create the vendor/vendors... My question is ..Is there any way that we can directly create the

  • Tax Code Creation when Excise is not Known during PO creation

    Hi, Scenario: Dealer's Scenario where during PO creation we don't know excise Amount and we consider PO price to include excise. Apart from excise we have CST. Excise and CST both will be inventorised. Example: PO = 5000 (Inclusive of excise) on whic

  • Restrict some document numbers in f-44 tcode

    Hello Experts, My client requirement is to restrict some document numbers when we run f-44 , here I am entering account and company code as input and after pressing enter here it displays some records. here among the list of displayed records, I want

  • Is there any way for Apple to recover my iPad with a cracked screen?

    I recently put my iPad down and discovered it was cracked when I picked it up. After a period of time the crack got worse and now it is across the whole top of the iPad.some of the pieces are falling out, but there is no real damage to the screen. Pl