Multiple entries by user in display dialog?

Looking to prompt a user of an applescript to enter two variables in that I will then export to Excel. Can I display a dialog box that prompts the user for two pieces of data? I've heard of Applescript studio or something like that name...is this more in that realm? Here is the script I have so far for prompting the user for the info, except that it is a series of dialog boxes. Looking to make it concise and have all the info entered at once.
<pre style="
font-family: Monaco, 'Courier New', Courier, monospace;
font-size: 10px;
margin: 0px;
padding: 5px;
border: 1px solid #000000;
width: 720px;
color: #000000;
background-color: #FFDDFF;
overflow: auto;"
title="this text can be pasted into the Script Editor">
set slots to {"A", "B", "C", "D", "E", "F"}
set rooms to {"1 ", "2", "3", "4", "5", "6", "7", "8", "9", "10"}
set chosenslot to (choose from list slots with prompt "What slot does your first class go into?  Choose one." without multiple selections allowed) as text
if chosenslot is not "false" then
display dialog "You chose " & chosenslot & ". Next choose the course to go into this slot"
set chosencourse to (choose from list rooms with prompt "What course will go into slot " & chosenslot & "?   Choose one." without multiple selections allowed) as text
display dialog "So " & chosenslot & " will be put into " & chosencourse & " CORRECT??"</pre>
dan

If the default answer of a dialog contains a return, then you can +use a return in the answer+ (in this case, the return key won't be used for the default button, although the enter key will still be used). Going a little bit further than casdvm, but using the same idea (using a return as a delimiter between items), you can fake a multiple input dialog. I have a general purpose handler that will get multiple input items (it is a bit long but has a lot of options):
<pre style="
font-family: Monaco, 'Courier New', Courier, monospace;
font-size: 10px;
margin: 0px;
padding: 5px;
border: 1px solid #000000;
width: 720px; height: 340px;
color: #000000;
background-color: #FFEE80;
overflow: auto;"
title="this text can be pasted into the Script Editor">
on run -- example
set {Slot, Course} to (InputItems for {"• Class slot", "• Course"} with Prompt given Title:"Data Entry")
display dialog "Slot:  " & (quoted form of Slot) & return & "Course:  " & (quoted form of Course) with title "results"
end run
to InputItems for SomeItems given Title:TheTitle, Prompt:ThePrompt
displays a dialog for multiple item entry - a carriage return is used between each input item
  for each item in SomeItems, a line of text is displayed in the dialog and a line is reserved for the input
    the number of items returned are padded or truncated to match the number of items in SomeItems
to fit the size of the dialog, items should be limited in length (~30) and number (~15)  
parameters - SomeItems [list/integer]: a list or count of items to get from the dialog
TheTitle [boolean/text]: use a default or the given dialog title
ThePrompt [boolean/text]: use a default or the given prompt text
returns [list]: a list of the input items
if ThePrompt is in {true, false} then -- "with" or "without" prompt
if ThePrompt then
set ThePrompt to "Input the following items separated by returns:" & return & return -- default
else
set ThePrompt to ""
end if
else -- fix up the prompt a bit
set ThePrompt to ThePrompt & return & return
end if
if TheTitle is in {true, false} then if TheTitle then -- "with" or "without" title
set TheTitle to "Multiple Input Dialog" -- default
else
set TheTitle to ""
end if
if class of SomeItems is integer then -- no item list
set {TheCount, SomeItems} to {SomeItems, ""}
if ThePrompt is not "" then set ThePrompt to text 1 thru -2 of ThePrompt
else
set TheCount to (count SomeItems)
end if
if TheCount is less than 1 then error "InputItems handler:  empty input list"
set {TheItems, TheInput} to {{}, {}}
repeat TheCount times -- set the number of lines in the input
set the end of TheInput to ""
end repeat
set {TempTID, AppleScript's text item delimiters} to {AppleScript's text item delimiters, return}
set {SomeItems, TheInput} to {SomeItems as text, TheInput as text}
set AppleScript's text item delimiters to TempTID
set TheInput to paragraphs of text returned of (display dialog ThePrompt & SomeItems with title TheTitle default answer TheInput) -- with icon caution with hidden answer)
repeat with AnItem from 1 to TheCount -- pad/truncate entered items
try
set the end of TheItems to (item AnItem of TheInput)
on error
set the end of TheItems to ""
end try
end repeat
return TheItems
end InputItems
</pre>
If you are looking at easier error handling or an entry box for each item, then yes, AppleScript Studio is what you want.
Message was edited by: red_menace

Similar Messages

  • Multiple users with single dialog..

    Hi,
    How to handle multiple user activities in dialog programming ?
    In my custom dialog transaction, there is very little probability that two or more will be working on the same data. But in case by chance, two people try to modify the same data, how should that be handled ?
    Can anyone explain in detail?
    thks

    Yes, you should always, regardless of chances, use lock objects when updating database tables.  These are generated in the ABAP dictionary for each table, or you could define it to cover mulitple tables at one time.  It will also generate functions modules, ENQUEUE_<name of lock object> and DEQUEUE_<name of lock object>, which you use to Lock, and Unlock..
    http://help.sap.com/saphelp_nw04/helpdata/en/41/7af4c5a79e11d1950f0000e82de14a/frameset.htm
    http://help.sap.com/saphelp_nw70/helpdata/en/a2/3547360f2ea61fe10000009b38f839/frameset.htm
    Regards,
    Rich Heilman

  • Multiple entries from iCal calendar being displayed, why?

    My Trainingpeaks account is synced with calendar using iCal. Recently multiple entries fro the same vent are being displayed. How do I stop this?

    Probably because of iCloud since I assume you started it up on both Macbook and a mobile device.

  • Display dialog, await user input how to get no timeout?

    I have a script i run on login, it brings up a dialog that requests user input, how can I stop it timing out if nothing happens?

    Sorry long delay to get back to my question that I asked,
    Still having issues, original I used the timeout action, and that keeps the script working.... However it still times out and then when I use the
    giving up after 150
    I've not tested it to see if it prevents an early timeout, but clicking a the dialog and my script, just stops working there and does nothing else.
    --These files need to change on boot.
    --:Applications:Adobe Photoshop CS6:Presets:Scripts:SAVEAS.jsx
    --:Applications:Adobe Photoshop CS6:Presets:Scripts:SaveOnly.jsx
    --:Volumes:StudioC:Users:StudioC:Workflow:Folder Actions:0_HeliconHotFolder.scpt
    set CS6Applications to ((path to applications folder as text) & "Adobe Photoshop CS6:Presets:Scripts")
    set HeliconLabeler to ((path to home folder as text) & "Workflow:Folder Actions")
    set HeliconAbdul to ((path to me as text) & "Contents:Resources:Scripts:abdul:0_HeliconHotFolder.scpt")
    set HeliconMatt to ((path to me as text) & "Contents:Resources:Scripts:matt:0_HeliconHotFolder.scpt")
    set HeliconShah to ((path to me as text) & "Contents:Resources:Scripts:shah:0_HeliconHotFolder.scpt")
    set PS6SaveAsAbdul to ((path to me as text) & "Contents:Resources:Scripts:abdul:SAVEAS.jsx")
    set PS6SaveOnlyAbdul to ((path to me as text) & "Contents:Resources:Scripts:abdul:SaveOnly.jsx")
    set PS6SaveAsMatt to ((path to me as text) & "Contents:Resources:Scripts:matt:SAVEAS.jsx")
    set PS6SaveOnlyMatt to ((path to me as text) & "Contents:Resources:Scripts:matt:SaveOnly.jsx")
    set PS6SaveAsShah to ((path to me as text) & "Contents:Resources:Scripts:shah:SAVEAS.jsx")
    set PS6SaveOnlyShah to ((path to me as text) & "Contents:Resources:Scripts:shah:SaveOnly.jsx")
    tell application "System Events"
              if name of current user is equal to "StudioA" then ¬
                        set MacName to "true"
              if name of current user is not equal to "StudioA" then ¬
                        set MacName to "false"
    end tell
    with timeout of (60 * 61) seconds
              display dialog "Who is using the Computer?" buttons {"Abdul", "Matt", "Shah"} with icon caution
              if result = {button returned:"Abdul"} then
                        if MacName = "true" then
                                  tell application "Finder"
      duplicate file PS6SaveAsAbdul to folder CS6Applications with replacing
      duplicate file PS6SaveOnlyAbdul to folder CS6Applications with replacing
                                  end tell
                        else if MacName = "false" then
                                  tell application "Finder"
      duplicate file HeliconAbdul to folder HeliconLabeler with replacing
      duplicate file PS6SaveAsAbdul to folder CS6Applications with replacing
      duplicate file PS6SaveOnlyAbdul to folder CS6Applications with replacing
                                  end tell
                                  display alert "Turn Camera on"
                                  delay 1
                                  tell application id "breezesys.com.dslrremotepro" to activate
                                  menu_click({"DSLRRemotePro", "Camera", "Set date/time and owner string..."})
                                  delay 1
                                  tell application "System Events"
      keystroke "a" using command down
                                            delay 1.5
                                            keystroke "Shot_By_Abdul"
                                            delay 1.5
      keystroke return
                                  end tell
                        end if
              else if result = {button returned:"Matt"} then
                        if MacName = "true" then
                                  tell application "Finder"
      duplicate file PS6SaveAsMatt to folder CS6Applications with replacing
      duplicate file PS6SaveOnlyMatt to folder CS6Applications with replacing
                                  end tell
                        else if MacName = "false" then
                                  tell application "Finder"
      duplicate file HeliconMatt to folder HeliconLabeler with replacing
      duplicate file PS6SaveAsMatt to folder CS6Applications with replacing
      duplicate file PS6SaveOnlyMatt to folder CS6Applications with replacing
                                  end tell
                                  display alert "Turn Camera on"
                                  delay 1
                                  tell application id "breezesys.com.dslrremotepro" to activate
                                  menu_click({"DSLRRemotePro", "Camera", "Set date/time and owner string..."})
                                  delay 1
                                  tell application "System Events"
      keystroke "a" using command down
                                            delay 1.5
                                            keystroke "Shot_By_Matt
                                            delay 1.5
      keystroke return
                                  end tell
                        end if
              else if result = {button returned:"Shah"} then
                        if MacName = "true" then
                                  tell application "Finder"
      duplicate file PS6SaveAsShah to folder CS6Applications with replacing
      duplicate file PS6SaveOnlyShah to folder CS6Applications with replacing
                                  end tell
                        else if MacName = "false" then
                                  tell application "Finder"
      duplicate file HeliconShah to folder HeliconLabeler with replacing
      duplicate file PS6SaveAsShah to folder CS6Applications with replacing
      duplicate file PS6SaveOnlyShah to folder CS6Applications with replacing
                                  end tell
                                  display alert "Turn Camera on"
                                  delay 1
                                  tell application id "breezesys.com.dslrremotepro" to activate
                                  menu_click({"DSLRRemotePro", "Camera", "Set date/time and owner string..."})
                                  delay 1
                                  tell application "System Events"
      keystroke "a" using command down
                                            delay 1.5
                                            keystroke "Shot_By_Shah"
                                            delay 1.5
      keystroke return
                                  end tell
                        end if
              end if
    end timeout
    --handlers
    on menu_click(mList)
              local appName, topMenu, r
      -- Validate our input
              if mList's length < 3 then error "Menu list is not long enough"
      -- Set these variables for clarity and brevity later on
              set {appName, topMenu} to (items 1 through 2 of mList)
              set r to (items 3 through (mList's length) of mList)
      -- This overly-long line calls the menu_recurse function with
      -- two arguments: r, and a reference to the top-level menu
              tell application "System Events" to my menu_click_recurse(r, ((process appName)'s ¬
                        (menu bar 1)'s (menu bar item topMenu)'s (menu topMenu)))
    end menu_click
    on menu_click_recurse(mList, parentObject)
              local f, r
      -- `f` = first item, `r` = rest of items
              set f to item 1 of mList
              if mList's length > 1 then set r to (items 2 through (mList's length) of mList)
      -- either actually click the menu item, or recurse again
              tell application "System Events"
                        if mList's length is 1 then
      click parentObject's menu item f
                        else
                                  my menu_click_recurse(r, (parentObject's (menu item f)'s (menu f)))
                        end if
              end tell
    end menu_click_recurse

  • HT4528 Calendar under IOS7.0.2 has been changed. does not work the same. what happened to LIST mode (multiple entries being displayed in list format) or am i doing something wrong?

    I got use to using Calendar app where multiple entries are stacked under IOS6.  Under iOS7.0.2 I enter a new appointment and after the entry I can not find the new appointment after i click on done.  Am I doing something incorrect HELP!

    The list view does not appear to be among the "standard views" for the Calendar app in iOS 7.0.x.  You can still get the list view by going to the day view and hitting the search button (magnifying glass icon).

  • Can I combine multiple entries into a single statement?

    I am relatively new to Live Cycle so forgive my lack of technical wording.
    I would like to use multiple entry fields to fill in a statement.
    For example:
    I'd like the user to see this:
    Target Dropdown     Endo Dropdown     Type Dropdown     Version # Entry     Date 1 Entry     Date 2 Entry
    and then have the form merge all that together into a line that looks like this:
    RS_(target)_(endo)_(type)\(version)_(date)_(date)
    Preferably without repeating information on the page as we'll have multiple of these entries and the page will get hectic quick.
    Is this possible?
    I first had each dropdown in individual table fields, but due to regulations we follow the entries need to be merged without spaces.
    I always have a backup if this can't be done, but any help is appreciated.

    Not sure where you're sending it, but if you have a global variable named "bob".
    bob.value = "RS_"+target.rawValue+"_"+endo.rawValue+"_"+type.rawValue+"\"+version.rawValue+"_"+date.r awValue+"_"+date2.rawValue;
    Something like that should work.

  • How do I use Display Dialog to get back a date?

    Can anyone tell me how to use Display Dialog to get back a date?
    I am using the following code that does not work. It does not accept anything.  And I have searched high and low for an answer to my question and found nothing.
    repeat
           display dialog "When should I remind you (date)?" default answer ""
           try
                 if the text returned of the result is not "" then
                        set the requested_text to the date returned of the result as date
                        exit repeat
                end if
           on error
               beep
    end try
    endrepeat
    display dialog requested_text
    The code is based on what I found in AppleScript 1-2-3 (page 300). It shows examples for getting text and numbers but not one for dates.
    For what it is worth, my goal is to create a script that will convert an email from Evernote into an iCal Reminder. To do so, I want to ask the user (myself) for the reminder's date and time. I am assuming I need to ask for each separately. I also assume that once I get the date and time for the reminder, it should be relatively straightforward to 'make' a 'todo' with an alarm.
    Thanks in advance.
    -David

    Hi David,
    Try this:
    repeat
        set theCurrentDate to current date
        display dialog "When should I remind you (date)?" default answer (date string of theCurrentDate & space & time string of theCurrentDate)
        set theText to text returned of result
        try
            if theText is not "" then
                set theDate to date theText -- a date object
                exit repeat
            end if
        on error
            beep
        end try
    end repeat
    display dialog (date string of theDate & space & time string of theDate)
    You might also have a look at this page of the AppleScript Language Guide.
    Message was edited by: Pierre L.

  • Under Options , Applications There are multiple entries for the same item (Acrobat Document). how can I delete the duplicates?

    Under Options, Applications there are multiple entries for the same item. (Adobe Acrobat) . Three show Adobe Acrobat Reader 9.3 and the other shows (ask) or (save file) with no ability to select Acrobat Reader . Is there a way to edit this list to remove the duplicates and
    the incorrect entry? Adobe installed a very quick update today.

    They are all different. Hover your mouse pointer over each of the "Content Type" descriptions and you should see a "tooltip" to see that each has a different description.
    You need to update your plugins. It is important to keep them updated due to continuing security fixes and improvements in those plug-ins:
    * Adobe Shockwave for Director Netscape plug-in, version 11.5 (you '''<u>may</u>''' need to update)
    * Shockwave Flash 10.1 r53
    * Next Generation Java Plug-in 1.6.0_20 for Mozilla browsers
    #Check your plugin versions: http://www.mozilla.com/en-US/plugincheck/
    #*'''Note: plugin check page does not have information on all plugin versions'''
    #'''Update Shockwave for Director'''
    #*NOTE: this is not the same as Shockwave Flash; this installs the Shockwave Player.
    #*Use Firefox to download and SAVE the installer to your hard drive from the link in the article below (Desktop is a good place so you can find it).
    #*When the download is complete, exit Firefox (File > Exit)
    #*locate and double-click in the installer you just downloaded, let the install complete.
    #*Restart Firefox and check your plugins again.
    #*'''<u>Download link and more information</u>''': http://support.mozilla.com/en-US/kb/Using+the+Shockwave+plugin+with+Firefox
    #'''Update Shockwave Flash'''
    #*Use Firefox to Download and SAVE to your hard drive from the link in article below
    #*SAVE to your Desktop so you can find it
    #*After download completes, close Firefox
    #*Click on the file you just downloaded and install
    #**Note: Vista and Win7 users may need to right-click the installer downloaded and choose "Run as Administrator"
    #**Note: Most browsers other than IE will also get updated with this one download
    #**Note: To update IE, same procedure '''<u>but use IE</u>''' to go: http://fpdownload.macromedia.com/get/flashplayer/current/install_flash_player_ax.exe
    #*After installation, restart Firefox and check your version again.
    #*'''<u>Download link and other information</u>''': https://support.mozilla.com/en-US/kb/Managing+the+Flash+plugin#Updating_Flash
    #* Also see: http://support.mozilla.com/en-US/kb/Installing+the+Flash+plugin
    #* Also see (if needed): http://kb2.adobe.com/cps/191/tn_19166.html#main_Uninstall
    #'''Update Java:'''
    #* Download and update instructions: https://support.mozilla.com/en-US/kb/Using+the+Java+plugin+with+Firefox

  • Multiple entries of the same topic in calendar

    Hi, i am having trouble with my calendar, as in it displays multiple entries of 1 entry on the same day! eg. if i have one entry then it displays that same entry about 15-20 times on that same day in a list!!! can anyone help with this fault?

    I'm having same problem but where there are duplicate calendar entries, one of the entries cannot be changed (doesn't have edit button)and the other entry can be changed. Needed to reschedule a doctor's appointment and wasn't able to delete b/c there isn't an edit button. So it stays there. Don't know which date is the new rescheduled date. I have iPhone 3g. Since iPhone4 my 3g is extremely slow too.

  • Multiple Entries on ipod

    I imported a 4 disc CD to i tunes and then synced it to my ipod. When I go into albums on the ipod, there are multiple entries and not just the 4 cds.Every entry shows the same tracks, so in essence I have about 10 entries for each CD. Also, in another case when a single album was synced to the ipod, it appears 4 times on the ipod. Why this happening?

    *HowTo: Grouping Tracks Into Albums*
    Excuse the long post, but hopefully covering all the bases (that I can think of) will help you fix the other issues you are likely to run into as you try to organise your iTunes library.
    *Use an album friendly view*
    iTunes will let you sort music on many columns, some of which are unlikely to group albums together or put the tracks in their normal order. The most useful order for editing the library is probably *Album by Artist*. If you're not already there, select the list view and click on the column heading for Album until it reads Album by Artist.
    *One cover, too many tracks*
    The iPod (and iTunes to a lesser extent) conflates two or more albums with the same title, most obviously with *Greatest Hits*. On the iPod this can result in one album acting as a combination of two or more. Selecting any cover gives all the tracks of all albums with the same title. The workaround for this "Greatest Hits" bug is to give each album a unique title - I tend to go for *Album - Album Artist* as this reads clearly in the iTunes browser. Alternatively you could use the wording as it appears on the cover or append different numbers of spaces for each different album. Somewhat oddly, setting different values for Sort Album doesn't work.
    *Missing Artist or Album not with others by same artist*
    iTunes relies on the Gracenote CDDB database when identifying CD's. This often marks collections or anthologies of an artist's work as a compilation. In iTunes, however, the compilation flag has the logical function of grouping together tracks with the same album name, but different artists on each track, e.g. "Now That's What I Call Metal 666!". These compilations are then all grouped together at the end of cover flow. Most of us however, would expect "Greatest Hits" albums to be listed with the other albums by the same album artist. For albums which are essentially by a single album artist or group it is best to set the appropriate value for the album artist and clear the compilation flag.
    *One album, too many covers*
    For true compilations, where each track is by a different artist, the answer is to set the compilation flag to true and enable the iTunes preference to *Group compilations when browsing*. If the album is not a compilation however, any tracks which list guest artists may be treated as separate items. Filling in the Album Artist field is enough to link things in iTunes. Sadly, however, the iPod ignores the Album Artist field when grouping albums so this is only a partial solution. You can simply mark the entire album as a compilation which seems to be the way iTMS handles it, however that's not an ideal fix. Short of waiting for Apple to address this issue (and as far as I can tell it goes back to the 1st gen. of iPods) we need a workaround. What I do is to put any additional artist info. in square brackets after the song name. E.g. *Track \[Feat. Guest\]* and then set *Artist=Album Artist* for each track. For anthologies where the Album Artist is credited as part of another group, e.g. for Cream tracks on an Eric Clapton anthology, I use *Track \[As Group\]*. For a track where the main Album Artist doesn't receive a credit, e.g. the first track of the Slim Shady LP credited to Jeff Bass, I just set the track name to *Track \[Guest\]* while still setting the artist to the album artist. N.b. I use square brackets to indicate that this is information about the track as distinct from the song title and also use this style for Mix/Live/Bonus info.
    *One album, still too many covers*
    iTunes may split albums into two or more sections if some tracks from the album have different values for Artist, Album Artist, Album, No. of Discs or Part of a Compilation. Tiny differences such as trailing spaces, accented characters or variants of symbols can sometimes be quite hard to spot. The iPod is also more sensitive to case variations and may split or reorder an album that looks okay in iTunes. Normally overtyping the desired value for each shared field will complete the grouping of the album into one entity. Occasionally, however, this method seems to fail. When this happens I've found that you can force every field to update properly by adding some extra text - e.g. a trailing X, which once applied seems to complete the joining of the tracks into one album. Once this has happened the extra data can be removed and the album should remain properly grouped.
    *Tried that, there are STILL too many covers!*
    The Sort Artist, Sort Album & Sort Album Artist fields can be used to override the normal sort order. For example iTunes automatically drops leading articles (a/an/the) so "The Beatles" are arranged under "B" instead of "T". Occasionally different tracks from the same album can have different values in these sort fields which can also break up the grouping. Making the sort columns visible in iTunes can help with spotting & correcting such problems.
    *One cover for multi-disc album*
    Multi-disc albums are often listed as *Album (CD1)* for CD 1, *Album (CD2)* for CD 2 etc. To display these properly using just one cover, each disc should have the correct *Disc X of Y* values set, and then the entire album should be given the single title Album. Being somewhat obsessive I also renumber the tracks sequentially, working backwards from the last track (so that no two tracks ever have the same number) until I reach disc 1. BTW You can still give the individual discs different artwork should it be relevant so that the correct artwork will be displayed as the album progresses.
    *Tracks out of sequence*
    Check that all tracks have the same/correct disc no. For a single disc album this should be either blank (my preference) or 1 of 1. iTunes will sort tracks with a disc no. of 1 before those that are blank. Just for fun the iPod sorts them the other way around. Consistency is the key. In addition ensure that the Sort Artist, Sort Album Artist & Sort Album fields are the same across all tracks.
    *One artist, many names*
    With some artists, particularly classical composers, you should be aware of alternative representations of their names. E.g. 2Pac vs. Tupac. The menus will work best if for each artist you standardise on just one form of their name. E.g. make a choice between Mozart, W.A. Mozart or Wolfgang Amadeus Mozart, and then apply it consistently. For classical music I tend also to use the Composer as the Artist & Album Artist and either discard the performer details or place these into the Comments field. The Sort Artist/Sort Album Artist fields can group alternate forms in iTunes but these will break up again on the iPod. It is best therefore to use Artist & Album Artist consistently so the name is shown the way that you want and Sort Artist & Sort Album Artist to control where it is displayed.
    tt2

  • List View Showing Multiple Entries for Certain Records

    I've been updating my large mp3 library with album art in order to make the list view more useful and fun to look at. With just a handful of records however I've noticed that they're getting split into multiple entries. For instance, Album X shows up twice, with one entry displaying only song 1 and the other entry displaying the rest of the songs.
    I've looked hard at the tags but I don't see any difference. All the records in question were ripped using iTunes so they're not coming from different sources either.
    Any thoughts would be hugely appreciated! Cheers.

    Thanks again; I tried the solution this morning and it fixes the problem. I've marked the thread as such. Unfortunately it's a lot of fiddly updating, but hey, it's better than no workaround at all.

  • User Authorisations in Dialog Programming.

    Hi Friends,
    I have a small requirement, I want to create user authorisations in dialog programming.
    Actually client requirement is he want to enter absence details of each and every branch.
    For that i have created a cusom table and i  also i have developed a dialog program inorder to update the details
    and to retrive all the data i have created a report program also.
    Now the client requirement is he want user authorisations while updating the data through dialog programming, that means if a user loging in that particular branch he want to enter the absence details pertaining to that branch only, when he tries to enter the details of other employee pertaining to another branch an error should be raised.
    Actually in the client place they are using authrisation object as 'Z_WERKS'.  The basis person has created this and provided for me.
    Actually i have created an Authority check in module pool program.Here iam attaching my prog,
    Pls provide me the sample code if at all available.
    *& Include ZEMPTOP                                           Module pool
    PROGRAM  ZEMP.
    TABLES : ZABS,PA0001.
    DATA : WA_PA0001 LIKE PA0001,
           V_ANS.
    DATA: BEGIN OF Z_WERKS OCCURS 0,
            PERSA LIKE T500P-PERSA,
            NAME1 LIKE T500P-NAME1,
          END OF Z_WERKS.
    *&  Include           ZEMPI01
    *&      Module  USER_COMMAND_0100  INPUT
          text
    MODULE USER_COMMAND_0100 INPUT.
    CASE SY-UCOMM.
    WHEN 'DISP'.
    SELECT SINGLE * FROM ZABS WHERE PERNR = ZABS-PERNR.
    IF SY-DBCNT <> 0.
    *MESSAGE I000(Z00) WITH 'Details of' ZABS-PERNR .
    else.
    MESSAGE I000(Z00) WITH 'No Details Available to Display'.
    ENDIF.
    WHEN 'EXIT'.
    LEAVE PROGRAM.
    WHEN 'BACK' OR 'EXIT' OR 'CANCEL'.
    LEAVE TO SCREEN 0.
    WHEN 'CLS'.
    CLEAR ZABS.
    WHEN 'INS'.
    INSERT ZABS .
    ZABS-ABWTG = ZABS-ENDDA - ZABS-BEGDA + 1.
    IF SY-DBCNT <> 0.
    MESSAGE I000(Z00) WITH 'Personnel No' ZABS-PERNR
    'inserted successfully'.
    ENDIF.
    CLEAR ZABS.
    WHEN 'MOD'.
    UPDATE ZABS.
    ZABS-ABWTG = ZABS-ENDDA - ZABS-BEGDA + 1.
    IF SY-DBCNT <> 0.
    MESSAGE I000(Z00) WITH 'Personnel No' ZABS-PERNR
    'Modified Successfully'.
    ENDIF.
    CLEAR ZABS.
    *WHEN 'DEL'.
    *CALL FUNCTION 'POPUP_TO_CONFIRM_LOSS_OF_DATA'
    EXPORTING
       TEXTLINE1           = 'ARE YOU SURE'
       TEXTLINE2           = 'YOU WANT TO DELETE'
       TITEL               = 'CONFIRMATION'
       START_COLUMN        = 25
       START_ROW           = 6
       DEFAULTOPTION       = 'N'
    IMPORTING
       ANSWER              = V_ANS.
    *IF V_ANS = 'J'.
    *DELETE ZABS.
    *IF SY-DBCNT <> 0.
    *MESSAGE I000(Z00) WITH 'Personnel No' ZABS-PERNR
    *'Deleted Successuflly'.
    *ELSE.
    *MESSAGE I000(Z00) with 'No Record to Delete'.
    ENDIF.
    *ENDIF.
    ENDCASE.
    ENDMODULE.                 " USER_COMMAND_0100  INPUT
    *&      Module  GET_REC  INPUT
          text
    MODULE GET_REC INPUT.
    SELECT SINGLE * FROM PA0001 INTO WA_PA0001
             WHERE PERNR = ZABS-PERNR.
    MOVE: WA_PA0001-PERNR TO ZABS-PERNR,
          WA_PA0001-ENAME TO ZABS-ENAME,
          WA_PA0001-GSBER TO ZABS-GSBER,
          WA_PA0001-WERKS TO ZABS-WERKS.
    ZABS-ABWTG = ZABS-ENDDA - ZABS-BEGDA + 1.
    ENDMODULE.                 " GET_REC  INPUT
    *&      Module  CHECK_AUTH_WERKS  INPUT
          text
    MODULE CHECK_AUTH_WERKS INPUT.
    *SELECT PERSA INTO TABLE _WERKS FROM T500P
            WHERE  PERSA = ZABS-WERKS.
    AUTHORITY-CHECK OBJECT 'Z_WERKS'
    ID 'PERSA' FIELD Z_WERKS-PERSA.

    You need to test the sy-subrc after the authority check - that will indicate whether the user has the authorisation or not.. you also often include the activity being tested e.g. generally 03 = Display, 02 = Update etc
    AUTHORITY-CHECK OBJECT 'S_TRVL_BKS'
      ID 'ACTVT'    FIELD '03'
      ID 'CUSTTYPE' FIELD 'B'.
    IF not SY-SUBRC is initial.
      MESSAGE E...   "put your exception here...
    ENDIF.
    see [Programming Authorization Checks  |http://help.sap.com/saphelp_nw04/helpdata/en/52/6712ac439b11d1896f0000e8322d00/content.htm] for more info.
    Jonathan

  • Check on Multiple entries in the same positions

    Hullo all!
    Can anyone pls tell me as to how can i keep a check on multiple entries (i.e.persons) occupying the same position?
    i mean that if a position is 100% staffed, then there should be an error popped up when another personnel no. is being assigned to the same position.
    And if the position is staffed 60%, then another personnel no. should be accepted on the same position only if the staffing percentage is allotted as 40%.
    is this an ABAP development? and if so, what all tables are to be referred etc? what is the logic?

    Hi ,
    Please download the note from transaction "SNOTE" (Cntrl + F8 / Download SAP Note). I can send you the note if you can share your email id.
    An extract from note for your reference :-
    Number 502182
    Version 0004
    Processor
    Processing Status new
    Implement. Status Cannot be implemented
    Language EN
    Short Text Holder relationship, staffing percentage, working time
    Component PA-OS Organizational Structure
    Long Text
    Symptom
    In Organizational Management, difficulties exist concerning the creation of the staff
    assignments. The interaction of holder relationship, staffing percentage working time
    of the employee and planned working time of the position is not clear.
    Effects on subsequent processes, for example, the integration of Cost Distribution are
    not clear.
    Other terms
    Integration of Cost Distribution, IT1018, IT0027
    Reason and Prerequisites
    Solution
    The following text should explain the interaction of holder relationship, working time
    of the employee, planned working time of the position and the integration of Cost
    Distribution.
    Contents:
    1. The holder relationship
    2. The staffing percentage
    3. The staff assignment from the viewpoint of the position
    4. The working time at the position
    5. The working time of the employee
    6. The relationship characteristics of the holder relationship
    7. Dependent processes (Integration of Cost Distribution)
    =======================================================================
    1. The holder relationship
    Relationship between position and position holder (employee), infotype 1001, subtype
    A008
    Allowed relationships:
    (See system table T777E)
    A Work center A 008 Holder P
    A Work center A 008 Holder US
    BP Business partner B 008 Holder S
    P Person B 008 Holder A
    P Person B 008 Holder S
    S Position A 008 Holder BP
    S Position A 008 Holder P
    S Position A 008 Holder US
    US User B 008 Holder A
    US User B 008 Holder S
    SAP Note Nr. 502182 10/05/2007 Page 1
    Time constraint:
    (See system table T777Z)
    A 1001 Relationships A008 Holder 3
    S 1001 Relationships A008 holder 3
    P 1001 Relationships B008 holder 3
    That means:
    <b>o An employee can be assigned to several positions at the same time.
    o A position can be assigned to several holders at the same time.</b>
    Reward points, if this was helpful.

  • How to Add multiple entry to the group policy security filtering

    How to Add multiple entry to the group policy security filtering
    Is there any way we can add multiple entry to the Domain group policy Security filtering tab.Currently its not allowing to add more then one entry at a time.
    Getting Error like "only one name can be entered,and the name cannot contain a semicolon.Enter a valid name"

    Hi
    Are you trying to add more users or groups through Group Policy Management Security Filtering tab?
    Try right clicking on the policy and then edit
    Then in Editor Right click on the name of the policy and Properties
    Security tab and add user or group from this tab. Just make sure if you are adding user or groups "Select this object type" has
    the correct option also "From this Location" is set to your entire directory not the local server.
    Update us with the above.
    Thanks

  • Creating multiple entries in ztable with the same name

    Dear sir / madam,
    iam new in sap-abap , i have created ztable in se11, table name zrajesh
    and fields i have created zemp_name and zempid which has data element and domain also. and zprice.
    when iam creating entries in table mataince generator
    eg: zemp_name     zempid       zprice
          rajesh              001             100
          raj                     002            110
          rajesh              001             200  
          rajesh             001              300
         rajesh              001              250
    i am looking forward to create multiple entries of the same employ name .. as shown in example . iam able to create numbers of entries with the help of different names. is it possible to create numbers of entries with same name..
    and it will show all the entries in the list when display.
    please help me..
    regards,
    rajesh swami

    hi,
    have a look at these tables
    VBAK -  Header table
    VBAP -  Item table
    here in table VBAK we have a key field VBELN(document no.)
    Whereas for the same document no. we can have many entries in the the table VBAP where the key is VBELN(document no.)
    and POSNR (line item no.).
    You have to do something of this type i suppose ............
    Hope it helps you,
    Regards,
    Abhijit G. Borkar

Maybe you are looking for

  • Error at deploying Enterprise Application Archives

    Hi, I am running CE 7.1 SR5 and I have tried to deploy the EAA. All program incl. XML is ok and should have no errors. However, I get the errorlog as seen below. It will not deploy; any help is appreciated: Start of File: --- Deploying file(s):      

  • Repeat Purchase Order

    Hi Friends, Pls let me know how create repeat purchase order with PR Request refering to the old PO. Regards Lakshman.

  • Alternative style-sheet (CSS) for printing

    Hi folks. Anybody knows if it is possible to tell VisualComposer to use a different CSS for printing. That's a common trick to getter printer friendly output. Take a look on: http://webdesign.about.com/cs/css/a/aa042103a.htm. Thanx a lot, Harald

  • Sharing an inDesign file for multiple people to edit using Dropbox?

    Hi, I'm trying to figure out how exactly using Dropbox can help our group share an inDesign file. It's just one file (one magazine every couple of months), with lots of images + text. Some of us use Macs, others PCs. We all have different (recent) ve

  • CS5.5 Plugins

    Where do I find CS5.5 plugin updates?