At new and At last Concept

Hi All,
Is their any Possibilities to use AT LAST and AT NEW Concepts in WebDynpro ABAP.
Plz Give me the solution with an Example
Regards,
Vimalraj

Hi  Vimalraj,
yes you can use at new and at last as you would use in normal abap....
lets say i have a context node called: TABLE_NODE
and this node has two attributes, name: field1 and field2.... field1 is of type char and field2 is of type p.
table_node
>field1
>field2
and a context node called : TOTAL with an attribute "VALUE".  value is of type p.
total
>value
now i am interested in doing the sum for field2 and display that sum on my view....the ui element which is bound to my node "total"  attribute "value".  And also i am only interested in the sum of field value "A"...pls see code below.
so here is the code:
DATA lo_nd_table_node TYPE REF TO if_wd_context_node.
  DATA lo_el_table_node TYPE REF TO if_wd_context_element.
  DATA ls_table_node TYPE wd_this->element_table_node.
  DATA lt_table_node TYPE wd_this->elements_table_node.
navigate from <CONTEXT> to <TABLE_NODE> via lead selection
  lo_nd_table_node = wd_context->get_child_node( name = wd_this->wdctx_table_node ).
  lo_nd_table_node->get_static_attributes_table(
  IMPORTING
  table = lt_table_node ).
  ls_table_node-field1 = 'A'.
  ls_table_node-field2 = '1.0'.
  APPEND ls_table_node TO lt_table_node.
  ls_table_node-field1 = 'A'.
  ls_table_node-field2 = '2.0'.
  APPEND ls_table_node TO lt_table_node.
  ls_table_node-field1 = 'B'.
  ls_table_node-field2 = '5.0'.
  APPEND ls_table_node TO lt_table_node.
  ls_table_node-field1 = 'B'.
  ls_table_node-field2 = '2.0'.
  APPEND ls_table_node TO lt_table_node.
  DATA lo_nd_total TYPE REF TO if_wd_context_node.
  DATA lo_el_total TYPE REF TO if_wd_context_element.
  DATA ls_total TYPE wd_this->element_total.
  DATA lv_value LIKE ls_total-value.
navigate from <CONTEXT> to <TOTAL> via lead selection
  lo_nd_total = wd_context->get_child_node( name = wd_this->wdctx_total ).
get element via lead selection
  lo_el_total = lo_nd_total->get_element(  ).
get single attribute
  lo_el_total->get_attribute(
    EXPORTING
      name =  `VALUE`
    IMPORTING
      value = lv_value ).
  LOOP AT lt_table_node INTO ls_table_node.
    AT NEW field1.
      SUM.
      IF ls_table_node-field1 = 'A'.
        lv_value = ls_table_node-field2.   "at this point lv_value will be 3...
      ENDIF.
    ENDAT.
    lo_nd_table_node->bind_table( lt_table_node ).
  ENDLOOP.
get single attribute
  lo_el_total->set_attribute(
    EXPORTING
      name =  `VALUE`
      value = lv_value ).
that is all....similarly we can use at last.....
hope this helps...
J.
Edited by: J Are on Feb 22, 2009 6:49 PM

Similar Messages

  • At new and at last

    Hi...
    can i use At first or At last in the modulepool table control....
    if not , what is the alternate to get grandtotals in the table controls?
    Thanks,
    Naveen

    Hi
    No! U can't do it for the table control, but u can do it for the internal table with data tobe displayed by table control.
    Remember the LOOP of table control don't run all records, but only ones showed.
    If you have 100 records in your internal table and the table control can display only 10 records, if the record 20 is on the top of table control, the LOOP for table control loops from 20 to 29.
    Max

  • Hi Have new laptop as last laptop died. Now can't sync and Cannot connect to Itunes to authorise. I get error message -9808

    Hi Have new laptop as last one comitted suicide. I have loaded Itunes onto new laptop but cannot sync my Ipod. When I try to authorise this laptop, I am unable to log into Itunes and receive error message -9808. Can any one help.
    Thanks

    This should help:
    iTunes Store: "An unknown error occured (-9808)"

  • Old computer died and I am trying to install Illustrator CS5 on new computer. Last version I had before CS5 was/is Illustrator 10, which has been installed in new computer. CS5 install says I need CS2,3, or 4 before installing 5, but old computer went dir

    Old computer died and I am trying to install Illustrator CS5 on new computer.
    Last version I had before CS5 was/is Illustrator 10,which has been installed on new computer.
    CS5 install says I need CS2,3 or 4 before installing 5, but old computer went directly from 10 to CS5.
    How can I repeat this 10 to CS5 install?

    It does not seem likely that CS6 was upgraded from version 10.  You might want to check your purchase history in your Adobe account to see if there is some missing link in the chain of purchases you made.
    You can always try contacting Adobe support thru chat to see if they can find information or otherwise assist you in this matter.
    Serial number and activation chat support (non-CC)
    http://helpx.adobe.com/x-productkb/global/service1.html ( http://adobe.ly/1aYjbSC )

  • Hello, i'm using Iphone 5, with ios 7  . I have one old macbook, working with mac osx 10.6.8 and itunes last version updated. Itunes do not synchronize new contacts from my Iphone to my adress book mac.  What can i do ?

    Hello, i'm using Iphone 5, with ios 7  . I have one old macbook, working with mac osx 10.6.8 and itunes last version updated. Itunes do not synchronize new contacts from my Iphone to my adress book mac.  What can i do ?

    Hello, i'm using Iphone 5, with ios 7  . I have one old macbook, working with mac osx 10.6.8 and itunes last version updated. Itunes do not synchronize new contacts from my Iphone to my adress book mac.  What can i do ?

  • Why is it taking 19 hours to encode four avi. files. I just bought a new 21" iMac last week and it is just to slow to use. Thanks

    I just bought a new 21" iMac last week and it is just to slow to use. Before it used to take a couple of hours now its just way too long

    Hi
    As I understands it - This has nothing to do with Your iMac - Any Mac would take the same time.
    May be OS and support on the Window-PC platform handles this better.
    • .avi - is no specific codec (file format) but a container and the codec in this might not be one that iDVD can directly use (encode to .mpeg2 as on DVD disks)
    So either it just can't do it - or -
    iDVD has to back-encode to an usably codec - THIS IS WHAT I THINK HAS HAPPENED
    This back-encoding can take serious time - AND the final result usually is far from Good.
    I would
    • find out in what codec the .avi file is (I use QuickTime and in this inspector to read what codec .avi contains) (.mov is also a container)
    • import it into a program that can transcode to a better codec for iDVD - streamingDV or AIC (I GUESS)
    • then use this in iDVD
    Yours Bengt W

  • HT4993 Everytime i plug my phone into itunes it says it cant connect because the phone is locked well i restored my phone twice and set a new passcode the last time and it still wont work . I even deleted itunes and reinstalled it , it dosent work . HELP

    Everytime i plug my phone into itunes it says it cant connect because the phone is locked well i restored my phone twice and set a new passcode the last time and it still wont work . I even deleted itunes and reinstalled it , it dosent work . HELP PLZ !!

    I had the same issue. I tried everything unchecking / rechecking, formatting Iphone and restoring from backup etc etc.
    In the end it was a simple issue which might of might not help you.
    A number of months ago I relocated by Itunes folder to a NAS drive. It appears when I did the last I tunes update Itunes set the destination path of the Itunes media to the default location, the result was Itunes couldn't install music,apps, video until I set the correct destination path.
    The bit that confused me was it was transferring some media. This was of course the media I had downloaded since the last Itunes update which had gone to the default location.
    I hope that makes sense and is off some help.

  • New and Last MacBook Pro

    I have just signed a new and probably the last employment contract which includes a new
    Laptop..
    Am Considering the 15 inch, 8GB, 512GB Solid State DR.
    After reading through some of the discussion threads, decided to post the question
    and ask if I am doing the right thing?
    Is there still a freezing up problem?
    Other problems??
    I am in no hurry to order, so should I wait??
    tia for any advice
    Presently using a 2008 15inch and living with some mouse freezing...

    wey wrote:
    I have just signed a new and probably the last employment contract which includes a new
    Laptop..
    Am Considering the 15 inch, 8GB, 512GB Solid State DR.
    After reading through some of the discussion threads, decided to post the question
    and ask if I am doing the right thing?
    Is there still a freezing up problem?
    Other problems??
    I am in no hurry to order, so should I wait??
    tia for any advice
    Presently using a 2008 15inch and living with some mouse freezing...
    If you are basing your conclusion that their are freezing, or other problems with the Macbook Pro on what you read in the help forums I think you have reached an incorrect conclusion. If you reached a conclusion on the health of Americans based on only visits to a hospital emergency room you would conclude that everyone is in poor health.
    There are many thousands of Macbook Pro users who do not experience freezing problems. You never hear of these users as they do not post in these forums (they do not visit the hospital emergency room).
    Wait for what? If you want a Macbook Pro, or any other computer, now is the time to buy. Unless you think there will be Christmas discounts coming. But your employer is buying the laptop so price should not be a concern.
    Message was edited by: BobTheFisherman

  • DIFFERENCE BETWEEN "AT NEW " AND "AT FIRST" , "AT END OF" AND "AT LAST" ?

    WHAT IS THE DIFFERENCE BETWEEN "AT NEW " AND "AT FIRST" , "AT END OF" AND "AT LAST" WITH REFERENCE TO CONTROL BREAK STATEMENTS ? PLEASE EXPLAIN IN DETAIL.
    BEST REGARDS
    RYAN.

    Hi
    i am sending you a simple program in which i had write program on that events
    you can understand very easily
    Using AT FIRST , AT NEW, AT THE END OF , AT LAST.
    DATA: BEGIN OF ITAB OCCURS 0,
          F1 TYPE I,
          F2(6) TYPE C,
          F3(10) TYPE N,
          F4(16) TYPE P DECIMALS  2,
          END OF ITAB.
    DATA: SUB_TOT(10) TYPE P DECIMALS 3.
    **--1
    ITAB-F1 = 1.
    ITAB-F2 = 'ONE'.
    ITAB-F3 = 10.
    ITAB-F4 = '1000.00'.
    APPEND ITAB.
    CLEAR ITAB.
    ITAB-F1 = 1.
    ITAB-F2 = 'ONE'.
    ITAB-F3 = 20.
    ITAB-F4 = '2000.00'.
    APPEND ITAB.
    CLEAR ITAB.
    ITAB-F1 = 1.
    ITAB-F2 = 'ONE'.
    ITAB-F3 = 30.
    ITAB-F4 = '3000.00'.
    APPEND ITAB.
    CLEAR ITAB.
    *--2
    ITAB-F1 = 2.
    ITAB-F2 = 'TWO'.
    ITAB-F3 = 10.
    ITAB-F4 = '1000.00'.
    APPEND ITAB.
    CLEAR ITAB.
    ITAB-F1 = 2.
    ITAB-F2 = 'TWO'.
    ITAB-F3 = 20.
    ITAB-F4 = '2000.00'.
    APPEND ITAB.
    CLEAR ITAB.
    *-- 3
    ITAB-F1 = 3.
    ITAB-F2 = 'THREE'.
    ITAB-F3 = 10.
    ITAB-F4 = '1000.00'.
    APPEND ITAB.
    CLEAR ITAB.
    ITAB-F1 = 3.
    ITAB-F2 = 'THREE'.
    ITAB-F3 = 20.
    ITAB-F4 = '2000.00'.
    APPEND ITAB.
    CLEAR ITAB.
    SORT ITAB BY F1.
    LOOP AT ITAB.
    AT FIRST.
    WRITE: /35 ' MATERIAL DETAILS:'.
    ULINE.
    ENDAT.
    AT NEW F1.
    WRITE: / 'DETAILS OF MATERIAL:' COLOR 7  , ITAB-F1.
    ULINE.
    ENDAT.
    WRITE: / ITAB-F1, ITAB-F2, ITAB-F3, ITAB-F4.
    SUB_TOT = SUB_TOT + ITAB-F4.
    AT END OF F1.
    ULINE.
    WRITE: / 'SUB TOTAL :'  COLOR 3 INVERSE ON, SUB_TOT COLOR 3 INVERSE ON.
    CLEAR SUB_TOT.
    ENDAT.
    AT LAST.
    SUM.
    ULINE.
    WRITE: 'SUM:', ITAB-F4.
    ULINE.
    ENDAT.
    ENDLOOP.
    Using AT FIRST , AT NEW, AT THE END OF , AT LAST.
    DATA: BEGIN OF ITAB OCCURS 0,
          F1 TYPE I,
          F2(6) TYPE C,
          F3(10) TYPE N,
          F4(16) TYPE P DECIMALS  2,
          END OF ITAB.
    DATA: SUB_TOT(10) TYPE P DECIMALS 3.
    **--1
    ITAB-F1 = 1.
    ITAB-F2 = 'ONE'.
    ITAB-F3 = 10.
    ITAB-F4 = '1000.00'.
    APPEND ITAB.
    CLEAR ITAB.
    ITAB-F1 = 1.
    ITAB-F2 = 'ONE'.
    ITAB-F3 = 20.
    ITAB-F4 = '2000.00'.
    APPEND ITAB.
    CLEAR ITAB.
    ITAB-F1 = 1.
    ITAB-F2 = 'ONE'.
    ITAB-F3 = 30.
    ITAB-F4 = '3000.00'.
    APPEND ITAB.
    CLEAR ITAB.
    *--2
    ITAB-F1 = 2.
    ITAB-F2 = 'TWO'.
    ITAB-F3 = 10.
    ITAB-F4 = '1000.00'.
    APPEND ITAB.
    CLEAR ITAB.
    ITAB-F1 = 2.
    ITAB-F2 = 'TWO'.
    ITAB-F3 = 20.
    ITAB-F4 = '2000.00'.
    APPEND ITAB.
    CLEAR ITAB.
    *-- 3
    ITAB-F1 = 3.
    ITAB-F2 = 'THREE'.
    ITAB-F3 = 10.
    ITAB-F4 = '1000.00'.
    APPEND ITAB.
    CLEAR ITAB.
    ITAB-F1 = 3.
    ITAB-F2 = 'THREE'.
    ITAB-F3 = 20.
    ITAB-F4 = '2000.00'.
    APPEND ITAB.
    CLEAR ITAB.
    SORT ITAB BY F1.
    LOOP AT ITAB.
    AT FIRST.
    WRITE: /35 ' MATERIAL DETAILS:'.
    ULINE.
    ENDAT.
    AT NEW F1.
    WRITE: / 'DETAILS OF MATERIAL:' COLOR 7  , ITAB-F1.
    ULINE.
    ENDAT.
    WRITE: / ITAB-F1, ITAB-F2, ITAB-F3, ITAB-F4.
    SUB_TOT = SUB_TOT + ITAB-F4.
    AT END OF F1.
    ULINE.
    WRITE: / 'SUB TOTAL :'  COLOR 3 INVERSE ON, SUB_TOT COLOR 3 INVERSE ON.
    CLEAR SUB_TOT.
    ENDAT.
    AT LAST.
    SUM.
    ULINE.
    WRITE: 'SUM:', ITAB-F4.
    ULINE.
    ENDAT.
    ENDLOOP.
    <b>Reward if usefull</b>

  • AT NEW AND AT FIRST AND AT LAST

    WHAT IS THE FUNCTION OF AT NEW AND AT FIRST AND AT LAST?
    Title edited by: Alvaro Tejada Galindo on Dec 24, 2007 7:46 AM

    They are used inside loops to evaluate the value of a field....The value if the first, is it a new value, and so on...
    Greetings,
    Blag.

  • I have receive my new ipad 2 last wek and found scratched behind.what should the steps to cliam at JB area

    I have receive my new ipad 2 last wek and found scratched behind.what should the steps to cliam at JB area

    The iPad was sealed in the box when I got it. It had the plastic screen protector wrapped all around it and when I powered it on for the first time it displayed the "connect to iTunes for setup" message displayed. The only other thing I can think of is if the person I bought it from had ordered it through Verizon on and the iPad was set up on a number on his pre-existing verizon account. My question is should I just keep using it and consider myself lucky? Since there is no way for Verizon to charge me for the usage because I never signed a contract. I realize that if it is on the account belonging to the person I bought it from, they will eventually figure this out and shut it off. But I might as well use it in the meantime right?

  • I changed my Apple ID and password last week.  Today I cannot get into my computer with the new password..help!

    I changed my Apple ID and password last week.  Today I cannot get into my computer with the new password..help!

    Your Apple id password is not necessarily the same as your log-in password.
    The former is what you use to log-in to Apple services and sites. The latter is what you use to login to your computer. That does not change when you change your Apple ID password. Try the original computer login password.

  • HT5622 I lost all my pictures! Please help:( I added all my photo to a new album from the camera roll and i delete the picture that already move to new album, at last all my picture was gone !:'( Please, anyway to recover back all my photo? please help :'

    I lost all my pictures! Please help:( I added all my photo to a new album from the camera roll and i delete the picture that already move to new album, at last all my picture was gone !:'( Please, anyway to recover back all my photo? please help :'( Apple Service Center or Branch can help?

    Albums is a way or sorting photos. Photos aren't moved from the Camera roll. The Camera Roll consists of all the photos on the phone. If you delete from Camera Roll they are deleted everywhere but Photo Stream.
    Are you using Photo Stream? Your photos, providing they wer recent should still be in Photo Stream. If you have Photo Stream set up on your computer they should all be there.

  • Hey every one ,i bought a new ipad 2 last month,i am not using it  so much but  sometimes it does respond,hang's up,all games and app come out of there folder . can you plz help me

    hey every one ,i bought a new ipad 2 last month,i am not using it  so much but  sometimes it does respond,hang's up,all games and app come out of there folder . can you plz help me.my email id is [email protected]

    Try a reset. Hold the Sleep and Home button down for about 10 seconds until you see the Apple logo. Ignore the red slider.
    Don't leave your email address on a public forum

  • I can not create a new ID in my iphon 4s, well I've created several to solve the problem of FaceTime, and the last restoration would not let me create a new ID. I can do? Thanks for helping.

    I can not create a new ID in my iphon 4s, well I've created several to solve the problem of FaceTime, and the last restoration would not let me create a new ID.
    I can do?
    Thanks for helping.

    Thanks Ckuan
    I can do, to create new ID?
    No way to delete all information from Iphon to create another ID?
    I will appreciate your answer

Maybe you are looking for

  • List of logon/logoff activity for a user in specfied date range

    Hello all, We have a requirement to check the activity of two users. It is requested that we get their logon/logoff and timeout activity in our PRD system for a specfic range of dates.  To retrieve that info do we have to be auditing their user ID's

  • ALV Grid Download to Excel - Columns in wrong order

    I'm using the object cl_gui_alv_grid to output an ALV grid to the screen.  I've populated the field catalogue as follows: wa_alvfieldcat-col_pos = 1. wa_alvfieldcat-just = 'L'. wa_alvfieldcat-reptext = 'Customer Name'. wa_alvfieldcat-scrtext_s = 'Cus

  • How to storage the material involved in an imovie project

    Hello, I want to start a new project, but as my last one is super heavy (340GB) i want to save all the material involved in that heavy project (the project+ the events,gop, etc) in my external hard drive so i can free space from the macbook and start

  • Can't Download PDF and ZIP Oracle Documentation

    Hi! I love you all at OTN. You are doing a great job, enlightening us about Oracle technologies. Well done. I experienced a problem while trying to download the Oracle documentation files in pdf format. All the download management software I tried to

  • Shell script issue

    Hi All, Am new to DB and unix....Trying to find the diskspace utilization of the filesystem so as to get an alert if it crosses limit. Here is the code that i am trying to run but it doesn't seem to work. Need ur help on this #!/bin/bash #--To send a