Why cant we used sy-subrc in loop and endloop?why?where exactly it  is used

hi
can u help me for this

sure you can use sy-subrc inside a loop, for example for checking READ statement inside the loop.
Checking sy-subrc (return code) is done to determine is 'something' was successfull (return code = 0) or not (return code <> ).

Similar Messages

  • Why cant we use sy-index in loop and endloop?where exactly we used sy-index

    hi
    can u help me for this

    Hi...
    Genereally Sy-index is used in iterative cases like
    while....endwhile
    and
    Do.... Enddo
    In LOOP ..... Endloop.... We should use SY-TABIX....
    It would be more consistent we use sy-tabix as we loop at internal table so this SY-TABIX points to the current record its reading...
    we can use sy-index but rarely depends on condition.....
    SY-INDEX and SY-TABIX will not be same always in LOOP and ENDLOOP
    Rewards points if satisfied..
    Regards
    Narin Nandivada

  • Urgent - I have written select query between loop and endloop, Ple help out

    Can any one help out me on this select query. I have written select query between loop and endloop. When I execute the program it will take too much time in this query. Please help me out. Its very urgent.
    LOOP AT l_i_invoices ASSIGNING <l_invoices>.
          CLEAR alv_wa.
          alv_wa-bukrs = <l_invoices>-bukrs.
          alv_wa-gsber = <l_invoices>-gsber.
          CLEAR l_instid.
          CONCATENATE <l_invoices>-belnr <l_invoices>-gjahr INTO l_instid.
          SELECT top_wi_id FROM sww_wi2obj INTO TABLE l_i_swwwihead
                  WHERE catid   = c_catid_business_object
                    AND instid  = l_instid
                    AND typeid  = c_typeid_invoice
                    AND removed = space
                    AND ( wi_rh_task = c_task_buyer_message
                       OR wi_rh_task = c_task_buyer_message2 ).
          IF sy-subrc = 0.
            <l_invoices>-flag = 'X'.
          ELSE.
            <l_invoices>-flag = ' '.
          ENDIF.
          MODIFY l_i_invoices FROM <l_invoices> TRANSPORTING flag
                                WHERE belnr = <l_invoices>-belnr
                                   AND gjahr = <l_invoices>-gjahr.
          APPEND alv_wa TO i_alv.
        ENDLOOP.
    Thanks in advance.

    Here is a way to solve this problem.
    Choose somewhere before this loop processing to use that select. Therefore, you'll need use FOR ALL ENTRIES <that_loop_table> clause, and in the WHERE condition you need to specify that same fields.
    This way, you will have an internal table with all data you'll need to check.
    Then, inside your loop statement, use the READ TABLE command with the clause WITH KEY field = value, to read that record and use the value found.
    Like this sample:
      SELECT bukrs lifnr umsks umskz augdt augbl zuonr gjahr belnr buzei
             waers xblnr blart gsber ebeln zfbdt zbd1t zlsch
      INTO TABLE tg_bsak
      FROM bsak
      FOR ALL ENTRIES IN tl_bkpf_sel
      WHERE bukrs EQ tl_bkpf_sel-bukrs AND
            lifnr IN s_lifnr AND
            augbl EQ tl_bkpf_sel-belnr.
    LOOP AT tg_bseg INTO wa_bseg.
        READ TABLE tg_bsak INTO wa_bsak WITH KEY bukrs = wa_bseg-bukrs
                                                 gjahr = wa_bseg-gjahr
                                                 belnr = wa_bseg-belnr
                                                 BINARY SEARCH.
    if sy-subrc = 0.
    * do something
    endif.
    ENDLOOP.

  • How to write select statement before the loop and how to use read statemnt

    Hi,
    Recently our system has changed from 4.6 to ECC6.
    As its migrated its showing lots of errors like in between loop and endloop there should be no select statemnt........
    Can any one please tell how to write that coding in ECC6 , how can i change the code......
    In between loop and endloop i am having lots of select statemnts.....ple tell thye coding how can i select before the loop starts and
    how to read that internal table in loop.

    Hi Deepthi,
    You can do as per below:
    1) Select the required entries from the tables you need (VBAK, VBAP, KNA1, etc)
    SELECT VBELN ERDAT KUNNR
        into table it_vbak
        from VBAK
    where VBELN = S_VBELN. "Selection criteria
    If sy-subrc = 0.
    SELECT VBELN POSNR MATNR
        into table it_vbap
        from VBAP
    for all entries in it_vbak
    where VBELN = it_vbak-vbeln
    SELECT KUNNR NAME1
        into table it_vbak
        from VBAK
    where VBELN = it_vbak-vbeln.
    endif.
    2) Loop at the entries, and read internal table it-kna1 for customer info.
    Loop at it_vbak into wa_vbak.
    read table it_kna1 into wa_kna1 with key kunnr = wa_vbak-kunnr.
    if sy-subrc = 0.
    endif.
    loop at it_vbap into wa_vbap where vbeln = wa_vbak-vbeln.
    endloop.
    endloop.
    This is the basic idea and short example of how to extract entries and read internal table.
    Hope this helps.
    Regards,
    Patrick

  • WHY CANT I USE FINAL CUT EXPRESS HD IN MY MACBOOK

    WHY CANT I USE FINAL CUT EXPRESS HD IN MY MACBOOK?

    hey there DavoMrMac,
    according to Apple's 'site:
    System Requirements
    Macintosh computer with 500MHz or faster PowerPC G4 or G5 (550MHz for PowerBook G4) or Intel Core Duo
    512MB RAM
    Display with 1024-by-768 (or higher) resolution
    An AGP or PCI Express graphics card compatible with Quartz Extreme or an Intel GMA integrated graphics processor in MacBook or Mac Mini
    Mac OS X 10.4.6 or later
    QuickTime 7.0.4 or later
    HDV features require 1GHz or faster processor and 1GB of RAM (2GB recommended)
    500MB disk space required for applications; additional 16GB of additional storage space for Soundtrack and LiveType content (can be installed on separate disks)
    DVD drive for software installation
    i've been running FCE HD 3.5 on my MacBook since i got it in November '06. runs okay for the few short SD projects(15:00) or less i've put together.

  • Why cant i use a bought call-tone bought through I-tones for calling tones for just one of my contacts?

    Why cant i use a bought call-tone bought through I-tones for calling tones for just one of my contacts?

    What makes you believe that you can't? To set a custom ringtone (or SMS tone) for a contact, go to that contact entry, tap the Edit button in the upper right. You can then edit both ringtones and SMS tones for that contact.

  • Why cant I use relative paths in Netbeans

    Why cant I use relative paths in Netbeans to files on my PC.
    I want to be able to copy my project folder between different drives and pcs dont want to edit the code everytime I do.
    BTW I didnt know where on the forum to post this. Just in case this is the wrong place.

    When I use relative paths it doesnt see the files. Like when I want to add an image to a panel. If I use '../image.jpg' it wont work but if I use 'd:\javafiles\images\image.jpg\ it will work.
    Cant seem to fix it.

  • Why cant i use turn by turn navigation on my iPad 3 ?

    Why cant i use turn by turn navigation? i can see the route and start it ,but i wont get turn by turn navigation, i online get directions!

    I just bought a mini and updated to iOS 7 straightaway. It's running quite well and I haven't experienced any issues.
    There is NO way to downgrade. Your friend probably did it before Apple stopped signing iOS 6.

  • Why cant i use normal messaging on  my ipad mini

    I have recenly got an Ipad mini buy it will only let me message people who are on Imessage ,Why cant i use normal messaging on  my ipad mini ?

    Try resetting your Wi-Fi router. Turn off the power to the router. Leave it off for at least 30 seconds then power it back on. After the router has completed its startup routine and indicates a good connection to the internet, turn on your iPad and try to connect again.

  • Why cant i use air print with my hp deskjet 3050

    why cant i use air print with my hp deskjet 3050

    The HP Deskjet 3050A J611 is AirPrint compatible.
    If it is not working for you, try restarting your router as well as the printer. Power them down, wait a moment or two, then power them back up again. It should work.

  • Why cant I use my lights in the render future in PS CC

    I am having trouble with the 3D feature and the Lights in the render feature in PS CC.  I have contacted the Technicians on a number of occasions and each time they say its my Graphics card.  My PC is only months old and the firm that built it has checked out my graphics card and say there's nothing wrong with it.    When I first had PS CC things worked fine its only lately that this problem has developed, if the Technicians cant help me what chance do I have on my own and now I'm now renting something that I cant fully use.  Eve

    Great, now you've posted a completely blank post! 

  • Why won't my audio loops and MIDI loops sync together in a project?

    I have a number of guitar riffs in a project that I've been making into loops, as I wish to use these as ideas which I arrange in a new project. I've been saving the edited regions of the riffs by going to Region>Add To Apple Loops Library> and saving it as a loop, which is supposed to conform to tempo as stated. These are a blue icon with a little soundwave icon in it.
    I have been doing the same with drum loops that I have created using the piano roll. These have a green icon with a note inside it.
    I want to use these to create arrangements in a new file. Obviously I need them both to conform to various tempos together.
    Why are my guitar riff loops comforming to my global tempo track, but as soon as I add a drum loop and change the tempo, the drum loop will conform but not the guitar.
    I've also tried exporting each of the guitar riff (regions) as audio files because I read something in the manual about the audio files needing to be saved in as SDII to conform to tempo, but that doesn't work either.
    What's the deal?

    I'm no guru, I'm a neophyte, but I'm interested in the problem anyway.
    "I have a number of guitar riffs in a project that I've been making into loops... I've been saving the edited regions of the riffs by going to Region>Add..."
    I assume all of these regions are audio regions. Do they all have an anchor assigned to whatever you consider the downbeat?
    "I've also tried exporting each of the guitar riff (regions) as audio files..."
    Once imported anew, again, is there an anchor indicated. I think that may be key.
    You say that sometimes they work? What have you changed when they do? The tempo?
    -- Gerry

  • This computer is already associated with an Apple ID. ! ! ! ! !!!!???? i cant even use it on my macbook air right now :?

    WHY CANT I USE ITUNES MATCH THAT I PAID 25£ FOR?! APPARENTLY I CAN START USING IT IN 65 DAYS ***?!

    You do what it says.

  • Why I cant view my picture on my iphoto and if I try to copy to any folder it Shows "The item on the clipboard cant be pasted to this location. (One or more of the item may have been deleted or are no longer available) "

    Why I cant view my picture on my iphoto and if I try to copy to any folder it Shows "The item on the clipboard cant be pasted to this location. (One or more of the item may have been deleted or are no longer available) "

    There are 9 different versions of iPhoto and they run on 9 different versions of the Operating System. The tricks and tips for dealing with issues vary depending on the version of iPhoto and the version of the OS. So to get help you need to give as much information as you can. Include things like:
    - What version of iPhoto.
    - What version of the Operating System.
    - Details. Describe the problem as fully as you can. For example, if you have a problem with exporting, then explain by describing how you are trying to export, and so on.
    - History: Is this going on long? Has anything been installed or deleted? - Are there error messages?
    - What steps have you tried already to solve the issue.
    - Anything unusual about your set up? Or how you use iPhoto?
    Anything else you can think of that might help someone understand the problem you have.

  • I cant activate my i phone 4s its showing one message u cant activating use this apple id what i do?

    i restore my i phone 4s after i switch onn the mobile asking apple id and password and i enter id and password  but i cant activating my i phone why? its showing one message u cant activating use this apple id i am original owner this phone  have id and password my IMEI:********
    <Edited by Host>

    FYI - not a wise idea to post your IMEI in a public forum. Perhaps the hosts will edit it for
    you.
    Take the proof that you were the original purchaser of that iPhone to Apple in the country
    where the original purchase was made and they may be able to assist you.

Maybe you are looking for

  • Problem in using AcroPDF.dll in vb6 application

    I have an vb6 application and i want to display a PDF file in a form. I have used AcroPDF.dll and works fine on developmeny system. But when i install application on client's system i get error "Out of memory" when i try to open the form with PDF con

  • Flv encoding software in flex and AIR

    Hi, I want to create an FLV encoding software which takes various video files and encode them into flv format. Is there any actionscript library or flv sdk for this? I saw the flash media server but it is for online apps. I want to create an AIR app

  • Sort Address Book search dialog box by last name, first name

    When I am entering an email, and I click on the To: field to bring up the Address Book dialog box, by default the names are ordered according to the Name field in First Name, Last name format. Is there any way to have this column display the names in

  • One source system feeding multiple BW systems?

    Is it possible to have the same source R/3 system feed multiple BW systems? It doesn't seem likely to me. I would think delta's would get confused. However I might be missing something. Regards Steve

  • Reverse Telecine with Premiere Pro

    Hi All, I had digibeta tapes that I captured at 740x486 and the client wanted us to do a reverse telecine on them which I did by creating a 24p DV timeline, dropping the video in and than outputed the timesline with the settings of Prores HQ (require