Hello, everybody,regarding  events  At LAST,AT END,

Hello everybody:
    thank you all in advance for your help!
     What's the difference between at-last event and at-end event,  would you please give me an example, couldn't thank you more!
     Best regards
    Frank

Hi,
This is very good document for you.
Processing Control Levels
When you sort an extract dataset, control levels are defined in it. For general information about control levels, refer to Processing Internal Tables in Loops The control level hierarchy of an extract dataset corresponds to the sequence of the fields in the HEADER field group. After sorting, you can use the AT statement within a loop to program statement blocks that the system processes only at a control break, that is, when the control level changes.
AT NEW <f> | AT END OF <f>.
ENDAT.
A control break occurs when the value of the field <f> or a superior field in the current record has a different value from the previous record (AT NEW) or the subsequent record (AT END). Field <f> must be part of the HEADER field group.
If the extract dataset is not sorted, the AT... ENDAT block is never executed. Furthermore, all extract records with the value HEX 00 in the field <f> are ignored when the control breaks are determined.
The AT... ENDAT blocks in a loop are processed in the order in which they occur. This sequence should be the same as the sort sequence. This sequence must not necessarily be the sequence of the fields in the HEADER field group, but can also be the one determined in the SORT statement.
If you have sorted an extract dataset by the fields <f1>, <f2>, ..., the processing of the control levels should be written between the other control statements as follows:
LOOP.
  AT FIRST.... ENDAT.
    AT NEW <f1>....... ENDAT.
      AT NEW <f2>....... ENDAT.
          AT <fgi>..... ENDAT.
          <single line processing without control statement>
      AT END OF <f2>.... ENDAT.
    AT END OF <f1>.... ENDAT.
  AT LAST..... ENDAT.
ENDLOOP.
You do not have to use all of the statement blocks listed here, but only the ones you require.
REPORT DEMO.
DATA: T1(4), T2 TYPE I.
FIELD-GROUPS: HEADER.
INSERT T2 T1 INTO HEADER.
T1 ='AABB'. T2 = 1. EXTRACT HEADER.
T1 ='BBCC'. T2 = 2. EXTRACT HEADER.
T1 ='AAAA'. T2 = 2. EXTRACT HEADER.
T1 ='AABB'. T2 = 1. EXTRACT HEADER.
T1 ='BBBB'. T2 = 2. EXTRACT HEADER.
T1 ='BBCC'. T2 = 2. EXTRACT HEADER.
T1 ='AAAA'. T2 = 1. EXTRACT HEADER.
T1 ='BBBB'. T2 = 1. EXTRACT HEADER.
T1 ='AAAA'. T2 = 3. EXTRACT HEADER.
T1 ='AABB'. T2 = 1. EXTRACT HEADER.
SORT BY T1 T2.
LOOP.
  AT FIRST.
    WRITE 'Start of LOOP'.
    ULINE.
  ENDAT.
  AT NEW T1.
    WRITE / '   New T1:'.
  ENDAT.
  AT NEW T2.
    WRITE / '   New T2:'.
  ENDAT.
  WRITE: /14 T1, T2.
  AT END OF T2.
    WRITE / 'End of T2'.
  ENDAT.
  AT END OF T1.
    WRITE / 'End of T1'.
  ENDAT.
  AT LAST.
    ULINE.
  ENDAT.
ENDLOOP.
Reward if useful

Similar Messages

  • Hello, everybody, who know how to use the function READ_TEXT

    Hello , everybody,  I came across a program in which there is a function  READ_TEXT, what is it used for ? please specify the parameters  id object 
    . Thank you in advance, mate.
             Best regards                                                                               
    Frank
    CALL FUNCTION 'READ_TEXT'
          EXPORTING
        CLIENT                        = SY-MANDT
            id                            = '0207'
            language                      = sy-langu
            name                          = tmp_name
            object                        = 'VBBK'
        ARCHIVE_HANDLE                = 0
        LOCAL_CAT                     = ' '
      IMPORTING
        HEADER                        =
          TABLES
            lines                         = text_itab
         EXCEPTIONS
           id                            = 1
           language                      = 2
           name                          = 3
           not_found                     = 4
           object                        = 5
           reference_check               = 6
           wrong_access_to_archive       = 7
           OTHERS                        = 8

    Refer this link:
    http://help.sap.com/saphelp_nw04/helpdata/en/d6/0db764494511d182b70000e829fbfe/frameset.htm
    READ_TEXT provides a text for the application program in the specified work areas.
    The function module reads the desired text from the text file, the text memory, or the archive. You must fully specify the text using OBJECT, NAME, ID, and LANGUAGE. An internal work area can hold only one text; therefore, generic specifications are not allowed with these options.
    After successful reading, the system places header information and text lines into the work areas specified with HEADER and LINES.
    If a reference text is used, SAPscript automatically processes the reference chain and provides the text lines found in the text at the end of the chain. If an error occurs, the system leaves the function module and triggers the exception REFERENCE_CHECK.
    Function call:
    CALL FUNCTION 'READ_TEXT'
    EXPORTING CLIENT = SY-MANDT
    OBJECT = ?...
    NAME = ?...
    ID = ?...
    LANGUAGE = ?...
    ARCHIVE_HANDLE = 0
    IMPORTING HEADER =
    TABLES LINES = ?...
    EXCEPTIONS ID =
    LANGUAGE =
    NAME =
    NOT_FOUND =
    OBJECT =
    REFERENCE_CHECK =
    WRONG_ACCESS_TO_ARCHIVE =
    Export parameters:
    CLIENT
    Specify the client under which the text is stored. If you omit this parameter, the system uses the current client as default.
    Reference field: SY-MANDT
    Default value: SY-MANDT
    OBJECT
    Enter the name of the text object to which the text is allocated. Table TTXOB contains the valid objects.
    Reference field: THEAD-TDOBJECT
    NAME
    Enter the name of the text module. The name may be up to 70 characters long. Its internal structure depends on the text object used.
    Reference field: THEAD-TDNAME
    ID
    Enter the text ID of the text module. Table TTXID contains the valid text IDs, depending on the text object.
    Reference field: THEAD-TDID
    LANGUAGE
    Enter the language key of the text module. The system accepts only languages that are defined in table T002.
    Reference field: THEAD-TDSPRAS
    ARCHIVE_HANDLE
    If you want to read the text from the archive, you must enter a handle here. The system uses it to access the archive. You can create the handle using the function module ACHIVE_OPEN_FOR_READ.
    The value '0' indicates that you do not want to read the text from the archive.
    Reference field: SY-TABIX
    Default value: 0
    Import parameters:
    HEADER
    If the system finds the desired text, it returns the text header in this parameter.
    Structure: THEAD
    Table parameters:
    LINES
    The table contains all text lines that belong to the text read.
    Structure: TLINE
    Exceptions:
    ID
    The text ID specified in the parameter ID does not exist in table TTXID. It must be defined there together with the object of the text module.
    LANGUAGE
    The parameter LANGUAGE contains a language key that does not exist in table T002.
    NAME
    The parameter NAME contains the name of a text module that does not correspond to the SAPscript conventions.
    Possible errors:
    The field contains only blanks.
    The field contains the invalid characters ‘*’ or ‘,’.
    OBJECT
    The parameter OBJECT contains the name of a text object that does not exist in table TTXOB.
    NOT_FOUND
    The system did not find the specified text module.
    REFERENCE_CHECK
    The text module to be read has no text lines of its own but refers to the lines of another text module. This reference chain can include several levels. For the current text, the chain is interrupted, that is, one of the text modules referred to in the chain no longer exists.
    WRONG_ACCESS_ TO_ARCHIVE
    The exception WRONG_ACCESS_TO_ARCHIVE is triggered if an archive is accessed using an incorrect or non-existing archive handle or an incorrect mode (that is, read if the archive is open for writing or vice versa).
    Raja T

  • Need to get data till last month end by using Calday

    Hello SAPiens,
    Could anybody please guide me how to get the data till last month end date.
    Example: If i m executing a report in 05 November 2009 then i should get all the details of last month till last date of the Calmonth. thanks in advance.
    Regards,
    Sandy.S

    Hi,
    you can do the following:
    Create a Customer Variable for Calday
    EXIT_SAPLRSOO_001 ---> Include ZXRSRUO1 write the code for the variable created above
    DATA : date TYPE sy-datum.
    date = sy-datum. "Today
    date+6(2) = '01'. "First day of this month
    date = date - 1. "Previous day before first day of this month = last day of last month
    Or
    you can you many function Modules
    CALL FUNCTION 'RP_LAST_DAY_OF_MONTHS
    FKK_LAST_DAY_OF_MONTH
    OIL_LAST_DAY_OF_PREVIOUS_MONTH
    Santosh

  • How to use at last/ at end of in this code

    Hi,
    i want to do sum for each and every line item of the delivery quantity and compare it with final purchase order quantity if it is equal do not display in the output.(how to use at last/at end of ) in this code,
    below code wat i have ritten is only comparing first record with final purchase order quantity and displaying the output, but i want sum of every line item and compare with final quantity(purchase order quantity)
    if possible try modify this code
    clear:wa_final,wa_kopoo,wa_likpp1.
        loop at it_kopoo into wa_kopoo.
          move wa_kopoo-ebeln to wa_final-ebeln.
          move wa_kopoo-ebelp to wa_final-ebelp.
          move wa_kopoo-matnr to wa_final-matnr.
          move wa_kopoo-txz01 to wa_final-txz01.
          move wa_kopoo-menge to wa_final-menge.
          move wa_kopoo-meins to wa_final-meins.
          move wa_kopoo-werks to wa_final-werks.
          move wa_kopoo-matkl to wa_final-matkl.
          move wa_kopoo-reswk to wa_final-reswk.
          move wa_kopoo-aedat to wa_final-aedat.
          move wa_kopoo-ekgrp to wa_final-ekgrp.
          move wa_kopoo-EINDT to wa_final-EINDT.
        read table it_likpp1 into wa_likpp1 with key vgbel = wa_final-ebeln
                                                     vgpos = wa_final-ebelp.
          if sy-subrc eq 0.
            if wa_final-menge > wa_likpp1-LFIMG.
            else.
              continue.
            endif.
          endif.
          append wa_final to it_final.
          clear:wa_final,wa_kopoo,wa_likpp1.
        endloop.
      endif.

    Hi,
    Try this:
    define one more internal table it_final1 similar to i_final .
    CLEAR:wa_final,wa_kopoo,wa_likpp1.
    SORT it_kopoo BY ebeln ebelp.
    LOOP AT it_kopoo INTO wa_kopoo.
      move-corresponding wa_kopoo to wa_final.
      COLLECT wa_final INTO it_final1.
      CLEAR: wa_kopoo, wa_final.
    ENDLOOP.
    sort it_final1 by ebeln ebelp.
    LOOP AT it_final1 INTO wa_final.
      READ TABLE it_likpp1 INTO wa_likpp1 WITH KEY vgbel = wa_final-ebeln
                                                   vgpos = wa_final-ebelp.
      IF sy-subrc EQ 0.
        IF wa_final-menge NE wa_likpp1-lfimg.
          APPEND wa_final TO it_final.
        ENDIF.
      ENDIF.
    ENDLOOP.
    Regards,
    Subramanian

  • Hello, everybody,  help me with quota arragement and release Purchase Order

    Hello everybody:
            When maintain Quota arrangement today, a warning message poped up saying Quota arrangement for Material X10002 in plant 1855 not active. but X10002 does exist, I can maitnain it with MM02. 
             Why this happened? everyone.
             what's more,  all purchase order can not be released  with me29n , but ok with me28. why is it so  ? thank  you in advance, everybody. couldn't thank you more.

    Hi,
    Regarding your 2 nd Query.
    ME29N - Indidual Release
    Suppose when my PO is subjected to three release code, this transaction gives me an option to release the three levels altogether by the highest level ( ie the three level release will be able to perform the release if R1 and R2 have not released )
    ME28 - Collective Release.
    This needs to be released by inidviuals using their release code independently thereby the release is possible only with the three levels releases the same.
    The names given to transaction codes is a little bit confusing unless until you are clear about the fucntionality.
    Regards,
    DilliB

  • Getting Last Month End date

    Dear Experts,
    I want the following result. I have a date parameter. I want to
    get the last / end date of the previous month
    for any given date which the user inputs.
    For ex:
    If user puts the date 15.06.2008
    then i want to get the previous month end date i.e. 31.05.2008.
    The reason being i am creating a program for updating Opening and Closing Stocks of every month in a ZTABLE. The user will put the date in the parameter and system will bring the closing stock of previous month and then calculate for the current month.
    I hope i am not complicating matters too much....
    Basic funda is to arrive at the end date of the previous month for any date which the user puts.
    Please help me... it is mission critical..
    Thanks & Regards,
    Jitesh M Nair

    hi,
    use this to get last month end date.
    ex:
    data: d2 like sy-datum.
    d2 = sy-datum.
    d2+6(2) = '01'.
    d2 = d2 - 1. "prev mnth last date
    write:/ d2.

  • Hello everybody,anyone can inform me plz if apple solve the problem of Maps

    hello everybody,anyone can inform me plz if apple solve the problem of Maps,

    i am in qatar ,i have iphone 4 (IOS 7) and after I determine the start and end point for the place where I want to go then i do route ,I receive this window :direction not available ,a route cannot be determined from this start location(this is old problem since ios4 maybe. plz any news about new solution .

  • Hello everybody, I need to update my ITunes on my MAC (laptop) to the newer version so I can then be able to update the latest updates for my Iphone-3G'S. I don't require a complete reinstall just need to be able to update it.What I have tried so far is I

    Hello everybody, Im trying to update my ITunes on my MAC (laptop) to the newer version so I can then be able to update the latest updates for my Iphone-3G. I don’t require a complete reinstall just need to be able to update my itunes.
    What I have tried so far is I had my MAC search for update’s and it said that I should update to (ITunes version  10 . 6 . 3 ) So I asked it to do the update but after 2hrs of waiting for it to download/update it then puts up a message saying the following- (In order to continue installation, please close the following application: ITunes).
    When I tried to do this another message comes up that says- (The update ITunes can’t be installed. The following install step failed: run preupgrade script for Apple mobile device support. Contact the software manufacturer for assistance.)
    I have also tried to run the update while having closed ITunes before I even start the update but the same problem happens after waiting about 2hrs.
    Some one that had the same problem said this might be happening in the older operating systems. But that does not make sense because surely Apple want customers who own a MAC and i-phone to still buy from iTunes.
    My MAC is about 4-5years old. I have a i-phone.3G, 
    Can anybody help me please and Thank you?

    Download iTunes using the tab at the top of this page. Then run the update with iTunes closed.

  • Hello everybody, is anybody else having problems exporting music to their iphone 4's from their itunes 10.6.1. (7)?

    hello everybody, is anybody else having problems exporting music to their iphone 4's from their itunes 10.6.1. (7)? i sure am. somehting is way differant. i used to be able to simply drag, and drop albums, artists, and entire genres to my phone without a worry. now i drag an album to my phone, and it will only add a couple of the songs. so i drag and drop again, and maybe even a third time to get all whole album on there. oh, and the album artwork is a no-show. i dont know what i'm missing. it's sure not what i'm used to. anyways, i'm new to this support community deal. thank you in advance for any help.
    much respect,
    tommy bravo

    After further testing, I noticed that iTunes not only becomes totally unresponsive but will start using all the CPU until I kill the process. After restarting, it works again for a while and then it dies again...
    Luis

  • Hello everybody,i've forgot my apple password and i wanted to reset it to a new one but i also forgot the security question and the alternative email does not work and i am really need to log in to my apple i d because my iPhone 4g won't  let me access it

    Hello everybody,i've forgot my apple password and i wanted to reset it to a new one but i also forgot the security question and the alternative email does not work and i am really need to log in to my apple i d because my iPhone 4g won't  let me access it so anyone can help me with it or can i put another apple id to it without putting the first password?THANKS FOR YOUR HELP.

    Then call AppleCare and talk to someone in account security.

  • Hello everybody out there, which way can I get the screensaver from Lion get back on Mountain Lion??

    Hello everybody out there.
    Which way can I get the screensaver from Lion get back on Mountain Lion??
    Thanks
    malibu0978

    Thanks very much I have contacted them via this. Just hope they respond quickly- rather annoing! Greatly appreciated though

  • Hello everybody, my Iphone feld on the ground. Now its broken the display is damaged. What can I do??!!

    Hello everybody, my Iphone feld on the ground. Now its broken the display is damaged. What can I do??!!
    I have the AppleCare Protection Plan!
    Can i send my iPhone to appel and then they replace my iphone??

    If you have AppleCare+ you can get the phone replaced for $49. Call or take it in to your local Apple Store (make an appointment first).

  • After updating to IOS 6 last week end my I books do not open, is there something else I should do?

    After updating to IOS 6 last week end my I books do not open when touched is this a problem? What am I missing?
    Thanks

    nope.  I think the update erased the contacts.  The update was for an exchange calendar bug.  This may have affected my contacts.  I use windows mail version for vista.  It just seemed simple to read mail without setting up outlook.  So I guess ordinarily I would just get them off the computer thru itunes but without a program to sync to I guess they are gone.  Some are still there with phone numbers but I guess only facebook friends.  What a mess.  I guess they are all gone.  I had originally thought that they would be backed up.  Now I guess I am building two or three years of contacts again.  Wish I'd kept my old phone.  Would have been worth the money to just keep that as a back-up.

  • Hello everybody. I have Mac Os X 10.6.8. Can I star with use creative clouds, or it's impossible?

    Hello everybody. I have Mac Os X 10.6.8. Can I star with use creative clouds, or it's impossible?

    Hi Daniele,
    The CC2014 applications are only compatible with 10.7 or later but you can install CC and CS6 versions of most of Adobe applications but not all.
    You can refer to the link mentioned below:
    http://helpx.adobe.com/creative-cloud/system-requirements.html
    Creative Cloud for desktop FAQ
    Thanks,
    Nikhil Gupta

  • Logic regarding EVENTS OnFilter and OnLeadSelect for table ui element

    provide me logic regarding EVENTS OnFilter and OnLeadSelect for table ui element for webdynpro abap application.

    OnLeadSelect - What kind of logic do you want?  There are many different things that you could do inthe OnLeadSelect
    onFilter- Generally you use IF_WD_TABLE_METHOD_HNDL~APPLY_FILTER  to perform the filter operation.
    In the onFilter itself you probably just have one line of code:
    wd_this->table_method_hndl->apply_filter( ).
    In your WDDOMODIFYVIEW you probably have this code to capture the table_method_hndl object:
    if first_time = abap_true.
      * Get reference of the table view element
      l_table ?= view->get_element( 'TABLE' ).
    * Get reference to the Filter & Sorting API
      wd_this->table_method_hndl ?= l_table->_method_handler.
    endif.

Maybe you are looking for

  • Reading variable from another class

    If you have two java classes both inside the same java package. And you declared a variable for example String bob; bob = "hello world?"How would you make it so that the other file could then output this value System.out.print(bob);Would you have to

  • My skype no shows Line Busy Always

    Hello, I have got Skype No for US [number redacted for privacy] forwarded to my Indian mobile no. However, if someone calls this no it always shows "Line Busy". Ideally, it should forward calls to my Indian mobile and also offer Voice Msg options..

  • Really annoying 'skipping' problem with itunes

    Hi I have recently purchased a new laptop running vista (an HP pavillion 2550) I transfered all my music over from my desktop to use on the move. The trouble is now all the somgs seem to skip at regular intervals. I have never had this on itunes on o

  • Blank CD and Sidebar behavior

    Can someone confirm this behavior for me: 1. Stick a blank cd into your drive 2. Open the finder and locate the blank cd icon in the sidebar 3. Control Click the sidebar cd icon and select eject 4. You get a finder message that says, "Are you sure yo

  • Need help with user defined function

    Hello SDN, I need some help with a user-defined function. My source message contains multiple generic records (1000 char string), and my target message is 1 header record, then multiple generic records.  See description of source and target messages