Query displaying digits into words...

I have a query:
SQL> select to_char(to_date('1234', 'J'), 'jsp') from dual ;
TO_CHAR(TO_DATE('1234','J'),'JSP')
one thousand two hundred thirty-four
can I know whats the logic for this?
what i understdand is '1234' get converted to julian equivalent.
what exactly JSP does in this scenario?

Don't forget about restricted nature of calendar:
SQL> select to_char(to_date(5373485,'J'),'Jsp') from dual;
select to_char(to_date(5373485,'J'),'Jsp') from dual
ERROR at line 1:
ORA-01854: julian date must be between 1 and 5373484

Similar Messages

  • How to display amount in words in the last page

    Hi,
    I am very new to Oracle Report, but v.good experience in Crystal report.
    How can i display amount in words for an invoice amount total in the last page of the invoice and after total amount. I created a new non repeating frame and put the amount in words inside that, and set the frames diplay property Print on Last Page, but the problem is already there is a repeating frame to print all the invoices item, and the total in figure. But the amount in words frame is not always coming after the total amount,either it should be at the bottom of the last page in fixed position, otherwise it should move just below the total amount.
    I am using Oracle 11g.
    Thanks in advance...
    Fsl

    Hi ,
    Use This function
    create or replace FUNCTION xxg4_zen_conv_words (p_amount IN Number) RETURN Varchar2 IS
    --Creation Date   :  11-DEC-2009
    --Purpose         :  This Function returns amount in words.
    --Parameters      :
    --1) p_amount : Only positive and negative values are allowed.
    Precision can be entered upto 10 digits and only 2 scales
    are allowed e.g 9999999999.99
    -- Index by Tables to store word list
    TYPE typ_word_list IS TABLE OF Varchar2(200) INDEX BY BINARY_INTEGER;
    t_typ_word_list typ_word_list;
    TYPE typ_word_gap IS TABLE OF Varchar2(200) INDEX BY BINARY_INTEGER;
    t_typ_word_gap typ_word_gap;
    -- Local Variables
    v_amount Number := p_amount;
    v_amount_length Number;
    v_words Varchar2(10000);
    v_point_found Varchar2(1) := 'N';
    v_point_value Number;
    BEGIN
    /*Getting value after point if found */
    v_point_value := SUBSTR(v_amount,(INSTR(v_amount,'.',1) + 1),2);
    /*Checking whether amount has any scale value also */
    v_point_found := CASE WHEN (INSTR(v_amount,'.',1)) = 0 THEN 'N'
    WHEN (INSTR(v_amount,'.',1)) > 0 THEN 'Y'
    END;
    /*Converting amount into pure numeric format */
    v_amount := FLOOR(ABS(v_amount));
    v_amount_length := LENGTH(v_amount);
    t_typ_word_gap(2) := 'and Paise';
    t_typ_word_gap(3) := 'Hundred';
    t_typ_word_gap(4) := 'Thousand';
    t_typ_word_gap(6) := 'Lakh';
    t_typ_word_gap(8) := 'Crore';
    t_typ_word_gap(10) := 'Arab';
    FOR i IN 1..99
    LOOP
    t_typ_word_list(i) := To_Char(To_Date(i,'J'),'Jsp');
    END LOOP;
    IF v_amount_length <= 2
    THEN
    /* Conversion 1 to 99 digits */
    v_words := t_typ_word_list(v_amount);
    ELSIF v_amount_length = 3
    THEN
    /* Conversion for 3 digits till 999 */
    v_words := t_typ_word_list(SUBSTR(v_amount,1,1))||' '||t_typ_word_gap(3);
    v_words := v_words ||' '||t_typ_word_list(SUBSTR(v_amount,2,2));
    ELSIF v_amount_length = 4
    THEN
    /* Conversion for 4 digits till 9999 */
    v_words := t_typ_word_list(SUBSTR(v_amount,1,1))||' '||t_typ_word_gap(4);
    IF SUBSTR(v_amount,2,1) != 0
    THEN
    v_words := v_words ||' '||t_typ_word_list(SUBSTR(v_amount,2,1))||' '||t_typ_word_gap(3);
    END IF;
    IF SUBSTR(v_amount,3,2) != 0
    THEN
    v_words := v_words ||' '||t_typ_word_list(SUBSTR(v_amount,3,2));
    END IF;
    ELSIF v_amount_length = 5
    THEN
    /* Conversion for 5 digits till 99999 */
    v_words := t_typ_word_list(SUBSTR(v_amount,1,2))||' '||t_typ_word_gap(4);
    IF SUBSTR(v_amount,3,1) != 0
    THEN
    v_words := v_words ||' '||t_typ_word_list(SUBSTR(v_amount,3,1))||' '||t_typ_word_gap(3);
    END IF;
    IF SUBSTR(v_amount,4,2) != 0
    THEN
    v_words := v_words ||' '||t_typ_word_list(SUBSTR(v_amount,4,2));
    END IF;
    ELSIF v_amount_length = 6
    THEN
    /* Conversion for 6 digits till 999999 */
    v_words := t_typ_word_list(SUBSTR(v_amount,1,1))||' '||t_typ_word_gap(6);
    IF SUBSTR(v_amount,2,2) != 0
    THEN
    v_words := v_words ||' '||t_typ_word_list(SUBSTR(v_amount,2,2))||' '||t_typ_word_gap(4);
    END IF;
    IF SUBSTR(v_amount,4,1) != 0
    THEN
    v_words := v_words ||' '||t_typ_word_list(SUBSTR(v_amount,4,1))||' '||t_typ_word_gap(3);
    END IF;
    IF SUBSTR(v_amount,5,2) != 0
    THEN
    v_words := v_words ||' '||t_typ_word_list(SUBSTR(v_amount,5,2));
    END IF;
    ELSIF v_amount_length = 7
    THEN
    /* Conversion for 7 digits till 9999999 */
    v_words := t_typ_word_list(SUBSTR(v_amount,1,2))||' '||t_typ_word_gap(6);
    IF SUBSTR(v_amount,3,2) != 0
    THEN
    v_words := v_words ||' '||t_typ_word_list(SUBSTR(v_amount,3,2))||' '||t_typ_word_gap(4);
    END IF;
    IF SUBSTR(v_amount,5,1) != 0
    THEN
    v_words := v_words ||' '||t_typ_word_list(SUBSTR(v_amount,5,1))||' '||t_typ_word_gap(3);
    END IF;
    IF SUBSTR(v_amount,6,2) != 0
    THEN
    v_words := v_words ||' '||t_typ_word_list(SUBSTR(v_amount,6,2));
    END IF;
    ELSIF v_amount_length = 8
    THEN
    /* Conversion for 8 digits till 99999999 */
    v_words := t_typ_word_list(SUBSTR(v_amount,1,1))||' '||t_typ_word_gap(8);
    IF SUBSTR(v_amount,2,2) != 0
    THEN
    v_words := v_words ||' '||t_typ_word_list(SUBSTR(v_amount,2,2))||' '||t_typ_word_gap(6);
    END IF;
    IF SUBSTR(v_amount,4,2) != 0
    THEN
    v_words := v_words ||' '||t_typ_word_list(SUBSTR(v_amount,4,2))||' '||t_typ_word_gap(4);
    END IF;
    IF SUBSTR(v_amount,6,1) != 0
    THEN
    v_words := v_words ||' '||t_typ_word_list(SUBSTR(v_amount,6,1))||' '||t_typ_word_gap(3);
    END IF;
    IF SUBSTR(v_amount,7,2) != 0
    THEN
    v_words := v_words ||' '||t_typ_word_list(SUBSTR(v_amount,7,2));
    END IF;
    ELSIF v_amount_length = 9
    THEN
    /* Conversion for 9 digits till 999999999 */
    v_words := t_typ_word_list(SUBSTR(v_amount,1,2))||' '||t_typ_word_gap(8);
    IF SUBSTR(v_amount,3,2) != 0
    THEN
    v_words := v_words ||' '||t_typ_word_list(SUBSTR(v_amount,3,2))||' '||t_typ_word_gap(6);
    END IF;
    IF SUBSTR(v_amount,5,2) != 0
    THEN
    v_words := v_words ||' '||t_typ_word_list(SUBSTR(v_amount,5,2))||' '||t_typ_word_gap(4);
    END IF;
    IF SUBSTR(v_amount,7,1) != 0
    THEN
    v_words := v_words ||' '||t_typ_word_list(SUBSTR(v_amount,7,1))||' '||t_typ_word_gap(3);
    END IF;
    IF SUBSTR(v_amount,8,2) != 0
    THEN
    v_words := v_words ||' '||t_typ_word_list(SUBSTR(v_amount,8,2));
    END IF;
    ELSIF v_amount_length = 10
    THEN
    /* Conversion for 10 digits till 9999999999 */
    v_words := t_typ_word_list(SUBSTR(v_amount,1,1))||' '||t_typ_word_gap(10);
    IF SUBSTR(v_amount,2,2) != 0
    THEN
    v_words := v_words ||' '||t_typ_word_list(SUBSTR(v_amount,2,2))||' '||t_typ_word_gap(8);
    END IF;
    IF SUBSTR(v_amount,4,2) != 0
    THEN
    v_words := v_words ||' '||t_typ_word_list(SUBSTR(v_amount,4,2))||' '||t_typ_word_gap(6);
    END IF;
    IF SUBSTR(v_amount,6,2) != 0
    THEN
    v_words := v_words ||' '||t_typ_word_list(SUBSTR(v_amount,6,2))||' '||t_typ_word_gap(4);
    END IF;
    IF SUBSTR(v_amount,8,1) != 0
    THEN
    v_words := v_words ||' '||t_typ_word_list(SUBSTR(v_amount,8,1))||' '||t_typ_word_gap(3);
    END IF;
    IF SUBSTR(v_amount,9,2) != 0
    THEN
    v_words := v_words ||' '||t_typ_word_list(SUBSTR(v_amount,9,2));
    END IF;
    END IF;
    IF v_point_found = 'Y'
    THEN
    IF v_point_value != 0
    THEN
    v_words := v_words||' '||t_typ_word_gap(2)||' '||t_typ_word_list(CASE WHEN LENGTH(SUBSTR(p_amount,(INSTR(p_amount,'.',1) + 1),2)) = 1 THEN SUBSTR(p_amount,(INSTR(p_amount,'.',1) + 1),2)||'0'
    WHEN LENGTH(SUBSTR(p_amount,(INSTR(p_amount,'.',1) + 1),2)) = 2 THEN SUBSTR(p_amount,(INSTR(p_amount,'.',1) + 1),2)
    END);
    END IF;
    END IF;
    IF p_amount < 0
    THEN
    v_words := 'Minus '||v_words;
    ELSIF p_amount = 0
    THEN
    v_words := 'Zero';
    END IF;
    IF LENGTH(v_amount) > 10
    THEN
    v_words := 'Value larger than specified precision allowed to convert into words. Maximum 10 digits allowed for precision.';
    END IF;
    RETURN (v_words);
    END xxg4_Zen_Conv_Words;
    --Thanks
    SAGAR SANKPAL

  • How can I display Excel using Word VSTO Addin.

    Hi all.
    I am a beginner.
    And studying Word VSTO ribbon addins.
    I wrote very simple one (works charm );   
    Microsoft.Office.Interop.Word.Application  oAPP  =  Globals.ThisAddIn.Application;
    oAPP.Selection.InsertAfter( " Hello, Word !! " );        
    oAPP.Selection.Collapse();
    Now, I have to go on.
    I want to display "Hello, Excel !! " from the same addin (from the Word Addin)
    I tried to port the following VBA codes (into Word Addin);
        Set oEXCEL = CreateObject("Excel.Application")
        Set oWBOOK = oEXCEL.Workbooks.Add
        oWBOOK.ActiveSheet.Range("A1").Value = " Hello, Excel !! "
        oEXCEL.Visible = True
    I do not know how to start from the very beginning.
    I can not make "Application (for excel)" object at all.
    VS says, the "Application" is not for the Excel but for the Word.
    Yes, everybody know it. But, Excel has the same one too. So I tried to make casting. It never works.
    I added required reference(s).
    Wht do I have to do ?
    Is it impossible, naturally ?
    Regards

    Hello,
    The
    How to automate Microsoft Excel from Microsoft Visual C#.NET  article describes all the required steps for automating Excel from any other application.
    Anyway, the current forum is for VSTO specific questions. I'd suggest asking Excel or Word specific questions on the
    Excel for Developers or
    Word for Developers forums instead.

  • Cannot paste any online pictures from any websites into word/powerpoint/onenote 2013

    I cannot paste any pictures/ images copied from any websites into word, powerpoint and onenote.
    Now, i am so stressful because this strange problem occurs with both versions of Microsoft Office (2010 and 2013). I had updated the Microsoft Office from 2010 to 2013
    with the hope that this problem will be solved in 2013 version but I was so disappointed. I was so addicted to onenote and cannot live without onenote. In the past, I always used onenote to store countless handmade-creating articles and so many other information
    found on websites and other resources by simply copying (Ctrl + C) and pasting (Ctrl + V) them into onenote without any problems.
    This strange problem has occurred and resisted approximate 2 months. Now I am almost going insane. I am longing for help, any help from the online community. Please!
    I will describe the problem in more details.
    -My laptop was Asus N550JV, and it was installed only one operating system: Window 8 single language by manufacturer. Nothing such as virtual machine or multiple operating
    systems in this laptop.
    -This problem occurred with all websites, not only with a certain website or a specific website.
    -It occurred with all of my latest-updated web-browsers, including firefox, internet explorer (which was pre-installed by factory in my window 8), opera, safari, chrome.
    -Despite of using whatever web-browsers listed above, although the whole articles (text and pictures) on these websites were copied, however there was only text pasted
    successfully, excluding pictures.
    -Pictures/ images were not pasted together with text. The onenote/word/powerpoint only shows a blank space where the picture should be in. If I click on this blank space,
    a frame will appear covering this blank space inside, and the url address of this picture was shown. The
    “drawing tools”
    tab appeared instead of “picture tools”
    tab. I guessed the pasted pictures were considered as drawing objects, not as pictures.
    -After many unsuccessful attempts to solve this problem in Microsoft Office, some days ago I decided to install Open Office of Apache in the same laptop in order to make
    a control test between the two programs. I was successfully in copying and pasting text and pictures on many websites (using whatever web-browsers I am having) into text document of Open Office without any problems. Pasting pictures and text from websites
    into Open Office was successful, so that what the hell was happened with my Microsoft Office?
    -If I download or save the pictures found on websites to my laptop then using the
    “insert picture”
    function to insert these pictures into word/ppt/onenote, these pictures were inserted successfully without any problems.
    -Copying and pasting text and pictures from old articles stored in onenote to a newly created word document were successful without any problems. Copying and pasting text
    and pictures between word and word, onenote and onenote were successful without any problems.
    -It was concluded that this problem only occurred with online pictures pasted from websites, while inserting or pasting the downloaded pictures were successful
    without any problems.
    -My internet connection was not disrupted during copying and pasting processes.
    -My Canon laser printer only recognized and printed the text lines, there were only blank spaces in the places where the pictures should be in.
    During two months since having this problem, I have searched so many times in order to find a solution. All of solutions listed behind I already found on internet and tried
    them all but nothing worked! This problem still resisted in Microsoft Office 2013 and now I am so sad and tired because of it.
    List of solutions I found and tried but nothing worked:
    -Right-clicking then choose "paste option: keep source formatting”
    and choose “set as default paste option"
    -On the
    View tab of the Ribbon or on the status bar, choose
    Print Layout view, not Draft view.
    -Go to
    Office Button | Word Options | Advanced: Show document content and make sure that
    “Show drawings and text boxes on screen”
    is checked and that “Show picture placeholders”
    is not checked.
    -Go to
    Office Button | Word Options | Display: Printing options and make sure that
    “Print drawings created in Word”
    is checked.
    -On the
    Home tab of the Ribbon, locate the
    Paragraph group and click the dialog launcher arrow in the bottom right corner to open the
    Paragraph dialog; in that dialog, make sure that line spacing of the paragraph the picture is in is not set to an
    Exact value.
    -Paste the picture and immediately press
    Ctrl+Shift+F9 to unlink it. The picture will then be embedded in your document.
    -If you find that Word hangs when you try to paste, you can instead select
    Edit | Paste Special and choose “Device-independent Bitmap”
    instead of the default of “HTML format.”->
    I could not try this solution because my paste special options only had three choices: unformatted text, html format, unformatted unicode text.
    -Select File, Options, Advanced, then under
    Cut, Copy, Paste section set "insert/paste picture as”:
    tight/ inline with text/ through/ square/ top and bottom/ in front of text/ behind text… -> I have tried all
    choices but nothing worked.
    -Rename the Normal.dot or Normal.dotm global template file: run cmd.exe and type
    ren %userprofile%\AppData\Roaming\Microsoft\Templates\Normal.dotm OldNormal.dotm. Then type
    exit, and then press Enter. Or go to C:\Users\Home\AppData\Roaming\Microsoft\Templates to rename the Normal.dot/ Normal.dotm file manually.
    -Turn off the "Use draft quality" option:
    Click
    File, and then click Options. Click Advanced,
    Under Print, click to clear the Use draft quality check box. Click OK.
    -Change the view to:
    Print Layout/ Full Screen Reading/ Web Layout/ Print Preview
    For Word 2010-2013: Click File, and then click Print.
    -Check the box for
    “Print background colors and images”
    at File | Options | Display: Printing options.
    -Check the box for
    “Show background colors and images in Print Layout view”
    at File | Options | Advanced: Show document content.
    -Using repairing function to repair the Microsoft office 2013.
    Nothing worked! I have no clue of what have been happened with my Microsoft Office! Please help!
     I cannot upload a screenshot taken from my laptop into this forum. It said that
    body text cannot contain images or links until we are able to verify your account.

    To Scxy1234: I also don't know why my paste special options only had 3 choices excluding "device independent bitmap'
    To Steve Fan: I created the new second user account in my window 8. It was set as a standard account, not as administrator account as my first original user account. Specifically, i used the same email address with this forum account's to
    create this second user account. It means that the second user account in my laptop also was a Microsoft account.
    Can you guess what happened after i had logged in to the second user account? I opened some random websites by firefox, copied and pasted all text and pictures on these websites into a word document and onenote successfully without any problems!!!!
    I saved this word document and exported this onenote section to a Usb. After that, i switched from second standard user account to my window administrator account and opened the two files which were saved to Usb previously. They were opened and displayed
    normally as the same as what i previously had seen in the second user account, i.e. pasted text and pictures were displayed normally. However, when i opened the same web address again to copy the same text and pictures to word and onenote, there were only
    text lines pasted successfully, excluding pictures! This old strange problem happened again when using original administrator account for logging in window. In contrast, when using the second standard user account to log in window, copying and pasting text
    and online pictures of Microsoft office worked normally.
    I truly don't figure out the reason(s) caused this strange problem. I think my case is a special case because i tried all solutions other people had tried but nothing worked.
    Please help me!
    p/s: when i logged in the second standard user account, i opened the paste special options in word and there were only 3 choices under paste special options, excluding "device independent bitmap"

  • I want to display a first word in the data of a column

    i want to display the first word
    example: Software Engg Ooo
    answer should be Software
    using simple query no nested queries

    10g:
    SQL> select regexp_substr('Software Engg Ooo','[^ ]+') from dual;
    REGEXP_S
    Software                                                                                                                                                                                                                           

  • What do I need to do to display a MS Word, Excel or PDF document in browser

    Hi, Right now I have photos loaded and displayed in my HTML document in the browser next to a report...
    What do I need to do to display a MS Word, Excel or PDF document in a browser?
    I use the following procedure to load the content to the region of my HTML .
    This gives an EDIT link to the photo...
    select
    '[img src="#OWNER#.display_thumb?p_file_id=' || nvl(file_catalog_id,0) || '" /]' "File"
    from "FILE_CATALOG"
    where "FILE_CATALOG_ID" = :P9_FILE_CATALOG_ID
    This is the procedure to load the content to the region of my HTML .
    create or replace PROCEDURE "DISPLAY_THUMB" (p_photo_id in number)
    as
    l_mime varchar2(255);
    l_length number;
    l_file_name varchar2(2000);
    lob_loc BLOB;
    begin
    select mime_type, thumbnail, photo_name, dbms_lob.getlength(thumbnail)
    into l_mime, lob_loc, l_file_name, l_length
    from photo_catalog where photo_catalog_id = p_photo_id;
    -- Set up HTTP header
    -- Use an NVL around the mime type and if it is a null, set it to
    -- application/octect - which may launch a download window from windows
    owa_util.mime_header(nvl(l_mime,'application/octet'), FALSE );
    -- Set the size so the browser knows how much to download
    htp.p('Content-length: ' || l_length);
    -- The filename will be used by the browser if the users does a "Save as"
    htp.p('Content-Disposition: filename="' || l_file_name || '"');
    -- Close the headers
    owa_util.http_header_close;
    -- Download the BLOB
    wpg_docload.download_file( Lob_loc );                               
    end;

    These were supplied from Justin in Experts Exchange..
    For PDF, see here:
    http://www.adobe.com/support/techdocs/328233.html
    http://www.adobe.com/support/techdocs/331025.html
    For Word docs, see here:
    http://www.shaunakelly.com/word/sharing/OpenDocInIE.html
    Any other input... any AJAX?

  • Photoshop CS6 files into Word 2011?

    When I import a photo file from CS6 for MAC, 1x2" at 300 ppi, into Word 2011 for MAC on my new MacBook Pro, the file is importing to fill the page width. When I import a similar file from my old CS2 on the same new computer, the file imports at the correct 1x2" size. I think there is some setting I need to change in CS6, but have been through every place I can find to look. What can I do to fix this?

    Don't have retina display. Just realized images are importing to Word 2011 sized at 72 ppi rather than the 300 of original file. That is why size is coming out so large. There must be somewhere in CS6 that is doing this. Apparently, in CS5.5, there is a place to change this under Photoshop>options>, but this choice does not show up in CS6, and I can't find anything similar under Preferences. Any ideas?

  • Using text select tool in Preview--pasting into Word

    Hi, since the recent updates made Acrobat Pro 7 unusable (installer crashes, Acrobat crashes upon displaying title bars . . . I've posted on this elsewhere), I have been using Preview. I noticed that when I select and copy a piece of text in Preview and then paste this selection into a Word document the selection is unreadable. Is there any way to make the image readable?

    Liz,
    I have the same problem. Acrobat Reader 7 works well in my computer... I do not know if you can copy/paste into Word. However, I am going to reintall the System X and not do the recent updates (QT7, wireless keyboard and Security from last Friday)

  • Function for amount into words

    hi friends,
               can any one tell from which function module we can convert amount in figures into words.
    input   -> 50,000
    output -> fifty thousands
    plz. help.
    it's urgent

    HI
    use SPELL_AMOUNT
    data: words type spell.
    call function 'SPELL_AMOUNT'
    exporting
        amount          = '100000'
    *   CURRENCY        = ' '
    *   FILLER          = ' '
    *   LANGUAGE        = SY-LANGU
      importing
        in_words        = words.
    if words-word = 'ONE HUNDRED THOUSAND'.
      words-word = '1 LAKH'.
    endif.
    write:/ words-word.
    display amount in words (USD) including cents
    convert amount in no's to words
    /community [original link is broken]
    <b>Reward if usefull</b>

  • Insert SAP ICONS into from SAP into Word document (OLE)

    Hi ,
    I want to Insert SAP ICONS into from SAP into Word document (OLE) .
    Please let me know how can I do it? I would really appreciate it.
    Regards,
    Sanjeev

    Hello,
    Try this out:
    (1) Copy program DD_ADD_PICTURE into your own version called ZDD_ADD_PICTURE. Make sure
    you select all the checkboxes (including GUI Status and screens).
    (2) Paste the modified code at the end of this reply into your ZZ_ADD_PICTURE program.
    (3) Run ZZ_ADD_PICTURE for a range of Icons (e.g. enter Icon name ICON_IN* on the selection screen)
    (4) When you get the result list, type in ok-code EXPO directly in the ok-code
    field (you could also add a button for this function in the GUI status).
    (5) Download all the displayed icons as .gif files into a Windows folder
    that you have created to hold the icon .gif files (e.g. C:SAPICONS)
    (6) Now you can work with the icon files as you would any .gif file. (e.g. In a Word doc, use menu path
    Insert -> Picture -> From file.)
    Here is the code:
    REPORT dd_add_picture.
    TYPE-POOLS: sdydo.
    DATA: do TYPE REF TO cl_dd_document.
    DATA: is_displayed.
    TABLES: icont.
    DATA: BEGIN OF icontab OCCURS 0.
            INCLUDE STRUCTURE icon.
    DATA: END OF icontab.
    select-options: s_icon for icontab-name obligatory.
    SELECT * FROM icon INTO TABLE icontab WHERE locked NE 'X'
                        AND name in s_icon.
    * Event Handler Definition, handling changes of GUI fonts, colors,...
    CLASS cl_my_event_handler DEFINITION.
      PUBLIC SECTION.
        METHODS:
          use_new_resources FOR EVENT resources_changed OF cl_gui_resources.
    ENDCLASS.
    DATA: my_handler TYPE REF TO cl_my_event_handler.
    CREATE OBJECT my_handler.
    * Call Screen
    CALL SCREEN 100.
    *&      Module  STATUS_0100  OUTPUT
    MODULE status_0100 OUTPUT.
      IF is_displayed IS INITIAL.
        SET PF-STATUS 'BRP'.
        SET HANDLER my_handler->use_new_resources.
    * create document
        CREATE OBJECT do.
    * fill document
        PERFORM dd_add_icon USING do.
    * merge document
        CALL METHOD do->merge_document.
    * display document .
        CALL METHOD do->display_document
                           EXPORTING  container          = 'HTML'
                           EXCEPTIONS html_display_error = 1.
                                           " do some exception handling ...
        is_displayed = 'X'.
      ENDIF.
    ENDMODULE.                             " STATUS_0100  OUTPUT
    MODULE user_command_0100 INPUT.
      CASE sy-ucomm.
        WHEN 'BACK'.                       "Beenden
          LEAVE PROGRAM.
        WHEN 'PRN'.
          CALL METHOD do->print_document
                  EXPORTING reuse_control = 'X'.
        WHEN 'PRN_NEW'.
          DATA text TYPE sdydo_text_element.
          CALL METHOD do->initialize_document.
          text = 'Dies Dokument wurde speziell fürs Drucken erstellt!' &
                            ' Druckdatum: '(500).
          CALL METHOD do->add_text EXPORTING
                               text         = text
                               sap_fontsize = cl_dd_area=>large.
          WRITE sy-datum TO text DD/MM/YYYY.
          CALL METHOD do->add_text EXPORTING text = text .
          CALL METHOD do->new_line EXPORTING repeat = 2.
          PERFORM dd_add_icon USING do.
          CALL METHOD do->merge_document.
          CALL METHOD do->print_document.
        WHEN 'EXPO'.
          CALL METHOD do->export_document EXPORTING to_filesystem = 'X'.
      ENDCASE.
      CLEAR sy-ucomm.
    ENDMODULE.                             " USER_COMMAND_0100  INPUT
    *&      Form  DD_ADD_ICON
    *       text
    FORM dd_add_icon USING p_do TYPE REF TO cl_dd_document.
      DATA ta TYPE REF TO cl_dd_table_element.
      DATA col1 TYPE REF TO cl_dd_area.
      DATA col2 TYPE REF TO cl_dd_area.
      DATA col3 TYPE REF TO cl_dd_area.
      DATA text TYPE sdydo_text_element.
    * set Heading
      text = ' Bilder in Dynamischen Dokumenten'(001).
      CALL METHOD p_do->add_text EXPORTING text = text
                                      sap_style = 'heading'.
      CALL METHOD p_do->new_line.
      CALL METHOD p_do->new_line.
      CALL METHOD p_do->add_table EXPORTING with_heading    = 'X'
                                          no_of_columns     = 3
                                          width             = '100%'
                                          IMPORTING table   = ta.
    * set columns
      text = 'Ikone'(011).
      CALL METHOD ta->add_column EXPORTING heading  = text
                                 IMPORTING column   = col1.
    * fill table
      LOOP AT icontab.
        SELECT SINGLE * FROM icont WHERE langu = sy-langu
                                   AND   id    = icontab-id.
        CALL METHOD col1->add_icon EXPORTING sap_icon = icontab-name
                                             sap_color = 'LIST_GROUP'.
      ENDLOOP.
    ENDFORM.                               " DD_ADD_ICON
    * CLASS cl_my_event_handler IMPLEMENTATION.
    CLASS cl_my_event_handler IMPLEMENTATION.
      METHOD use_new_resources.
        IF is_displayed EQ 'X'.
    * initialize document
          CALL METHOD do->initialize_document.
    * fill document
          PERFORM dd_add_icon USING do.
    * merge document
          CALL METHOD do->merge_document.
    * display document
          CALL METHOD do->display_document
                              EXPORTING reuse_control        = 'X'
                                        reuse_registration   = 'X'.
        ENDIF.
      ENDMETHOD.
    ENDCLASS.
    Regards,
    Vasanth

  • Display rows into multiple columns

    I have a table in the following format:
    id value
    a1 0
    a2 0
    a3 0
    a4 0
    b1 0
    b2 0
    b3 0
    b4 0
    how do I go about displaying it into four columns in the following format:
    id1 value1 id2 value2
    a1 0 b1 0
    a2 0 b2 0
    a3 0 b3 0
    a4 0 b4 0

    Hi,
    789063 wrote:
    I got that error in toad. So now I am testing from command prompt. When you say "command prompt", do you mean SQL*Plus?
    Sorry, I don't know much about Toad. If Toad is returning 0 rows, and the same query is returning 8 rows in SQL*Plus, then I suspect you are not connecting to the same database or the same user. ASre you sure you're running the exact same query in both front ends?
    Here is the data set that I am testing for:
    <pre>
    id1 value
    smple_val_1 0
    smple_val_2 1
    smple_val_3 1
    smple_val_4 2
    smple_other_1 3
    smple_other_2 5
    smple_other_3 8
    smple_other_4 13
    some_other_val1 1
    some_other_val2 0
    some_other_val3 3
    some_other_val4 5
    </pre>
    I am trying to select only 'smple%' in the query, which should display in four columns like:
    <pre>
    id1 val1 id2 val2
    smple_val_1 1 smple_other_1 3
    smple_val_2 0 smple_other_2 5
    smple_val_3 0 smple_other_3 8
    smple_val_4 2 smple_other_4 13
    </pre>Is that really the output you want? Why not
    ID1             VAL1 ID2             VAL2
    smple_val_1        0 smple_other_1      3
    smple_val_2        1 smple_other_2      5
    smple_val_3        1 smple_other_3      8
    smple_val_4        2 smple_other_4     13with the 0's and 1's in the val1 column reversed?
    Here is the ddl I used:
    <pre>
    CREATE TABLE     table_x
    ( id     VARCHAR2 (20)     PRIMARY KEY
    , value     NUMBER
    INSERT INTO table_x (id, value) VALUES ('smple_val_1', 0);
    INSERT INTO table_x (id, value) VALUES ('smple_val_2', 1);
    INSERT INTO table_x (id, value) VALUES ('smple_val_3', 1);
    INSERT INTO table_x (id, value) VALUES ('smple_val_4', 2);
    INSERT INTO table_x (id, value) VALUES ('smple_other_1', 3);
    INSERT INTO table_x (id, value) VALUES ('smple_other_2', 5);
    INSERT INTO table_x (id, value) VALUES ('smple_other_3', 8);
    INSERT INTO table_x (id, value) VALUES ('smple_other_4', 13);
    INSERT INTO table_x (id, value) VALUES ('some_other_val1', 1);
    INSERT INTO table_x (id, value) VALUES ('some_other_val2', 0);
    INSERT INTO table_x (id, value) VALUES ('some_other_val3', 3);
    INSERT INTO table_x (id, value) VALUES ('some_other_val4', 5);
    </pre>Thanks, that's good.
    Where is the explanation of how you get the results you want from that data? There are a lot of different ways to get the same results from the same data, especially from a small set of sample data. I might provide a query that gets the right results for the wrong reasons, and when you run that query on a different set of data, it won't necessarily work. That's exactly what happened before. I guessed at what you wanted, but I guessed wrong. Guessing is not a very efficient or reliable way to solve problems. Don't make people guess: explain what you want.
    In particular, explain how you can tell, buy looking at a row and column in the original table, to which row and which column of the output it corresponds. I'm pretty sure that the id column of the table always corresponds to either the id1 or idl2 column of the output, and that value always corresponds to either val1 or val2. From this latest set of sample data, it looks like all the rows in table_x that start with 'smple_val' will correspond to the id1 and val1 columns, and that all therows that start with 'smple_other_' will correspond to the id2 and val2 columns. It also looks like each row of the output represents a unique value of the last character of table_x.id.
    If I guessed right this time, then what you want is:
    SELECT       MIN (CASE WHEN id LIKE 'smple\_val\_%'   ESCAPE '\' THEN id    END)     AS id1
    ,       MIN (CASE WHEN id LIKE 'smple\_val\_%'   ESCAPE '\' THEN value END)     AS val1
    ,       MIN (CASE WHEN id LIKE 'smple\_other\_%' ESCAPE '\' THEN id    END)     AS id2
    ,       MIN (CASE WHEN id LIKE 'smple\_other\_%' ESCAPE '\' THEN value END)     AS val2
    FROM       table_x
    GROUP BY  SUBSTR (id, -1)
    ORDER BY  SUBSTR (id, -1)
    ;But this is only a guess. I can't guarrantee that this will work on your real data any better than my last guess did. You'll get better answers faster if you provide an explanation, so that poeple don't have to guess so much.

  • Crystal report AS ole object into word

    I've been searching the web on using crystal reports as an OLE object inside a word document, but all results have been about using a word document inside a crystal report.
    I am trying to create a quarterly report document for a  business. This document is built using MS word. The document needs to include various tables, charts and the like, which they want to build in crystal reports so that they can be used either as part of the quarterly or as standalone reports.
    I would like to embed these reports into MS Word. Ideally, every three months the reports would be updated with new parameters, the word document would be opened, and the linked OLE reports would display the updated data tables and charts.
    I'm not sure if this is possible. I just attempted to embed a crystal report inside a word 2007 document, but the OLE object only showed up as an object containing the report filename, not the actual report.
    Can crystal act as an ole server for a word document to do what I want it to do, or will I need to programatically export the batch of crystal reports to images in order to have them show up in the word document?

    if you have business objects enterprise & live office, you can use Business Objects Live Office to embed the following from crystal reports into word or excel or powerpoint:
    1) charts
    2) cross tabs
    3) summaries
    4) fields
    to name a few.
    you can also use prompts in the word doc to allow you to change up the above on the fly.

  • How to get best image quality when inserting PDF into Word?

    I am able to insert a PDF as an object into Word, but the image quality is slightly blurry.  Is there anything I can adjust to improve image clarity in Word?

    You can try to extract the images using Extract All Images or select the Settings on the save screen that you get when you save to a DOC, but I think the general result is that the image saves with the same resolution as contained in the PDF. It may be that you need to just adjust your screen in WORD. You might want to look at the image in WORD and see if it is being used at 100% or some other resolution. Bitmaps are not very forgiving if the resolution is changed for the document and does not like anything other than low number fractions of resolution display change.

  • Regarding Amount(Dollars) into Words

    hi all,
          How we will convert Amount( in terms of Dollars) into Words . I know how to convert Amount (in Rupees) into Words
    and I know function module SPELL_AMOUNT . but it is not working for Decimals.
    Can anyone suggest solution for this.
    Regards
    Rami Reddy

    https://www.sdn.sap.com/irj/sdn/wiki?path=/display/snippets/spell%2bthe%2bamount%2bentered%2bin%2bwords
    Split the amout into two, Dollar and Cents
    123. 45
    call FM for 123 and call FM for 45 and concatenate the result.
    Youcall the Same function module, twice, once for dollars and once for cents, and concatenate the both answers.

  • Export calender into word or else?

    Hi,
    can anyone tell me if I can export my iCal calender into word or sth else? In order to make a printout?
    Thanks for answering!

    There isn't a way to export as text file, or doc file or similar.
    Perhaps one workaround would be to choose the calendar display you want, and then take a screen capture shot (command-control-shift 4), select the portion of your calendar that you want with cross-hairs, and then just paste it into a word doc as a picture.

Maybe you are looking for