HELP REQ IN SIMPLE CODE TO RETRIEVE DATA

Hi all,
i need to retrieve data from an internal TABLE whose date field is multiple of 2 days behind from current date.
like todays date is 14/08/06
i need records of date 12/08/06,10/08/06,8/8/06,6/8/06,4/8/06 .....
any help would be appreciated
THANKS

You can use a range for this and build it on the fly.  The only question is how far back do you want to go.  I mean, how many dates to add to the range.  Here I'm only adding 10.
report zrich_0001.
<b>ranges: r_datum for sy-datum.
r_datum-sign = 'I'.
r_datum-option = 'EQ'.
r_datum-low  = sy-datum.  append r_datum.
do 10 times.
  r_datum-low  = r_datum-low - 2.  append r_datum.
enddo.</b>
select .....
          <b>where datum in r_datum</b>.
Regards,
Rich Heilman

Similar Messages

  • Need Sample code to retrieve Data from Portal DB(Oracle)

    Would anyone provide me steps to create application with a sample code to retrieve data from portal DB which is oracle and see the output in table format.

    Hi Bris ,
    The sample code , you didnt specified from where do u want to access the oracle thorough java code or through webdynpro .
    Sample code to access through Java
    import java.sql.*;
    class Customer
    public static void main(String args[]) throws SQLException
    DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
    System.out.println("Connecting to the database...");
    try
    Connection cn=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:orcl","scott","t");
    Statement st=cn.createStatement();
    ResultSet rs=st.executeQuery("select 'Connected' from dual");
    rs.next();
    String s=rs.getString(1);
    System.out.println(s);
    st.close();
    cn.close();
    catch(Exception ex)
    System.out.println("The exception raised is:" + ex);
    [code]
    If accessing through JDBC datasorce.
    https://www.sdn.sap.com/irj/sdn/thread?threadID=328550
    https://www.sdn.sap.com/irj/sdn/thread?threadID=309386
    [code]
    package com.dhl.employeemodel;
    import java.sql.Connection;
    import javax.naming.Context;
    import javax.naming.InitialContext;
    import javax.sql.DataSource;
    public class DBConnectionManager {
         Connection connection;
          * @return
         public Connection getConnection() {
              try
                   Context jndiContext = new InitialContext();
                   DataSource ds = (DataSource)jndiContext.lookup("jdbc/MyAlias");
                   connection = ds.getConnection();
             catch(Exception connectionErrEx)
                   //connectionErrEx.printStackTrace();
                   return null;
              return connection;
    Thanx
    Pankaj

  • To write ABAP code to retrieve data from RSTMANPART table

    hello everyone...
    Actually, i need help to write a ABAP code....
    i need to record the number of data records which is transferred and added to 3 cubes... i need to read the latest request number from the RSSTATMANPART table, for the 3 datatargets,  and gather the transferred records, added records , start time n end time from that specific req num....
    And i have to store it in an internal table....
    Please help me with the same.....
    Thanks....
    Edited by: neethacj on Dec 2, 2010 10:27 AM

    Dear Neetha,
    The table name is RSSTATMANPART.
    Now the relevant fields are
    DTA(Data Target)
    DTA_TYPE(Data Target Type = Cube)
    RNR (Request ID)
    STATUS(Data Load Status )
    TSTATUS(Technical Status)
    DATUM_ANF(Request date)
    DATUM_VERB(Loaded Date)
    ZEIT_ANF(Start Time)
    ZEIT_VERB(Finishing Time)-->just do one load and compare the entries with Process monitor
    OLTPSOURCE(Datasource).
    ANZ_RECS(Transferred Records)
    INSERT_RECS(Inserted Records)
    *Create an Internal Table :
    DATA: IT_MANPART1 TYPE TABLE OF RSSTATMANPART,
               IT_MANPART2 TYPE TABLE OF RSSTATMANPART,
              IT_MANPART3 TYPE TABLE OF RSSTATMANPART,
               WA_MANPART LIKE LINE OF IT_MANPART1.
    *Fill the internal table
    SELECT * FROM RSSTATMANPART INTO TABLE IT_MANPART1  WHERE 
    DTA = 'CUBE1'.
    SELECT * FROM RSSTATMANPART INTO TABLE IT_MANPART2  WHERE 
    DTA = 'CUBE1'.
    SELECT * FROM RSSTATMANPART INTO TABLE IT_MANPART3  WHERE 
    DTA = 'CUBE1'.
    SORT IT_RSSTATMANPART1 BY  RNR  DESCENDING.
    SORT IT_RSSTATMANPART1 BY  RNR  DESCENDING.
    SORT IT_RSSTATMANPART1 BY  RNR  DESCENDING.
    It will fill up your Internal table with all the requests of the RSSTATMANPART for the three Infocubes.The requests have been sorted in descending order ,the most latest will be at the top.
    You can do whatever you want to do with these three internal tables..you can have them in one talbe also..depends on ur exact requirement.
    Regards,
    RK

  • I need help with some simple code! Please read!

    hi everyone.
    I'm having problems with a piece of code, and i'd be extremely greatful if somebody could give me a hand with it. I'm totally new to java and have to make a program for my university degree, but i'm finding it extremely difficult, mainly due to my total lack of apptitude for this type of thing. I know this is easy stuff, but the books I have are no use so any help would be greatly appreciated.
    I have to write a program which uses two class files. I want one with the code to produce a simple button, and one to invoke it several times at different locations. I decided to write the program as one class file at first, and thought i'd be able to split it up at later. The program works fine when it is one class file. My book said that to split the two classes up, all i needed to do was change the second class to public, although this seems to not work at all. I'm at my wits end on this, and if anyone could correct my code I'd be eternally greatful.
    Here is the first class... (sorry about the lack of indentation)
    >>>>>>>>>>
    import java.awt.*;
    import java.applet.Applet;
    public class Phone extends Applet {
    private Image image;
    public void init() {
    setLayout(null);
    image = getImage(getDocumentBase(), "phone.jpg");}
    public void paint (Graphics g) {
    g.drawImage(image, 0, 0, 700, 530, this);
    PhoneButton myButton;
    myButton = new PhoneButton(20,20);
    >>>>>>>
    This is the second class....
    >>>>>>>
    public class PhoneButton {
    private Button butt;
    public PhoneButton(int a, int b, int c){
    setLayout(null);
    butt = new Button();
    butt.setBounds(a,b,20,20);
    add(butt);
    >>>>>>>>
    My compiler generates errors relating to Button, but i can't do anything to please it.
    Also, could anyone give me some pointers on how to add a different number or symbol to each button. That is what I added int c for, but i couldn't get it to work.
    Cheers in advance.
    Michael Morgan

    I found that there are 5 error in your code.
    1. You should import the "java.awt" package to the PhoneButton.java
    2. The PhoneButton is not a kind of Component. You cannot not add it to the Phone class
    3. the myButton = new PhoneButton(20, 20) does not provide enough parameters to create PhoneButton
    4. You cannot add a Button to a PhoneButton. Becaue the PhoneButton is not a kind of Container
    Fixed code:
    import java.awt.*;
    public class PhoneButton extends Button {
    public PhoneButton(int a, int b, int c){
         setBounds(a, b, 20, 20);
         setLabel(String.valueOf(c));
    ===========================================
    import java.awt.*;
    import java.applet.Applet;
    public class Phone extends Applet {
    private Image image;
    public void init() {
    setLayout(null);
    image = getImage(getDocumentBase(), "phone.jpg");}
    public void paint (Graphics g) {
    g.drawImage(image, 0, 0, 700, 530, this);
    PhoneButton myButton;
    myButton = new PhoneButton(20,20, 1);
    ======================
    Visual Paradigm for UML - Full Features UML CASE tool
    http://www.visual-paradigm.com/

  • Can anyone help me write a code about coping data from many files and paste them to one file !?

    Hello ! 
    As I said in title , I have alot files (e.g. 60 files) and I want to write a code to copy 5 columns (for examples) of special sheet of files and paste them in one file respectively. For perceive it I explained it more below .
    Suppose one of my files is simplified as this : http://s000.tinyupload.com/?file_id=00699705919876414523
    The name of  this file is 2006Oct and assume my excel files are like "2006Oct, 2006Nov,2006Dec,2007Jan ... 2010Dec". At first I should go to "my files" sheet of 2006Oct file and copy columns " A,B,C,D,E,F " that has "PerturbationNumber=1"
    respectively and then paste these to a file that is output file and repeat this process for the other files ( 2006Nov and etc ) and paste data in output file sequentially. 
    I appreciate and look foreward for any help in this issue.
    Majid

    Try code below
    Sub CombineBooks()
    Dim wb As Workbook
    Dim sourceSht As Worksheet
    Dim destSht As Worksheet
    Set destSht = ThisWorkbook.Sheets(1)
    destSht.Cells.Clear
    FolderName = "C:\temp\test\"
    file = Dir(FolderName & "*.xlsx")
    firstSht = True
    Do While file <> ""
    Set wb = Workbooks.Open(Filename:=FolderName & file, ReadOnly:=True)
    Set sourceSht = wb.Sheets(1)
    With sourceSht
    sourceLastRow = .Range("A" & Rows.Count).End(xlUp).Row
    If .Cells.AutoFilter Then
    .Cells.AutoFilter 'turn off autofilter
    End If
    .Cells.AutoFilter Field:=6, Criteria1:="1"
    If firstSht = True Then
    Set copyRange = .Range("A1", .Range("E" & sourceLastRow)).SpecialCells(xlCellTypeVisible)
    destSht.Range("F1") = "FileName"
    firstSht = False
    destNewRow = 1
    Else
    Set copyRange = .Range("A2", .Range("E" & sourceLastRow)).SpecialCells(xlCellTypeVisible)
    destNewRow = destSht.Range("A" & Rows.Count).End(xlUp).Row + 1
    End If
    copyRange.Copy Destination:=destSht.Range("A" & destNewRow)
    LastRow = destSht.Range("A" & Rows.Count).End(xlUp).Row
    If destNewRow = 1 Then
    destSht.Range("F2:F" & LastRow) = file
    Else
    destSht.Range("F" & destNewRow & ":F" & LastRow) = file
    End If
    End With
    wb.Close savechanges:=False
    file = Dir()
    Loop
    End Sub
    jdweng

  • Help needed with simple code

    Hi,
    Im doing a project for my module at uni. Not being a programmer I find it very hard to design application as Im required to. Anyway I have to design booking application for bikeshop.
    User selects bike from 3 types: MTB,Kids and racing. each bike has its price so cost of booking must be calculated.There are extra options like helmet which may rented as well. Some customer info must be collected (name,address etc).
    Bookings has to be written into file. Report of past booking must be available-simple printouts.
    No databases as use of arrays is required.
    Im stuck and trying to figure it out how to read from array which contains bike types and prices and extra features. Then combine several bookings for on customes on a form/interface.
    Any ideas how to start it? I mean at least on design level.
    Thanks in advance for any help

    Hi
    I managed to produced some code to extend my app but when I run it I get:
    Exception in thread "main" java.lang.NullPointerException
         at ReservationSystem.main(ReservationSystem.java:22)
    Im really stuck
    Will somebody give me any idea?
    Below is the code...
    Thanks
    whale
    mport java.util.ArrayList;
    import javax.swing.JOptionPane;
    public class ReservationSystem {
         static ArrayList<Booking> Bookings;
         public static void main(String[] args) {
              int BikeType = 0;
              do {
                   BikeType = Integer.parseInt(JOptionPane.showInputDialog("0 - Mountain bike, 1 - Racing Bike, 2 - Childrens Bike, 3 - Finish?"));
                   String Surname = JOptionPane.showInputDialog("Surname?");
                   String Date = JOptionPane.showInputDialog("Date?");
                   int Number_of_days = Integer.parseInt(JOptionPane.showInputDialog("Number of days?"));
                   switch (BikeType) {
                   case 0:
                        String Sex = JOptionPane.showInputDialog("Sex (M/F)?");
                        String Frame_size = JOptionPane.showInputDialog("Frame size (S/M/L)?");
                        boolean Helmet = JOptionPane.showConfirmDialog(null, "Is a helmet required?", "Helmet", JOptionPane.YES_NO_OPTION) == 0;
                        Bicycle Bike = new MountainBike(Sex, Frame_size, Helmet);
                        Bookings.add(new Booking(Surname, Date, Number_of_days, Bike));
                   case 1:
                   case 2:
                   default:
              } while (BikeType != 3);
              int Length = Bookings.size();
              int i;
              for (i = 0; i < Length; i++) {
               Bookings.get(i).print_booking();
         }Booking class
    public class Booking {
      //Date start_date;
      int Number_of_days;
      Bicycle Bike;
      String Surname;
      String Date;
      Booking(String Surname, String Date, int Number_of_days, Bicycle Bike) {
           this.Surname = Surname;
           this.Number_of_days = Number_of_days;
           this.Bike = Bike;
           this.Date = Date;
      public void print_booking() {
           System.out.print(this.Surname + ": " + this.Date + "/" + " for " + this.Number_of_days);
           this.Bike.print_bike();
      }}class Bicycle
    public class Bicycle {
      int Price;
      boolean Helmet;
         public void print_bike() {
    class MountainBike extends Bicycle {
         String Frame_size;
         String Sex;
         public MountainBike(String Sex, String Frame_size, boolean Helmet) {
              this.Sex = Sex;
              this.Frame_size = Frame_size;
              this.Helmet = Helmet;
              this.Price = 20;
              if (Helmet) {
                   this.Price += 5;
         public void print_bike() {
              System.out.println("Mountain bike (" + this.Sex + ", " + this.Frame_size + ") "
                        + (this.Helmet ? " with helmet" : "") + " price " + this.Price);
    class RacingBike extends Bicycle {
         boolean Panniers;
         String Frame_size;
         String Sex;
         public RacingBike(String Sex, String Frame_size, boolean Panniers) {
              this.Sex = Sex;
              this.Frame_size = Frame_size;
              this.Panniers = Panniers;
              this.Price = 25;
              if (Panniers) {
                   this.Price += 10;
                   this.Helmet = true;
         public void print_bike() {
              System.out.println("Racing bike (" + this.Sex + ", " + this.Frame_size + ") "
                        + (this.Panniers ? " with panniers" : "") + " price " + this.Price);
    class ChildrensBike extends Bicycle {
         int Age;
         public ChildrensBike(int Age) {
              this.Age = Age;
              this.Helmet = true;
              this.Price = 15;
         public void print_bike() {
              System.out.println("Mountain bike (" + this.Age + ") "
                        + (this.Helmet ? " with helmet" : "") + " price " + this.Price);
    }

  • Help to correct to codes to move data from tables! please help!

    HI,
    There is a internal table t and t1. I used loop to move the data which zuonr has no value from t to t1.
    BSID TABLE:
    KUNNR                 ZUONR
    0000052984         no value                            &#12288;&#12288;&#12288;&#12288;&#12288;&#12288;&#12288;&#12288;&#12288;  0000052984          no value                                            00052984              2007/06&#27770;&#31639;
    00052984               no value
    000052984          &#12288;2007/07&#25391;&#24403;      
    0000052984            MSFT047/07
    0000052984           MSFT061/07
    *what I need to do is that to move all the data belonge to the same kunnr whenever zuonr = space happend. *.
    The problem is that the data which zuonr = space is moved to t1 successful, but the other data which belong to the same kunnr has zuonr valune still remain.
    -Question_ : How to move all the data belong to the same kunnr whenever zuonr = space happend.
    DATA: BEGIN OF t OCCURS 0,
            bukrs   LIKE knb1-bukrs,
            zuonr   Like bsid-zuonr,                        "sort key  "CR01
            belnr   LIKE bsid-belnr,
            kunnr   LIKE kna1-kunnr,
            bldat   LIKE bsid-bldat,
            budat   LIKE bsid-budat,
            netdt   LIKE bsega-netdt,
            waers   LIKE bsid-waers,
            wrbtr   LIKE bsid-wrbtr,
            shkzg   LIKE bsid-shkzg,
            xblnr   LIKE bsid-xblnr,                            "WD041005a
            sgtxt   LIKE bsid-sgtxt,
            dmbtr   LIKE bsid-dmbtr,
          END OF t.
    DATA : t1 LIKE STANDARD TABLE OF t WITH HEADER LINE.
    *LOOP AT t WHERE zuonr EQ space.
      MOVE-CORRESPONDING t TO t1.
      APPEND t1.
    ENDLOOP.*
    How can I write the loop statement to mention  the KUNNR
    Please help, thank you!!

    Hi,
    Try this.
    data : wa_t like line of table t.
    field-symbols : <f_t> like line of table t.
    sort t by kunnr.
    Loop at t where zuonr eq space.
    read table t1 with key kunnr = t-kunnr.
    if sy-subrc = 0.
    continue.
    endif.
    read table t into wa_t with key kunnr = t-kunnr.
    if sy-subrc = 0.
    loop at t assigning <f_t> from sy-tabix..
    if <f_t>-kunnr = wa_t-kunnr.
    move-corresponding <f_t> to t1.
    append t1.
    else.
    exit.
    endif.
    endloop.
    endif.
    endloop.
    Regards,
    Mohaiyuddin

  • Help with a simple code snippet?

    Can someone tell me where I'm going wrong with this bit of code? Its more or less derrived from the Java tutorials, though its mid chapter so lets you make your own mind up about the surrounding code...I'm just trying to get a grip on how notifyAll() and wait() work(). The WaitProcess is suposed to sit there and wait for the NotifyProcess to wake it up. I was expecting both processes to finish after the notifyAll().
    Thanks for any help...
    Steve
    public class NotifyWaitTest {
        static boolean waiting = true;
        static class WaitProcess implements Runnable {
            public void run() {
                System.out.println("WaitProcess: started and waiting");
                waitHere();
                System.out.println("WaitProcess: Finished");
            public synchronized void waitHere() {
                while(waiting)
                    try {
                        wait();
                    } catch(InterruptedException e) {
        static class NotifyProcess implements Runnable {
            public void run() {
                System.out.println("NotifyProcess: started and sleeping 10s");
                try {
                    Thread.sleep(10000);
                } catch(InterruptedException e) {  
                notifyWait();
            public synchronized void notifyWait() {
                waiting = false;
                notifyAll();
                System.out.println("NotifyProcess: waiting = false, notifyAll()");
        public static void main(String... args) {
            new Thread(new WaitProcess()).start();
            new Thread(new NotifyProcess()).start();
    }Message was edited by:
    Steve12345

    The object you are waiting on and the object you are
    notifying are different.
    I thought notifyAll() interrupted all threads?No. notifyAll is an instance method (and wait is instance method too) and wakes up only threads, that waits on that object (instance) beeing notified. In your code call
    notifyAll();is actually the same, as
    this.notifyAll();which is notification of objects, that waits on notifying object (but not all waiting threads).
    All synchronization in java is tied to particular instances and is not a "global synchronization". This means, that two threads can simultaneously hold locks (or, other words, execute sections inside synchronized statements), but only on different instances. Lock on the particular instance can be hold by an only one thread at a time. Waiting and notifications are also tied to instances and requires a lock on the used object (i.e. should be executed in the synchronized block for that object). In your code syncronization is performed on different instances: one on the instance of WaitProcess (and wait is preformed on this instance), and second is performed on the instance of NotifyProcess (and notifyAll is performed on this instance). You should use synchonized section in both classes, and this synchonized section should be invoked on the same instance (not on two instances of same class).
    P.S. "interrupted" is wrong word here. notifyAll() "wakes up" threads, which waits on particular lock, allowing them to continue their execution. But "interrupt" means setting "interrupted" flag or throwing InterruptedException (which is abrupt completion of wait method).

  • Help req in table s525 ( any standard data source avaialable  for table s5)

    Hi all,
    i want to know any standatrd data source available for the table  s525  - MRP Exception Message Detail
    pl help me on this ..
    Thanks
    sivakumar r

    pl any one help me
    any std data source available for the table s525

  • Need help with some simple code

    Hi,
    I'm doing a lab for a class I'm taking and for the most part my code is working properly. It is supposed to accept inputs from the user of ints, doubles, or strings using the Scanner class until the user inputs "quit". It stores each input in array lists of class Integer, Double, and String. It the prints out each element of these in a list and quits the program. The problem is that after I query the user for input, if an int or double is input, the program then requires an input again before it will continue querying. So my question is how do I get it to query only once?
    The code and a copy of what it IS doing, and what it SHOULD do are shown below in bold.
    import java.util.ArrayList;
    import java.util.Scanner;
    import java.lang.Integer;
    import java.lang.Double;
    import java.lang.String;
    public class inputsort
    public static void main()
    int n = 0;
    boolean done = false;
    String quit;
    Scanner sc = new Scanner(System.in);
    ArrayList<Integer> intList = new ArrayList<Integer>();
    ArrayList<Double> doubList = new ArrayList<Double>();
    ArrayList<String> stringList = new ArrayList<String>();
    while(!done)
    System.out.print("Enter an int, double, any random text, or type quit to end: ");
    *if (sc.hasNextInt()){*
    intList.add(sc.nextInt());
    sc.next();
    *} else if (sc.hasNextDouble()){*
    doubList.add(sc.nextDouble());
    sc.next();
    *} else {*               
    quit = sc.next();
    *if (quit.equals("quit")) {*
    done = true;
    *else {*
    stringList.add(quit);
    System.out.println("Integers:");
    while(n < intList.size())
    System.out.print("Integer[" + n + "]: ");
    System.out.print(intList.get(n) + "\n");
    n += 1;
    n = 0;
    System.out.println("Doubles:");
    while(n < doubList.size())
    System.out.print("Double[" + n + "]: ");
    System.out.print(doubList.get(n) + "\n");
    n += 1;
    n = 0;
    System.out.println("Others:");
    while(n < stringList.size())
    System.out.print("Other[" + n + "]: ");
    System.out.print(stringList.get(n) + "\n");
    n += 1;
    Here's what it IS doing:
    Enter an int, double, any random text, or type quit to end: 10
    *10*
    Enter an int, double, any random text, or type quit to end: 1.2
    *1.2*
    Enter an int, double, any random text, or type quit to end: 3.4
    *3.4*
    Enter an int, double, any random text, or type quit to end: 5.6
    *5.6*
    Enter an int, double, any random text, or type quit to end: test
    Enter an int, double, any random text, or type quit to end: monkey
    Enter an int, double, any random text, or type quit to end: quit
    Integers:
    Integer[0]: 5
    Integer[1]: 10
    Doubles:
    Double[0]: 1.2
    Double[1]: 3.4
    Double[2]: 5.6
    Others:
    Other[0]: test
    Other[1]: monkey
    Here is what it SHOULD be doing:
    Enter an int, double, any random text, or type quit to end: 10
    Enter an int, double, any random text, or type quit to end: 1.2
    Enter an int, double, any random text, or type quit to end: 3.4
    Enter an int, double, any random text, or type quit to end: 5.6
    Enter an int, double, any random text, or type quit to end: test
    Enter an int, double, any random text, or type quit to end: monkey
    Enter an int, double, any random text, or type quit to end: quit
    Integers:
    Integer[0]: 5
    Integer[1]: 10
    Doubles:
    Double[0]: 1.2
    Double[1]: 3.4
    Double[2]: 5.6
    Others:
    Other[0]: test
    Other[1]: monkey
    Any help is greatly appreciated!!!
    Thanks!
    Edited by: sublimeph03nix on Jan 21, 2009 7:24 PM

    My professor told me to add sc.next(); because she said when you hit return its reads that in the scanner class too, so it's kinda to clear the buffer I think, I wasn't really sure. It changes nothing on the front end if I remove it.
    As for the thing, it wont let me edit for some reason.  I'll try again in a bit.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Help req with the code

    Hi all
    we are a MDMP code page system and we upgraded to ECC 6.0.
    This is the error iam getting IN UCCHECK for unicode
    The system could not perform a static convertibility check on the current
    statement, because of untyped or generic operands. It can only carry out this
    . runtime.
    Whta exactly static convertibility check.
    Can anyone suggest what i have to do regarding this
    The error is pointing this piece of code
    FORM bdc_dynpro *
    --> PROGRAM *
    --> DYNPRO *
    form bdc_dynpro using program dynpro.
    clear i_bdcdata.
    i_bdcdata-program = program.
    i_bdcdata-dynpro = dynpro.
    i_bdcdata-dynbegin = 'X'.
    append i_bdcdata.
    endform.
    FORM bdc_field *
    --> FNAM *
    --> FVAL *
    form bdc_field using fnam fval.
    clear i_bdcdata.
    i_bdcdata-fnam = fnam.
    i_bdcdata-fval = fval.
    append i_bdcdata.
    endform.
    This is from the standard include bdcrecx1
    Start new screen *
    FORM BDC_DYNPRO USING PROGRAM DYNPRO.
    CLEAR BDCDATA.
    BDCDATA-PROGRAM = PROGRAM.
    BDCDATA-DYNPRO = DYNPRO.
    BDCDATA-DYNBEGIN = 'X'.
    APPEND BDCDATA.
    ENDFORM.
    Insert field *
    FORM BDC_FIELD USING FNAM FVAL.
    IF FVAL <> NODATA.
    CLEAR BDCDATA.
    BDCDATA-FNAM = FNAM.
    BDCDATA-FVAL = FVAL.
    APPEND BDCDATA.
    ENDIF.
    ENDFORM.
    It looks the same way i wrote the code right.
    Thanks
    Suchitra

    Hi Srinivas,
    This is my actual code
    Here iam not comparing FVAL with  NODATA
    As its being done in SAP Standard code
    FORM bdc_dynpro *
    --> PROGRAM *
    --> DYNPRO *
    form bdc_dynpro using program dynpro.
    clear i_bdcdata.
    i_bdcdata-program = program.
    i_bdcdata-dynpro = dynpro.
    i_bdcdata-dynbegin = 'X'.
    append i_bdcdata.
    endform.
    FORM bdc_field *
    --> FNAM *
    --> FVAL *
    form bdc_field using fnam fval.
    clear i_bdcdata.
    i_bdcdata-fnam = fnam.
    i_bdcdata-fval = fval.
    append i_bdcdata.
    endform.
    I haven't used the satndard inclue bdcrecx1
    which has the code as you mentioned
    let me know

  • Basic TableUI element to Retrieve Data from DB in WEbDynPro For Java

    Hi Experts,
    I am new to WebDynPro for java.Can any body please help me out from this issue.
    I am trying to display records from DataBase by Using Table UI element.
    DBTable Contains 10 rows.
    I have created a Node and Attributes(for every column) .
    I am using JDBC code to retrieve data from database and assigning to Attributes.
    But in Table UIElement its displaying only last record from database as first row in UIElement.
    Its over writing previous rows.
    Can any body please help me the correct procedure to retrieve data from DataBase.
    Thanks and Regards,
    Shashikiran.B

    Hi,
    Iterate through the result set object
    populate the context node
    Ex:Replace the context nodeName with that of yours.
    ResultSet resultSet = stmt.getResultSet();
           //Iterate through the resultset
           while(resultSet.next())
                //Create element of the context node
               IWDNodeElement nodeElement = wdContext.nodeOrders().createElement();
               //assign value from the database to the context attribute
               //Replace attributeName with your attribute name
               //Replace value with resultSet.getShort("<ColumnName>")
               nodeElement.setAttributeValue(attributeName, value);
               //Add the element to your node
               wdContext.nodeOrders().addElement(nodeElement);
    Regards
    Ayyapparaj

  • How to Retrieve data from Variant Table

    Can anyone help me by telling how to retrieve data from variant table which was created by user. I am able to see data of variant table only thru cu60 transaction but not se11. I s there any function module to do this?

    Hello Mohan,
    if u already have data and u want to populate it in F4 help then use below code -
    u Have to make use of FM - 'F4IF_INT_TABLE_VALUE_REQUEST'
    REPORT  ZGILL_VALUE_REQUEST                     .
    data: begin of lt_all occurs 0.
            include structure DYNPREAD.
    data  end of lt_all.
    data: begin of lt_selected occurs 0.
           include structure DDSHRETVAL.
    data: end of lt_selected.
    DATA: BEGIN OF lt_code OCCURS 0,
                code LIKE zgill_main-PERNR,
          END OF lt_code.
    data no_dyn like sy-dynnr.
    Parameters : ECODE like zgill_main-PERNR.
    *parameters: pernr like pa0001-pernr .
    no_dyn =  sy-dynnr.   "give the scren no directly or sy-dynnr in case of report.
    At selection-screen on value-request for ECODE.
    select PERNR into table lt_code from zgill_main.
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
          EXPORTING
            retfield               = 'ECODE'
            dynpprog               = sy-repid
           dynpnr                  = no_dyn
          dynprofield              =       'ECODE'
          window_title           = 'Employee Details'
           value_org              = 'S'
          DISPLAY                = 'F'
       TABLES
            value_tab             = lt_code
           RETURN_TAB             = lt_selected.
    EXCEPTIONS
      PARAMETER_ERROR        = 1
      NO_VALUES_FOUND        = 2
      OTHERS                 = 3
    *if sy-subrc eq '0' .
      write: 'success'.
    *endif.
    read   table lt_selected index sy-tabix.
    move lt_selected-fieldval to ECODE.

  • How to retrieve data from a web service

    Hi
    i am at very beginner level about web services.
    I am searching for a simple example of retrieving data from a web services, but cant find.
    How can i get xml data from a web service. i dont need to develop the web service it is already ready, i just need how could i fetch data from it.
    Can somebody point out or give an example?
    Thanks in advance

    Hi,
    just create a skeleton for the Web Service. In JDeveloper, create a new project and then use the "NEW" context menu option.
    Navigate to "Business Tier" --> Web Services and select "Web Service Proxy"
    In teh following, provide the WSDL reference to create the Java proxy. This gives you accss to the WS without having to parse the XML yourself
    Frank

  • NEED HELP IN USING ALL_TAB_COLUMNS FOR RETRIEVING DATA???

    A table say T1 contains column like Emp_id,Code.
    and there are several Code like C1,C2,C3.
    Another table say T2 contains column like
    Emp_id,C1,C2,C3.Here the value of the code field of the
    T1 table is now column of the T2 table.And the amount of
    each code of T1 table is equal to column value of T2
    table.
    Now I want to retrieve data from T2 table like
    C1 200
    C2 300
    C3 140
    I cannot retrieve data like this using all_tab_columns.
    I can only getting the column_name but cannot its value.
    PLEASE HELP ME...
    Edited by: user630863 on Apr 8, 2009 11:37 AM

    emp_id | code
    001 | C1
    001 | C2
    005 | C3
    005 | C1
    002 | C2
    002 | C3
    Table T1
    emp_id | C1 | C2 | C3
    001 | 10 | 15 |
    002 | | 7 | 12
    005 | 45 | | 94
    Table T2
    I have written a query
    select column_name from all_tab_columns a,T1 b
    where a.column_name=b.code
    and table_name='T2'
    OUTPUT:
    C1
    C2
    C3
    But I Need data for each employee like
    001 C1 10
    001 C2 15
    002 C2 7
    002 C3 12
    005 C1 45
    005 C3 94
    Edited by: user630863 on Apr 8, 2009 1:28 PM

Maybe you are looking for