Problem in drawString() in canvas. Urgent!!!

harlo...i m new in canvas and graphics. i m using drawString() to write a long string. But it is only display haf of the string. Example...."harlo, everyone. Welcome", it only display "harlo, everyone" due to the limited screen, Can i know how to solve this problem? hopefully can get this solution quickly...thankss for helping. :)

Hi,
Unfortunately, the Canvas does not provide useful methods for that. You will need to implement such a mechanism on your own.
It's possible to retrieve actual width of a certain text by invoking 'charsWidth(..)' on Font. Then you will need to chop off a substring and decide what to do with the remaining substring, for example, by drawing it a few pixels lowers than the first part of the string...
Don't forget to set a Font on that Graphics object first. It also might be useful to use a small Font to gain more space...
Good luck!
Jasper

Similar Messages

  • Problem in code.it is urgent.

    problem in code.it is urgent.
    i want to display all po,s with all grs from requistion up to inspection. if for a po gr not happend or inspection not happend it must also display leaving blank for that po. actual flow is pur.reqpur.ordergoods receipt---quality inspection. once u copy this code and execute it. u will get better idea.
    regards!
    prasad.
    REPORT Z_MM_REQDETAILS1.
    TABLES: EKKO, EKPO, MSEG, QALS, EBAN, MKPF, MAKT.
    TYPE-POOLS: SLIS.
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME.
    SELECT-OPTIONS: SBADAT FOR EBAN-BADAT,
    SLIFNR FOR EKKO-LIFNR,
    SEBELN FOR EKKO-EBELN,
    SBEDAT FOR EKKO-BEDAT,
    SBSART FOR EKKO-BSART,
    SMATNR FOR EKPO-MATNR,
    SBUDAT FOR MKPF-BUDAT.
    SELECTION-SCREEN END OF BLOCK B1.
    DATA: BEGIN OF EBAN_TAB OCCURS 0,
    BANFN LIKE EBAN-BANFN,
    BADAT LIKE EBAN-BADAT,
    MENGE LIKE EBAN-MENGE,
    EBELN LIKE EBAN-EBELN,
    AFNAM LIKE EBAN-AFNAM,
    END OF EBAN_TAB.
    DATA: BEGIN OF EKKO_TAB OCCURS 0,
    BSART LIKE EKKO-BSART,
    EBELN LIKE EKKO-EBELN,
    LIFNR LIKE EKKO-LIFNR,
    BEDAT LIKE EKKO-BEDAT,
    END OF EKKO_TAB.
    DATA: BEGIN OF EKPO_TAB OCCURS 0,
    EBELN LIKE EKPO-EBELN,
    MENGE LIKE EKPO-MENGE,
    MATNR LIKE EKPO-MATNR,
    BANFN LIKE EKPO-BANFN,
    EBELP LIKE EKPO-EBELP,
    END OF EKPO_TAB.
    DATA: BEGIN OF MSEG_TAB OCCURS 0,
    EBELN LIKE MSEG-EBELN,
    MBLNR LIKE MSEG-MBLNR,
    MATNR LIKE MSEG-MATNR,
    MENGE LIKE MSEG-MENGE,
    EBELP LIKE MSEG-EBELP,
    END OF MSEG_TAB.
    DATA: BEGIN OF MSEG_TAB1 OCCURS 0,
    MBLNR LIKE MSEG-MBLNR,
    EBELN LIKE MSEG-EBELN,
    END OF MSEG_TAB1.
    DATA: BEGIN OF QALS_TAB OCCURS 0,
    LMENGE01 LIKE QALS-LMENGE01,
    LMENGE07 LIKE QALS-LMENGE07,
    MATNR LIKE QALS-MATNR,
    MBLNR LIKE QALS-MBLNR,
    EBELN LIKE QALS-EBELN,
    EBELP LIKE QALS-EBELP,
    END OF QALS_TAB.
    DATA: BEGIN OF MKPF_TAB OCCURS 0,
    MBLNR LIKE MKPF-MBLNR,
    BUDAT LIKE MKPF-BUDAT,
    END OF MKPF_TAB.
    DATA: BEGIN OF MAKT_TAB OCCURS 0,
    MATNR LIKE MAKT-MATNR,
    MAKTX LIKE MAKT-MAKTX,
    END OF MAKT_TAB.
    DATA: BEGIN OF SELTAB OCCURS 0,
    EBELN LIKE EKKO-EBELN,
    BLDAT LIKE MKPF-BLDAT,
    END OF SELTAB.
    *DATA: BEGIN OF SELTAB1 OCCURS 0,
    BUDAT LIKE MKPF-BUDAT,
    END OF SELTAB1.
    DATA: REPID LIKE SY-REPID.
    DATA: F_OUTPUT1 TYPE SLIS_T_FIELDCAT_ALV WITH HEADER LINE.
    DATA: IT_SORT TYPE SLIS_T_SORTINFO_ALV WITH HEADER LINE.
    DATA: REMARKS(40) TYPE C.
    DATA: BEGIN OF OUTPUT OCCURS 0,
    BANFN LIKE EBAN-BANFN,
    BADAT LIKE EBAN-BADAT,
    RMENGE LIKE EBAN-MENGE,
    AFNAM LIKE EBAN-AFNAM,
    BSART LIKE EKKO-BSART,
    EBELN LIKE EKKO-EBELN,
    LIFNR LIKE EKKO-LIFNR,
    BEDAT LIKE EKKO-BEDAT,
    PMENGE LIKE EKPO-MENGE,
    MATNR LIKE EKPO-MATNR,
    EBELP LIKE EKPO-EBELP,
    MBLNR LIKE MSEG-MBLNR,
    GMENGE LIKE MSEG-MENGE,
    LMENGE01 LIKE QALS-LMENGE01,
    LMENGE07 LIKE QALS-LMENGE07,
    BUDAT LIKE MKPF-BUDAT,
    MAKTX LIKE MAKT-MAKTX,
    REMARKS(40) TYPE C,
    SL_NO LIKE SY-TABIX,
    END OF OUTPUT.
    START-OF-SELECTION.
    IF SEBELN IS NOT INITIAL OR SLIFNR IS NOT INITIAL OR SBEDAT IS NOT INITIAL OR SBSART IS NOT INITIAL.
    SELECT EBELN
    BSART
    LIFNR
    BEDAT FROM EKKO INTO CORRESPONDING FIELDS OF TABLE EKKO_TAB WHERE EBELN IN SEBELN AND LIFNR IN SLIFNR AND BEDAT IN SBEDAT AND
    BSART IN SBSART.
    ELSEIF SBADAT IS NOT INITIAL.
    SELECT EBELN
    BANFN
    BADAT
    MENGE
    AFNAM FROM EBAN INTO CORRESPONDING FIELDS OF TABLE EBAN_TAB where BADAT IN SBADAT.
    SORT EBAN_TAB BY BADAT ASCENDING.
    select ebeln lifnr bedat bsart from ekko into corresponding fields of table ekko_tab for all entries in eban_tab where ebeln = eban_tab-ebeln.
    ELSEIF SMATNR IS NOT INITIAL.
    SELECT EBELN
    EBELP
    FROM EKPO INTO CORRESPONDING FIELDS OF TABLE SELTAB
    WHERE MATNR IN SMATNR.
    SORT SELTAB BY EBELN ASCENDING.
    DELETE ADJACENT DUPLICATES FROM SELTAB COMPARING EBELN.
    SELECT EBELN
    BSART
    BEDAT
    LIFNR FROM EKKO INTO CORRESPONDING FIELDS OF TABLE EKKO_TAB
    FOR ALL ENTRIES IN SELTAB WHERE EBELN = SELTAB-EBELN.
    ELSEIF SBUDAT IS NOT INITIAL.
    SELECT BUDAT
    MBLNR FROM MKPF INTO CORRESPONDING FIELDS OF TABLE MKPF_TAB WHERE
    BUDAT IN SBUDAT.
    sort mkpf_tab by budat ascending.
    SELECT EBELN FROM MSEG INTO CORRESPONDING FIELDS OF TABLE SELTAB FOR ALL ENTRIES IN
    MKPF_TAB WHERE MBLNR = MKPF_TAB-MBLNR.
    *SELECT EBELN
    FROM QALS INTO CORRESPONDING FIELDS OF TABLE SELTAB FOR ALL ENTRIES IN SELTAB WHERE EBELN = SELTAB-EBELN.
    SORT SELTAB BY EBELN ASCENDING.
    DELETE ADJACENT DUPLICATES FROM SELTAB COMPARING EBELN.
    SELECT EBELN
    BEDAT
    LIFNR
    BSART FROM EKKO INTO CORRESPONDING FIELDS OF TABLE EKKO_TAB
    FOR ALL ENTRIES IN SELTAB WHERE EBELN = SELTAB-EBELN.
    ENDIF.
    SELECT EBELN
    MENGE
    MATNR
    EBELP FROM EKPO INTO CORRESPONDING FIELDS OF TABLE EKPO_TAB FOR ALL ENTRIES IN EKKO_TAB WHERE EBELN = EKKO_TAB-EBELN AND
    MATNR IN SMATNR.
    SELECT EBELN
    BANFN
    BADAT
    MENGE
    AFNAM FROM EBAN INTO CORRESPONDING FIELDS OF TABLE EBAN_TAB FOR ALL ENTRIES IN EKKO_TAB WHERE EBELN = EKKO_TAB-EBELN AND
    BADAT IN SBADAT.
    SELECT EBELN
    MBLNR
    MATNR
    MENGE
    EBELP
    FROM MSEG INTO CORRESPONDING FIELDS OF TABLE MSEG_TAB FOR ALL ENTRIES IN EKPO_TAB WHERE EBELN = EKPO_TAB-EBELN AND
    MATNR = EKPO_TAB-MATNR AND
    EBELP = EKPO_TAB-EBELP AND
    BWART IN ('101','105').
    SELECT LMENGE01
    LMENGE07
    MATNR
    MBLNR
    EBELN FROM QALS INTO CORRESPONDING FIELDS OF TABLE QALS_TAB FOR ALL ENTRIES IN MSEG_TAB WHERE MBLNR = MSEG_TAB-MBLNR AND
    MATNR = MSEG_TAB-MATNR AND
    EBELN = MSEG_TAB-EBELN AND
    EBELP = MSEG_TAB-EBELP.
    SELECT MBLNR
    BUDAT FROM MKPF INTO CORRESPONDING FIELDS OF TABLE MKPF_TAB FOR ALL ENTRIES IN MSEG_TAB WHERE MBLNR = MSEG_TAB-MBLNR AND BUDAT
    IN SBUDAT.
    SELECT MATNR
    MAKTX FROM MAKT INTO CORRESPONDING FIELDS OF TABLE MAKT_TAB FOR ALL ENTRIES IN EKPO_TAB WHERE MATNR = EKPO_TAB-MATNR.
    *LOOP AT OUTPUT.
    **LOOP AT EKKO_TAB.
    **read table EKKO_TAB with key ebeln = output-ebeln.
    **if sy-subrc = 0.
    *READ TABLE EKPO_TAB WITH KEY EBELN = EKKO_TAB-EBELN.
    *IF SY-SUBRC = 0.
    *READ TABLE MSEG_TAB WITH KEY EBELN = EKPO_TAB-EBELN MATNR = EKPO_TAB-MATNR.
    *IF SY-SUBRC = 0.
    **READ TABLE QALS_TAB WITH KEY MBLNR = MSEG_TAB-MBLNR MATNR = MSEG_TAB-MATNR EBELN = MSEG_TAB-EBELN.
    **IF SY-SUBRC = 0.
              o OUTPUT-EBELN = EKKO_TAB-EBELN.
              o OUTPUT-BSART = EKKO_TAB-BSART.
              o OUTPUT-LIFNR = EKKO_TAB-LIFNR.
              o OUTPUT-BEDAT = EKKO_TAB-BEDAT.
    OUTPUT-PMENGE = EKPO_TAB-MENGE.
    OUTPUT-MATNR = EKPO_TAB-MATNR.
    OUTPUT-MBLNR = MSEG_TAB-MBLNR.
    OUTPUT-GMENGE = MSEG_TAB-MENGE.
              o OUTPUT-LMENGE01 = QALS_TAB-LMENGE01.
              o OUTPUT-LMENGE07 = QALS_TAB-LMENGE07.
    modify OUTPUT transporting pmenge matnr MBLNR GMENGE.
    **APPEND OUTPUT.
    *ENDIF.
    *ENDIF.
    *ENDLOOP.
    LOOP AT EKKO_TAB.
    LOOP AT EKPO_TAB WHERE EBELN = EKKO_TAB-EBELN.
    LOOP AT MSEG_TAB WHERE EBELN = OUTPUT-EBELN AND MATNR = output-MATNR AND EBELP = OUTPUT-EBELP.
    OUTPUT-EBELN = EKKO_TAB-EBELN.
    OUTPUT-BSART = EKKO_TAB-BSART.
    OUTPUT-LIFNR = EKKO_TAB-LIFNR.
    OUTPUT-BEDAT = EKKO_TAB-BEDAT.
    OUTPUT-PMENGE = EKPO_TAB-MENGE.
    OUTPUT-MATNR = EKPO_TAB-MATNR.
    OUTPUT-EBELP = EKPO_TAB-EBELP.
    APPEND OUTPUT.
    CLEAR OUTPUT.
    ENDLOOP.
    ENDLOOP.
    *LOOP AT OUTPUT.
    *LOOP AT EKPO_TAB WHERE EBELN = OUTPUT-EBELN.
    OUTPUT-PMENGE = EKPO_TAB-MENGE.
    OUTPUT-MATNR = EKPO_TAB-MATNR.
    OUTPUT-EBELP = EKPO_TAB-EBELP.
    *MODIFY OUTPUT TRANSPORTING PMENGE MATNR EBELP.
    *ENDLOOP.
    *ENDLOOP.
    LOOP AT OUTPUT.
    LOOP AT MSEG_TAB WHERE EBELN = OUTPUT-EBELN AND MATNR = OUTPUT-MATNR AND EBELP = OUTPUT-EBELP.
    *LOOP AT QALS_TAB WHERE MBLNR = MSEG_TAB-MBLNR AND MATNR = OUTPUT-MATNR AND EBELN = OUTPUT-EBELN AND EBELP = OUTPUT-EBELP.
    OUTPUT-MBLNR = MSEG_TAB-MBLNR.
    OUTPUT-GMENGE = MSEG_TAB-MENGE.
    OUTPUT-LMENGE01 = QALS_TAB-LMENGE01.
    OUTPUT-LMENGE07 = QALS_TAB-LMENGE07.
    OUTPUT-EBELP = QALS_TAB-EBELP.
    *APPEND OUTPUT.
    MODIFY OUTPUT TRANSPORTING MBLNR GMENGE.
    *CLEAR OUTPUT.
    *CLEAR MSEG_TAB.
    ENDLOOP.
    ENDLOOP.
    *ENDLOOP.
    LOOP AT OUTPUT.
    LOOP AT QALS_TAB WHERE MBLNR = OUTPUT-MBLNR AND MATNR = OUTPUT-MATNR AND EBELN = OUTPUT-EBELN.
    OUTPUT-LMENGE01 = QALS_TAB-LMENGE01.
    OUTPUT-LMENGE07 = QALS_TAB-LMENGE07.
    OUTPUT-EBELP = QALS_TAB-EBELP.
    MODIFY OUTPUT TRANSPORTING LMENGE01 LMENGE07.
    ENDLOOP.
    ENDLOOP.
    LOOP AT OUTPUT.
    LOOP AT EBAN_TAB WHERE EBELN = OUTPUT-EBELN.
    OUTPUT-BANFN = EBAN_TAB-BANFN.
    OUTPUT-BADAT = EBAN_TAB-BADAT.
    OUTPUT-RMENGE = EBAN_TAB-MENGE.
    OUTPUT-AFNAM = EBAN_TAB-AFNAM.
    MODIFY OUTPUT TRANSPORTING BANFN BADAT RMENGE AFNAM.
    ENDLOOP.
    ENDLOOP.
    LOOP AT OUTPUT.
    LOOP AT MKPF_TAB WHERE MBLNR = OUTPUT-MBLNR.
    OUTPUT-BUDAT = MKPF_TAB-BUDAT.
    MODIFY OUTPUT TRANSPORTING BUDAT.
    ENDLOOP.
    ENDLOOP.
    *LOOP AT OUTPUT.
    *SELECT SINGLE MATNR FROM EKPO INTO OUTPUT-MATNR WHERE EBELN = OUTPUT-EBELN.
    *MODIFY OUTPUT TRANSPORTING MATNR.
    *SELECT SINGLE MBLNR FROM MSEG INTO OUTPUT-MBLNR WHERE MATNR = OUTPUT-MATNR.
    *MODIFY OUTPUT TRANSPORTING MBLNR.
    *ENDLOOP.
    LOOP AT OUTPUT.
    LOOP AT MAKT_TAB WHERE MATNR = OUTPUT-MATNR.
    OUTPUT-MAKTX = MAKT_TAB-MAKTX.
    MODIFY OUTPUT TRANSPORTING MAKTX.
    ENDLOOP.
    ENDLOOP.
    *LOOP AT EKKO_TAB.
    LOOP AT EKPO_TAB WHERE EBELN = EKKO_TAB-EBELN.
              o LOOP AT MSEG_TAB WHERE EBELN = EKPO_TAB-EBELN AND MATNR = EKPO_TAB-MATNR.
              o LOOP AT QALS_TAB WHERE MBLNR = MSEG_TAB-MBLNR AND MATNR = MSEG_TAB-MATNR AND EBELN = MSEG_TAB-EBELN.
              o LOOP AT MKPF_TAB WHERE MBLNR = MSEG_TAB-MBLNR.
    OUTPUT-EBELN = EKKO_TAB-EBELN.
    OUTPUT-BSART = EKKO_TAB-BSART.
    OUTPUT-LIFNR = EKKO_TAB-LIFNR.
    OUTPUT-BEDAT = EKKO_TAB-BEDAT.
    OUTPUT-PMENGE = EKPO_TAB-MENGE.
    OUTPUT-MATNR = EKPO_TAB-MATNR.
    OUTPUT-EBELP = EKPO_TAB-EBELP.
              o OUTPUT-MBLNR = MSEG_TAB-MBLNR.
              o OUTPUT-GMENGE = MSEG_TAB-MENGE.
              o OUTPUT-BUDAT = MKPF_TAB-BUDAT.
              o OUTPUT-LMENGE01 = QALS_TAB-LMENGE01.
              o OUTPUT-LMENGE07 = QALS_TAB-LMENGE07.
              o MODIFY OUTPUT TRANSPORTING BSART LIFNR BEDAT PMENGE MATNR.
    APPEND OUTPUT.
    CLEAR OUTPUT.
              o CLEAR QALS_TAB.
              o ENDLOOP.
              o CLEAR MKPF_TAB.
              o ENDLOOP.
              o CLEAR MSEG_TAB.
              o ENDLOOP.
    CLEAR EKPO_TAB.
    ENDLOOP.
    CLEAR EKKO_TAB.
    ENDLOOP.
    **SELECT MBLNR EBELN FROM MSEG INTO TABLE MSEG_TAB1 FOR ALL ENTRIES IN EKKO_TAB WHERE EBELN = EKKO_TAB-EBELN.
              o LOOP AT OUTPUT.
              o MOVE-CORRESPONDING MSEG_TAB1 TO OUTPUT.
              o OUTPUT-MBLNR = MSEG_TAB1-MBLNR.
              o MODIFY OUTPUT TRANSPORTING MBLNR.
              o ENDLOOP.
    *LOOP AT OUTPUT.
    LOOP AT MSEG_TAB WHERE EBELN = output-EBELN AND MATNR = output-MATNR AND EBELP = OUTPUT-EBELP.
    **READ TABLE MSEG_TAB WITH KEY EBELN = OUTPUT-EBELN MATNR = OUTPUT-MATNR.
    *IF SY-SUBRC = 0.
    OUTPUT-MBLNR = MSEG_TAB-MBLNR.
    OUTPUT-GMENGE = MSEG_TAB-MENGE.
    *MODIFY OUTPUT TRANSPORTING MBLNR GMENGE.
    *ENDIF.
    *clear output.
    *ENDLOOP.
    *endloop.
    *LOOP AT OUTPUT.
    READ TABLE QALS_TAB WITH KEY MBLNR = OUTPUT-MBLNR MATNR = OUTPUT-MATNR EBELN = OUTPUT-EBELN.
    *IF SY-SUBRC = 0.
    *OUTPUT-LMENGE01 = QALS_TAB-LMENGE01.
    *OUTPUT-LMENGE07 = QALS_TAB-LMENGE07.
    *MODIFY OUTPUT TRANSPORTING LMENGE01 LMENGE07.
    *ENDIF.
    *ENDLOOP.
    LOOP AT OUTPUT.
    READ TABLE EBAN_TAB WITH KEY EBELN = OUTPUT-EBELN.
    IF SY-SUBRC = 0.
    OUTPUT-BANFN = EBAN_TAB-BANFN.
    OUTPUT-BADAT = EBAN_TAB-BADAT.
    OUTPUT-RMENGE = EBAN_TAB-MENGE.
    OUTPUT-AFNAM = EBAN_TAB-AFNAM.
    MODIFY OUTPUT TRANSPORTING BANFN BADAT RMENGE AFNAM.
    ENDIF.
    ENDLOOP.
    *LOOP AT OUTPUT.
    READ TABLE MKPF_TAB WITH KEY MBLNR = OUTPUT-MBLNR.
    IF SY-SUBRC = 0.
    OUTPUT-BUDAT = MKPF_TAB-BUDAT.
    MODIFY OUTPUT TRANSPORTING BUDAT.
    ENDIF.
    ENDLOOP.
    *LOOP AT OUTPUT.
    *READ TABLE MAKT_TAB WITH KEY MATNR = OUTPUT-MATNR.
    *IF SY-SUBRC = 0.
    *OUTPUT-MAKTX = MAKT_TAB-MAKTX.
    *MODIFY OUTPUT TRANSPORTING MAKTX.
    *ENDIF.
    *ENDLOOP.
    PERFORM F_OUTPUT.
    PERFORM SORT.
    PERFORM GRID.
    FORM F_OUTPUT.
    F_OUTPUT1-FIELDNAME = 'MATNR'.
    F_OUTPUT1-REF_TABNAME = 'EKPO'.
    F_OUTPUT1-REF_FIELDNAME = 'MATNR'.
    APPEND F_OUTPUT1.
    CLEAR F_OUTPUT1.
    F_OUTPUT1-FIELDNAME ='MAKTX'.
    F_OUTPUT1-SELTEXT_M = 'DESCRIPTION.'.
    APPEND F_OUTPUT1.
    CLEAR F_OUTPUT1.
    F_OUTPUT1-FIELDNAME = 'LIFNR'.
    F_OUTPUT1-REF_TABNAME = 'EKKO'.
    F_OUTPUT1-REF_FIELDNAME = 'LIFNR'.
    F_OUTPUT1-SELTEXT_M = 'SUPPLIER'.
    APPEND F_OUTPUT1.
    CLEAR F_OUTPUT1.
    F_OUTPUT1-FIELDNAME = 'AFNAM'.
    F_OUTPUT1-REF_TABNAME = 'EBAN'.
    F_OUTPUT1-REF_FIELDNAME = 'AFNAM'.
    APPEND F_OUTPUT1.
    CLEAR F_OUTPUT1.
    F_OUTPUT1-FIELDNAME = 'BANFN'.
    F_OUTPUT1-REF_TABNAME = 'EBAN'.
    F_OUTPUT1-REF_FIELDNAME = 'BANFN'.
    APPEND F_OUTPUT1.
    CLEAR F_OUTPUT1.
    F_OUTPUT1-FIELDNAME = 'BADAT'.
    F_OUTPUT1-SELTEXT_M = 'PRS DATE'.
    F_OUTPUT1-REF_TABNAME = 'EBAN'.
    F_OUTPUT1-REF_FIELDNAME = 'BADAT'.
    APPEND F_OUTPUT1.
    CLEAR F_OUTPUT1.
    F_OUTPUT1-FIELDNAME ='RMENGE'.
    *F_OUTPUT1-REF_TABNAME = 'MSEG'.
    *F_OUTPUT1-REF_FIELDNAME = 'MBLNR'.
    F_OUTPUT1-SELTEXT_M = 'PRS QTY'.
    APPEND F_OUTPUT1.
    CLEAR F_OUTPUT1.
    F_OUTPUT1-FIELDNAME = 'EBELN'.
    F_OUTPUT1-REF_TABNAME = 'EKKO'.
    F_OUTPUT1-REF_FIELDNAME = 'EBELN'.
    APPEND F_OUTPUT1.
    CLEAR F_OUTPUT1.
    F_OUTPUT1-FIELDNAME = 'BSART'.
    F_OUTPUT1-REF_TABNAME = 'EKKO'.
    F_OUTPUT1-REF_FIELDNAME = 'BSART'.
    APPEND F_OUTPUT1.
    CLEAR F_OUTPUT1.
    F_OUTPUT1-FIELDNAME = 'BEDAT'.
    F_OUTPUT1-REF_TABNAME = 'EKKO'.
    F_OUTPUT1-REF_FIELDNAME = 'BEDAT'.
    F_OUTPUT1-SELTEXT_M = 'PO DATE'.
    APPEND F_OUTPUT1.
    CLEAR F_OUTPUT1.
    F_OUTPUT1-FIELDNAME ='PMENGE'.
    F_OUTPUT1-SELTEXT_M = 'PO QTY'.
    APPEND F_OUTPUT1.
    CLEAR F_OUTPUT1.
    F_OUTPUT1-FIELDNAME = 'MBLNR'.
    F_OUTPUT1-REF_TABNAME = 'MSEG'.
    F_OUTPUT1-REF_FIELDNAME = 'MBLNR'.
    F_OUTPUT1-SELTEXT_M = 'GR NUMBER'.
    APPEND F_OUTPUT1.
    CLEAR F_OUTPUT1.
    F_OUTPUT1-FIELDNAME ='BUDAT'.
    F_OUTPUT1-SELTEXT_M = 'GR DATE'.
    APPEND F_OUTPUT1.
    CLEAR F_OUTPUT1.
    F_OUTPUT1-FIELDNAME ='GMENGE'.
    *F_OUTPUT1-REF_TABNAME = 'MSEG'.
    *F_OUTPUT1-REF_FIELDNAME = 'MBLNR'.
    F_OUTPUT1-SELTEXT_M = 'RECEIVED QTY'.
    APPEND F_OUTPUT1.
    CLEAR F_OUTPUT1.
    F_OUTPUT1-FIELDNAME = 'LMENGE01'.
    F_OUTPUT1-REF_TABNAME = 'QALS'.
    F_OUTPUT1-REF_FIELDNAME = 'LMENGE01'.
    F_OUTPUT1-SELTEXT_M = 'ACCEPTED QTY'.
    APPEND F_OUTPUT1.
    CLEAR F_OUTPUT1.
    F_OUTPUT1-FIELDNAME = 'LMENGE07'.
    F_OUTPUT1-REF_TABNAME = 'QALS'.
    F_OUTPUT1-REF_FIELDNAME = 'LMENGE07'.
    F_OUTPUT1-SELTEXT_M = 'REJECTED QTY'.
    APPEND F_OUTPUT1.
    CLEAR F_OUTPUT1.
    F_OUTPUT1-FIELDNAME ='REMARKS'.
    **F_OUTPUT1-REF_TABNAME = 'MSEG'.
    **F_OUTPUT1-REF_FIELDNAME = 'MBLNR'.
    F_OUTPUT1-SELTEXT_M = 'REMARKS'.
    APPEND F_OUTPUT1.
    CLEAR F_OUTPUT1.
    ENDFORM.
    FORM SORT.
    IT_SORT-FIELDNAME = 'MATNR'.
    IT_SORT-UP = 'X'.
    APPEND IT_SORT.
    CLEAR IT_SORT.
    IT_SORT-FIELDNAME = 'MAKTX'.
    IT_SORT-UP = 'X'.
    APPEND IT_SORT.
    CLEAR IT_SORT.
    IT_SORT-FIELDNAME = 'LIFNR'.
    IT_SORT-UP = 'X'.
    APPEND IT_SORT.
    CLEAR IT_SORT.
    IT_SORT-FIELDNAME = 'AFNAM'.
    IT_SORT-UP = 'X'.
    APPEND IT_SORT.
    CLEAR IT_SORT.
    IT_SORT-FIELDNAME = 'BANFN'.
    IT_SORT-UP = 'X'.
    APPEND IT_SORT.
    CLEAR IT_SORT.
    IT_SORT-FIELDNAME = 'BADAT'.
    IT_SORT-UP = 'X'.
    APPEND IT_SORT.
    CLEAR IT_SORT.
    IT_SORT-FIELDNAME = 'RMENGE'.
    IT_SORT-UP = 'X'.
    APPEND IT_SORT.
    CLEAR IT_SORT.
    IT_SORT-FIELDNAME = 'EBELN'.
    IT_SORT-UP = 'X'.
    APPEND IT_SORT.
    CLEAR IT_SORT.
    IT_SORT-FIELDNAME = 'BSART'.
    IT_SORT-UP = 'X'.
    APPEND IT_SORT.
    CLEAR IT_SORT.
    IT_SORT-FIELDNAME = 'BEDAT'.
    IT_SORT-UP = 'X'.
    APPEND IT_SORT.
    CLEAR IT_SORT.
    IT_SORT-FIELDNAME = 'PMENGE'.
    IT_SORT-UP = 'X'.
    APPEND IT_SORT.
    CLEAR IT_SORT.
    IT_SORT-FIELDNAME = 'MBLNR'.
    IT_SORT-UP = 'X'.
    APPEND IT_SORT.
    CLEAR IT_SORT.
    IT_SORT-FIELDNAME = 'BUDAT'.
    IT_SORT-UP = 'X'.
    APPEND IT_SORT.
    CLEAR IT_SORT.
    IT_SORT-FIELDNAME = 'GMENGE'.
    IT_SORT-UP = 'X'.
    APPEND IT_SORT.
    CLEAR IT_SORT.
    IT_SORT-FIELDNAME = 'LMENGE01'.
    IT_SORT-UP = 'X'.
    APPEND IT_SORT.
    CLEAR IT_SORT.
    IT_SORT-FIELDNAME = 'LMENGE07'.
    IT_SORT-UP = 'X'.
    APPEND IT_SORT.
    CLEAR IT_SORT.
    ENDFORM.
    FORM GRID.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
    I_INTERFACE_CHECK = ' '
    I_BYPASSING_BUFFER = ' '
    I_BUFFER_ACTIVE = ' '
    I_CALLBACK_PROGRAM = 'REPID'
    I_CALLBACK_PF_STATUS_SET = ' '
    I_CALLBACK_USER_COMMAND = ' '
    I_CALLBACK_TOP_OF_PAGE = ' '
    I_CALLBACK_HTML_TOP_OF_PAGE = ' '
    I_CALLBACK_HTML_END_OF_LIST = ' '
    I_STRUCTURE_NAME =
    I_BACKGROUND_ID = ' '
    I_GRID_TITLE =
    I_GRID_SETTINGS =
    IS_LAYOUT =
    IT_FIELDCAT = F_OUTPUT1[]
    IT_EXCLUDING =
    IT_SPECIAL_GROUPS =
    IT_SORT =
    IT_FILTER =
    IS_SEL_HIDE =
    I_DEFAULT = 'X'
    I_SAVE = ' '
    IS_VARIANT =
    IT_EVENTS =
    IT_EVENT_EXIT =
    IS_PRINT =
    IS_REPREP_ID =
    I_SCREEN_START_COLUMN = 0
    I_SCREEN_START_LINE = 0
    I_SCREEN_END_COLUMN = 0
    I_SCREEN_END_LINE = 0
    I_HTML_HEIGHT_TOP = 0
    I_HTML_HEIGHT_END = 0
    IT_ALV_GRAPHICS =
    IT_HYPERLINK =
    IT_ADD_FIELDCAT =
    IT_EXCEPT_QINFO =
    IR_SALV_FULLSCREEN_ADAPTER =
    IMPORTING
    E_EXIT_CAUSED_BY_CALLER =
    ES_EXIT_CAUSED_BY_USER =
    TABLES
    T_OUTTAB = OUTPUT[].
    EXCEPTIONS
    PROGRAM_ERROR = 1
    OTHERS = 2
    IF SY-SUBRC 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    ENDFORM.

    Hi prasad,
    Whats the problem exactly. Is it not displaying any records ?
    Thanks,
    bsv.

  • Flicker Problems with a dynamic Canvas and scrollpane

    Hello all,
    I'm having some trouble with flickering in a dynamically sizing canvas. Basically I have a new component similar to a text area implemented as a canvas. I put this canvas into a scrollpane and it is updated when a new message comes in. problem occurs both when a new msg comes in and when the scrollbar is used. I get heavy flickering in the component area and no where else. I've tried double buffering, I've looked through some of the old topic threads here and tried a few suggestions but it still occurs. I traced the paint/update calls with printlns into the console and found that only the paint gets called and not the update. I'm thinking that the changing height of the canvas is automatically calling the paint method directly. Any and all help (that works) will be rewarded with duke dollars. I really need help on this one. Below is a cut away of the code:
    CANVAS COMPONENT
    public class IconBox extends Canvas {
    //other methods to handle text processing
    public void append(String text)
    //places text into a vector and calls repaint to add it to
    //the canvas and updates the height of the canvas
    public void update (Graphics g)
    paint(g);
    public void paint(Graphics g)
    // I basically refresh the canvas with new text updates
    // here with g,drawtexts and add a few images with
    // drawimage
    APPLET
    public class ConfDraw extends Applet implements ComponentListener
    newTextarea lC;
    ScrollPane appletScroller
    public void init()
    lC = new IconBox(427);
    lC.addComponentListener(this);
    appletScroller = new ScrollPane(1);
    appletScroller.add(lC,0);
    appletScroller.setSize( 445, 380 );
    public void componentResized(ComponentEvent e) {
    appletScroller.doLayout();
    public void componentHidden(ComponentEvent e) {
    public void componentMoved(ComponentEvent e) {
    public void componentShown(ComponentEvent e) {
    // other methods that send text to IC
    public void update(Graphics g)
    //tried with and without this over ride at this level
    paint(g);
    }

    Create offscreen image & graphics
    eg.
    Image offscreenImg = createImage(w, this.size().height);
    Graphics offscreenG = offscreenImg.getGraphics();paint all ur contents on off screen grpahics.
    eg.
    offscreenG.drawString("Hello", 10, 10);finally paint the off-screen image to the Graphics
    g.drawImage(offscreenImg,0,0,this);This will avoid flickering as whole of the image is replaced at once. Also override update.

  • Problem with getting specific canvas's to display within a viewstack based on button's clicked within a tilelist

    In a new application I'm creating I've managed to set it up so that a user can add up to 5 'user profile buttons' by clicking an 'add item' button and remove each one by clicking an 'remove item' when they are selected.
    That part works fine, however once each button is clicked it should bring up a specific canvas view within the viewstack relevant to that particular button i.e. when a user clicks the 'New Profile 1' button the 'New Profile 1' Canvas view should then be displayed in the viewstack, when they click 'New Profile 2' it should display 'New Profile 2' canvas in the viewstack etc but I am having trouble linking each specific button to 1 specific Viewstack canvas.
    The problem is if, for example, I click the 'New Profile 2' button the 'New Profile 2' canvas IS displayed in the viewstack however if I then delete the selected 'New Profile 2' button the 'New Profile 3' button slides left into it's place but now clicking on New Profile 3 brings up the new profile 2 canvas whereas it should actually bring up the new profile 3 canvas at all times.
    Eventually these canvas's will be personal areas for specific users so it is important that each button in the tilelist links to that specific user but it is also important that a user can add/delete each button at all times.
    I've already had the first part of this problem (which was linking the tilelist to the viewstack) more or less answered but I clicked Correct answer rather than helpful answer in my previous thread. My mistake, sorry. Is ther a better way to do this application. Heres my code so far:-
    <?xml version="1.0" encoding="utf-8"?>
     <mx:Application 
    xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" xmlns:components="components.*" backgroundGradientAlphas="[1.0, 1.0]" backgroundGradientColors="[#545351, #E3DFDF]">
    <mx:Script>
    <![CDATA[
    import mx.managers.*; 
    private var _dragManager:DragManager; 
    private var _historyManager:HistoryManager; 
    private var _popupManager:PopUpManager; 
    import flash.net.navigateToURL; 
    import flash.net.URLRequest; 
    import flash.net.URLVariables;  
    import mx.events.ListEvent;  
    import mx.controls.Button; 
    import mx.collections.*; 
    import mx.controls.Alert;]]>
    </mx:Script>
    <mx:Script>
    <![CDATA[
    import mx.effects.easing.Elastic; 
    import mx.collections.ArrayCollection; 
    Bindable] 
    private var myDP:ArrayCollection = new ArrayCollection();
    private var dpArr:Array = [{label:"New Profile 1", data:View1},{label:"New Profile 2", data:View2}, {label:"New Profile 3", data:View3},{label:"New Profile 4", data:View4}, {label:"New Profile 5", data:View5}]; 
    private var addedIndices:ArrayCollection = new ArrayCollection(); 
    private function deleteItem():void { 
    if(myDP.length > 0){ 
    for each(var i:int in tlist0.selectedIndices)myDP.removeItemAt(i);
    private function addItem():void { 
    if(myDP.length < dpArr.length && addedIndices.length < dpArr.length){ 
    for(var a:uint = 0; a < dpArr.length; a++){ 
    if(!addedIndices.contains(a) && !myDP.contains(dpArr[a])){myDP.addItemAt(dpArr[a],myDP.length);
    break;}
    private function tileList_itemClick(event:ListEvent):void { 
    private function showAlert(event:ListEvent):void{ Alert.show(
    "You clicked button #"+event.currentTarget.selectedItem.data);}
    ]]>
    </mx:Script>
    <mx:Sequence id="itemsChangeEffect1">
    <mx:Blur blurYTo="12" blurXTo="12" duration="300" perElementOffset="150" filter="removeItem"/>
    <mx:Parallel>
    <mx:Move duration="750" easingFunction="{Elastic.easeOut}" perElementOffset="20"/>
    <mx:RemoveItemAction startDelay="400" filter="removeItem"/>
    <mx:AddItemAction startDelay="400" filter="addItem"/>
    <mx:Blur startDelay="410" blurXFrom="18" blurYFrom="18" blurXTo="0" blurYTo="0" duration="300" filter="addItem"/>
    </mx:Parallel>
    </mx:Sequence>
    <mx:Canvas width="1168" height="716" backgroundColor="#0219FB" horizontalCenter="0" verticalCenter="0" borderColor="#000000" borderStyle="solid" borderThickness="1" cornerRadius="20" backgroundAlpha="0.8">
    <mx:Canvas id="UserArea" left="10" x="0" y="49" width="670" height="594" backgroundColor="#000000" cornerRadius="20" borderStyle="solid">
    <mx:TileList id="tlist0" itemClick="myViewStack.selectedIndex=tlist0.selectedIndex" itemRenderer="mx.controls.Button" top="10" left="10" right="10" color="#FFFFFF" height="50" width="100%" fontSize="12" fontStyle="bold" columnCount="5" rowCount="2" direction="horizontal" dataProvider="{myDP}" itemsChangeEffect="{itemsChangeEffect1}" backgroundColor="#000000" fontWeight="bold" borderStyle="none"/>
    <mx:Canvas x="63" y="129" width="200" height="200" fontSize="36" borderColor="#FFFFFF" id="Canvas1" visible="false">
    <mx:Label x="27" y="25" text="Profile 1"/>
    </mx:Canvas>
    <mx:ViewStack x="115" y="88" id="myViewStack" width="382" height="317" backgroundColor="#F90C0C">
    <mx:Canvas id="View1" label="View 1" width="100%" height="100%" backgroundColor="#0FDDE5">
    <mx:Label x="10" y="10" text="NEW PROFILE 1" fontWeight="bold" fontSize="15"/>
    </mx:Canvas>
    <mx:Canvas id="View2" label="View 2" width="100%" height="100%" backgroundColor="#A90BCB">
    <mx:Label x="10" y="10" text="NEW PROFILE 2" fontWeight="bold" fontSize="15"/>
    </mx:Canvas>
    <mx:Canvas id="View3" label="View 3" width="100%" height="100%" backgroundColor="#E6E413">
    <mx:Label x="10" y="10" text="NEW PROFILE 3" fontWeight="bold" fontSize="15"/>
    </mx:Canvas>
    <mx:Canvas id="View4" label="View 4" width="100%" height="100%" backgroundColor="#F4A40A">
    <mx:Label x="10" y="10" text="NEW PROFILE 4" fontWeight="bold" fontSize="15"/>
    </mx:Canvas>
    <mx:Canvas id="View5" label="View 5" width="100%" height="100%" backgroundColor="#0D1DFA">
    <mx:Label x="10" y="10" text="NEW PROFILE 5" fontWeight="bold" fontSize="15" color="#FFFFFF"/>
    </mx:Canvas>
    </mx:ViewStack>
    </mx:Canvas>
    <mx:Button label="Remove item" click="deleteItem();" color="0x323232" x="96" y="10"/>
    <mx:Button label="Add item" click="addItem();" color="0x323232" x="10" y="10"/>
    </mx:Canvas>
     </mx:Application>

    Hi
    Try this if it works..
    1. In MultiProvider identify those key figure from both the InfoProvider ( DSOs)
    2. In BEx create KF1 . Restrict with 0INFOPROV = DSO1 ( Billing) , hide it
    3. Create KF2 . Restrict with 0INFOPROV = Cube ( condition cube) , hide it
    3. Create a Fomula Key Figure 3 with the definition
    KF3 =  KF1 + KF2* ( KF1==0)
    If KF1 is zero, then KF1 == 0  will be true and it will return value 1.  So, basically you would get
    KF3 = 0 + KF2 *1 = KF2
    When KF1 is non-zero, expression KF1== 0 will be false and gives a value 0. Let;s say KF1 =5 , then
    KF3 = 5 + KF2 * 0 = 5
    Now show KF3 in the report
    Regards
    Anindya

  • Process chain problem...., its urgent

    Hi all
    in my process chain we are loading 4 loads into ODS. After 3 loads, 4th load didn't take place. its not yet started even 3rd one successfully ran. its not showing error also. what can i do. after 4th one ODS activation process is there.
    Please advice me. will i go for manual loading. if i do manual, what abt activation after 4th load. will i do activation also manual or else it will trigger automatically as part of process chain........../
    Advice me frnds..., its urgent
    Regards
    swetha

    Hi Swetha,
    Sometimes, it doesn't help to just set a request to green status in order to run the process chain from that step on to the end.
    You need to set the failed request/step to green in the database as well as you need to raise the event that will force the process chain to run to the end from the next request/step on.
    Therefore you need to open the messages of a failed step by right clicking on it and selecting 'display messages'.
    In the opened popup click on the tab 'Chain'.
    In a parallel session goto transaction se16 for table rspcprocesslog and display the entries with the following selections:
    1. copy the variant from the popup to the variante of table rspcprocesslog
    2. copy the instance from the popup to the instance of table rspcprocesslog
    3. copy the start date from the popup to the batchdate of table rspcprocesslog
    Press F8 to display the entries of table rspcprocesslog.
    Now open another session and goto transaction se37. Enter RSPC_PROCESS_FINISH as the name of the function module and run the fm in test mode.
    Now copy the entries of table rspcprocesslog to the input parameters of the function module like described as follows:
    1. rspcprocesslog-log_id -> i_logid
    2. rspcprocesslog-type -> i_type
    3. rspcprocesslog-variante -> i_variant
    4. rspcprocesslog-instance -> i_instance
    5. enter 'G' for parameter i_state (sets the status to green).
    Now press F8 to run the fm.
    Now the actual process will be set to green and the following process in the chain will be started and the chain can run to the end.
    Of course you can also set the state of a specific step in the chain to any other possible value like 'R' = ended with errors, 'F' = finished, 'X' = cancelled ....
    Check out the value help on field rspcprocesslog-state in transaction se16 for the possible values.
    Try this solution with your 3rd ODS..hope this will solve your problem for this instance. This is just a workaround.
    Before next scheduel of the process chain..remove the link between 3rd ODS and 4th ODS and then reconnect once again and activate the process chain and schedule it as per your schedule cycle. From next upload onwards everything works fine.
    Assign points if it is helpful.
    Regards,
    Sreedhar

  • Overprinting problem in HTML!!Urgent....

    I am writing feedback reports for a computerised Liecencing Test.
    The reports are written in 28 languages.The report created in a java file which renders an HTML output.In Russian,Polish and Greek languages there ia overpriting problem.Even when I create a print preview showing the output on a frame containing JTextPane ,it shows overlapped output.
    Intresting as I select that overlapped text ,it becomes all right but
    disappears as any key is pressed or mouse is clicked.
    Kindly help.

    Look at http://forum.java.sun.com/thread.jsp?forum=31&thread=271751
    Give us some code, show us what you've done, tell us where it goes wrong. And remember, we don't really care if your problem is Urgent, we are doing you the favour by helping and will do it when/if we have time.

  • Problem when publishing HTML5 canvas animation

    Hi,
    I have a problem when I publish my animation in flash cc into HTML canvas, although it works fine on my desktop, but it gets worse on tablet, the animation gets slower and the colors are darker.
    I did some fixes as: removed all filters - converted the artwork objects into bitmaps - I even deleted the big BGs that have the biggest sizes.
    Any help/suggestions would be very appreciated.

    Thanks kglad for you reply, but the animation I am publishing is too simple and short, I've deleted anything that may effect the performance, I am sending you the link to view it and tell me if there is something wrong I am doing.
    http://192.185.4.135/~alwasaet/amman-rlo/char/01_html_character.html
    Thanks,

  • Have a big problem with report. Very urgent please help

    I have a report rep1. When I run the report via batch thru command rwclient to create a file it failed. I got the follwoing error message:
    REP-0177: Error while running in remote server
    Job 1413 is terminated due to connection timeout.
    It does not even try for few seconds before gives this message. I ran some other batch reports whihc took 15 minutes and they were fine.
    So, I stopped running the bad report for the day thinking the report is still not dead. I ran the same rep1 next day I still get the same error message. But this time when I ran I looked at the appserver showjobs (which lists the reports that were running and that already ran). The job number is different But still it fails in 3 seconds with the job number 1413 and connection time out. Can any one tell what might be the problem.
    Any number of times I run this job I get the same job number with same error (all this is only if I run it as batch using rwclient). If I run this as online by calling it from a form it returns the results without any problems.
    Please help. Very urgent.
    Thanks in advance.
    Asha

    You might want to delete the report server .dat file and restart the server and try
    his also could be one of the issues we had seen and fixed in 9.0.2.3. Please ensure you have the latest patch applied
    Thanks
    The Oracle Reports team

  • Problem with tiles ..VERY URGENT!

    I have a problem using tiles.
    I have a search page called search.jsp. It calls a searchResults.jsp page when user enters searchcriteria and clicks the search button. I want to have the results on the same page in the bottom part.
    I tried using Struts tiles but I have to make it understand that my results should appear on the same page at the bottom.I could not figure it out.
    Please help me out.Its very urgent.
    Thanks

    Sounds VERY URGENT to me....

  • Problem in executing a smartform URGENT!!

    HI,
    I created a template in my layout and created a structure
    z_tab which i had to pass in the smartform now
    my problem is
    in form interface i gave i_tab type z_tab
    and in template-> text iam adding a feild&i_tab-raw&( this is my feild name which i have to show in output) and in se38 my interface program i gave the necessary.
    But iam getting error saying
    "Reference field I_TAB-RAW unknown in form."
    please help its urgent
    Thank you

    the reference field which i gave in the structure was making this problem it was currency field and reference table was mismatched.
    Thankyou for replying raam & rahul.

  • Sorting problem in TreeMap, please help urgent :-((

    Hi
    Following is a program, please execute it to see the problem. I am adding four elements in the TreeMap. The problem is when I add the elements it never compares the newly added element with the first element. I was sick of it so to test the TreeMap I created my own small class and defined a Comparator for that class. Following is the code which shows the problem in TreeMap. Am I doing something wrong? Please help its urgent.
    import java.util.*;
    public class SortingCollection {
         public static void main(String[] args) {
              SortingCollection sortingCollection = new SortingCollection();
              sortingCollection.sortingTest();
         public void sortingTest() {
              TreeMap treeMap = new TreeMap();
              treeMap.put(new Test("Bhushan", 1022), new Integer(1022));
              treeMap.put(new Test("Wasil", 1023), new Integer(1023));
              treeMap.put(new Test("Ifti", 1020), new Integer(1020));
              treeMap.put(new Test("Roshan", 1021), new Integer(1021));
              System.out.println(treeMap);
              Test test = new Test("Bhushan", 1028);
              treeMap.put(test, new Integer(1022));
              System.out.println(treeMap);
         public class Test implements Comparable {
              public String name;
              public int age;
              public Test(String name, int age) {
                   this.name = name;
                   this.age = age;
              public int compareTo(Object toBeCompared) {
                   Test casted = (Test) toBeCompared;
                   if (name.equals(casted.name)) {
                        System.out.println("Returning 0 for " + name + " " + casted.name);
                        return 0;
                   System.out.println("Returning -1 for " + name + " " + casted.name);
                   return -1;
              public String toString() {
                   return "[" + name + ", " + age + "]";
    }

    If you are using TreeMap, you should want the keys to be immutable. You can't change the state of the keys of a Map such that their natural order will change, or chaos will happen.
    If the key is the GateKeeperInfo class (which has host, port, and # of users as its data members) and the value is "some other object reference which you need", and this reference is closely tied to the GateKeeperInfo, have you considered making it a member of the GateKeeperInfo?
    That way you don't need this TreeMap business. You can have the natural ordering imposed on the GateKeeperInfo class (which is apparently comparing the host and port only). You can also have a Comparator object that can compare these objects in a different way (# of users, for instance).
    public class MyClass implements Comparable
       String host;
       int    port;
       int    currNumUsers;
       Object someOtherObjectReferenceINeed;
       // or if the object reference you need is an Integer, make that last member
       // an int...
       // Also, let's keep a Comparator in here for comparing # of users.
       // See further down for actual implementation...
       public static final Comparator BY_NUM_USERS = new NumUsersComparator();
         // Use the equal methods to determine whether or not host and port matches
       public boolean equals( Object obj )
       // Use the compareTo method to compare 2 instances in terms of host and port
       public int compareTo( Object obj )
         // Make this object take care of changing # of users, outside of the
         // Comparable interface.
         public int getNumUsers();
         public int bumpNumUsers( int byThisAmount ); // changes # of users...
         // Beef up this object to take advantage of someOtherObjectReferenceINeed
    // Use this Comparator object to compare 2 instances of MyClass
    // according to # of users.
    public class NumUsersComparator implements Comparator
         public int compare( Object a, Object b )
              MyClass left      = (MyClass)a;
              MyClass right      = (MyClass)b;
              // I am assuming both # of users are of the same sign...positive
              return ( right.getNumUsers() - left.getNumUsers() );
    // Now when you need to compare, you can do it 2 different ways...
    // You can use whatever Collection you fits, List, Set, ...
    // I am going to use List in this case
    List gateways = new ArrayList;
    // add the objects...
    gateways.add( /* . . . */ );
    // Now let's sort in terms of user/port
    Collections.sort( gateways );
    // Let's sort in terms of number of users...
    Collections.sort( gateways, MyClass.BY_NUM_USERS );
    // I am going to mix them around now...
    Collections.shuffle( gateways );
    // Now let's find the gateway w/ the largest # of users...
    MyClass currMaxGateway = Collections.max( gateways, MyClass.BY_NUM_USERS );
    .

  • Problem with generating stacked canvas in Designer 6i

    When I try to generate a master detail form, in which the detail block is placed on a 'new stacked canvas' the form is generated as expected: master- and detailblock are both created, but when running the form
    the detail block is somehow made invisible. I don't understand!!!
    Does anyone recognize this problem????
    Hope to hear from you!
    Alex

    Hello,
    When you put a block on a "new stacked canvas" that canvas is generated as a popup canvas. If that popup overlaps with some other generated items (for instance: items in master block) Forms will not show it.
    You can try showing that popup canvas programatically with Show_View('canvas_name') in When-New-Form-Instance and see what happens.
    Dalibor
    P.S. Why do you have to put detail block on a popup canvas? Why don't you simply put it on a "same content canvas"?

  • Problem viewing text in canvas

    Good day.
    I've tried to use Canvas for wiewing long text in midp application.
    I'm using drawString() method of class Graphics.
    For calculating the substring viewed horizontally a screen I'm using the method stringWidth() of class Font.
    The font is:
    Font f = Font.getFont(Font.FACE_PROPORTIONAL, Font.STYLE_PLAIN, Font.SIZE_MEDIUM);
    In some phones the rows are clipped.
    I've tried using Font.FACE_MONOSPACE and / or Font.SIZE_SMALL but with the same result.
    Debuging code I've seen that the value calculate from stringWidth() method id less than the with of the screen, but really is clipped.
    Why?
    Best regards and good work.
    Stefano Errani

    sure you're not setting clipRect() anywhere? I've never seen what you're describing, and I've done LOTS of canvas/text work. hmm. i'm sure there's a good explanation

  • PROBLEM IN EXCEL EXPORT. URGENT!!!!!

    hi all,
    I have requriment acco to which i need to download or export the content of the table UI element to excel 2003. I used the a excel export application, but facing problem like. in the below mentioned method name, how are the parameters
    1) com.sap.tc.webdynpro.progmodel.api.IWDNode
    2)java.util.map
    has been taken, i am not able to get this in my application where i need to use this method.
    or is there any other method by which i can export my table data to excel2003. please this really urgent requirment.
    public void exportToExcel2003( com.sap.tc.webdynpro.progmodel.api.IWDNode
    dataNode, java.util.Map columnInfos )
    REGRADS
    SHARAN
    Edited by: saisharan kalla on Dec 20, 2007 6:01 AM

    Hi Sharan,
                    What exactly is the problem u r facing with those parameters??
    U can use this method also for excel export
    /people/subramanian.venkateswaran2/blog/2006/08/16/exporting-table-data-to-ms-excel-sheetenhanced-web-dynpro-binary-cache
    U can check with this also
    https://www.sdn.sap.com/irj/sdn/wiki?path=/display/snippets/webDynproJava-ExportingTableDataUsingOn-DemandStreams-SAPNW+7.0&
    regards
    Sumit

  • Problem uninstalling MaxMSPRuntime on mac - urgent help needed

    Hello there,
    I've been using Cycle 74's MaxMSP Runtime version 5.1 for a while but recently had to witch to an earlier version to make some hardware function along side the Max runtime environment. The problem is that where i would usually just drag and drop Max 5.1 into the trash to uninstall it, for some reason, after i have done this and try to install the older version of Max, OSX wont let me install Max 4.0.8 as it says an updated version is currently installed. I have scoured my hard drive for the remanence of Max 5.1. and deleted everything i've found. Is there a way of overriding macosx and getting it to replace Max5.1 with an older version?
    Urgent help needed as i am playing a show this weekend and currently am not able to get my equipment to function.
    A shiny nickel for the one who saves my ***.
    Thanks
    Henry

    Hi- Try this...
    If you can, reinstall or use time machine to recover your recently deleted MaxMSP Runtime 5.1.
    Then, download AppZapper. It is a utility that helps you cleanly delete programs off your mac. It is free for the first 5 uses.
    http://appzapper.com/
    Then, install AppZapper, and then go ahead and drag the MaxMSP Runtime 5.1 into it, and it should hopefully get rid of the pesky program

Maybe you are looking for

  • Change default spool extension

    Hi, I am trying to write piece of code that would spool a file directly in .csv format. However, when I try to do it the .csv file is further appended with .lst and this does not serve my purpose. Is there a way to work around this. My existing code

  • How to view / edit other users subscriptions to reports via report admin user ?

    Is there a built-in GUI means or power tool to access a list of all the users' subscriptions to reports in SQL 2012 ? It seems that report admin can only view his own subscriptions, same as any other user via "my subscriptions", but no found option f

  • PCR -Adobe form error

    Hi, We are tryying to configure the standard PCR iview available. Currently employee on clicking the PCR iview can see employees under him but when he selects an employee and clicks iview "change area and subarea" we get the following error.(Adobe fo

  • Completely blocked, need help

    hi, have a serious problem: it happens that when i want to open a session following error message appears: "Audition has encountered an error :[\Monk\main\common\PremiereShell\Src\PlayerFactory.cpp-379]". My two recent sessions i cannot get back anym

  • SINCE UPDATING TO IOS 5.1, MY MESSAGING CANT GO IN LANDSCAPE MODE

    SInce updating to the ios 5.0.1, my messaging cannot go into landscape mode.