Please make suggestions on how to improve this code.

Hello Experts,
I am currently modifying a report where a certain code is giving
me run time error. When I debugged the program, the internal table
has 20,000+ records. Now, is there any alternative to this code?
I really need to speed this up. Help would be greatly appreciated and rewarded.
LOOP AT it_cdpos INTO wa_cdpos.
    l_matnr = wa_cdpos-objectid+00(18).
    l_charg = wa_cdpos-objectid+22(10).
    l_zustd = wa_cdpos-value_new+00(01).
    READ TABLE it_batch INTO wa_batch
         WITH KEY matnr = l_matnr
                  charg = l_charg.
    IF sy-subrc EQ 0.
      l_tabix = sy-tabix.
      wa_batch-zustd = l_zustd.
      MODIFY it_batch FROM wa_batch INDEX l_tabix
             TRANSPORTING zustd.
    ELSE.
      wa_batch-matnr = l_matnr.
      wa_batch-charg = l_charg.
      wa_batch-zustd = l_zustd.
      wa_batch-code  = 'A'.              "selected within period
      APPEND wa_batch TO it_batch.
    ENDIF.
  ENDLOOP.

Check the SQL statement from which u get the result otherwise
the code which u sent is optimized or u can use the binary search option for the Read statement for MATNR
while the rest of the code is optimized....
or u can use
loop at it_cdpos assinging <fs>.
             <FS>-cols = value.
<b>note: in this case <FS>-col = value</b>
u wont have to use <b>modify</b> statement for internal table for updating the line contents
since assinging it to field-symbol will dynamically modifies the contents.
<b>this method is faster than the below modify process </b>
endloop.

Similar Messages

  • Can someone please tell me on how to modify this code so that I dont have to enter the file name at all?

    Hello
    can someone please tell me how to modify this code so that I dont have to enter the file path at all? When i give the same file path constants to both the read and write VIs I'm getting an error message.
    Attachments:
    read and write.vi ‏11 KB

    Yup use the low level File I/O opening the reference once, and closing it once.  
    As for the path selection you have an unwired input which is the path to use.  Programatically set that and you won't be prompted to select a path.  Usually this is done with a path constant to a folder, then using the Build Path, to set the file name in that folder.
    Unofficial Forum Rules and Guidelines - Hooovahh - LabVIEW Overlord
    If 10 out of 10 experts in any field say something is bad, you should probably take their opinion seriously.

  • My MacBook Pro switches automatically from a program to finder while working.  Can anyone make suggestions on how to stop this?

    My MacBook Pro will automatically jump from a program (Safari, Excel, etc.) to the Finder window.  Can anyone tell me how to stop this?

    Please read this whole message before doing anything.
    This procedure is a diagnostic test. It’s unlikely to solve your problem. Don’t be disappointed when you find that nothing has changed after you complete it.
    The purpose of the test is to determine whether the problem is caused by third-party software that loads automatically at startup or login, by a peripheral device, by a font conflict, or by corruption of certain system caches. 
    Disconnect all wired peripherals except those needed for the test, and remove all aftermarket expansion cards. Boot in safe mode and log in to the account with the problem. Note: If FileVault is enabled on some models, or if a firmware password is set, or if the boot volume is a software RAID, you can’t do this. Ask for further instructions.
    Safe mode is much slower to boot and run than normal, and some things won’t work at all, including sound output and  Wi-Fi on certain models. The next normal boot may also be somewhat slow.
    The login screen appears even if you usually log in automatically. You must know your login password in order to log in. If you’ve forgotten the password, you will need to reset it before you begin. Test while in safe mode. Same problem? After testing, reboot as usual (i.e., not in safe mode) and verify that you still have the problem. Post the results of the test.

  • White line onscreen in all applications.  I do not know if I did something or if this is some problem.  Everything seem to be working alright otherwise.  Any suggestions on how to fix this p

    I have an eight year old IMAC with the Intel dual core.  Today for the first time a fine white vertical line appeared on screen in all applications.  I do not know if I did something or if this is a larger problem.  Everything  else seems to be working alright.  Any suggestions on how to fix this problem would be appreciated. Thanks.

    Eight-year old iMacs did not have Intel processors. Please do "About this Mac" from you Apple menu to see something like this:
    Please post the "Version" under  the big "Mac OS X" and the "Processor" information. These can make a big difference in advising you how to proceed.
    iOS  4.1 currently shown in you profile will not run on a  Mac computer; it is only for iDevices (Pads, Pods and Phones), so fixing that in your profile can help you get answers faster because people won't to ask for more info before forming an answer.

  • I am no longer able to double click on a file and have it open.  Any suggestions on how to resolve this problem?

    I am no longer able to double click on a file and have it open.  Any suggestions on how to resolve this problem?

    Please read this whole message before doing anything.
    This procedure is a diagnostic test. It’s unlikely to solve your problem. Don’t be disappointed when you find that nothing has changed after you complete it.
    The purpose of the test is to determine whether the problem is caused by third-party software that loads automatically at startup or login, by a peripheral device, by a font conflict, or by corruption of the file system or of certain system caches.
    Disconnect all wired peripherals except those needed for the test, and remove all aftermarket expansion cards, if applicable. Start up in safe mode and log in to the account with the problem. You must hold down the shift key twice: once when you turn on the computer, and again when you log in.
    Note: If FileVault is enabled, or if a firmware password is set, or if the startup volume is a software RAID, you can’t do this. Ask for further instructions.
    Safe mode is much slower to start up and run than normal, with limited graphics performance, and some things won’t work at all, including sound output and Wi-Fi on certain models. The next normal startup may also be somewhat slow.
    The login screen appears even if you usually login automatically. You must know your login password in order to log in. If you’ve forgotten the password, you will need to reset it before you begin.
    Test while in safe mode. Same problem?
    After testing, restart as usual (not in safe mode) and verify that you still have the problem. Post the results of the test.

  • I unistalled Photoshop Elements 12 from my computer and now when I'm trying to re-install I'm getting an error message "object already exist".  Any suggestions on how to correct this?

    I unstalled Photoshop Elements 12 from my computer andnow when I'm trying to re-install I'm getting an error message "objext already exist".  Any suggestions on how to correct this?

    jgbrph
    If your program is Photoshop Elements 12, then you have posted in the wrong forum. Your thread is now in the Adobe Premiere Elements Forum (video editing).
    Please re-post your question in the Adobe Photoshop Elements Forum or wait for a moderator here to see your thread here and move it from here to there.
    Photoshop Elements
    While you are making your move, consider
    a. what computer operating system is involved...if we assume Windows
    b. have you checked Control Panel/Programs to assure that the program is no longer listed as an installed program?
    If it is no longer installed, you might want to consider a free ccleaner run through (regular cleaner and registry cleaner parts) to get
    rid of any leftovers from incomplete installs and uninstalls. Then reinstall with antivirus and firewall(s) disabled.
    ATR

  • While syncing my I phone it gets to step six "optimizing " and gets almost to the end and I get a message that itunes has stopped working and has to close. it get to like 1074 of 1138 items to optimize when iTunes quits. Any suggestions on how to fix this

    While syncing my I phone it gets to step six "optimizing " and gets almost to the end and I get a message that itunes has stopped working and has to close. It get to like 1074 of 1138 items to optimize when iTunes quits. Any suggestions on how to fix this?

    Same problem here! Moreover, for some reason, the pictures in my iPhone 3GS somehow have been divided into 2 folders, Photos and Medialibrary. And when I open iPhone as a folder through the explorer I can see only the Photos folder, but cannot see the Medialibrary folder which stores the photos taken before updating/upgrading the iPhone and getting separated folders!!! What the hack with all of this?!!! When I connect iPhone to PC it automatically opens iTunes and starts syncronizing it, but at the process of OPTIMIZING the photos (and according to the number of photos it shows, I see that it tries to syncronize that invisible Medialibrary folder) the process suddenly stops and error message pops out Tried the sync test, tried the button DEBUG in that pop out message, but NOTHING HELPS!!! Also, when I open the Medialibrary in my iPhone, the screen get sblack all through scrolling it down, only the video clips are shown there... >.<
    So, could you, apple developers, please, explain WHAT THIS PROBLEM IS ABOUT?!!!!!! FIX IT! I am getting ****** of to spend hours at the computer and reading those lame advises which do not help at all! I have my own things to do except reading your support websites. And I payed for the product ready to use, but not a halfproduct which problems should further be solved somehow by users..

  • Not able to acess app store .. Tried every thing with ... Dns change .. Time chage.... Reset... Location services .suggest me how to resolve this issue

    Not able to acess app store .. Tried every thing with ... Dns change .. Time chage.... Reset... Location services .suggest me how to resolve this issue

    Hi aditya123,
    If you are having difficulty connecting to the App store from your iPhone, you may want to try the steps in this article -
    Can't connect to the iTunes Store
    http://support.apple.com/kb/TS1368
    Specifically -
    Troubleshoot issues on an iPhone, iPad, or iPod touch
    If you haven't been able to connect to the iTunes Store:
    Make sure your date, time, and time zone are correct in Settings > General > Date & Time.
    Note: Time Zone may list another city in your time zone.
    Make sure that your iOS software is up to date by tapping Settings > General > Software Update (iOS 5 or later) or connecting your iOS device to iTunes and clicking Check for Update on your device's Summary page.
    Check and verify that you're in range of a Wi-Fi router or base station. If you're on a device with cellular service, make sure that cellular data is turned on from Settings > General > Cellular.
    Note: If connected to cellular data, larger items may not download. You may need to connect to Wi-Fi to download apps, videos, and podcasts.
    Make sure that you have an active Internet connection. You can check the user guide for your device for help with connecting to the Internet.
    Make sure that other devices (portable computers, for example) are able to connect to the Wi-Fi network and access the Internet.
    Try resetting (turning off and then on again) your Wi-Fi router.
    If the issue persists, try troubleshooting your Wi-Fi networks and connections.
    It looks like you have already done many of these, but there are a few more to check out.
    Thanks for using Apple Support Communities.
    Best,
    Brett L

  • TS2566 whenever I use the sustain pedal it holds the E note down? Any suggestions on how to fix this problem?

    I downloaded apple mainstage and am pleased with it. However when i use it on my keyboard the the sustain pedal holds down the E note. Any suggestions on how to fix this?

    If you have this problem (facetime dropping calls). Just go to settings, then general, and scroll it down to reset. Once on the reset, tap on reset all settings, it will ask your code. After you do this close out your iphone by pressing the main button on top of your iphone. I tried everything and this procedure works with me. Let me know if it works with you all.

  • My 5s will not stay paired in my GMC 2015 Terrain. Any suggestions on how to fix this? Very aggravating!!!!

    My 5s will not stay paired in my GMC 2015 Terrain. Any suggestions on how to fix this? Very aggravating!!!!

    Debbie813
    I can see how this can be aggravating. Have you ever been able to pair your 5s phone to your Bluetooth? Is there another Bluetooth device near by that might be connecting to your phone instead? Is your Software up to date on your device? Check by going into Settings>General>Software Update. Please provide details so we can assist.
    JorgeO_VZW
    Follow us on Twitter @VZWSupport

  • I am having trouble with iMessage being activated. It has worked up until yesterday and now won't activate and is saying no address in the send and receive section. My number is there but not ticked. Any suggestions on how to fix this?

    I am having trouble with iMessage being activated. It has worked up until yesterday and now won't activate and is saying no address in the send and receive section. My number is there but not ticked. Any suggestions on how to fix this? I have shut down my phone, but still no luck!

    iMessage and FaceTime went down yesterday for some people. Mine is still down. My iMessage is saying the same thing about being activated. Sounds like you are still down too. Ignore the status page that says everything is fine - it lies.

  • Help...my Messages doesn't work. Any suggestions of how to fix this?

    Help...my Messages doesn't work. When I click on the Messages button, my phone thinks for a minute and then goes back to the main screne. Any suggestions of how to fix this?

    Try a reset: Press the Sleep/Wake button and the Home button at the same time for ten seconds until the Apple logo appears. Note: No data will be lost 

  • I downloaded a song from i-tunes.  It plays on my computer, but won't play on my i-phone.  Any suggestions on how to fix this? Or how can I re-download the song without getting charged a second time.  I could not find an option to "report a problem".

    I downloaded a song from i-tunes.  It plays on my computer, but won't play on my i-phone.  Any suggestions on how to fix this? Or how can I re-download the song without getting charged a second time.  I could not find an option to "report a problem".

    I could not find an option to "report a problem".
    Log in to the Store. Click on "Account" in your Quick Links. When you're in your Account information screen, go down to Purchase History and click "See all".
    Find the item that is not playing properly. If you can't see "Report a Problem" next to the entry, click the "Report a problem" button. Now click the "Report a Problem" link next to the item.
    (Not entirely sure what happens after you click that link, but fingers crossed it should be relatively straightforward.)

  • I have a problem in my iphone 4 with wi-fi after update to IOS6 please can help my how can solve this problem?

    I have a problem in my iphone 4 with wi-fi after update to IOS6 please can help my how can solve this problem?

    Nope
    One needs to press the home and sleep / wake keys together for the phone to reset
    The other thing I could recommend
    Let the battery run out and the phone completely "die"
    It may take a day or two with it not being used
    Then plug it in to charge and see if there is any change in behavior
    If you cannot get this to work - you may need to bring it to an Apple store

  • Hi all, My external hard drive does not show up on my MacBook Pro again. I've tried connecting it to another Mac desktop as well but doesn't work either. any suggestions on how to fix this?

    Hi all, my external hardrive is no longer being recognized on my Macbook pro after I tried to transfer some documents from another Macbook( that used the Lion operating system) to mine. i'm currently using the Mac OS X 10.6.8. Any suggestions on how to fix this?

    I suspect the drive got disconnected, somehow, on that other system and corrupted the drive because of the Disconnection.
    Connect it to your system and open Disk Utility and see if the drive is even being seen. If it is all the data on is more then likely lost and it will need to be repartitioned and or just erased and reformatted.

Maybe you are looking for

  • Binary Jar file?

    How can we create binary Jar file in order to hide the code from the client? Note that: The .xml and .html files are accessible/understandable in Jar file. I need somehow hidden this codes when deploy it.

  • Can not use 'AT LINE-SELECTION' with SET PF-STATUS

    Hi experts, my code is like below: PARAMATERS: ..... SET PF-STATUS 'st_nam'. Perform Load_data . ' For list display START-OF-SELECTION. AT LINE-SELECTION.   Perform list_detail. AT USER-COMMAND.   CALL SCREEN '1001'. END-OF-SELECTION. When I execute

  • Noarchive mode to archive mode

    Hi, I'm trying to backup my database in online mode. I've 2 instances: BDPROD and BDPROD2. BDPROD is already in archive mode. I'm trying to change BDPROD2, but when I shutdown the database and run startup mount, I received the error:  ORA-12514: TNS:

  • Delete Cookies in URL iView

    Hello: I have to delete cookies from a url iview with target a asp.net web application when the iview is selected. Can you Help me?

  • Oracle sequences

    My table A has two columns which are ID and Name. I used sequence to increment the ID number sequentially. "Name" column is with "not null" constraint. My problem in here is that if a user insert data into table "A" without giving a value for "Name"