Using cl_gui_alv_grid class in report , but when no data , entire session closed ?

Hi ,
I am using cl_gui_alv_grid for one of my report . It is working fine when there are reocords , but when there is no record
entire session will be closed from selection screen itself.
Having class with data /method declaration and an event class ..
Appreciate your help..
Kind regards
Rama

Hello Siva ,
Code an EVENT for NO DATA in the main class. I guess you have already done the same
Having class with data /method declaration and an event class ..
Now while implementing the method for that event , don't forget to write LEAVE LIST-PROCESSING also.
For eg :
Now RAISE this event when SY-SUBRC is NE 0 for the SELECT statement i.e no data found.

Similar Messages

  • Alv show in report but when see in spool (after run background job) there i

    my program have some error when i run result alv show in report but when see in spool (after run background job) there is no data, (other program can see result in spool)
    Please help
    here is some example of my program
    ********************************declare internal table*****************************
    internal table output for BDC
    data : begin of t_output occurs 0,
    bukrs type anla-bukrs,
    anln1 type anla-anln1,
    anln2 type anla-anln2,
    zugdt type anla-zugdt,
    result(70) type c,
    end of t_output.
    *****get data from loop********************************
      loop at t_anla.
        CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
             EXPORTING
                  INPUT  = t_anla-anln1
             IMPORTING
                  OUTPUT = t_anla-anln1.
        CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
             EXPORTING
                  INPUT  = t_anla-anln2
             IMPORTING
                  OUTPUT = t_anla-anln2.
    check record is correct or not
        select single bukrs anln1 anln2 zugdt
        into w_output
        from anla
        where bukrs = t_anla-bukrs and
        anln1 = t_anla-anln1 and
        anln2 = t_anla-anln2
       zugdt = '00000000'
    if record is correct
        if sy-subrc = 0 and w_output-zugdt = '00000000'.
          w_output-bukrs = t_anla-bukrs.
          w_output-anln1 = t_anla-anln1.
          w_output-anln2 = t_anla-anln2.
          w_output-result = 'Yes : this asset can delete'.
          append w_output to t_output.
    if record is not correct
        elseif sy-subrc = 0 and w_output-zugdt <> '00000000'.
    there is error record  this asset have value already
          v_have_error = 'X'.
          w_output-bukrs = t_anla-bukrs.
          w_output-anln1 = t_anla-anln1.
          w_output-anln2 = t_anla-anln2.
          w_output-result = 'Error : this asset have value already'.
          append w_output to t_output.
        else.
    there is error record this asset donot exist in table anla
          v_have_error = 'X'.
          w_output-bukrs = t_anla-bukrs.
          w_output-anln1 = t_anla-anln1.
          w_output-anln2 = t_anla-anln2.
          w_output-result = 'Error : this asset doest not exist'.
          append w_output to t_output.
        endif.
    *end of check record is correct or not
        clear w_output.
      endloop.
    ******************************show data in ALV***************************************************
    show data from file in ALV
      perform display_report_ALV.
    *&      Form  display_report_ALV
    form display_report_ALV.
      DATA: LT_FIELD_CAT TYPE SLIS_T_FIELDCAT_ALV,
          LT_EVENTS TYPE SLIS_T_EVENT,
          LV_REPID LIKE SY-REPID.
      PERFORM ALV_DEFINE_FIELD_CAT USING LT_FIELD_CAT.
      PERFORM ALV_HEADER_BUILD USING T_LIST_TOP_OF_PAGE[].
      PERFORM ALV_EVENTTAB_BUILD USING LT_EVENTS[].
      LV_REPID = SY-REPID.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
           EXPORTING
                I_CALLBACK_PROGRAM = LV_REPID
                IT_FIELDCAT        = LT_FIELD_CAT
                I_SAVE             = 'A'
                IT_EVENTS          = LT_EVENTS[]
           TABLES
                T_OUTTAB           = t_output
           EXCEPTIONS
                PROGRAM_ERROR      = 1
                OTHERS             = 2.
      IF SY-SUBRC NE 0.
        WRITE: / 'Return Code : ', SY-SUBRC,
          'from FUNCTION REUSE_ALV_GRID_DISPLAY'.
      ENDIF.
    endform.
    *&      Form  alv_define_field_cat
          text
         -->P_LT_FIELD_CAT  text
    FORM ALV_DEFINE_FIELD_CAT USING  TB_FCAT TYPE SLIS_T_FIELDCAT_ALV.
      DATA: WA_FIELDCAT LIKE LINE OF TB_FCAT,
        LV_COL_POS TYPE I.
      DEFINE FIELD_CAT.
        CLEAR WA_FIELDCAT.
        ADD 1 TO LV_COL_POS.
        WA_FIELDCAT-FIELDNAME = &1.
        WA_FIELDCAT-REF_TABNAME = &2.
        WA_FIELDCAT-COL_POS = LV_COL_POS.
        WA_FIELDCAT-KEY = &3.
        WA_FIELDCAT-NO_OUT = &4.
        WA_FIELDCAT-REF_FIELDNAME = &5.
        WA_FIELDCAT-DDICTXT = 'M'.
        IF NOT &6 IS INITIAL.
          WA_FIELDCAT-SELTEXT_L = &6.
          WA_FIELDCAT-SELTEXT_M = &6.
          WA_FIELDCAT-SELTEXT_S = &6.
        ENDIF.
        WA_FIELDCAT-DO_SUM = &7.
        WA_FIELDCAT-OUTPUTLEN = &8.
        APPEND WA_FIELDCAT TO TB_FCAT.
      END-OF-DEFINITION.
      FIELD_CAT  'BUKRS'  'ANLA'     'X' '' 'BUKRS' 'Company Code' '' ''.
      FIELD_CAT  'ANLN1'  'ANLA'     'X' '' 'ANLN1' 'Asset Number' '' ''.
      FIELD_CAT  'ANLN2'  'ANLA'     'X' '' 'ANLN2' 'Asset Sub Number' '' ''.
    FIELD_CAT  'ATEXT'   'T5EAE'     'X' '' 'ATEXT' 'Result' '' ''.
      FIELD_CAT  'RESULT'  ''     'X' '' 'RESULT' 'RESULT' '' ''.
    ENDFORM.                    " alv_define_field_cat

    Hi,
    Check this code..
    FORM display_report_alv.
      DATA: lt_field_cat TYPE slis_t_fieldcat_alv,
      lt_events TYPE slis_t_event,
      lv_repid LIKE sy-repid.
      PERFORM alv_define_field_cat USING lt_field_cat.
      PERFORM alv_header_build USING t_list_top_of_page[].
      PERFORM alv_eventtab_build USING lt_events[].
      lv_repid = sy-repid.
      IF sy-batch EQ 'X'.  ----> " System Field for Backgroud..if Background use list display
        CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
          EXPORTING
            i_callback_program = lv_repid
            it_fieldcat        = lt_field_cat
            i_save             = 'A'
            it_events          = lt_events[]
          TABLES
            t_outtab           = t_output
          EXCEPTIONS
            program_error      = 1
            OTHERS             = 2.
      ELSE.
        CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
          EXPORTING
            i_callback_program = lv_repid
            it_fieldcat        = lt_field_cat
            i_save             = 'A'
            it_events          = lt_events[]
          TABLES
            t_outtab           = t_output
          EXCEPTIONS
            program_error      = 1
            OTHERS             = 2.
      ENDIF.
      IF sy-subrc NE 0.
        WRITE: / 'Return Code : ', sy-subrc,
        'from FUNCTION REUSE_ALV_GRID_DISPLAY'.
      ENDIF.
    ENDFORM.                    "display_report_ALV

  • I have just bought a macbook pro and i want to use an ext hard drive with it which i previously used on a windows computer, but when i plug it in it doesn't show up on my macbook pro, I've wiped it and just need to format it but don't know how, help

    i have just bought a macbook pro and i want to use an ext hard drive with it which i previously used on a windows computer, but when i plug it in it doesn't show up on my macbook pro, I've wiped it and just need to format it but don't know how, any help would be much appreciated

    Try the other USB port. If it still doesn't show up in Disk Utility then there may be something wrong with your Mac. Try something else in each USB port and see if it is seen. If the other thing, like a USB thumb drive, does show up in disk utiltiy then the USB ports are fine.
    Power down the system and restart with the drive connected, go to DU and see it it is seen.

  • I got my ipod, and my wife, her iphone. I downloaded an app and use it in my itouch, but when my wife download it in her iphone, and the phone ask her to update it, it asks for my apple ID, but she has her own apple ID, how do we avoid this?

    I got my ipod, and my wife, her iphone. I downloaded an app and use it in my itouch, but when my wife download it in her iphone, and the phone ask her to update it, it asks for my apple ID, but she has her own apple ID, how do we avoid this?

    Hi peacemakerco,
    Thanks for visiting Apple Support Communities.
    You can use the steps in this article to sign in on the iPhone with the right Apple ID:
    iOS: Changing the signed-in iTunes Store Apple ID account
    http://support.apple.com/kb/ht1311
    Best,
    Jeremy

  • I have an apple earpods and I use them for my ipad but when I want to skip a song by tapping the middle button twice it doesn't skip the music so what to do?

    I have an apple earpods and I use them for my ipad but when I want to skip a song by tapping the middle button twice it doesn't skip the music so what to do?

    The procedure is Settings>Messages>Send & Receive at>You can be reached by iMessages at>Add another email address. The email address has to be a valid working email address, obviously. Apple should verify the email address and you have to go to the inbox of that email account, read the verification email from Apple and follow the inductions in the email in order to complete the verification. Then you go back to the settings, uncheck your email address and check the new email address to be used as the contact email address.

  • On my keyboard, a few of my keys are using incorrect letters or symbols, but when I replaced the keyboard that did;t fix it.

    On my keyboard, a few of my keys are using incorrect letters or symbols, but when I replaced the keyboard that did;t fix it. Help.

    The the box check in System Preferences - Keyboard - Use F1, F2 ......... if so uncheck the box.

  • I Baught A iMac 2010 From Someone it came with lion but for the programs i use i need snow leopard but when trying to install it won't boot from usb or cd what can be the problem i've been at this for over 24 hours if anyone ca help it'd be greatly apprec

    I Baught A iMac 2010 From Someone it came with lion but for the programs i use i need snow leopard but when trying to install it won't boot from usb or cd what can be the problem i've been at this for over 24 hours if anyone ca help it'd be greatly appreciate it! Thanks!

    Downgrade OS X Lion To Snow Leopard [Video How-To]
    http://www.cultofmac.com/110614/downgrade-os-x-lion-to-snow-leopard-video-how-to /
    How To Downgrade OS X Lion To Snow Leopard: The Complete Tutorial
    http://www.redmondpie.com/how-to-downgrade-os-x-lion-to-snow-leopard-the-complet e-tutorial/
    How To Downgrade from Apple OS X Lion to Snow Leopard
    http://www.pcmag.com/article2/0,2817,2389334,00.asp

  • Doing setBytes() but when extracting data get BLOB error?

    I am inserting a video into an oracle 10g db, and I insert it using the setBytes method but when trying to pull that video from the db, it gives me this error
    SQL Exception in getting video ORA-00932: inconsistent datatypes: expected - got BLOB
    The field value is a blob type, but don't have any issues when doing this with a jpg vs a wmv file. here is my code for insertion and extraction of the data.
                            String query=("INSERT INTO VIDEO (P_ID, P_VIDEONAME, P_VIDEO) Values (?,?,?)");
                            prepStmt = connection.prepareStatement(query);
                            prepStmt.setInt(1,patient.getP_ID());
                            prepStmt.setString(2,patient.getVideoName());
                            prepStmt.setBytes(3,patient.getVideo());
                            prepStmt.executeUpdate();
    rs = stmnt.executeQuery("SELECT P_VIDEONAME, P_VIDEO FROM VIDEO WHERE P_VIDEO = " + patient.getVideoName() + " and P_ID = " + patient.getP_ID());
                            ResultSetMetaData metaData = rs.getMetaData();
                            int columns=metaData.getColumnCount();
                            while(rs.next()){
                                for(int i=1;i<=columns;++i) {
                                    patient.setAction("getVideo");
                                    patient.setVideoName(rs.getString(i));
                                    patient.setVideo(rs.getBytes(++i));
                                    sendPatient();
                        }catch(SQLException e) {
                            //this is similar to the definition i gave you above.
                            System.out.println("SQL Exception in getting video " + e.getMessage());

    That inner for loop makes no sense. You don't need to iterate through the columns; you already know what's supposed to be in each one. Get rid of the loop and just refer to them by their absolute indices, like you did when you inserted the record.
    Also, I would advise always using the postfix operators i++ and i-- instead of the prefix forms, ++1 and --i.  It's just too easy to lose track of what's going on when you mix the the two styles, and postfix operators are much more commonly used.
    I don't know if any of this will solve your problem, but it should at least make the probelm easier to see.

  • Help Using a webservice to report back very large data

    Hi All,
    I am in the process of creating a web service to report back lots of data according to some input params, I am using axis2 to test the soap message.
    Now the problem, the webservice will be collection data from the live database which is attached to a web application. It has high usage and I don't want to affect there service.
    Do you think it will affect there service and we would be better to report against a backup database or something?
    Also a client can request data on a certain user just a plain string ID in the wsdl file (data returned will be very large user history), now I was thinking would it be best to keep this as a single users input or create a array of stings with a max length (set in a xsd property)?
    My idea was it might be better that someone just implements another client with single ID and get data for each users, therefore the request could be called
    Customer * number of users
    Or they array XSD will allow them to report on say 10 at a time?

    Hi Steve
    It seems like you have alot of different versions of Crystal Reports and Business Objects products and you are getting them mixed up a bit. It can be confusing.
    So basically you want to access Crystal reports via the BO SDK and you want the reports to connect to web services.
    1. Creating the Report
    Since you have BOE XI R2 my guess is that you have a copy of Crystal Reports XI R2 or R1.
    Create the report with XI because it comes with a special XML Web Services data source driver. My guess is that you already have the web service created.
    2. Publish the report to BOE XI.
    Using the report designer publish the report to BOE (Save As).
    3. Write code to view the report.
    If you need to change the datasource at runtime then you will want to use the Report Application Server (RAS) SDK to do that. If you are only changing the data source to move from Dev/QA/Production then you may not want to do this task at runtime. In the CMC you should be able to change the data source for migration purposes.If you truely need to do it at runtime then you want to do RAS.
    Here's a sample to get you started.
    http://diamond.businessobjects.com/node/6197
    <a href="/blog/10">Rob&#39;s blog - http://diamond.businessobjects.com/robhorne</a>

  • HT201250 Can I restore photo files from Time Machine without the use of an external drive?  I'm trying to restore lost photo files and I see them listed in Time Machine (without use of an external drive), but when I try to restore I get a error code 36.

    Can I restore photo files from Time Machine without the use of an external drive?  While I was transferring photos back and forth from a thumb drive something went haywire and my IPhoto was wiped clean!  When I click on Time Machine I see all the dated pages (without an external storage drive connected), go back to a date where all my photo files are there, click "restore", and I get the message:  "The Finder can't complete the operation because some data in file cant be read or written (error code - 36)"

    Thanks so much Terence.  I tried some of the fixes from that page, but then discovered the suggestion to compress the Time Machine Back up of the original library and transfer it as a zip back to my computer as detailed here:
    http://pondini.org/TM/E9.html
    That worked like a charm.  I really appreciate it. 

  • I have converted my pdf files to docx files using the Adobe Export PDF but when I drag my converted files to Word there is no text, just blank pages.

    I am really new to Adobe and Creative Cloud and its logic so I hope someone can help me understand it.  My objective is to get my scanned PDF docs converted to text document files so I can open and edit in Word.
    I have scanned my documents into a pdf format. I then dropped the pdf file into my Adobe Export from PDF. It exported and converted them to docx files just fine. When I click on the created docx file I have the correct number of pages but they are completely blank. I don't have any converted text. Am I missing a step?  I have also dropped these files into my Word with the same result. 

    Are you still experiencing a problem with Adobe Send?  We inadvertently introduced a problem earlier today (now fixed), but you reported your issue was last night.
    Anyway, can you check again?

  • I'm using firefox 4.0.1 but when i'm visiting websites they detect my browser firefox 3.6.x

    see it
    [http://estakhri.com/upload/uploads/1303294241.png myproblem]

    This can be caused if you have a preference that is overriding the user agent string. This can be caused by an add-on modifying the user agent string.
    # Type '''about:config''' into the location bar and press enter
    # Accept the warning message that appears, you will be taken to a list of preferences
    # Locate the preference '''general.useragent.override''', right-click (or control-click) on it and select '''Reset''', this will set the user agent string back to the default in Firefox 4
    There are other user agent string settings that may have been modified, but these are no longer used in Firefox 4. You can reset them if you want, for details see https://support.mozilla.com/kb/Websites+or+add-ons+incorrectly+report+incompatible+browser

  • I Just bought a used 6th gen nano. But when I plug it into my usb it says " an ipod had be detected but cannot be identified properly". I registered it also. What am I doing wrong?

    I Just bought a used 6th gen nano and when I plug it into the usb it says on my itunes page "an ipod has been detected but cannot be identified properly". I have already registered it. What am I doing wrong? Is it a faulty one?

    The following document might be worth a try with that:
    iPod nano: Error message saying that iPod 'could not be identified properly'

  • I am trying to use a visa gift card but when I submit it, the store says I cant use it because it doesnt match my bank records?

    the tital more or less sums up  my problem

    Firefox needs 32-bit plugins, so you'll need to install 32-bit Java for Firefox.
    No, you can't change Firefox from 32-bt to 64-bit. There is a Nightly 64-bit version (alpha) of Firefox, but it is used only to test for regressions until development is resumed.

  • I did disk utility, and verify disk and it asks to repair the disk using dvd installer...but when i insert the dvd- restart- hold c, it keep ejecting and can't read the dvd....i tried with my friends dvd too, but still fail...mac osx v10.6.7

    someone pls help me

    Well there is Resolve startup issues and perform disk maintenance with Disk Utility and fsck witch includes step by step instructions to run disk repair without the install disk.
    But before doing that, it's a good idea to backup. You may want to troubleshooting your superdrive / disk before hand. if I disk repair fails you may need the disk working to re-install the OS.
    Dose the computer read any DVDs? if no, you may want to use Troubleshooting the slot load optical disc drive.

Maybe you are looking for

  • Query "magnifying" glass not working on forms - 1 workstation

    I have a single workstation that  has suddenly stopped showing the small magnifying glass that can be clicked and runs saved queries.    Example - we have a query that generates a new BP code - when you bring up the BP master data form it usually sho

  • Process events and business functions: automatic insertion of process event

    Here is the scenario: I defined (in Designer 9.0.4.5.6) a number of business functions. Some of them are basic functions, others are Business Rules. When I am trying to link them up the following happens: I have a function FUNCCON31 that I want to co

  • Thumbnails not linked to Files anymore

    Last night I was organizing my computer, deleting old documents and such.  Now, as soon as I opened iPhoto it asked me to select a Library, so I found the iPhoto library icon (I had accidentally moved it into a sub folder within my pictures folder) o

  • Bookmarks gone

    Hi, all My bookmarks in Safari is gone. Hon can I get Them back? Have tried to kill Safari but it didnt help. I have restarted the pad and that didnt help. I Think they disapered at the last program update ios6.

  • Boot from Disk Warrior?

    I tried to boot from DW CD and all I get is a grey apple screen. I dragged DW image to an external drive and it will not launch. A warning tells me to uncheck ignore owership in the info - but there is no such option. Anyone able to run DW on the sys