Problem in Creating New position in Siebel CRM 7.8 using java program

Hi
We have Siebel CRM with Business Object and Business Component as Position.
Position Business Component has a manadatory pick list Division.
When we try to create a new Position by picking the Divison then we are getting the below error
Logged in OK!
picking the list
in the pick() method before
<Exception>
<Major No.>256</Major No.><Minor No.>21944</Minor No.><Message>An error has occurred picking the current row.
Please continue or ask your systems administrator to check your application configuration if the problem persists.(SBL-DAT-00292)</Message><DetailedMessage>Unknown<DetailedMessage>
<Exception>
<com.siebel.om.sisnapi.i>
<Major No.>256</Major No.><Minor No.>21944</Minor No.><Message>An error has occurred picking the current row.
<Error><ErrorCode>21944</ErrorCode> <ErrMsg>An error has occurred picking the current row.
Please continue or ask your systems administrator to check your application configuration if the problem persists.(SBL-DAT-00292)</Message><DetailedMessage>Unknown<DetailedMessage>
Please continue or ask your systems administrator to check your application configuration if the problem persists.(SBL-DAT-00292)</ErrMsg></Error>
<com.siebel.om.sisnapi.i>
<Error><ErrorCode>21735</ErrorCode> <ErrMsg>Siebel eScript runtime error occurred in procedure 'BusComp_SetFieldValue' of BusComp [Position]:
<Error><ErrorCode>21944</ErrorCode> <ErrMsg>An error has occurred picking the current row.
ConversionError 1616: Undefined and Null types cannot be converted to an object.
Please continue or ask your systems administrator to check your application configuration if the problem persists.(SBL-DAT-00292)</ErrMsg></Error>
(SBL-SCR-00141)</ErrMsg></Error>
<Error><ErrorCode>21735</ErrorCode> <ErrMsg>Siebel eScript runtime error occurred in procedure 'BusComp_SetFieldValue' of BusComp [Position]:
<Error><ErrorCode>21735</ErrorCode> <ErrMsg>Stack trace:
BusComp [Position].BusComp_SetFieldValue(), Line: 1110</ErrMsg></Error>
ConversionError 1616: Undefined and Null types cannot be converted to an object.
</com.siebel.om.sisnapi.i></Exception>
(SBL-SCR-00141)</ErrMsg></Error>
<Error><ErrorCode>21735</ErrorCode> <ErrMsg>Stack trace:
BusComp [Position].BusComp_SetFieldValue(), Line: 1110</ErrMsg></Error>
</com.siebel.om.sisnapi.i></Exception>
at com.siebel.data.SiebelBusComp.pick(SiebelBusComp.java:241)
at siebelconn.main(siebelconn.java:44)
Java program
import com.siebel.data.*;
import com.siebel.data.SiebelException;
class siebelconn {
public static void main (String args [])
SiebelDataBean m_dataBean = null;
SiebelBusObject m_busObject = null;
SiebelBusComp m_busComp = null;
SiebelBusComp picklistBC = null;
     try{
m_dataBean = new SiebelDataBean(); //Create Siebel JDB instance
m_dataBean.login("XXXX", "XXX", "XXX");
     System.out.println("Logged in OK!");
m_busObject = m_dataBean.getBusObject("Position");
m_busComp = m_busObject.getBusComp("Position");
m_busComp.newRecord(false);
picklistBC = m_busComp.getPicklistBusComp("Division");
picklistBC.clearToQuery();
picklistBC.setViewMode(3);
picklistBC.setSearchSpec("Name", "idmtest");
//picklistBC.executeQuery(true);
picklistBC.executeQuery2(true,true);
if(picklistBC.firstRecord())
System.out.println("picking the list");
picklistBC.pick();
System.out.println("records are there");
m_busComp.setFieldValue("Name","Access GE HQ 11");
m_busComp.writeRecord();
}//if
     if(m_busObject!=null)
m_busObject.release();
if(m_busComp!=null)
m_busComp.release();
if(picklistBC!=null)
picklistBC.release();
if(m_dataBean!=null)
m_dataBean.logoff();
catch(Exception e)
System.out.println(e);e.printStackTrace();
if(m_busObject!=null)
m_busObject.release();
if(m_busComp!=null)
m_busComp.release();
if(picklistBC!=null)
picklistBC.release();
try
if(m_dataBean!=null)
m_dataBean.logoff();
}catch(Exception e1){System.out.println(e1);}
Can any body please help us.
Thanks

From the error code, it looks like you have a scripting error in the BusComp_SetFieldValue event on the Position
business component in your application.
Have you tried to look at that code or to turn of scripting for the application as a total?
Axel

Similar Messages

  • Creating new positions in deliveries

    Hello,
    I need Function Module or BAPI to create new positions in deliveries (vl02n). Could you help me please to find something useful?
    Regards

    Hi,
    New position in delivery is a new row on the first screen after enter vl03n. Delivery header is in LIKP (VBELN = delivery number), positions are in LIPS (VBELN, POSNR - position in delivery).
    I have problem as below:
    At first I have delivery with one position (it is created by hand, the is only one row in LIPS related with delivery), next I have to add the second position and I don't know how...

  • Language German Position Appear When Create New position (PO13)

    Dear Experts,
    I have very odds problem. When I create new position through PO13, pop-up message appear "previous record will be delimited at end. Do you want to save".  For example I want to create new position 'Engineer ' starting 01 Feb 2011 through PO13.After I select new button , pop-up message with this record appear.If I choose yes, position with german language appear; for example 'entwickler' and validity period 30.11.1995 to 31.01.2012 with language  key German.So this position have 2 object
    1) DE 30.11.1995 31.01.2012 entwickler
    2) EN  01.02.2012 31.12.9999  engineer
    Every time I create new position seem I copy position from german language. How to avoid this error

    Hi
    Can i take clarity here
    a) Are you working in the IDES system to create the position ? if yes, there is every possibility of such a thing happening as ther are few standard entries in the SAP IDES system.
    If you are not working on the IDES system please excuse me for having picked to reply for your query.
    All the best to you
    Regards
    RR

  • Error while Creating new Position-Data fields have not been filled (no. 5A135)

    Dear Consultants,
    My client using SAP HCM form 2008, now they want to create new positions to the existing system,
    To create new positions I am using T Code : PP03, while creating I am getting error "Date Fields have not been filled- Error Message No - 5A135", I want to create the positions valid from 01.04.2014. please do needful why this error is coming
    Regards,
    Naresh

    Hi,
    It is mandatory to give the org unit to which the position is being associated with.
    Give the org unit and try saving it.
    Thanks,
    Sriram

  • Problem with creating new user in portal = portlet is not visible

    Hi,
    I've got a problem with creating new users in portal. In the Administer tab of the builder is the user portlet not visible.
    How can I make this portlet visible?
    Please Help
    thank you...
    Gilbert

    Hi..my problem slightly similar.
    I created one new user, and didn't select anything from "Public Groups Assignment" and "Privilege Assignment" for him.
    I expect the user will be a public user.
    But, when he try to logged in the portal,
    He cannot see all the PORTLETS related to database values..
    All he can see just LINKS -that all in my portal right now beside the report from database that the user cannot see :)
    So, what did i do wrong?
    Plz Advise, and thanks.

  • Problem in creating new communication channel template in IR

    Hi experts,
    I currently have problems with creating new communication channel template in Integration Repository. If I choose the New-Context (Adapter Objects-->Communication Channel Template) the dialog "CREATE OBJECT" is shown. After I have inserted the Name of my template I push the create button.
    Then the following error occurs:
    STOP: Internal error: Object cannot be changed in display mode
    DETAILS: Internal error: Object cannot be changed in display mode(CANT_SET_MODIFIED).
    So can anybody help me. Thanks for your help.
    Best regards.
    Mario

    Hi Mario,
                This is genral problem appearing in PI 7.0 with SP12.
                Previously, i have the same problem.
                i.e STOP: Internal error: Object cannot be changed in display mode
    DETAILS: Internal error: Object cannot be changed in display mode(CANT_SET_MODIFIED)
                Regarding this we raise an OSS note SAP people.
                they gave the suggestion that update with SP13.
              i discuss with basis team and install the SP13.
               now the problem is solved, i can able to create the Communication Channel Template.
    Please award points, if it really help to u
    Regards
    Mahesh.

  • Problem in creating new versions for existing DIR using CV01N

    I am working in SAP ERP 6.0 EHP 4.0 system.
    I have problem in creating new versions for existing DIR using CV01N
    I create a DIR version 00 with functional location and mpd cycles. Then when i try to create a new version by copying the contents created from already created document.I change the MPD cycles in the new version and save it.
    once when i display the first document created the mpdcycle specified in version 01 is copied to the 00 version.
    The document is inconsistent where versioning of document doesnot work properly wrt MPDCYCLE and MP HEADER.
    The problem which i found was the document identification guid remains the same for all the document versions getting created.
    The same is working fine in SAP ERP6.0 EHP3.0 sytem.
    Please someone help me in resolving the above issue.
    Regards,
    Prasad.B

    There is a change in the standard code.The reason for the above problem was  because of a missing Enhancemnet point in a standard function module 'CV110_DOC_CREATE_WITH_TEMPLATE'.
    IS-ADEC-MPD  - Enhancement to copy MPD data
    ENHANCEMENT-POINT CV110_DOC_CREATE_WTEMPL_01 SPOTS ES_SAPLCV110.
    +*$*$-Start: CV110_DOC_CREATE_WTEMPL_01----------------------------------------------------------$*$*+
    +**ENHANCEMENT 1  ZSF_AD_MPD_SAPLCV110.    "active version**+
    +*** copy MPD relevant data from templ. doc to current doc**+
      +**CALL FUNCTION 'MPD02_COPY_MPD_DATA'**+
        +**EXPORTING**+
          +**is_draw = ls_draw**+
        +**TABLES**+
          +**ct_drad = lt_drad.**+
    +*ENDENHANCEMENT.**$*$-End:   CV110_DOC_CREATE_WTEMPL_01----------------------------------------------------------$*$*+
    Created a custom enhancement point similar to SAP ECC6.0 EHP 3.0 system.
    The reason was the buffer was not getting cleared previously.After inserting the above code the DIR's are getting created withot any issues.
    Regards,
    Prasad.B

  • MSS - Creating new Position and Org unit in MSS

    Dear Expert,
    Question 1: I want to know that is it possible to create a new Position or Org Unit in MSS. I am aware that manager can create a requisitioin for a position. But I am not aware that how HR manager will create the Org Unit or Position thourgh MSS.
    - will the HR manager have a new HR administrator Role to do this activity, if yes, which service / iview is used.
    Question 2: We are using Management of Global employees (MGE). Now if any employee expariate to a foreign country how does ESS/MSS will pick the new country assignment. Is there any ess/mss switch for this? or any other configuration
    Question 3: I would like to know what are the main differences of EHP4 and EHP5.
    thanks
    honey

    Hello honey - answer to the 1st question.
    MSS- click Organisation - Search Organisational Process - enter the Process HR_PD_CREATE_POSITION and click start , this could be one solution how the managers may be able to create new position through MSS.
    Regards,
    Regi

  • Authorization required for creating new Organizational units in CRM

    Hi all,
    How can we give authorization required for creating new Organizational units (IMG – CRM – Master Data – Organizational Management – Organizational Model – Create Organizational Model) to a particular user?
    Thanks and Regards,
    Archana

    Hi archana,
    U can Create a role through Transaction PFCG.
    Just create a role and assign the tcode PPOCA_CRM if u want to give the user just only this authorization otherwise u can select the menu list from sap menu and assign this role to that user.
    Another way is if that user already exist in that system then just assign that particular transaction codr with that user.
    Hope it will help u
    Regards
    Subhash

  • Creating new Positions using RH_CREATE_POSITIONS?

    Hi
    I tried to use the RFC rh_create_positions to create new positions using C#. But
    i get an error:"Screen output without connection to user".
    Well is there any work around for it or is there any other RFC/BAPI i can use to create positions under an org unit.
    any suggestions are welcome!!!!!
    thanks

    Yes, the BAPI doesn't create the position ID.  You need three tables to be populated for update
    1. hr_object_header - one entry for entire update
    2. hr_infotype_header - one entry for each infotype record update
    3. pd_object - required if you have IT1000 in hr_infotype_header
    4. pd_object_relationships - required if you have IT1001 in hr_infotype header
    Similarly all other tables need update based on records on hr_infotype_header.
    Regards

  • I have problems with creating new projects in iMovie.

    I have problems with creating new projects. When i try, the mac says the following "Make sure there is enough disk space and that you have permission to write the projects to the drive." I have 8GB available, so its not that.

    thanks for your support
    lol

  • When I attempt to send a text from the new iPad, a dialog box appears with the option to either sign in with Apple ID Password or Create New Account. I try signing in using my Apple ID password but IMessage informs me that email address cannot be verified

    When I attempt to send a text from the new iPad, a dialog box appears with the option to either sign in with Apple ID Password or Create New Account. I try signing in using my Apple ID password but IMessage informs me that email address cannot be verified because it is already in use ??? What am I doing wrong?

    settings -> iTunes & App Store
    click on apple ID listed there
    select Sign Out
    sign in with the proper account
    from then on, when the store ask for your password it should be with the correct ID

  • How to create a directory or Folder  using java program?

    Hi all,
    Can any one know, how to create a directory(new folder) in java.
    can any give me some idea, on creating a directory using java program dynamically.
    thanx in advance

    hi thanks for your answer,
    sorry, actual i know this technique(its my fault i didnt mentioned it)
    i am looking for some what different technique.
    bye
    ram

  • Create RFC Function using Java Program

    hi
    I am trying to create a small utility in java that extracts data from SAP system and loads it to local Db
    For extracting data from SAP we have a custom ABAP function (RFC) running on SAP server that is called from Java using JCO3 APIs
    Installation of this utility on client side involves -
    1.     Installing RFC on Clientu2019s SAP instance
    2.     Installing / Configuring Java code on Clientu2019s machine
    Is there a way to install / create a RFC function using java -JCO APIs so that Step-1 can be omitted?
    I had browsed through a sample provided in examples installed with JCO3 but its very trivial example can someone point to a exhaustive link or explain how this can be achieved using Java program
    Thanks

    Hi Amit
    I am not sure I understand the question. You want to create an RFC in Java? If this is correct why not create a Remote Method in java for example as EJB or Web Service which is more standard than creating an RFC.
    On the other hand if you want to create a RFC client in Java (a Program which calls a RFC in SAP ABAP system) you can use JCo APIs (which can be either standalone or on the NW Java server) or JRA (from NW 7.1 onwards).
    Regards
    Partha

  • STRANGE PROBLEM with "Create New Mail Account.scpt" when creating POP acct.

    I am using "Create New Mail Account.scpt" to create a POP account. It creates the account successfully. It fetches the mails successfully. Now the problem begins. After fetching all the mails once if u click "Get Mail" in mac mail, it fetches all the emails again and has now 1 original and 1 copy of the email set which is on the server. I just need 1 copy of the mail set not multiple. Please give me a solution or direct me to a help.
    Thanks
    SCRIPT
    global theUsername
    global thePassword
    set success to 1
    set theResult to true
    if theResult is not equal to false
    #set theAccountName to getAccountName()
    #set theUsername to getUsername()
    #set thePassword to getPassword()
    #set theEmailAddresses to getEmailAddress()
    #set theFullName to getFullName()
    -- POP Account
    if accountTypeString is equal to "POP" or accountTypeString is equal to "IMAP" then
    set theHostname to "THE HOST NAME"
    -- POP specific options
    if accountTypeString is equal to "POP" then
    set deletionPolicy to my getDeletionPolicy()
    if deletionPolicy is not equal to false then
    set deletionPolicy to item 1 of deletionPolicy
    set theNewAccount to my createAccount(accountTypeString, theAccountName, theUsername, theHostname, thePassword, theEmailAddresses, theFullName)
    if theNewAccount is not equal to false then
    setDeletionPolicy(theNewAccount, deletionPolicy)
    getAndSetAuthenticationScheme(accountTypeString, theNewAccount)
    getAndSetSMTPServer(theNewAccount)
    else
    set success to 0
    end if
    end if
    -- IMAP specific options
    else if accountTypeString is equal to "IMAP" then
    set theNewAccount to my createAccount(accountTypeString, theAccountName, theUsername, theHostname, thePassword, theEmailAddresses, theFullName)
    if theNewAccount is not equal to false then
    getAndSetCachingSettings(theNewAccount)
    getAndSetAuthenticationScheme(accountTypeString, theNewAccount)
    getAndSetSMTPServer(theNewAccount)
    else
    set success to 0
    end if
    end if
    end if
    if success is equal to 1 then
    display dialog "Account created!"
    else
    display dialog "Account creation failed!"
    end if
    end if
    -- Convenience handler for creating accounts
    on createAccount(theAccountType, theAccountName, theUsername, theHostname, thePassword, theEmailAddresses, theFullName)
    tell application "Mail"
    try
    if theAccountType is equal to ".Mac" then
    set theNewAccount to make new Mac account with properties {name:theAccountName, user name:theUsername, server name:theHostname, password:thePassword, full name:theFullName, email addresses:{theEmailAddresses}}
    else if theAccountType is equal to "IMAP" then
    set theNewAccount to make new imap account with properties {name:theAccountName, user name:theUsername, server name:theHostname, password:thePassword, uses ssl:true, full name:theFullName, email addresses:{theEmailAddresses}}
    else if theAccountType is equal to "POP" then
    set theNewAccount to make new pop account with properties {name:theAccountName, user name:theUsername, server name:theHostname, include when getting new mail:true, password:thePassword, uses ssl:true, full name:theFullName, email addresses:{theEmailAddresses}}
    end if
    on error
    set theNewAccount to false
    end try
    end tell
    return theNewAccount
    end createAccount
    -- Ask the user what they would like to name the account
    on getAccountName()
    repeat
    set theResult to display dialog "What would you like this account to be named?" default answer "Example: My Home Account"
    set theAccountName to text returned of theResult
    if theAccountName does not start with "Example:" then
    exit repeat
    end if
    end repeat
    return theAccountName
    end getAccountName
    -- Ask the user for the user name for their email account
    on getUsername()
    repeat
    set theResult to display dialog "What is your email user name?" default answer "Example: janedoe"
    set theUsername to text returned of the theResult
    if theUsername does not start with "Example:" then
    exit repeat
    end if
    end repeat
    return theUsername
    end getUsername
    -- Ask the user for the password for their email account
    on getPassword()
    set theResult to display dialog "What is the password for this account?" default answer ""
    set thePassword to text returned of theResult
    return thePassword
    end getPassword
    -- Ask the user for the email addresses for their email account
    on getEmailAddress()
    repeat
    set theResult to display dialog "What email address would you like to use for this account?" default answer "Example: [email protected]"
    set theEmailAddress to text returned of theResult
    if theEmailAddress does not start with "Example:" then
    exit repeat
    end if
    end repeat
    return theEmailAddress
    end getEmailAddress
    -- Ask the user for the full name for their email account
    on getFullName()
    repeat
    set theResult to display dialog "What is the full name for this account?" default answer "Example: Steve Smith"
    set theFullName to text returned of theResult
    if (theFullName does not start with "Example:") then
    exit repeat
    end if
    end repeat
    return theFullName
    end getFullName
    -- Convenience handler for asking the user what settings they would
    -- like to have for their special mailboxes. This handler also sets these
    -- values in Mail.
    on getAndSetSpecialMailboxes(theAccount)
    -- Sent messages default to storing locally
    set theResult to display dialog "Would you like to store Sent Messages on the IMAP server?" buttons {"Yes", "No"} default button 2
    log theAccount
    tell application "Mail"
    tell theAccount
    if button returned of theResult is equal to "Yes" then
    set store sent messages on server to true
    else if button returned of theResult is equal to "No" then
    set store sent messages on server to false
    end if
    end tell
    end tell
    -- Drafts default to storing locally
    set theResult to display dialog "Would you like to store Drafts on the IMAP server?" buttons {"Yes", "No"} default button 2
    tell application "Mail"
    tell theAccount
    if button returned of theResult is equal to "Yes" then
    set store drafts on server to true
    else if button returned of theResult is equal to "No" then
    set store drafts on server to false
    end if
    end tell
    end tell
    -- Trash defaults to storing on the IMAP server
    set theResult to display dialog "Would you like to store Deleted Messages on the IMAP server?" buttons {"Yes", "No"} default button 1
    tell application "Mail"
    tell theAccount
    if button returned of theResult is equal to "Yes" then
    set store deleted messages on server to true
    else if button returned of theResult is equal to "No" then
    set store deleted messages on server to false
    end if
    end tell
    end tell
    end getAndSetSpecialMailboxes
    -- Convenience handler for asking the user what IMAP
    -- caching setting they would like to use and configuring
    -- it in Mail.
    on getAndSetCachingSettings(theAccount)
    set theResult to choose from list {"Cache everything", "Cache everything but attachments", "Cache when read", "Don't cache"} ¬
    with prompt "Choose a message caching setting for this account:" default items {"Cache everything"} without multiple selections allowed
    if theResult is not equal to false then
    tell application "Mail"
    tell theAccount
    if (item 1 of theResult is equal to "Cache everything") then
    set message caching to all messages and their attachments
    else if (item 1 of theResult is equal to "Cache everything but attachments") then
    set message caching to all messages but omit attachments
    else if (item 1 of theResult is equal to "Cache when read") then
    set message caching to only messages I have read
    else if (item 1 of theResult is equal to "Don't cache") then
    set message caching to do not keep copies of any messages
    end if
    end tell
    end tell
    end if
    end getAndSetCachingSettings
    -- Convenience handler for asking the user whether they want to use
    -- an already defined SMTP server (if any) or whether they want to
    -- define a new one.
    on getAndSetSMTPServer(theAccount)
    tell application "Mail" to set everySMTPServer to every smtp server
    if ((count of everySMTPServer) > 0) then
    set listOfSMTPServers to {}
    repeat with eachServer in everySMTPServer
    try
    set listOfSMTPServers to listOfSMTPServers & name of eachServer
    end try
    end repeat
    createNewSMTPServer(theAccount)
    else
    createNewSMTPServer(theAccount)
    end if
    end getAndSetSMTPServer
    -- Handler for creating a new SMTP server, if the user has none set up
    -- already or if they choose not to use one of their existing servers.
    on createNewSMTPServer(theAccount)
    set theServerName to "THE SERVER NAME"
    tell application "Mail"
    set theSMTPServer to make new smtp server with properties {server name:theServerName, port:25, uses ssl:true}
    set smtp server of theAccount to theSMTPServer
    end tell
    getAndSetAuthenticationScheme("SMTP", theSMTPServer)
    end createNewSMTPServer
    -- Handler for asking the user what authentication scheme their server supports.
    -- The options are different for POP, IMAP, and SMTP. Unless you are told otherwise,
    -- it's best to leave these at their default settings.
    on getAndSetAuthenticationScheme(accountType, theAccount)
    if accountType is equal to "POP" then
    set theChoices to {"Password", "Kerberos 4", "Kerberos 5", "KPOP", "MD5"}
    set theDefault to {"Password"}
    else if accountType is equal to "IMAP" then
    set theChoices to {"Password", "Kerberos 4", "Kerberos 5", "MD5"}
    set theDefault to {"Password"}
    else if accountType is equal to "SMTP" then
    set theChoices to {"None", "Password", "Kerberos 4", "Kerberos 5", "MD5"}
    set theDefault to {"Password"}
    end if
    set theResult to choose from list theChoices ¬
    with prompt ¬
    "Choose an authentication scheme for this " & accountType & " server. Most servers support 'Password' authentication." default items theDefault without multiple selections allowed
    if theResult is not equal to false then
    tell application "Mail"
    set theScheme to item 1 of theResult
    tell theAccount
    if theScheme is equal to "Password" then
    set authentication to password
    else if theScheme is equal to "Kerberos 4" then
    set authentication to «constant exutaxk4»
    else if theScheme is equal to "Kerberos 5" then
    set authentication to kerberos 5
    else if theScheme is equal to "MD5" then
    set authentication to md5
    else if theScheme is equal to "None" then
    set authentication to none
    else if theScheme is equal to "KPOP" then
    set authentication to «constant exutakpo»
    end if
    end tell
    end tell
    if accountType is equal to "SMTP" then
    set theSMTPLogin to theUsername
    set theSMTPPassword to thePassword
    tell application "Mail"
    tell theAccount
    set user name to theSMTPLogin
    set password to theSMTPPassword
    set uses ssl to true
    set port to 25
    end tell
    end tell
    end if
    end if
    end getAndSetAuthenticationScheme
    -- Handler for asking the user what POP deletion policy
    -- they would like to use for their account.
    on getDeletionPolicy()
    set theResult to choose from list {"Immediately after being downloaded", "After a specified number of days", ¬
    "When I remove them from the inbox", "Always leave them on the server"} ¬
    with prompt ¬
    "Choose a POP message deletion option:" default items {"Always leave them on the server"} without multiple selections allowed
    return theResult
    end getDeletionPolicy
    -- Handler for setting the deletion policy established in getDeletionPolicy()
    on setDeletionPolicy(theAccount, thePolicy)
    tell application "Mail"
    tell theAccount
    if thePolicy is equal to "Immediately after being downloaded" then
    set delete mail on server to true
    set delayed message deletion interval to 0
    else if thePolicy is equal to "After a specified number of days" then
    set numberOfDays to my getDeletionInterval()
    set delete mail on server to true
    set delayed message deletion interval to numberOfDays
    else if thePolicy is equal to "When I remove them from the inbox" then
    set delete mail on server to true
    set delete messages when moved from inbox to true
    else if thePolicy is equal to "Always leave them on the server" then
    set delete mail on server to false
    end if
    end tell
    end tell
    end setDeletionPolicy
    -- Handler for asking the user what deletion interval they
    -- would like to use, if they are setting up a POP account
    on getDeletionInterval()
    set theResult to display dialog "After how many days would you like POP messages to be deleted from the server?" default answer "30"
    set numberOfDays to text returned of theResult as integer
    return numberOfDays
    end getDeletionInterval

    Hi amiaba, and a warm welcome to the forums!
    I can't quite tell what it's doing, but open Keychain Access in Applications>Utilities, click on your Keychain on the left, put .mac in the search bar, once you find it, double click on it and click show password.
    If you have no mail in there try this with Mail quit.
    Drag this file to the Desktop...
    /Users/YourUserName/Library/Preferences/com.apple.mail.plist
    Start Mail & see if it steps you through it.
    Not sure on the .uk thing, but is Date & Time>Time Zone set to the UK?

Maybe you are looking for