BAPI - Webservice, Date-Format changed

Helly everyone,
I've got a problem when creating a WS based uppon a BAPI (BAPI_FLIGHT_GETDETAIL). The Webservice itself works fine. But if I use the BAPI I need to use the Date-Format DD.MM.YYYY for the required Input-Field Flightdate. In the WS I need to use the format YYYY-MM-DD. Now, is there any way to use the DD.MM.YYYY-Format in the WS also?
Greetings

Hi Marcel,
Thanks for the fast reply. I will give it a try probably.
I am still wondering what could have changed the date format.
Originally Posted by Marcel_Cox
I^d be suprised if it is really SP8 that changed your date format on the server console.
In any case, the date format on the server console is controlled by the file lconfig.sys copied to the server's c:\nwserver directory at installation time.
The following TID tells you how you can replace this file.
Note that the TID refers to changing the code page. In your case, it is not the code page you want to change, but the country code which corresponds to the date format you want to display
10093487: Convert existing NetWare server to different Codepages.

Similar Messages

  • Date format changes in the middle of a program execution

    In my C code I have a series of select statements.
    When I first get a session to the database I use the following command to set the date format
    alter session set nls_date_format = 'MM/DD/YYYY HH24:MI:SS'
    It works fine for a few queries. After a while during the program execution I see that the date format changes to 'DD-MON-YY' format. This results in a series of error in my code because I expect the date format to always be in the 'MM/DD/YYYY HH24:MI:SS' format.
    Any idea why the date format should change all of a sudden in the middle of the program execution.

    I second the idea that you should always use TO_DATE and TO_CHAR if you want to reliably convert between dates and strings.
    Without seeing your code, it is hard to say why your date format is changing, but the most likely reason is that you are changing users somewhere in the code. For example:
    SQL> show user
    USER is "OPS$ORACLE"
    SQL> SELECT sysdate FROM dual;
    SYSDATE
    11-JUL-2003
    SQL> ALTER SESSION SET nls_date_format='dd-Mon-yyyy hh24:mi:ss';
    Session altered.
    SQL> SELECT sysdate FROM dual;
    SYSDATE
    11-Jul-2003 10:15:12
    SQL> connect jtest/test
    Connected.
    SQL> SELECT sysdate FROM dual;
    SYSDATE
    11-JUL-2003TTFN
    John

  • Date format changed (since SP8?)

    Applied SP8 lately on a server. I guess since then the date format changed.
    It is now April 18, 2011,
    and it should be 18 April, 2011.
    I am not sure if this is because applying SP8, but what is for sure that the date format is not what we used to.
    Checked time zone. Regarding to `set time zone` it is proper (CET-1CEST).
    Please advise.

    Hi Marcel,
    Thanks for the fast reply. I will give it a try probably.
    I am still wondering what could have changed the date format.
    Originally Posted by Marcel_Cox
    I^d be suprised if it is really SP8 that changed your date format on the server console.
    In any case, the date format on the server console is controlled by the file lconfig.sys copied to the server's c:\nwserver directory at installation time.
    The following TID tells you how you can replace this file.
    Note that the TID refers to changing the code page. In your case, it is not the code page you want to change, but the country code which corresponds to the date format you want to display
    10093487: Convert existing NetWare server to different Codepages.

  • Data format changing from database to datagridview

    hi I am trying to display data from database sqlite  to datagridview the data format changed automatically
    the date in database is
    2012-02-20 16:42:10.00 but on datagrid view it appears like  20/02/2012 16:42:10,
    swOut.Write(",");
    swOut.Write(dataGridView1.Columns[i].HeaderText);
    swOut.WriteLine();
    //write DataGridView rows to csv
    for (int j = 0; j <= dataGridView1.Rows.Count - 1; j++)
    if (j > 0)
    swOut.WriteLine();
    dr = dataGridView1.Rows[j];
    for (int i = 0; i <= dataGridView1.Columns.Count - 1; i++)
    if (i > 0)
    swOut.Write(",");
    value = dr.Cells[i].Value.ToString();
    //replace comma's with spaces
    value = value.Replace(',', ' ');
    //replace embedded newlines with spaces
    value = value.Replace(Environment.NewLine, " ");
    swOut.Write(value);

    This forum is for Microsoft products, they have already and endless quantity of databases, many even freeware. 
    Try therefore for your question the forums for SQLite.
    SQLite has very special own way of datatypes.
    Success
    Cor

  • SSAS Cube parameter date format change

    Hi Experts,
    I am new to SSRS report creation. I have a parameter which is fetching date from cube. The date format from cube is YYYY-MM-DD.
    I want expression to change the date format to DD/MM/YYYY.
    I have used this expression - =Format(CDATE(Parameters!DimPromoUBUBStartDate.Value),"dd/MM/yyyy")
    but it is not working and getting the following error,
    "unable to cast object of type 'System.object[]' to type 'system Iconvertible'
    Please give your suggestions
    Thanks in Advance,
    Rajan

    Hi Rajan,
    According to your description, when you convert the "YYYY-MM-DD" formatted data from the parameter and change the format, it throw the error above. Right?
    In this scenario, the reason why you get this error because you set allow multiple values in that parameter. When we allow multiple values in a parameter, all select values will be put into a array when processing even you only select one value. And
    the CDate() function can't convert the object[]. So please unselect the allow multiple values in parameter. If you want to keep multiple values selection, you can only convert one element from the array. For example: CDate(Parameter!XXXX.Value(0))
    If you have any question, please feel free to ask.
    Best Regards,
    Simon Hou

  • Date Format changes    in   Query Designer

    Hi friends,
              I have one  date field that is Keyfigure (not  a Time charecterstic) ...now   i want to display date in  DD- MON - YYYY format... but  up to modelling side my date format is DD.MM.YYYY.....
           i dont want to change in modelling side.. because.. this required format is needed only for some querys ...
       so, can  any one  suggest me is there any chance to  get the date format in the reporting side like this..(27-JAN-2007) ..
            helpful answers will be appriciated..
    Thanks
    Babu

    Hi,
    After logon to BW, goto SYSTEM at menu bar.select user profile --> select OWN DATA. You will get Windoe, in that goto default tab, there you change DATE FORMAT and save.
    If it useful assign points.
    Regards,
    sri

  • Date Format  changes in  the Reporting side..

    Hi friends,
    I have one date field that is Keyfigure (not a Time charecterstic) ...now i want to display date in DD- MON - YYYY format... but up to modelling side my date format is DD.MM.YYYY.....
    i dont want to change in modelling side.. because.. this required format is needed only for some querys ...
    so, can any one suggest me is there any chance to get the date format in the reporting side like this..(27-JAN-2007) ..
    helpful answers will be appriciated..
    Thanks
    Babu

    Hi Babu,
    If the format is required in the Bex analyser then its system dependent setting .
    Control panel - > Regional & language options -> Regional options -> Customize -> Date -> Short Date format -> DD-MMM-YYYY(Change) .
    Do not forget to log off and re-login into bex,execute queries and see the output.
    Hope that helps.
    Regards
    Mr Kapadia
    Assigning points is the way to say thanks in SDN.

  • R2 to R3 upgrade Schedule Date Format Changed

    We recently did an upgrade from BOXI r2 to R3. We did the installation wizard using the r3 image to the same server.
    What we have noticed now is that all the schedule dates in the CMC for our reports have changed format from US to EURO. 01/13/08 to 13/01/08
    We are still on the same server, and it appears that the time format is comming from our web server now.
    Dose anyone know how to change the date format on Tomcat to reflect standard US time and Not Euro.
    Or if this isnt the case where else could I check for date formats, we have checked the CMC, the Server itself and the Preferences.
    Thanks
    KF
    Edited by: Kris Fox on Dec 9, 2008 11:47 PM
    Edited by: Kris Fox on Dec 9, 2008 11:47 PM

    Hello,
    did you checked the locale of your OS ?
    When you say you checked the preferences you mean the preferences of InfoView ?
    Regards
    -Sebastian

  • Date format changed while printing invoice

    Dear All,
    Since yestardayin production server the date format of invoice is like 12.02.2010,but form morning it is comming like 2010.02.12.
    I have checked in quality and it is still comming like 12.02.2010.
    Could you please tell me why is it comming?
    Regards,
    Amar

    Dear Amar,
    1 Check the user profile for default type od date value in production system and compare it with quality. If this is not as per the quality system then change it.
    2 if both system quality and production both have same date format then  you have to debug and find out the issue.
    Hope you need not to go for second point.

  • Date Format changes in EP.

    Dear All,
    In Adobe Interactive Form, I am using a field which is mapped to the Date Context Variable.
    In R3, it shows the date format as DD.MM.YYYY. But when I look from EP, it shows YYYY-MM-DD Why this validation ?
    How to solve this issue? I( am using Adobe Interactive Form and it displays that field in Pdf in EP)
    Please help.
    Nikesh Shah

    Got the answer.
    Actually you need to write a simple code :
    SimpleDateFormat InvoiceDate = new SimpleDateFormat("MM/dd/yyyy")
    String InvoiceDate1 = InvoiceDate.format(Your Date) ;
    wdContext.currentOutputPrintNewElement().setInvoiceDate(InvoiceDate1);
    Thx everyone for reading this thread.

  • Data format change in bex

    hi friends,
    i have 0date infoobject as one of the fields in a cube. data is uploaded into cube correctly. when i checked data in cube it's in correct format 20.12.2006, but when i checked in bex report it shows 12/20/2006. how to convert it into dd/mm/yyyy or simply day first,month second and year third component format. where i have to routine? suggestion pls..
    thanks,
    raju

    Raju,
    Change default user settings. at TCode: SU01 > User id> Change --> Defaults.
    These changes are User Specific. effects to all reports.
    Hope it Helps
    Srini

  • Date format change

    hi friends,
    i have 0date infoobject as one of the fields in a cube. data is uploaded into cube correctly. when i checked data in cube it's in correct format 20.12.2006, but when i checked in bex report it shows 12/20/2006. how to convert it into dd/mm/yyyy or simply day first,month second and year third component format. where i have to routine? suggestion pls..
    thanks,
    raju

    Hi RAJU,
    change the setting in your report....choose dd/mm/yyyy  format.......as we do in EXCEL sheet
    Right click  on  CELL in ur  report......choose FORMAT CELLS......in NUMBER TAB select date ....change as per requirement
    hope it helps..........
    Regards
    chandra sekhar

  • Regarding date format changes

    Hi All,
    I have a date variable.
    Th date variable is v_doc_date which is declared like SY-DATUM.
    I will get value into that variable in format <b>DDMMYYYY</b> EX: <b>18072005</b> now i want make that variable as <b>18.07.2005</b> through Function module.
    Can any body tell me how can we convert DDMMYYYY into DD.MM.YYYY through function module.
    Thanks in advance.
    Thanks & Regards,
    Rayeez.

    Hi,
    If you are writing it on the screen - use edit mask.
    eg: write v_doc_date using edit mask '__.__.____'.
    Or use this piece of code.
    data: v_date(10),
          v_doc_date like sy-datum.
        v_date0(2) = v_doc_date6(2).
        v_date+2(1) = '.'.
        v_date3(2) = v_doc_date4(2).
        v_date+5(1) = '.'.
        v_date6(4) = v_doc_date0(4).
    If you have to change the date in many places, just put this in a form and call it.

  • Webservice date format

    I have used "clientgen" Ant task to generate the client library. The WSDL indicates that certain fields are of type xsd:date.
    The web service client sends sends "2009-08-04T13:55:46.237-04:00".
    However, the server expects "2009-08-04".
    In the WSDL file, after you following all the links/referers URLs, you end up with the type definition:
    <xs:simpleType name="PublicationDate">
    <xs:restriction base="xs:date"/>
    </xs:simpleType>
    My questions are:
    1. Is the client behaving correctly? The WSDL indicates this field is a "date" and NOT "dateTime". Perhaps the problem is in the "clientgen" Ant task which is not generating the client stubs/implementation correctly?
    2. How can I change the manner in which the date gets formatted and passed on the SOAP body (java.util.Calendar)?
    Edited by: user8651233 on Aug 5, 2009 7:15 AM

    When trying to generate a client for your JAX-RPC web service from a schema. The schema includes
    an schema datatype which is derived from a standard schema datatype by restriction. For example
    <xs:simpleType name="SampleDate">
    <xs:restriction base="xs:date"/>
    </xs:simpleType>
    When clientgen task is used, there is no custom class created to represent this schematype and the WSDL mappings map to the standard schema datatype rather than to your custom datatype. Subsequently, when the web service request is made, it too generates the request using the standard datatype rather than your custom datatype. The web service is expecting the custom datatype, so the request fails with a SOAP fault
    There is a restriction on what Java data types can be automatically generated by the WebLogic ant
    tasks: specifically, a schema data type is derived "by restriction of an existing simple type," it
    is generated as the "equivalent Java data type of simple type."
    This is the expected behavior for the JAX-RPC ant tasks, so the system is functioning as designed.
    The solution is to program the appropriate class yourself. To do that, you would set up a class
    which handles that element and does what it needs to do with the data in it.Then you would need to change the mappings that are automatically generated to point to your new custom class .
    Once all that is in place, recompile your war file and retest. As long as everything is pointing
    to the right places, the request and subsequent response should then be correct.
    -Chandrasen.
    Edited by: user10600598 on Aug 27, 2009 9:08 AM

  • Cannot Paste Duration data--format changes upon Paste!

    I'm pasting some tabular data and one column is Duration (Ex: 01:19:00) and when I paste the data in values like 01:19:00 become 1:19 AM.
    I need the actual durations so they can be computed.... how can I get Numbers to stop automatically changing these values???
    Thanks,
    Robert

    For those which don't want to pre-format a table, I wrote this script which protect the durations.
    CAUTION :
    as the developers forgot to include duration in the list of formats settable thru AppleScript, I apply the format text. You will have to change it to duration 0:00:00.
    --[SCRIPT iTunestoNumbers]
    Enregistrer le script en tant que Script : iTunestoNumbers.scpt
    déplacer le fichier ainsi créé dans le dossier
    <VolumeDeDémarrage>:Users:<votreCompte>:Library:Scripts:Applications:Numbers:
    Il vous faudra peut-être créer le dossier Numbers et peut-être même le dossier Applications.
    Copier des données dans iTunes. Si elles contiennent des durées,
    aller au menu Scripts , choisir Numbers puis choisir “iTunestoNumbers”
    Le script les colle dans une table d'un nouveau document Numbers
    dont certaines colonnes sont définies au format texte pour préserver les dites durées.
    Il vous faudra retoucher le format en spécifiant durée, 0:00:00 dans l'Inspecteur de cellules.
    Je suis désolé mais les dévelopeurs ont oublié d'inclure durée dans les formats applicables à l’aide d’AppleScript.
    --=====
    L’aide du Finder explique:
    L’Utilitaire AppleScript permet d’activer le Menu des scripts :
    Ouvrez l’Utilitaire AppleScript situé dans le dossier Applications/AppleScript.
    Cochez la case “Afficher le menu des scripts dans la barre de menus”.
    Sous 10.6.x,
    aller dans le panneau “Général” du dialogue Préférences de l’Éditeur Applescript
    puis cocher la case “Afficher le menu des scripts dans la barre des menus”.
    --=====
    Save the script as a Script: iTunestoNumbers.scpt
    Move the newly created file into the folder:
    <startup Volume>:Users:<yourAccount>:Library:Scripts:Applications:Numbers:
    Maybe you would have to create the folder Numbers and even the folder Applications by yourself.
    Copy datas from iTunes. If they contain durations,
    go to the Scripts Menu, choose Numbers, then choose “iTunestoNumbers”
    The script will paste the datas in a Numbers new table
    whose some columns are defined as text to protect the duration entries.
    You will have to adjust the format to duration 0:00:00 thru the Inspector of Cells.
    I apologize but the develpers forgot to include duration in the list of formats settable thru AppleScript.
    --=====
    The Finder’s Help explains:
    To make the Script menu appear:
    Open the AppleScript utility located in Applications/AppleScript.
    Select the “Show Script Menu in menu bar” checkbox.
    Under 10.6.x,
    go to the General panel of AppleScript Editor’s Preferences dialog box
    and check the “Show Script menu in menu bar” option.
    --=====
    Yvan KOENIG (VALLAURIS, France)
    2011/03/24
    --=====
    on run
    run script doyourduty
    --my doyourduty()
    end run
    --=====
    script doyourduty
    -- on doyourduty()
    local le_fichier, en_liste, ligne_10, nb_colonnes, colonnesdedurees, c, item_c
    local format_duree, j, r, une_ligne, en_texte, myNewDoc, n_colonnes, nb_colonnes
    my activateGUIscripting()
    Extract the datas from the clipboard.
    set en_liste to paragraphs of (the clipboard as text)
    Search values containing durations to be able to apply the format duration to their columns.
    set ligne_10 to my decoupe(item 10 of en_liste, tab)
    set nb_colonnes to count of ligne_10
    set colonnesdedurees to {}
    repeat with c from 1 to nb_colonnes
    set item_c to item c of ligne_10
    if item_c contains ":" then
    set format_duree to true
    repeat with j from 1 to count of item_c
    if character j of item_c is not in {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", ":"} then
    set format_duree to false
    exit repeat
    end if
    end repeat -- with j
    if format_duree then copy c to end of colonnesdedurees
    end if -- item_c contains…
    end repeat -- with i
    Create a new Numbers document from the Apple's Blank template.
    set myNewDoc to my makeAnIworkDoc("Numbers")
    tell application "Numbers" to tell document myNewDoc to tell sheet 1 to tell table 1
    Remove header row and header column.
    remove row 1
    remove column 1
    Insert the required columns.
    set n_colonnes to count column
    repeat nb_colonnes - n_colonnes times
    add column after last column
    end repeat
    Define the format of columns which must be set to text.
    if colonnesdedurees is not {} then
    repeat with c from 1 to count of colonnesdedurees
    set une_colonne to item c of colonnesdedurees
    set format of range ((name of cell 1 of column une_colonne) & ":" & (name of cell -1 of column une_colonne)) to text
    end repeat
    end if -- colonnesdedurees is not {}…
    Define the first cell to paste in.
    set selection range to range "A1"
    end tell -- Numbers
    Concatenate the rows with carriage return as separators. Pass the result to the clipboard.
    set the clipboard to my recolle(en_liste, return)
    with timeout of (10 * 60) seconds
    my raccourci("Numbers", "v", "cas") (* Paste and Match Style *)
    end timeout
    Select every cells except the column 1.
    tell application "Numbers" to tell document myNewDoc to tell sheet 1 to tell table 1
    set selection range to range ("A1:" & name of last cell)
    end tell -- Numbers
    As there is no shortcut, trigger the menu item itself.
    my select_menu("Numbers", 6, 17) (* Table > Resize Columns to Fit Contents *)
    if colonnesdedurees is not {} then
    set colonnesde_dureestext to my recolle(colonnesdedurees, ", ")
    tell application "Numbers"
    if not my parleAnglais() then
    if (count of colonnesdedurees) = 1 then
    display dialog "Don’t forget to set the format" & return & "of column “" & colonnesdedurees & "” to duration 0:00:00 !"
    else
    display dialog "Don’t forget to set the format" & return & "of columns “" & my recolle(colonnesdedurees, ", ") & "” to duration 0:00:00 !"
    end if -- (count of colonnesdedurees)…
    else
    if (count of colonnesdedurees) = 1 then
    display dialog "N'oubliez pas de fixer le format" & return & "de la colonne « " & colonnesdedurees & " » à durée 0:00:00 !"
    else
    display dialog "N'oubliez pas de fixer le format" & return & "des colonnes « " & my recolle(colonnesdedurees, ", ") & " » à durée 0:00:00 !"
    end if -- (count of colonnesdedurees)…
    end if -- parleAnglais{}
    end tell
    end if -- colonnesdedurees is not {}…
    -- end doyourduty
    end script
    --=====
    on parleAnglais()
    local z
    try
    tell application "Numbers" to set z to localized string "Cancel"
    on error
    set z to "Cancel"
    end try
    return (z is not "Annuler")
    end parleAnglais
    --=====
    on decoupe(t, d)
    local oTIDs, l
    set oTIDs to AppleScript's text item delimiters
    set AppleScript's text item delimiters to d
    set l to text items of t
    set AppleScript's text item delimiters to oTIDs
    return l
    end decoupe
    --=====
    on recolle(l, d)
    local oTIDs, t
    set oTIDs to AppleScript's text item delimiters
    set AppleScript's text item delimiters to d
    set t to l as text
    set AppleScript's text item delimiters to oTIDs
    return t
    end recolle
    --=====
    removes every occurences of d in text t
    on supprime(t, d)
    local oTIDs, l
    set oTIDs to AppleScript's text item delimiters
    set AppleScript's text item delimiters to d
    set l to text items of t
    set AppleScript's text item delimiters to ""
    set t to l as text
    set AppleScript's text item delimiters to oTIDs
    return t
    end supprime
    --=====
    Creates a new iWork document from the Blank template and returns its name.
    example:
    set myNewDoc to my makeAnIworkDoc(theApp)
    on makeAnIworkDoc(the_app)
    local maybe, pathto_theApp, nb_doc, doc_name
    if the_app is "Pages" then
    tell application "Pages"
    set nb_doc to count of documents
    make new document with properties {template name:item 1 of templates}
    end tell
    else if the_app is "Numbers" then
    tell application "System Events" to set maybe to the_app is in title of every application process
    if not maybe then tell application the_app to activate
    tell application "System Events"
    set pathto_theApp to get application file of application process the_app
    end tell
    tell application "Numbers"
    set nb_doc to count of documents
    open ((pathto_theApp as text) & "Contents:Resources:Templates:Blank.nmbtemplate:")
    end tell
    else
    if my parleAnglais(the_app) then
    error "The application “" & the_app & "“ is not accepted !"
    else
    error "l’application « " & the_app & " » n’est pas gérée !"
    end if
    end if
    tell application the_app
    repeat until (count of documents) > nb_doc
    delay 0.1
    end repeat
    set doc_name to name of document 1
    end tell -- the_App
    return doc_name
    end makeAnIworkDoc
    --=====
    on activateGUIscripting()
    (* to be sure than GUI scripting will be active *)
    tell application "System Events"
    if not (UI elements enabled) then set (UI elements enabled) to true
    end tell
    end activateGUIscripting
    --=====
    ==== Uses GUIscripting ====
    This handler may be used to 'type' text, invisible characters if the third parameter is an empty string.
    It may be used to 'type' keyboard raccourcis if the third parameter describe the required modifier keys.
    I changed its name « shortcut » to « raccourci » to get rid of a name conflict in Smile.
    on raccourci(a, t, d)
    local k
    tell application a to activate
    tell application "System Events" to tell application process a
    set frontmost to true
    try
    t * 1
    if d is "" then
    key code t
    else if d is "c" then
    key code t using {command down}
    else if d is "a" then
    key code t using {option down}
    else if d is "k" then
    key code t using {control down}
    else if d is "s" then
    key code t using {shift down}
    else if d is in {"ac", "ca"} then
    key code t using {command down, option down}
    else if d is in {"as", "sa"} then
    key code t using {shift down, option down}
    else if d is in {"sc", "cs"} then
    key code t using {command down, shift down}
    else if d is in {"kc", "ck"} then
    key code t using {command down, control down}
    else if d is in {"ks", "sk"} then
    key code t using {shift down, control down}
    else if (d contains "c") and (d contains "s") and d contains "k" then
    key code t using {command down, shift down, control down}
    else if (d contains "c") and (d contains "s") and d contains "a" then
    key code t using {command down, shift down, option down}
    end if
    on error
    repeat with k in t
    if d is "" then
    keystroke (k as text)
    else if d is "c" then
    keystroke (k as text) using {command down}
    else if d is "a" then
    keystroke k using {option down}
    else if d is "k" then
    keystroke (k as text) using {control down}
    else if d is "s" then
    keystroke k using {shift down}
    else if d is in {"ac", "ca"} then
    keystroke (k as text) using {command down, option down}
    else if d is in {"as", "sa"} then
    keystroke (k as text) using {shift down, option down}
    else if d is in {"sc", "cs"} then
    keystroke (k as text) using {command down, shift down}
    else if d is in {"kc", "ck"} then
    keystroke (k as text) using {command down, control down}
    else if d is in {"ks", "sk"} then
    keystroke (k as text) using {shift down, control down}
    else if (d contains "c") and (d contains "s") and d contains "k" then
    keystroke (k as text) using {command down, shift down, control down}
    else if (d contains "c") and (d contains "s") and d contains "a" then
    keystroke (k as text) using {command down, shift down, option down}
    end if
    end repeat
    end try
    end tell
    end raccourci
    --=====
    my selectMenu("Numbers",6, 17) (* Table > Resize Columns to Fit Contents *)
    ==== Uses GUIscripting ====
    on selectMenu(theApp, mt, mi)
    tell application theApp
    activate
    tell application "System Events" to tell process theApp to tell menu bar 1 to ¬
    tell menu bar item mt to tell menu 1 to click menu item mi
    end tell -- application theApp
    end selectMenu
    --=====
    useful to get the indexs of the triggered item
    my select_Menu("Numbers",6, 17) (* Table > Resize Columns to Fit Contents *)
    on select_menu(theApp, mt, mi)
    tell application theApp
    activate
    tell application "System Events" to tell (first process whose title is theApp) to tell menu bar 1
    get name of menu bar items
    01 - "Apple",
    02 - "Numbers",
    03 - "File",
    04 - "Edit",
    05 - "Insert",
    06 - "Table",
    07 - "Format",
    08 - "Arrange",
    09 - "View",
    10 - "Window",
    11 - "Share",
    12 - "Help"}
    get name of menu bar item mt
    -- {"Table"}
    tell menu bar item mt to tell menu 1
    get name of menu items
    01 - "Add Row Above",
    02 - "Add Row Below",
    03 - missing value
    04 - "Add Column Before",
    05 - "Add Column After",
    06 - missing value,
    07 - "Delete Row",
    08 - "Delete Column",
    09 - missing value,
    10 - "Header Rows",
    11 - "Header Columns",
    12 - "Freeze Header Rows",
    13 - "Freeze Header Columns",
    14 - "Footer Rows",
    15 - missing value,
    16 - "Resize Rows to Fit Content",
    17 - "Resize Columns to Fit Content",
    18 - missing value,
    19 - "Unhide All Rows",
    20 - "Unhide All Columns",
    21 - "Enable All Categories",
    22 - missing value,
    23 - "Merge Cells",
    24 - "Split into Rows"
    25 - "Split into Columns"
    26 - missing value
    27 - "Distribute Rows Evenly"
    28 - "Distribute Columns Evenly"
    29 - missing value
    30 - "Allow Border Selection"
    31 - missing value
    32 - "Show Reorganize Panel"}
    get name of menu item mi
    --{"Resize Columns to Fit Content"}
    click menu item mi
    end tell -- menu bar item…
    end tell -- System Events…
    end tell -- application theApp
    end select_menu
    --=====
    --[/SCRIPT]
    Yvan KOENIG (VALLAURIS, France) jeudi 24 mars 2011 17:08:42

Maybe you are looking for