USER Exit variable doesn't work in BSP

Hi gurus
I made a characteristic variable with user-exit replacement type.
It get the user id from sy-uname. It works well in Gui version. But when I execute the layout in BSP (WI), it doesn't work.
But If i do the hard-coding the line from (l_eto_charsel-low   = uid.) to (l_eto_charsel-low   = '4012121'.) it works well.
The following is my coding.
Please give me any comment.
  CLEAR eto_charsel.
  DATA l_eto_charsel TYPE upc_ys_charsel.
  DATA  uid type c. "(also I have tried 'data uid type sy-uname')
  uid = sy-uname.
  l_eto_charsel-chanm = i_chanm.
  l_eto_charsel-seqno = '0001'.
  l_eto_charsel-sign  = 'I'.
  l_eto_charsel-opt   = 'EQ'.
  l_eto_charsel-low   = uid.  ++++>
  INSERT l_eto_charsel INTO TABLE eto_charsel.
ENDFUNCTION.
Message was edited by: Bryan Lee

Hi,
Your patch level seems to be OK.
pls. try the declaration as 'Data: uid like syst-uname' or you could try directly assigning the sy-uname.
Try to debug and see the content of the sy-uname, when it hits this code.
HTH,
Regards,
Nataraj.

Similar Messages

  • Customer exit variable doesn't work

    Hi,
    I tried to create customer exit for my query but  iam not getting the right result.
    My requirement is to create a Key figure variable that displays Q1 - Q4 based on fiscal year/period (001.2008) entered by the user.
    steps I have taken
    1. created variable MD_VAR for fiscal year/period
    2. created key figure variable MD_VAR_KF where I have the description as Q1 .
    and the result I have is Q&MD_VAR_KF& but I would like to get Q1
    my code
    data: lv_month type n length 3.
    CASE I_VNAM.
    WHEN 'MD_VAR_KF'. "KF variable
    IF I_STEP = 2.
    LOOP AT I_T_VAR_RANGE INTO LOC_VAR_RANGE WHERE VNAM ='MD_VAR'.
    lv_month = LOC_VAR_RANGE-LOW+6(3).
    IF lv_month = '001' OR lv_month = '002' OR lv_month = '003'.
    L_S_RANGE-LOW = '1'.
    ELSEIF lv_month = '004' OR lv_month = '005' OR lv_month = '006'.
    L_S_RANGE-LOW = '2'.
    ELSEIF lv_month = '007' OR lv_month = '008' OR lv_month = '009'.
    L_S_RANGE-LOW = '3'.
    ELSEIF lv_month = '010' OR lv_month = '011' OR lv_month = '012'.
    L_S_RANGE-LOW = '4'.
    ELSE.
    L_S_RANGE-LOW = 'wrong values'.
    ENDIF.
    L_S_RANGE-SIGN = 'I'.
    L_S_RANGE-OPT = 'EQ'.
    APPEND L_S_RANGE TO E_T_RANGE.
    ENDLOOP.
    ENDIF.
    ENDCASE.
    What did I do wrong and  how do I achieve my requirement
    thanks

    When you variable result displays the variable name inside &...& means the variable is not deriving a value.
    Make sure the variable &MD_VAR_KF& is defined as a Text variable and as an Exit variable. Otherwise it won't process it in the exit.
    If Fiscal Period is dependent on Fiscal Year Variant (I can't remember off-hand) then the variant key will preceed the Fiscal Period value in the variable, and the value is always processed based on internal format YYYYMMM.  So your substring will be +6(3) if FYV dependent, and +4(3) otherwise.
    You have focused the issue on the code but didn't clarify how you defined the variable itself. If these settings are correct then you need to debug the code to see what part works and what doesn't, then provide more details.

  • Currency conversion type by customer exit variable doesn't work

    Hi all.
    In my query I need amounts by quarter, applying quarters last date rates as currency conversion.
    Query has Year parameter. Based on this parameter, by customer exits I calculate every quarters last date and use them as currency conversion types.
    The problem is that query DOESN'T APPLY currency conversions!
    I checked TCURR table - currency conversions do exist for applied days
    I checked my customer exits - the date calculation works fine
    I suppose where is something wrong in query processes (customer exits/currency conversions) sequence before running it.
    Someone knows anything 'bout that?

    Check these docs.. and check again.
    [Creating Currency Translation Types|http://help.sap.com/saphelp_nw04/helpdata/en/80/1a6813e07211d2acb80000e829fbfe/content.htm]
    [Use Variables for Currency Conversion|http://www.scribd.com/doc/7061035/How-to-Use-Variables-for-Currency-Conversion]

  • User Exit EXIT_SAPLMGMU_001 doesn't work with all MM views

    Hello,
    I'm using user exit EXIT_SAPLMGMU_001 in MM02/MM01 tcode to check if valuation class is correctly filled and i've a problem when i select all views for material. In MM02, when i select Accounting View, i can make the validation because in user exit, structure wmbew is filled, but if i select all views, only structure wmara is filled, all others structure are empty.
    does anyone can help me in this?
    Thanks

    HI
    CHECK WITH THESE USER EXITS
    MGA00001 Material Master (Industry): Checks and Enhancements
    MGA00002 Material Master (Industry): Number Assignment
    MGA00003 Material Master (Industry and Retail): Number Display
    Hope this helps !!!
    Cheers
    Alfred

  • How to select several values from a user exit variable in a planning folder

    Hello,
    I have created a user exit variable for limiting the values only to which the user need to access.
    For a simulation part, it is then necessary for him to select several values from these values (not only one, and not all)
    But It seems in this case the user has only two possibilities :
    - keep all the values without any restriction
    - restrain the selection to only one value.
    It seems possible for the user to access to a multiple choice window, but this possibility doesn't seems to work : in all tests we did, only the first value was taken into account by BPS.
    If this method is not good do you know an other manner to permit the user to choice several values amongst a set of pre-selected  (because the original set is too important) values ?
    Thanks for your help.

    Hi Mayank,
    Thanks for your response, but I don't think it corresponds to my problem.
    I my case, I use a user exit variable to filter some data. It seems BPS offers the possibility to the user to select several values amongts the pre-selected values presented by the user exit variable, but it doesn't work. We can use a popup in which we enters the required values, but in final, only the first value is taken into account.
    I don't know if it is due to a BPS bug or if it is not a good solution in regard to BPS philosophy. In this case, the concerned caracteristic isn't in the header but in lead columns.
    I must present a solution to my client next monday, so I have not enough time to open an OSS message.
    An alternate solution should be interesting too.
    My need is to present to a user a selection of values amongst all values from an infoobject (the user exit variable seemed to be a good solution) and the user must have the possibility to select some values amongst these as filter.
    Regards

  • BI 7 Bex Query - User exit variables after variable screen re-processed

    User exit variables are not re-calculated after the variable screen is called up to re-run report with a new selection.  Is there some way to force the user exit variables to change?   I am aware of note 1064273 but this doesn't seem to help in these circumstances.
    Example:
    My Bex Query uses OI_FYPER for a static characteristic selection and  I have defined a customer exit formula variable which uses the values in OI_FYPER.
    All works fine when the query is run first time but if the user calls up the variable screen to change the selection and re-run the query, the customer exit formula variable is not re-calculated (customer exit is called but only with ISTEP = 3).
    Software version is NS2004S (BI 7.0)  SPS10, BI ABAP SP11, BI JAVA SP10, BI Front End Package 1401 rel 354.

    hi.. i just came to know about this in another thread..
    I_STEP 3 does not have I_VNAM stored. So, to access values at I_STEP3 :
    data: l_range TYPE RRS0_S_VAR_RANGE.
    if I_STEP = '3'.
    read table I_T_VAR_RANGE into L_RANGE with key VNAM = 'OI_FYPER'
    if SY-SUBRC = 0.
    ...code as required...
    endif.
    endif.
    Customer-Exit for analysis Authorizations: i_step = 3, i_vnam is empty

  • BEX User exit variables in WEBI

    Hi Experts,
    Need your help please.
    I have a report in BEX with a user exit variable wich depends on other manual input variable.
    In BEX it works properly but in WEBI it doesn't recognize the user exit variable.
    It displays the error message: Not possible to determine the value for ZPD_YEAR_DAY variable
    Error in DB.​ ​Error message is​:​ ​failure to execute the query ​M​D​X​ ​S​E​L​E​C​T​ ​ ​{​ ​[​M​e​a​s​u​r​e​s​]​.​[​D​9​C​S​1​W​7​F​A​8​F​E​O​H​J​3​T​3​2​H​4​Q​D​Z​4​]​,​ ​[​M​e​a​s​u​r​e​s​]​.​[​D​9​D​H​9​K​1​N​I​T​C​Z​E​4​U​Y​3​J​4​U​A​E​T​Z​4​]​,​ ​[​M​e​a​s​u​r​e​s​]​.​[​D​9​D​H​9​K​1​N​I​T​D​R​2​R​6​P​F​2​K​G​C​U​8​8​W​]​,​ ​[​M​e​a​s​u​r​e​s​]​.​[​D​9​C​S​1​W​7​F​A​8​E​M​Z​V​7​C​H​J​M​V​2​A​Z​P​C​]​,​ ​[​M​e​a​s​u​r​e​s​]​.​[​D​9​C​S​1​W​7​F​A​8​K​0​S​7​H​N​Q​B​O​5​J​A​R​L​S​]​,​ ​[​M​e​a​s​u​r​e​s​]​.​[​D​9​C​S​1​W​7​F​A​8​G​6​D​3​U​V​4​M​I​3​7​5​S​8​W​]​,​ ​[​M​e​a​s​u​r​e​s​]​.​[​D​9​C​S​1​W​7​F​A​8​H​P​Q​C​I​D​R​P​D​B​C​0​K​S​G​]​,​ ​[​M​e​a​s​u​r​e​s​]​.​[​D​9​C​S​1​W​7​F​A​8​I​H​E​Y​U​5​3​8​S​X​E​F​Z​2​8​]​,​ ​[​M​e​a​s​u​r​e​s​]​.​[​D​9​D​H​2​8​D​W​V​F​6​7​4​2​E​6​4​Z​O​L​8​F​X​3​4​]​ ​}​ ​ ​O​N​ ​C​O​L​U​M​N​S​ ​,​ ​N​O​N​ ​E​M​P​T​Y​ ​C​R​O​S​S​J​O​I​N​(​ ​C​R​O​S​S​J​O​I​N​(​ ​C​R​O​S​S​J​O​I​N​(​ ​C​R​O​S​S​J​O​I​N​(​ ​C​R​O​S​S​J​O​I​N​(​ ​C​R​O​S​S​J​O​I​N​(​ ​C​R​O​S​S​J​O​I​N​(​ ​C​R​O​S​S​J​O​I​N​(​ ​C​R​O​S​S​J​O​I​N​(​ ​ ​{​ ​[​0​C​A​L​Y​E​A​R​]​.​[​2​0​1​0​]​ ​}​ ​,​ ​ ​{​ ​[​0​H​A​P​_​D​O​C​_​I​D​_​_​Z​A​P​_​S​U​B​S​T​]​.​[​5​0​]​,​ ​[​0​H​A​P​_​D​O​C​_​I​D​_​_​Z​A​P​_​S​U​B​S​T​]​.​[​7​0​]​ ​}​ ​ ​)​,​ ​[​0​I​N​F​O​P​R​O​V​]​.​[​L​E​V​E​L​0​1​]​.​M​E​M​B​E​R​S​ ​)​,​ ​[​Z​D​A​T​E​_​A​T​]​.​[​L​E​V​E​L​0​1​]​.​M​E​M​B​E​R​S​ ​)​,​ ​ ​{​ ​[​Z​C​P​M​]​.​[​X​]​ ​}​ ​ ​)​,​ ​[​Z​P​R​O​M​O​C​A​O​]​.​[​L​E​V​E​L​0​1​]​.​M​E​M​B​E​R​S​ ​)​,​ ​[​Z​R​E​S​P​_​A​V​L​_​_​Z​N​I​V​_​C​A​R​R​]​.​[​L​E​V​E​L​0​1​]​.​M​E​M​B​E​R​S​ ​)​,​ ​[​Z​R​E​S​P​_​A​V​L​]​.​[​L​E​V​E​L​0​1​]​.​M​E​M​B​E​R​S​ ​)​,​ ​[​Z​N​I​V​_​C​A​R​R​]​.​[​L​E​V​E​L​0​1​]​.​M​E​M​B​E​R​S​ ​)​,​ ​[​0​E​M​P​L​O​Y​E​E​]​.​[​L​E​V​E​L​0​1​]​.​M​E​M​B​E​R​S​ ​)​ ​D​I​M​E​N​S​I​O​N​ ​P​R​O​P​E​R​T​I​E​S​ ​M​E​M​B​E​R​_​N​A​M​E​,​ ​M​E​M​B​E​R​_​C​A​P​T​I​O​N​,​ ​[​0​E​M​P​L​O​Y​E​E​]​.​[​2​0​E​M​P​L​O​Y​E​E​]​,​ ​[​0​E​M​P​L​O​Y​E​E​]​.​[​4​0​E​M​P​L​O​Y​E​E​]​,​ ​[​0​H​A​P​_​D​O​C​_​I​D​_​_​Z​A​P​_​S​U​B​S​T​]​.​[​2​0​H​A​P​_​D​O​C​_​I​D​_​_​Z​A​P​_​S​U​B​S​T​]​,​ ​[​Z​R​E​S​P​_​A​V​L​]​.​[​2​Z​R​E​S​P​_​A​V​L​]​ ​O​N​ ​R​O​W​S​ ​F​R​O​M​ ​[​Z​A​V​D​P​_​M​0​1​/​Z​P​D​_​G​P​S​_​V​A​R​I​A​V​E​L​_​0​0​2​]​ ​ ​with error:​ Not possible to determine the value for ZPD_YEAR_DAY variable​.​ ​(​W​I​S​ ​1​0​9​0​1​)
    This ZPD_YEAR_DAY variable​ is the user exit variable.
    Thanks in advance,
    José Simões

    Hi!
    I am following up to this post to see if there is something I am missing.
    We have bex query with user exit variable and webi bi4sp04.4
    In bex the user exit variable works correctly, in webi, it is ignored  (the webi results are not filtered as they are in bex web results)
    I have tried moving the variable to the char restrictions and removed ready for input - so there are now no prompts in bex query.
    I have reviewed note 1611185 as well as other info on restrictions of BICS and webi, but cannot find a clear answer if bex user exit variables are supported in BI4 clients or not.
    Lee Lewis

  • User Exit Variable picking values from InfoProvider

    Hi,
    I've created a User Exit variable (of type Interval, Mandatory) on 0CALMONTH and populating it in exit.
    The problem is at the time of query execution, I get "BRAIN 657" error i.e.  "Value <value> is Invalid for Variable <variable name>".
    After doing some analysis I figured out that once the user-exit code is performed, system validates the entries populated in this Variable against the values in InfoProvider and gives error when it doesn't find those values.
    E.g. lets say InfoProvider has values for 0CALMONTH from 06.2010 till 10.2010 and if I populate my variable with range 03.2009 till 12.2010 then it throws above error. But if I populate the variable with exact values i.e. 06.2010 till 10.2010 then it works.
    Any idea how can I remove this validation and populate with my own value range?
    Regards,
    Vikrant.

    hi remove that default value from the variable.
    and you shd be able to run the query without any problem.
    regards,
    VJ

  • Problem with User exit variable

    We're using an user exit variable (var2) for YTD calculation (For getting the first month of current year). It gets value from another exit variable (var1) which has by default value last month of current year(populated in I_step1 from sy-datum). If the user wants he can change the default value of var1. It works fine when the query is executed the first time. But if the user calls the variable screen again, the variable screen does not show var1 in the popup and the user gets an error message that no value could be determined for var2. How can this issue be resolved or is there any other method to satisfy this requirement.
    Your help would be appreciated and rewarded.
    Thanks & Regards
    Hari

    Hi Ravi,
    Sorry, there's a correction. <b>var2 is used for getting the first month of the year selected by the user in var1</b>. If the user doesn't enter a value for var1, then var2 should take first month of current year from var1 which has by default last month of current year (populated in i_step1 from sy-datum). The user can select the value of var1 according to his requirement. Then var 2 should get first month of the year selected. That's why I'm using two exit variables.
    It works fine during the initial run of the query. But when the user clicks on the variable button in the toolbar and executes the query, var1 is not being displayed and an error message <i>No value could be determined for var2</i> is shown. All other variables used in the query are displayed except var1.
    Krzys, Is the option <i>Can be changed in Query Navigation</i>  available for Exit variables. I'll check that and get back to you.
    Boujema, Thanks for the OSS note.
    Thanks
    Hari

  • User-Exit Variable

    Hi, I created a simple user-exit variable and for some reason the variable seems to get executed around 16 times and then the query gives me the below error messages.   Any ideas why my variable would have I_STEP = 2 many times before it bombs out? 
    Note: This variable is based on a Virtual Characteristic I just implemented and is probably related.  The query did not fail before trying to implement this user exit based on the Virtual Characteristic.
    Error for variable in customer enhancement ZVRSR_001
    Incorrect call of OLAP layer CL_RSR_OLAP; error in BW-BEX-ET
    *~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
    * Load Variable with NCI Authorized Sales Rep (Sales Group)
    *~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
      WHEN 'ZVRSR_001'.
        IF I_STEP = 2.                         "after the popup
          DATA: LT_REP    TYPE /BIC/AZ_P_O04300.
          DATA: LV_REP    TYPE /BI0/OISALES_GRP.
          SELECT SINGLE * FROM /BIC/AZ_P_O04300 INTO LT_REP
               WHERE USERNAME = SY-UNAME.
          IF SY-SUBRC = 0.
            W_L_S_RANGE-LOW = LT_REP-/BIC/ZSHTO_GRP.
          ELSE.
            W_L_S_RANGE-LOW = '???'.
          ENDIF.
          W_L_S_RANGE-SIGN = 'I'.
          W_L_S_RANGE-OPT  = 'BT'.
          APPEND W_L_S_RANGE TO E_T_RANGE.
        ENDIF.
    ENDCASE.

    OK, It looks like because it is a Virtual Characteristic that the User Exit Variable Code will be called every time the "Virtual Characteristic" code is executed as well.  The real problem seemed to be that I had used a BT in the Variable User Exit Range.  Once I changed that to "EQ' it works fine now.  Thanks

  • User exit variable I_STEP=1 does not show default value WebI selection scr

    Hello,
    We have a BW query with a user exit variable. We have written user exit code under I_STEP = 1 so that the default value for the field is displayed on the selection screen to the user. Works very well on the BW side.
    We based a universe on top of the query and then created a WebI report.
    When the WebI report is executed the default value is NOT seen on the selection screen,
    Note:
    1. If the user exit variable is optional and we execute the report, the default value is NOT seen on the selection screen. However if the report is executed without entering any value for the field the logic under I_STEP = 1 is picked up and the report gets the correct output
    1. If the user exit variable is mandatoryand we execute the report, the default value is NOT seen on the selection screen. The user now has to enter the value for the field.
    The scheduled reports will work in case of optional user exit variable.
    However this amounts to loss of functionality.
    Is this a known bug?
    Is there a way to display default values based on user exit variables on the WebI selection screen?
    Kindly advice. Btw we are on XI 3.1 SP3
    Rgds
    Edited by: Anup Deshmukh on Jun 29, 2010 11:13 PM

    OSS Note 1285993 - "Support of Customer Exit Variables from BEx query into WebIntelligence via OLAP universe"  deals with this issue and has deemed it out of scope for XI 3.1 SP3.
    Rgds

  • RRI & user exit variable

    Hello RRI specialist!
    I need to implement the following logic: user executes report 1 (sender) which contains characteristic Material (and several other characteristics). With the RRI the user must be abled to jump into report 2 (receiver)displaying the Material Type(s) of the Material selectied in report 1.
    Note: in this case there is a n:m relationship between Material and  Material Type. The relationship between Material and Material Type exists in a Z-table.
    I thought to implement this with 2 alternatives:
    First alternative, under Assignment Details, assigning Material to variable V1 (being a User-Exit variable of type Material Type) used in report 2.  From report 1 I hope to jump into report 2 by "selecting" on a Material (e.g. 4711) and then read the Z-table when i_step = 2 to find the corresponding Material Type. 
    Prolem: when I set a break point for V1 in ZXRSRU01 I see that V1 does not appear in the table I_T_VAR_RANGE (for any i_step), i.e. the values (e.g. 4711) are no passed from the sender selection to V1.
    Second alternative, under Assignment Details, assigning Material to variable V2 (being a User-Entry/Default variable of type Material) used in report 2.  Report 2 will then contain variable V3 (being a User-Entry/Default variable of type Material Type). The user-exit logic will read V2 from I_T_VAR_RANGE when i_step = 2 and the Z-table to find the corresponding Material Type.  
    Problem: exactly the same as above. NOTE: it does not help that V3 is of type replacement type from the sender report.
    When I use the debugger of the RRI in RSRT2 both alternatives seem to work correctly.
    Does the variable defined under Assignment Details have to fulfill certain conditions in order for the values to be passed?
    Is it simply that ZXRSRU01 is called before the values are passed from the sender report?
    Anybody got an idea what I am doing wrong and how I could implement the requirement to read the Z-table in the RRI jump????
    Thanks for any help,
    Martin

    Dear Martin,
    That was a good explanation of issue and approach. It had been quitesome time to work on user exits. I am not sure the following views can help you.. but i am also interested in the solution..
    1) can we include the material group in the sendor ( hidden) and can this me directly assigned to target?
    2) I think i_step = 2, get excuted after user filled the values manually. How about trying i_step = 3, i think this is the loop for reading other than manual entries..
    3) how about the trails of filing the default values at i_step = 1, on the taget query names. Notsure this will give you the solution.. just my thoughts..
    regards,
    hari

  • BPS User Exit Variable based on Planning Package Selection

    Hi,
    I'm implementing a SAP BW-BPS planning layout to be integrated into the CRM we user interface.
    Most of the characteristic selections come from the CRM fields that need to be filled by the user when creates a trade promotion.
    The charcteristic selections work (as standard) just if in the planning level I flag "Selection in Package", then in package these selections are dinamically defined from what the user select in the CRM fields at runtime.
    My problem is that I have to build a BPS User Exit variable to filter, in the planning level, the proper Planning Area based on the CRM Sales Organization value.
    The characteristic CRM Sales Organization belongs to whose chararcteristic the value is determined dinamically in the planning package.
    Is it possible for a BPS user exit variable, set in the planning level, to catch the value of a characteristic selection made at planning package?
    Many thanks for your help.
    Alessandro

    Hi Indu,
    Many thanks for your answer.
    I have already took a look at the document posted by you but I didn't find the solution to my problem.
    This because i have to create a user exit variable that need to get the value of the characteristic selection in package.
    I mean in the planning level I will have the user exit variable that restrict the planning area and, his function module, need to read, at runtime, what is the value of the characteristic CRM Sales Organization restricted in package by CRM.
    So I don't have any idea to which BPS internal table I have referred to in my funcion module to catch the value of the CRM Sales Organization dinamically filtered by CRM.
    Many thanks,
    Alessandro

  • Exit Customize doesn't work - other questions...

    Firefox updated to Beta 29 (i didn't do it x_x) and everything is confusing me right now. Actually pissing me off to be honest. I was playing around this new, tried to customize it but didn't work. I followed this page and nothing. https://support.mozilla.org/en-US/kb/customize-firefox-controls-buttons-and-toolbars the Exit Customize doesn't work at all. I have to quit firefox using Alt+F4 and start all over.
    So, that doesn't work for me. How do I go back to the previous version of Firefox or how do I undo this Beta 29 thing? I really don't like it.

    You can check for problems with preferences.
    Delete a possible user.js file and numbered prefs-##.js files and rename (or delete) the prefs.js file to reset all prefs to the default value including prefs set via user.js and prefs that are no longer supported in the current Firefox release.
    *http://kb.mozillazine.org/Preferences_not_saved
    *http://kb.mozillazine.org/Resetting_preferences
    You can check for problems caused by a corrupted localstore.rdf file.
    *http://kb.mozillazine.org/Corrupt_localstore.rdf
    Create a new profile as a test to check if your current profile is causing the problem.
    See "Creating a profile":
    *https://support.mozilla.org/kb/profile-manager-create-and-remove-firefox-profiles
    *http://kb.mozillazine.org/Standard_diagnostic_-_Firefox#Profile_issues
    If the new profile works then you can transfer files from a previously used profile to the new profile, but be cautious not to copy corrupted files to avoid carrying over the problem
    *http://kb.mozillazine.org/Transferring_data_to_a_new_profile_-_Firefox

  • Exit Command doesn't work

    Guys, I've put a few hours researching the web for code examples on how to program the Exit button on a J2ME app. It didn't help me finding out why my Exit simply doesn't work. It must be something trivial that I'm just not aware of. I would really appreciate your help analyzing the following code.
    Regards,
    Filipe
    public class BiblioMIDlet extends MIDlet implements CommandListener {
         private Display display;
         private Form gui;
         private static Command renewCommand, exitCommand;
         public BiblioMIDlet() {
              renewCommand = new Command("Renew", Command.ITEM, 1);
              exitCommand = new Command("Exit", Command.EXIT, 1);
              gui = new Form("Biblio");
              display = Display.getDisplay(this);
         protected void startApp() throws MIDletStateChangeException {
              this.showLoginForm();
         private void showLoginForm() {
              TextField user = new TextField("User", null, 9, TextField.NUMERIC);
              TextField password = new TextField("Password", null, 4, TextField.PASSWORD | TextField.NUMERIC);
              gui.append(user);
              gui.append(password);
              gui.addCommand(renewCommand);
              gui.addCommand(exitCommand);
              display.setCurrent(gui);
         protected void pauseApp() {     }
         public void commandAction(Command c, Displayable s) {
              if (c == exitCommand) {
                   destroyApp(false);
                   notifyDestroyed();
         protected void destroyApp(boolean arg0) {      }
    }

    Hai
    I think u missed to add the commandListener in your code "gui.setCommandListener(this)"
    public class BiblioMIDlet extends MIDlet implements CommandListener {
         private Display display;
         private Form gui;
         Command renewCommand, exitCommand;
         public BiblioMIDlet() {
              renewCommand = new Command("Renew", Command.ITEM, 1);
              exitCommand = new Command("Exit", Command.EXIT, 1);
              gui = new Form("Biblio");
              display = Display.getDisplay(this);
         protected void startApp() throws MIDletStateChangeException {
              this.showLoginForm();
         private void showLoginForm() {
              TextField user = new TextField("User", null, 9, TextField.NUMERIC);
              TextField password = new TextField("Password", null, 4, TextField.PASSWORD | TextField.NUMERIC);
              gui.append(user);
              gui.append(password);
              gui.addCommand(renewCommand);
              gui.addCommand(exitCommand);
    /* u missed this line of code in your program*/
              gui.setCommandListener(this);
    /* End */
              display.setCurrent(gui);
         protected void pauseApp() {     }
         public void commandAction(Command c, Displayable s) {
              if (c == exitCommand) {
                   destroyApp(false);
    { notifyDestroyed();
         protected void destroyApp(boolean arg0)      }
    regards
    jinesh

Maybe you are looking for

  • Wireless modem and Airport Express.. one at a time

    Recently my internet provider upgraded my old plug in modem to a newer wireless model. Now it seems that the current setting allow communication with only one or the other at the same time. If I want to be online with the wireless modem and send my i

  • Error: Windows Vista failed to start. A recent hardware or software change might be the cause

    PLEASE HELP! My Lenovo SL500 is not working at all - I get error: "Windows Vista failed to start. A recent hardware or software change might be the cause" I tried the following on my Lenovo: Windows repair menu = "windows cannot be repaired" Lenovo R

  • How to build a time stamp from a string

    I have the date-time information stored in a string and I want to build a time stamp to make a plot with the date-time in the X axys. Is there a way to do this?? thanking in advance... crimolvic

  • System object create problem in EP 7.3 Version.

    Hi Exports, i was created system object in sap ep 7.3 but  i got some error please give me solutions........... Connection Test for Connectors: : Test Details: The test consists of the following steps: 1. Retrieve the default alias of the system 2. C

  • How do I overlay two scanned photos of a real painting?

    I'm a professional artist so I need really good photos of my work for promo and gallery applications.  My Brother gave me a really good Canon Scanner.  He told me I should try and scan my paintings, laying them on the scanner one way then the other (