URGENT-- Data is going to delete after end of loop .

hi all,
i have written code .....
SELECT DISTINCT M1VKBUR M1KUNNR M1VBELN M1BSTNK M1AUDAT M1KNUMV M2NETWR M2MWSBP M3ERDAT M3FKART
                                     INTO CORRESPONDING FIELDS OF TABLE ITAB
                                     FROM VBAK AS M1 INNER JOIN VBRP AS M2
                                     ON M1VBELN = M2AUBEL
                                     INNER JOIN VBRK AS M3 ON M2VBELN = M3VBELN
                                     WHERE M1~VKBUR IN VKBUR
                                          AND M3~ERDAT IN ERDAT
                                           AND M1~KUNNR IN KUNNR
                                            AND M3~FKART IN FKART .
DELETE ADJACENT DUPLICATES FROM ITAB COMPARING VBELN .
LOOP AT ITAB .
SELECT KAWRT KBETR INTO CORRESPONDING FIELDS OF TABLE ITAB2 FROM KONV
               WHERE KNUMV = ITAB-KNUMV
               AND KSCHL IN ('SKTO' , 'INV1') .
  MODIFY ITAB2 INDEX SY-TABIX TRANSPORTING KAWRT KBETR .
ENDLOOP .
LOOP AT ITAB2 .
  ITAB-CD_AMT = ITAB2-KAWRT * ITAB2-KBETR / 10 .
  ITAB-AMT_DUE = ITAB-NETWR + ITAB-MWSBP - ITAB-CD_AMT .
  MODIFY ITAB INDEX SY-TABIX TRANSPORTING CD_AMT AMT_DUE  .
ENDLOOP .
problem is that i m not getting values in itab2 at end of itab, its going to delete after completing  last itab value of KNUMV.
can anybody help me its urgent .
thanks in advance .
Anil .

Hi Anil..
There are some corrections needed in ur Code..
Check the modified code: Changes in BOLD
SELECT DISTINCT M1VKBUR M1KUNNR M1VBELN M1BSTNK M1AUDAT M1KNUMV M2NETWR M2MWSBP M3ERDAT M3FKART
INTO CORRESPONDING FIELDS OF TABLE ITAB
FROM VBAK AS M1 INNER JOIN VBRP AS M2
ON M1VBELN = M2AUBEL
INNER JOIN VBRK AS M3 ON M2VBELN = M3VBELN
WHERE M1~VKBUR IN VKBUR
AND M3~ERDAT IN ERDAT
AND M1~KUNNR IN KUNNR
AND M3~FKART IN FKART .
<b>SORT ITAB BY VBELN.</b>
DELETE ADJACENT DUPLICATES FROM ITAB COMPARING VBELN .
<b>IF ITAB[] IS NOT INITIAL.</b>
SELECT KAWRT KBETR INTO CORRESPONDING FIELDS OF TABLE ITAB2
FROM KONV
<b>FOR ALL ENTRIES IN ITAB</b>
WHERE KNUMV = ITAB-KNUMV
AND KSCHL IN ('SKTO' , 'INV1') .
<b>ENDIF.</b>
LOOP AT ITAB2 .
ITAB-CD_AMT = ITAB2-KAWRT * ITAB2-KBETR / 10 .
ITAB-AMT_DUE = ITAB-NETWR + ITAB-MWSBP - ITAB-CD_AMT .
MODIFY ITAB INDEX SY-TABIX TRANSPORTING CD_AMT AMT_DUE .
ENDLOOP .
Now it works properly.. And with better performance.
Note: Avoid using CORRESPONDING FIELDS option in the SELECT when the Internal table structure is same as the Fields selected.
<b>Reward if Helpful.</b>

Similar Messages

  • HOT backup done but archives deleted after end backup, so need backup from

    Hello Team,
    I did HOT CLONE upto sequence :-
    alter database begin backup; and golbal change#=12564
    alter database end backup ; and sequence#=12675
    Now the problem is my archives are deleted between 12564 and 12675,
    I want to take backup for the sequences deleted from production, How can i do??

    No, It's not possible.
    Datafiles contains the data being thrown into the database from its inception (first use of the Database itself). That too, the data is scattered inside the datafiles, so you couldn't guess that based upon time when they're filled up i.e. it's not like one data file will be used first and other one next...based upon the factors like how your tablespaces are defined etc...Data will be scattered.
    As someone answered, try to copy archives from production (OS level copy) and recover the Database here.
    PS:Please dont forget to change thread status to answered if it possible when u belive your thread has been answered, it pretend to lose time of other forums user while they are searching open question which is not answered,thanks for understanding
    Thanks,
    CSM

  • Has anyone else had iCloud notes automatically deleted after ending a skype call?

    I was making notes during a Skype call and when I ended the call the note was gone.
    This has happened twice now, the first time I presumed it was my mistake. When it happened again in exactly the same conditions I knew it wasn't my doing.
    has this happened to anyone else? Does anyone know if the notes are recoverable?
    Thanks

    Hi AP_In_Surbiton,
    I am really sorry that you have had so much trouble getting your Caller ID up and going.  I'll be happy to help you out with this and get it working for you.
    Could you drop me in an email please? Use the 'contact us' form in my forum profile under the 'about me' section. You can find it by clicking on my username.
    Thx
    Craig
    BTCare Community Mod
    If we have asked you to email us with your details, please make sure you are logged in to the forum, otherwise you will not be able to see our ‘Contact Us’ link within our profiles.
    We are sorry but we are unable to deal with service/account queries via the private message(PM) function so please don't PM your account info, we need to deal with this via our email account :-)”
    td-p/30">Ratings star on the left-hand side of the post.
    If someone answers your question correctly please let other members know by clicking on ’Mark as Accepted Solution’.

  • Urgent Assistance Needed:  All Documents deleted after setting system-wide viewing preferences for Finder

    I got myself into some trouble...
    Following the guide here to force a default Folder view to sub folders:  http://apple.stackexchange.com/questions/10488/system-wide-finder-view-preferenc es
    Which is:
    There is a simpler way.
    In the Terminal, navigate to your $HOME directory: cd ~
    Remove all the .DS_Store files:find ~ -name ".DS_Store" -depth -exec rm -f {} \;
    Relaunch finder going to: Force Quit → Finder
    Set your global preferences using ⌘J and press the Use as default button.
    Now, every folder you open or create will have the new settings.
    I now have the existing Folder structure in tact for Documents, but every single file is gone (in my entire Documents directory).
    Naturally I'm thinking two things:
    1)  Oh no.  I knew better than to go down this path without knowing exactly what I was doing.
    2)  How do I "get my files back..."
    I'm not sure if they're just not viewable or if they were deleted.  Essentially everything I've configured on the machine (From Apple login to mouse scroll reversal) has been undone.  I don't have TimeMachine set up yet - I brought two remote hard drives to work today to get it done but they're both NTFS so I couldn't progress. 
    I'm reasonably technical but new to Mac. 
    Advice is greatly appreciated... I'm GREATLY distressed at the moment...
    <Edited by Host>

    Ok so "DS_Store files are used by Mac OS X to store folder specific metadata information."  Supposedly they get recreated... except I didn't get a nice smooth transition of newly created invisible, instead every file on my machine is "gone."

  • Production Order reservation(ETO) not deleting after PGI (VL01N)

    Hi All,
    Greetings!!!
    A query, regarding ETO (Project system)
    ETO scenario, For production, reservation will be create through WBS element. After production , If I do delivery and PGI,  production order reservation is not deleting.
    Same material If I do delivery(LP) through CNS0, then order reservation is going to delete after PGI. But Sales order price is not copying to Billing If I follow this process.
    Is there any copy controls to flow the sales price to billing when delivery happens through CNS0. If not
    Which requirement class and movement type I need to determine in Sales order.
    Please do needful.
    Very High,
    Thanks,
    Prasad.

    This is standard SAP
    SAP process is to deliver project stock using project delivery , where in PGI happens against the reservation created & deletes RESERVATION.
    wherein if you do PGI for order ( sale order or prod order ) , it happens against project stock ( spe stk Q - 281 movement )  i.e., against WBS element
    I faced the same for sale order delivery of project stock .
    we are selecting FINAL Issue indicator through user exit which triggers when PGI is clicked
    This will delete RESERVATION from stock overview
    hope this helps ...Let me know if you found any alternative

  • Reg  Order reservation not deleting after PGI (VL01N)

    Hi All,
    ETO scenario, For production, reservation will be create through WBS element. After production , If I do delivery and PGI,  production order reservation is not deleting.
    Same material If I do delivery(LP) through CNS0, then order reservation is going to delete after PGI. But Sales order price is not copying to Billing If I follow this process.
    Is there any copy controls to flow the sales price to billing when delivery happens through CNS0. If not
    Which requirement class and movement type I need to determine in Sales order.
    With regards,
    Prasad.
    Edited by: SDGURU on Feb 9, 2011 10:50 AM
    Edited by: SDGURU on Feb 9, 2011 10:51 AM
    Edited by: SDGURU on Feb 9, 2011 11:14 AM

    Hi All,
    Please do need full.
    Regards,
    Prasad.

  • Behaviour of "Disable/Delete User After End Date" Task

    Hi Expert,
    We ran the given OOTB task "Disable/Delete User After End Date" and the behavior is always delete. How,if possible, to change the behavior to disable?
    Thanks in advance.
    SK

    In order to change the behavior, you have to set the system manager preference called "Period to Delay User Delete" to something bigger than the task will make the user disabled and will automatically delete them at a future date.

  • Hi why are my photos after downloading twice ,once in photo library and once in a file with the date why cant i delete a file its an iphone 4s please help

    why are my photos after downloadon twice one as photo library the other as a file with date how can i delete one file same pics

    Generally I would not use Facebook for sharing any photos, it compresses the photos substantially, and when you have shadows and dark colours you get visible "bands" where there should be subtle gradients, ie at sunsets and sunrises.
    It sounds like you are using two methods to upload to Facebook:
    1. Sharing from within Aperture, which basically syncs Facebook with your Aperture album, so any changes made at either end gets synced, hence the deletions from Albums, although the original file should still be in your library, just removed rom the album. It is like a playlist in iTunes.
    2. Exporting pics and uploading to Facebook from the browser.
    I am not sure how method 1 gets compressed, but I know that uploading hi-res jpegs to Facebook using method 2 results in poor quality images.
    I wouldn't even bother comparing option 1 or 2, and they will both be poor images once you view them on Facebook, as opposed to viewing uploaded images on proper image sharing / hosting sites.
    Your problem is not with Aperture, it is using Facebook for showing your work.
    If you export pics form Aperture at high res jpegs or TIFFs your images will be fine.
    If you insist to use Facebook as your way to share your work, then your workflow should be this:
    1. Right click images you want to share.
    2. Select Export version.
    3. Export as 100% size and ensure the export settings are set at 100% quality.
    4. Upload this pic into Facebook.
    This will get you the best image size and resolution on Facebook.
    See how you go.

  • All data deleted after upgrade to iOS8

    I am deeply sad. All data has been deleted after upgrade to iOS8.
    What I did:
    1. Connect ipad to PC to transfer records from voice recorder.
    2. iTunes offered to upgrade system.
    3. I confirmed.
    4. Some unknown error occured in the end of upgrade process.
    5. When iPad started, iOS8 was there. All data disappeared.
    6. I am sad. All valued data I need is lost... (no backup has been done before upgrade).
    Pls advice is it possible to get data back.

    Yes. I did backup.
    But don't know how to get it.
    Actualy, all I need is 2 records from Recorder programm. Before upgrade I downloaded records from itunes; screen → http://joxi.ru/caQdVIwyTJDKAjTtsuk
    Now it is empty, no records.
    I see that backup of this programm data available in storage. But don't know how to get it from there; screen → http://joxi.ru/taUdVP3JTJAaYtIkBaI
    By the way iTunes tells me that backup copies available for today only → http://joxi.ru/7KUdVP3JTJBAXfQZjgI

  • HT201412 After ios7, My iphone4 has gone dead twice in a time frame of around two months...even though its not happening very often but a two month Old phone going dead just after a New update is not acceptable.probably ios7 still has sum bugs dat need to

    After ios7, My iphone4 has gone dead twice in a time frame of around two months...even though its not happening very often but a two month Old phone going dead just after a New update is not acceptable.probably ios7 still has sum bugs dat need to be fixed...Can this bug expected to be fixed in the next update...

    Hi 1283ar.
    Unfortunately, iOS 7 is too hard to push for the iPhone 4 and therefore has a lot of effects turned off to try to get it to run as smoothly as possible.
    However, it becomes better and better with each update coming but it's hard to do anything about the hardware on an already released phones.
    If you still have trouble or think they are too hard. My tip is, if so, to restore your iPhone 4 and make a clean setup with no iCloud backup. But all your photos in a photostream so you can access it later.

  • After navigating (sometimes downloading pictures, sometimes not) for approximately 10 minutes, I can no longer see contents of drop down menues, then Firefox freezes up and I have to use Ctrl/Alt/Delete to end my internet experience.

    After navigating (sometimes downloading pictures, sometimes not) for approximately 10 minutes, I can no longer see contents of drop down menus, then Firefox freezes up and I have to use Ctrl/Alt/Delete to end my internet experience.
    == This happened ==
    Every time Firefox opened
    == After upgrading to 3.6

    Step by step, how did you arrive at seeing this agreement?

  • 61 062 & date comes after end of valid factory calendar. (Please correct)

    Hi Experts,
    I am Getting the Error in Creating Purchase Order:
    Error Message No. 61 062 & date comes after end of valid factory calendar. (Please correct)
    Please suggest.
    Regards,
    Ashok

    I got a Solution For this. Actually User has Maintained Wrong Planned Delivery time in PIR for the Same it was Behaving like that.
    Thanks

  • Iphone G3 screen goes black after ending every call.

    My iphone screen goes black after ending a call. Shouldn't I have to hit the "end call" button? I'm having to re-boot the phone after every call I make. Anyone else have similar issues?

    Nathan C.,
    I know that and it is not the problem nor an explanation.
    Here is the issue I am referring to:
    When someone calls, still during the conversation when I remove the phone from my ear (in order to access the key pad, for example), or in order to hand up, the screen goes black and the phone freezes.
    In other words I cannot terminate the call or access the keys,as I remove the phone away from my ear it shuts down.
    Any help???

  • The date and time is not working after setting it to current date and goes back to may,26 2011

    the date and time is not working after setting it to current date and goes back to may,26 2011; 2 PM . I bought my ipod tocuh 4th gen on july 18th

    On the iPod, make sure your Calendar is set to Gregorian (Settings > General > International > Calendar).  Also make sure your date and time on your computer is correct as well as the Time Zones on both.

  • User not disabled after end date (9i)

    Hi All,
    The Disable after end date schedule task disabled 7 users but did not disable 1 user.
    Any know issue around this.
    Thanks
    Don

    Hi Gyanprakash,
    i can not try disable manually, its in production. The log for disable user is commented in log.properties. Can not change that .
    Just need to analyze, why this user was left out.
    Regards
    Don

Maybe you are looking for

  • Error in Customer Exit

    Hi Guys, I hope someone would be able to quickly point me in the right direction. I have the following error message: "Diagnosis This internal error is a deliberate termination, since a program status has arisen, that is not allowed to occur. The err

  • Nokia lumia 620 stereo headset

    sir , As per you have told that the company will give nokia stereo headset wh 108. i have searched so many times on google but there is BH 108 not stereo wh108 please send me an image of that headset. i'm really waiting for this phone to purchase. my

  • Stuck on a plain white screen

    Hi, i have a blackberry curve 8520 its stuck on a white screen and it does nothing except stay on that no timer or anything any help please!!!

  • Error in Payroll Log

    Hi experts, Please let me know the cause for the error in payroll log for an  employee  evrytime his payroll is run. Error is "no cumulation for quota type 01". Why such messages creeps in? Regards, Veena

  • Discouraged with VZW

    I have been a loyal VZW customer for many years, and I simply feel that my loyalty is completely disregarded by the company.  Just today the sound on my IPhone has stopped working.  I came to the website to estimate what it may cost me for a replacem