How to update popup (drop down) cells in Numbers using Applescript

I understand that the list popups (dropdown lists in cells) cannot be dynamic in Numbers.
I have the same dropdown list in multiple cells and tables, and this list often needs to be changed. Its not practical to amend one list, then copy/paste it into 200 plus cells that require the dropdown facility (they are not in sequential rows).
Can Applescript be used to do the copy/paste function, as i could specify the cell ranges. My simple attempt only managed to copy/paste the cell values rather than the dropdown/popup list.
Any constructive help would be appreciated.
Thanks.

Hi Hiroto,
I have this script running, with one issue.
set tValues to my doThis(1) -- get values of the selection
if tValues is not "" then
  activate
          display dialog "Select the cells where you want to create the PopUp." & return & "After that, click on the 'OK' button."
          my doThis(tValues) -- set the cell format of the new selection to "PopUp Menu" and set the values of the each menu item
          tell application "Numbers" to display dialog "Done"
else
          tell application "Numbers" to display dialog "You must select the cells in a table before running this script."
end if
on doThis(n)
          tell application "Numbers"
                    set tTables to (tables of sheets of front document whose its selection range isnot missing value)
                    repeat with t in tTables -- t is a list of tables of a sheet
                              if contents of t is not {} then -- this list is not empty, it's the selected sheet
                                        set activeTable to (get item 1 of t)
                                        if n = 1 then return value of cells of selection range of activeTable-- return values of the selection
                                        set format of (cells of selection range of activeTable) to pop up menu -- set the format to pop up menu
                                        return my setValuePopUp(n) -- set value of each menu item
                              end if
                    end repeat
          end tell
          return ""
end doThis
on setValuePopUp(L)
          tell application "System Events"
                    tell process "Numbers"
                              set frontmost to true
                              delay 0.3
                              set inspectorWindow to missing value
                              set tWindows to windows whose subrole is "AXFloatingWindow"
                              repeat with i in tWindows
                                        if exists radio group 1 of i then
                                                  set inspectorWindow to i
                                                  exit repeat
                                        end if
                              end repeat
                              if inspectorWindow is missing value then
  keystroke "i" using {option down, command down} -- Show Inspector
                              else
  perform action "AXRaise" of inspectorWindow -- raise the Inspector window to the front
                              end if
                              delay 0.3
                              tell window 1
  click radio button 4 of radio group 1 -- the "cell format" tab
                                        delay 0.3
                                        tell group 2 of group 1
                                                  set tTable to table 1 of scroll area 1
                                                  set tc to count rows of tTable
                                                  set lenL to (count L)
                                                  if tc < lenL then -- ** add menu items **
                                                            repeat until (count rows of tTable) = lenL
  click button 1 -- button [+]
                                                            end repeat
  keystroke return -- validate the default name of the last menu item
                                                  else if tc > lenL then -- ** remove menu items **
                                                            repeat while exists row (lenL + 1) of tTable
                                                                      select row (lenL + 1) of tTable
  click button 2 --  button [-]
                                                            end repeat
                                                  end if
                                                  tell tTable to repeat with i from 1 to lenL -- ** change value of each menu item **
                                                            set value of text field 1 of row i to item i of L
                                                  end repeat
                                        end tell
                              end tell
                    end tell
          end tell
end setValuePopUp
==============================
When the popup is created, if there is one header row, it adds "1" to the list of popup items, if there are two header rows, it adds "1", "2" to the list of popup items. What should i amend to remove this (i have two header rows in my sheet).
I would ideally like to add a "-" to the list (to represent nothing selected in the cell) as default i.e. top of the list (i could add the symbol to my source data but that would look untidy). At the moment, after running the script all cell values change to 1.
Oh, what would the best way to modify the script so it selects a specific cell range? At the moment i have to first select a column, then run the script, then select the source cells, then click ok on the dialog box before it does the magic.
Someone else will be running the script, and if its easy to change, i would prefer to have an absolute source cell range values so the user can just rund the script without any selection required.
If you can advise on this, that would be most helpful.

Similar Messages

  • How to select a drop down option item while using logic:iterate?

    I am using the following peice of code -
    {color:#808080}+String countrySelected = (String)request.getAttribute("country");+
    +....+
    +<logic:iterate id="countryVO" name="countryList" type="com.sa.biz.vo.airport.CountryVO">+
    +<%+
    +if (countrySelected != null){+
    String countrySel = countryVO.getCountryCode().toString();
    String selected = (countrySel.equalsIgnoreCase(countrySelected)) ? " " "Selected" : " ";+
    +%>+
    +<option value="<%=countryVO.getCountryCode()%>*<%=selected%>*"><bean:write property="countryName" name="countryVO"/></option>+
    +<%+
    +}+
    +%>+{color}
    {color:#808080}+</logic:iterate>+
    {color}{color:#000000}The drop down is a list of country names (value - country code, display text - country name) which gets populated from the database. I need to ensure that the countrySelected is the menu item which gets selected in the drop down.
    The expected option item is not rendered as selected when i run this code? Please help!!{color}

    <option value="<%=countryVO.getCountryCode()%>" <%=selected%>>Apply the above change which should help you out on the same. :)
    REGARDS,
    RaHuL

  • Need help with Drop down cells on IPAD Numbers

    Hy everyone:
    Im new in this forum and Im not god writing, so sorry for my english.
    I have a question about using Drop down cells on Numbers in the IPAD version. In Numbers I normally can use drop down cell but some days ago i bought the IPAD and Iwork suit, and i import some numbers documents that I have done. When I tried to drop the menu of a cell I could not.
    I would like to know is their is a way to see this type of menus on IPAD Numbers.
    Thanks for the attention. And I will be grateful for your answers

    I don't think drop down selection is supported in iPad numbers. If you would like to see this functionality added, peas make a suggestion at http://www.apple.com/feedback
    Thanks
    Jason

  • How to display a drop down list

    how to display a drop down list when the user clicked (right click) on a JPanel or a JFrame

    how to display a drop down list when the user clicked
    (right click) on a JPanel or a JFrameI've not done it my self, I just looked it up:
    JComponent.setComponentPopupMenu(JPopupMenu popup).
    The menu doesn't showed automatically when I added it to a JComponent and tried to right click.
    I guess you could add a listener and call setVisible and setLocation for the menu in the listener, but there has to be an easier way...

  • How to add a drop-down menu to a rollover image?

    Hi,
    I guess my title says it all... I was wondering how to add a drop-down menu to a rollover image? I know that there's the sprymenu, but I need to have my own rollover images.
    Thanks,
    Kazem

    Frankly, ANY link can offer a drop down.
    Take a look at this turorial.
    That will get you your dropdown menu. So you have that.
    Now, on your top menu (or any level where you want to have an image instead of text do this:
    (I am copying the HTML structure in the tutorial here):
    <nav>
              <ul>
                        <li><a href="#">Home</a></li>
                        <li><a href="#">Tutorials</a>
                                  <ul>
                                            <li><a href="#">Photoshop</a></li>
                                            <li><a href="#">Illustrator</a></li>
                                            <li><a href="#">Web Design</a></li>
                                  </ul>
                        </li>
                        <li><a href="#">Articles</a>
                                  <ul>
                                            <li><a href="#">Web Design</a></li>
                                            <li><a href="#">User Experience</a></li>
                                  </ul>
                        </li>
                        <li><a href="#">Inspiration</a></li>
              </ul>
    </nav>
    Now, let's pretend you want an image instead of the word "Articles." You'll want the image to be sized appropriately, and if you look at the CSS, you'll see it's 112 pixels wide by 52 high. If your image is approximately those dimensions, you're all set.
    So instead of "articles" you insert your image.
    Done.

  • How to make each drop down a different color?

    I'm looking to do a menu similar to this: http://www.cca.edu/ and I can't figure out how to make each drop down a different color? Any help or resources greatly appreciated!

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Document sans nom</title>
    <script src="SpryAssets/SpryMenuBar.js" type="text/javascript"></script>
    <link href="SpryAssets/SpryMenuBarHorizontal.css" rel="stylesheet" type="text/css" />
    <style>
    ul.MenuBarHorizontal li#yellow ul a,
    ul.MenuBarHorizontal li#yellow a:hover, ul.MenuBarHorizontal li#yellow a:focus,
    ul.MenuBarHorizonta li#yellow a.MenuBarItemHover, ul.MenuBarHorizontal li#yellow a.MenuBarItemSubmenuHover, ul.MenuBarHorizontal li#yellow a.MenuBarSubmenuVisible {
        background-color: #FF6;
        color: #333;
    ul.MenuBarHorizontal li#yellow ul a:hover, ul.MenuBarHorizontal li#yellow ul a:focus,
    ul.MenuBarHorizonta li#yellow ul a.MenuBarItemHover, ul.MenuBarHorizontal li#yellow ul a.MenuBarItemSubmenuHover, ul.MenuBarHorizontal li#yellow ul a.MenuBarSubmenuVisible {
        background-color: #FF0;
        color: #333;
    ul.MenuBarHorizontal li#red ul a,
    ul.MenuBarHorizontal li#red a:hover, ul.MenuBarHorizontal li#red a:focus,
    ul.MenuBarHorizonta li#red a.MenuBarItemHover, ul.MenuBarHorizontal li#red a.MenuBarItemSubmenuHover, ul.MenuBarHorizontal li#red a.MenuBarSubmenuVisible {
        background-color: #F30;
        color: #333;
    ul.MenuBarHorizontal li#red ul a:hover, ul.MenuBarHorizontal li#red ul a:focus,
    ul.MenuBarHorizonta li#red ul a.MenuBarItemHover, ul.MenuBarHorizontal li#red ul a.MenuBarItemSubmenuHover, ul.MenuBarHorizontal li#red ul a.MenuBarSubmenuVisible {
        background-color: #F00;
        color: #333;
    ul.MenuBarHorizontal li#blue ul a,
    ul.MenuBarHorizontal li#blue a:hover, ul.MenuBarHorizontal li#blue a:focus,
    ul.MenuBarHorizonta li#blue a.MenuBarItemHover, ul.MenuBarHorizontal li#blue a.MenuBarItemSubmenuHover, ul.MenuBarHorizontal li#blue a.MenuBarSubmenuVisible {
        background-color: #6CC;
        color: #333;
    ul.MenuBarHorizontal li#blue ul a:hover, ul.MenuBarHorizontal li#blue ul a:focus,
    ul.MenuBarHorizonta li#blue ul a.MenuBarItemHover, ul.MenuBarHorizontal li#blue ul a.MenuBarItemSubmenuHover, ul.MenuBarHorizontal li#blue ul a.MenuBarSubmenuVisible {
        background-color: #00F;
        color: #333;
    ul.MenuBarHorizontal li#pink ul a,
    ul.MenuBarHorizontal li#pink a:hover, ul.MenuBarHorizontal li#pink a:focus,
    ul.MenuBarHorizonta li#pink a.MenuBarItemHover, ul.MenuBarHorizontal li#pink a.MenuBarItemSubmenuHover, ul.MenuBarHorizontal li#pink a.MenuBarSubmenuVisible {
        background-color: #F99;
        color: #333;
    ul.MenuBarHorizontal li#pink ul a:hover, ul.MenuBarHorizontal li#pink ul a:focus,
    ul.MenuBarHorizonta li#pink ul a.MenuBarItemHover, ul.MenuBarHorizontal li#pink ul a.MenuBarItemSubmenuHover, ul.MenuBarHorizontal li#pink ul a.MenuBarSubmenuVisible {
        background-color: #F36;
        color: #333;
    </style>
    </head>
    <body>
    <ul id="MenuBar1" class="MenuBarHorizontal">
      <li id="yellow"><a class="MenuBarItemSubmenu" href="#">Item 1</a>
        <ul>
          <li><a href="#">Item 1.1</a></li>
          <li><a href="#">Item 1.2</a></li>
          <li><a href="#">Item 1.3</a></li>
        </ul>
      </li>
      <li id="red"><a href="#">Item 2</a></li>
      <li id="blue"><a class="MenuBarItemSubmenu" href="#">Item 3</a>
        <ul>
          <li><a class="MenuBarItemSubmenu" href="#">Item 3.1</a>
            <ul>
              <li><a href="#">Item 3.1.1</a></li>
              <li><a href="#">Item 3.1.2</a></li>
            </ul>
          </li>
          <li><a href="#">Item 3.2</a></li>
          <li><a href="#">Item 3.3</a></li>
        </ul>
      </li>
      <li id="pink"><a href="#">Item 4</a></li>
    </ul>
    <script type="text/javascript">
    var MenuBar1 = new Spry.Widget.MenuBar("MenuBar1", {imgDown:"SpryAssets/SpryMenuBarDownHover.gif", imgRight:"SpryAssets/SpryMenuBarRightHover.gif"});
    </script>
    </body>
    </html>
    Gramps

  • How to make chooser drop down menu, Example i want choices 1 or 2 or 3 from the drop down menu or Location , Egypt , USA , Canda

    how to make chooser drop down menu, Example i want choices 1 or 2 or 3 from the drop down menu or Location , Egypt , USA , Canda

    Hello,
    Where do you want to insert it in Muse. Do you want to add this in Muse Form widget then you can use the widget mentioned in the link below.
    Forms+ Bundle Widget – Widgets.Mu
    If you want to insert it anywhere else in Muse and if you have the HTML codes for that then you can insert its codes in page from Object > Insert HTML.
    You may also require to use some java scripts to make them working as expected.
    How to Make JavaScript Dropdown List - YouTube
    Regards
    Vivek

  • How to change the drop down list "Category" in the Risk page (PWA 2013)

    Hello,
    How to change the drop down list "Category" in the Risk page of a Project Site. I need to change the list of elements.
    Thanks

    Hi Robert,
    You actually cannot edit the current template.
    The process is as follow: 
    create a brand new project site from the existing template,
    edit the site configuration (list, column, webparts, image, logo, theme...),
    save it as a template,
    associate it to an EPT.
    See reference below:
    http://blogs.msdn.com/b/brismith/archive/2010/03/15/customizing-the-project-site-in-project-server-2010.aspx
    Hope this helps,
    Guillaume Rouyre, MBA, MCP, MCTS |

  • How to open the Drop Down List on the "enter" event?

    I am trying to find a way for the users to see the expanded drop down list options without using their mouse to click on the down-arrow.
    I am able to add script to the "enter" event so when user key-broad-tabbed into the drop down field, the first items of the list shows up:
    dropdown1.selectedIndex = 0
    However, it would be nice if at the same time, they can also see the rest of the options within the drop down expanded.
    Any help/hints would be appreciated
    Thanks in advance
    p

    It would even be nice if the PDF could default with the small arrow already displaying instead of having having to click the field, then click the arrow. I'm just hoping adobe would add this in a future version.

  • I'm not techinal so please bear with me. I don't have the bar that allows me to type in a website. I did have a few minutes ago. When I make the page full screen and move my cursor to the top of the page, the bar drops down and I can use it.  help

    I'm not techinal so please bear with me. I don't have the bar that allows me to type in a website. I did have a few minutes ago. When I make the page full screen and move my cursor to the top of the page, the bar drops down and I can use it. I've tried restarting my computer, didn't work. Help!

    Well I figured it out, right click the arrow that makes the screen bigger and unclick the Hide Toolbar. I knew it couldn't be that hard.

  • I am creating a template with drop down menus in Numbers. I want to be able to insert options into the middle of my list at a later date if I need to, but I can only insert at the end of the drop down list. Is there a different program I could be using?

    I need to be able to add in more options into my drop down list in Numbers at a later time, not only at the bottom but say in the middle of the list. Should I be using a different program that can allow this to work? Thank you!

    This forum thread appears to point towards the problem.
    Re: Unable to Switch Audio Sync Settings

  • Hello, I would like to know how to add or delete single cell in numbers.

    Hello, I would like to know how to add or delete single cell in numbers.

    If by delete you really mean clear the contents of a cell, then just click once on the cell and hit the 'delete' button.
    Before:
    After hitting delete button:
    In some circumstances you can actually delete one cell.
    For example here, I make this choice:
    Resulting in this:
    So it's not strictly true that Numbers does not delete one cell, ever.  It can if you have a one-column table. 
    So never say never or not ever! Enough pedantry for today!
    SG

  • How to update field values in a database table using module pool prg?

    hi
    how to update field values in a database table using module pool prg?
    we created a customized table, and we put 2 push buttons in screen painter update and display.
    but update is not working?
    data is enter into screen fields and to internal table, but it is not updated in database table.
    thanks in adv
    vidya

    HI,
    we already used the update statement. but its not working.
    plz check this.
    *& Module Pool       ZCUST_CALL_REC
    PROGRAM  ZCUST_CALL_REC.
    TABLES: ZCUST_CALL_REC,ZREMARKS.
    data:  v_kun_low like ZCUST_CALL_REC-kunnr ,
           v_kun_high like ZCUST_CALL_REC-kunnr,
           v_bud_low like ZCUST_CALL_REC-budat,
           v_bud_high like ZCUST_CALL_REC-budat.
    ranges r_kunnr for ZCUST_CALL_REC-kunnr  .
    ranges r_budat for zcust_call_rec-budat.
    DATA: ITAB TYPE STANDARD TABLE OF ZCUST_CALL_REC WITH HEADER LINE,
          JTAB TYPE STANDARD TABLE OF ZREMARKS WITH HEADER LINE.
    *data:begin of itab occurs 0,
        MANDT LIKE ZCUST_CALL_REC-MANDT,
        kunnr like ZCUST_CALL_REC-kunnr,
        budat like ZCUST_CALL_REC-budat,
        code like ZCUST_CALL_REC-code,
        remarks like ZCUST_CALL_REC-remarks,
        end of itab.
    *data:begin of Jtab occurs 0,
        MANDT LIKE ZCUST_CALL_REC-MANDT,
        kunnr like ZCUST_CALL_REC-kunnr,
        budat like ZCUST_CALL_REC-budat,
        code like ZCUST_CALL_REC-code,
        remarks like ZCUST_CALL_REC-remarks,
        end of Jtab.
    CONTROLS:vcontrol TYPE TABLEVIEW USING SCREEN '9001'.
    CONTROLS:vcontrol1 TYPE TABLEVIEW USING SCREEN '9002'.
    *start-of-selection.
    *&      Module  USER_COMMAND_9000  INPUT
          text
    MODULE USER_COMMAND_9000 INPUT.
    CASE sy-ucomm.
    WHEN 'BACK' OR 'EXIT' OR 'CANCEL'.
    SET SCREEN 0.
    LEAVE SCREEN.
    CLEAR sy-ucomm.
    WHEN 'ENQUIRY'.
    perform multiple_selection.
    perform append_CUSTOMER_code.
    PERFORM SELECT_DATA.
    call screen '9001'.
    WHEN 'UPDATE'.
          perform append_CUSTOMER_code.
          PERFORM SELECT_DATA.
          call screen '9002'.
          perform update on commit.
    WHEN 'DELETE'.
          perform append_CUSTOMER_code.
          PERFORM SELECT_DATA.
          call screen '9002'.
    ENDCASE.
    ENDMODULE.                 " USER_COMMAND_9000  INPUT
    *&      Module  STATUS_9000  OUTPUT
          text
    MODULE STATUS_9000 OUTPUT.
      SET PF-STATUS 'ZCUSTOMER'.
    SET TITLEBAR 'xxx'.
    ENDMODULE.                 " STATUS_9000  OUTPUT
    *&      Module  USER_COMMAND_9001  INPUT
          text
    MODULE USER_COMMAND_9001 INPUT.
    CASE sy-ucomm.
    WHEN 'BACK' OR 'EXIT' OR 'CANCEL'.
    SET SCREEN 0.
    LEAVE SCREEN.
    CLEAR sy-ucomm.
    endcase.
    ENDMODULE.                 " USER_COMMAND_9001  INPUT
    *&      Module  STATUS_9001  OUTPUT
          text
    MODULE STATUS_9001 OUTPUT.
      SET PF-STATUS 'ZCUSTOMER'.
    SET TITLEBAR 'xxx'.
    move itab-MANDT   to zcust_call_rec-MANDT.
    move itab-kunnr   to zcust_call_rec-kunnr.
    move itab-budat   to zcust_call_rec-budat.
    move itab-code    to zcust_call_rec-code.
    move itab-remarks to zcust_call_rec-remarks.
    vcontrol-lines = sy-dbcnt.
    ENDMODULE.                 " STATUS_9001  OUTPUT
    *&      Module  USER_COMMAND_9002  INPUT
          text
    module  USER_COMMAND_9002 input.
    CASE sy-ucomm.
       WHEN 'BACK' OR 'EXIT' OR 'CANCEL'.
          SET SCREEN 0.
          LEAVE SCREEN.
          CLEAR sy-ucomm.
       WHEN 'UPDATE'.
             perform move_data.
         UPDATE ZCUST_CALL_REC FROM TABLE ITAB.
            IF SY-SUBRC = 0.
               MESSAGE I000(0) WITH 'RECORDS ARE UPDATED'.
             ELSE.
               MESSAGE E001(0) WITH 'RECORDS ARE NOT UPDATED'.
            ENDIF.
      WHEN 'DELETE'.
             perform move_data.
             DELETE ZCUST_CALL_REC FROM TABLE ITAB.
              IF SY-SUBRC = 0.
               MESSAGE I000(0) WITH 'RECORDS ARE DELETED'.
             ELSE.
               MESSAGE E001(0) WITH 'RECORDS ARE NOT DELETED'.
            ENDIF.
    endcase.
    endmodule.                 " USER_COMMAND_9002  INPUT
    *&      Module  STATUS_9002  OUTPUT
          text
    module STATUS_9002 output.
      SET PF-STATUS 'ZCUSTOMER1'.
    SET TITLEBAR 'xxx'.
    endmodule.                 " STATUS_9002  OUTPUT
    *&      Module  update_table  OUTPUT
          text
    module update_table output.
         move itab-MANDT   to zcust_call_rec-MANDT.
         move itab-kunnr   to zcust_call_rec-kunnr.
         move itab-budat   to zcust_call_rec-budat.
         move itab-code    to zcust_call_rec-code.
         move itab-remarks to zcust_call_rec-remarks.
    vcontrol-lines = sy-dbcnt.
    endmodule.                 " update_table  OUTPUT
    ***Selection Data
    FORM SELECT_DATA.
    SELECT  mandt kunnr budat code remarks  FROM zcust_call_rec INTO
                            table itab
                             WHERE kunnr IN r_kunnr AND BUDAT IN R_BUDAT.
    ENDFORM.
    ****append vendor code
    FORM APPEND_CUSTOMER_CODE.
    clear r_kunnr.
    clear itab.
    clear r_budat.
    refresh r_kunnr.
    refresh itab.
    refresh r_kunnr.
    IF r_kunnr  IS INITIAL
                  AND NOT v_kun_low IS INITIAL
                   AND NOT v_kun_high IS INITIAL.
                        CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
                                    EXPORTING
                                       input         = v_kun_low
                                    IMPORTING
                                       OUTPUT        = r_kunnr-low.
                       CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
                                  EXPORTING
                                      input         = v_kun_high
                                  IMPORTING
                                      OUTPUT        = r_kunnr-high.
                     r_kunnr-option = 'BT'.
                     r_kunnr-sign = 'I'.
                     append r_kunnr.
       PERFORM V_BUDAT.
    ELSEIF r_kunnr  IS INITIAL
                  AND NOT v_kun_low IS INITIAL
                   AND  v_kun_high IS INITIAL.
                        CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
                                    EXPORTING
                                       input         = v_kun_low
                                    IMPORTING
                                       OUTPUT        = r_kunnr-low.
                    r_kunnr-SIGN = 'I'.
                    r_kunnr-OPTION = 'EQ'.
                    APPEND r_kunnr.
       PERFORM V_BUDAT.
    ELSEIF r_kunnr IS INITIAL
                  AND  v_kun_low IS INITIAL
                   AND NOT v_kun_high IS INITIAL.
                        CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
                                    EXPORTING
                                       input         = v_kun_low
                                    IMPORTING
                                       OUTPUT        = r_kunnr-low.
                    r_kunnr-SIGN = 'I'.
                    r_kunnr-OPTION = 'EQ'.
                    APPEND r_kunnr.
          PERFORM V_BUDAT.
    ELSEIF r_kunnr IS INITIAL
                  AND  v_kun_low IS INITIAL
                   AND  v_kun_high IS INITIAL.
                        IF SY-SUBRC = 0.
                             MESSAGE I003(0) WITH 'ENTER CUSTOMER NUMBER'.
                              CALL SCREEN '9000'.
                        ENDIF.
    PERFORM V_BUDAT.
    ENDIF.
    ENDFORM.
    FORM V_BUDAT.
    IF  R_BUDAT IS INITIAL
                   AND NOT v_BUD_low IS INITIAL
                   AND NOT v_BUD_high IS INITIAL.
                     r_budat-low = v_bud_low.
                     r_budat-high = v_bud_high.
                     r_budat-option = 'BT'.
                     r_budat-sign = 'I'.
                     append r_budat.
             ELSEIF  R_BUDAT IS INITIAL
                   AND NOT v_BUD_low IS INITIAL
                   AND  v_BUD_high IS INITIAL.
                     r_budat-low = v_bud_low.
                     r_budat-high = v_bud_high.
                     r_budat-option = 'EQ'.
                     r_budat-sign = 'I'.
                     append r_budat.
             ELSEIF  R_BUDAT IS INITIAL
                   AND  v_BUD_low IS INITIAL
                   AND NOT v_BUD_high IS INITIAL.
                     r_budat-HIGH = v_bud_HIGH.
                     r_budat-option = 'EQ'.
                     r_budat-sign = 'I'.
                     append r_budat.
              ELSEIF  R_BUDAT IS INITIAL
                   AND  v_BUD_low IS INITIAL
                   AND  v_BUD_high IS INITIAL.
                   IF SY-SUBRC = 0.
                       MESSAGE I002(0) WITH 'ENTER POSTING DATE'.
                      CALL SCREEN '9000'.
                    r_budat-low = ''.
                    r_budat-option = ''.
                    r_budat-sign = ''.
                    ENDIF.
            ENDIF.
    ENDFORM.
    *&      Form  update
          text
    -->  p1        text
    <--  p2        text
    form update .
    commit work.
    endform.                    " update
    *&      Form  move_data
          text
    -->  p1        text
    <--  p2        text
    form move_data .
       clear itab.
      refresh itab.
           move-corresponding  zcust_call_rec to itab.
           MOVE ZCUST_CALL_REC-MANDT   TO ITAB-MANDT.
           MOVE ZCUST_CALL_REC-KUNNR   TO ITAB-KUNNR.
           MOVE ZCUST_CALL_REC-BUDAT   TO ITAB-BUDAT.
           MOVE ZCUST_CALL_REC-CODE    TO ITAB-CODE.
           MOVE ZCUST_CALL_REC-REMARKS TO ITAB-REMARKS.
         APPEND ITAB.
         delete itab where kunnr is initial.
    endform.                    " move_data
    thanks in adv
    vidya

  • How to update transaction data automatically into MySQL database using PI

    Dear All,
    With reference to subject matter I want a sincere advice regarding how to update transaction data automatically into MySQL database using PI. Is there any link available where I can get step-by-step process.
    Ex: I have a MYSQL database in my organization. Whenever a delivery created in SAP some fields like DO Number, DO quantity, SO/STO number should get updated in MYSQL database automatically.
    This scenario is related to updation of transactional data into MYSQL DB and I want your suggestions pertaining to same issue.
    Thanks and Regards,
    Chandra Sekhar

    Hi .
    Develop a sceanrio between SAP to Database system,When the data updates in SAP Tables read the data and update it in DATA Base using JDBC adapter,but there will be some delay in updating data in MySQL.
    serach in sdn for IDOC-TOJDBC sceannario,many documents available for the same.
    Regards,
    Raja Sekhar

  • How to create a drop down box and text box in screen painter?

    Hi i am totally new to this concept of screen painter..please can any tell me
    how to create drop down box in screen painter?
    How to create or display default date and time values?
    How to create text box for giving comments?
    How to store the records that we are entering in a table?
    Please can any one send me the procedure for creating all these its very urgent useful information will be surely rewarded.

    Hi,
    Check all these.
    1.how to create drop down box in screen painter?
    To get Drop Drown Box on screen .
    Follow these steps.
    1.
    Go to T.Code SE51 and Select Laypout for the Screen.
    2.
    Double click on the field for which u want Dropdown box.
    3.
    Then U will see Name ,Text ,DROPDOWN.Click on that and select List Box or ListBox with key . Better to to select first one.
    4.
    Save and Activate ur screen .
    5.
    Enter the following piece of code in the PBO of the screen.(Change for ur requirement).
    6.
    The following code should be written under PROCESS BEFORE EVENT in the MODULE.
    TYPE-POOLS :vrm.
    DATA:
      i_natio TYPE vrm_values, "-->Table that is passed through FM vrm_set_values
      w_natio LIKE LINE OF i_natio.
    DATA:
    BEGIN OF i_t005t OCCURS 0,
        land1 TYPE t005t-land1,
        natio TYPE t005t-natio,
    END OF i_t005t.
    IF i_t005t[] IS INITIAL.
      SELECT land1 natio
         FROM t005t
           INTO TABLE i_t005t
       WHERE spras = sy-langu.
      IF sy-subrc = 0.
      LOOP AT i_t005t .
          w_natio-key = i_t005t-land1.
          w_natio-text = i_t005t-natio.
          APPEND w_natio TO i_natio.
          CLEAR w_natio.
      ENDLOOP.
      ENDIF.
    ENDIF.
    CALL FUNCTION 'VRM_SET_VALUES'
    EXPORTING
                          id = 'I_IT0002-NATIO' "-->Field for which dropdown is needed.
                    values = i_natio
    EXCEPTIONS
       id_illegal_name = 1
                OTHERS = 2.
    IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    * WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    2.1.How to create or display default date and time values?
    1.
    create input field for DATE and TIME on screen.ex. DATE1 and TIME1 are screen field names .
    2.
    Just assign SY-DATUM to DATE1 and SY-UZEIT to TIME1 under PROCESS BEFORE EVENT.
    3.How to create text box for giving comments?
    1.
    Define one variable in the TOP include with type STRING means Global variable.
    2.
    Create one input field by giving screen field name which u have defined in the above step.
    4.How to store the records that we are entering in a table?
    For this case.. Create one table control. you can select one record and create record in the Z table by pressing button on Application toolbar..
    Check the following steps to handle Table control.
    1).
    U should take one variable in your internal table or in structure which
    is used for table control fields
    ex :
    data :
    begin of itab occurs 0 ,
        mark type c , "This is to select the record.
        matnr like mara-matnr ,
        matkl like mara-matkl,
        maktx like makt-maktx,
    end of itab .
    Controls: TABC types TABLEVIEW using screen 100.
    2).
    This mark variable should be given in Table control properties.
    follow the path
    double click on the table control-->attributes .->select
    w/SelColumn and in that itab-mark. Check in the figure.
    [Table control properties screen|http://bp2.blogger.com/_O5f8iAlgdNQ/R99gOUH8CXI/AAAAAAAAA9I/d3gOum1fJ6s/s1600-h/pic28145-796618.jpg]
    3).
    After that. Take this example.
    PROCESS BEFORE OUTPUT.
    MODULE STATUS_0100.
    LOOP AT ITAB WITH CONTROL tabc
    ENDLOOP.
    PROCESS AFTER INPUT.
    MODULE CANCEL AT EXIT-COMMAND.
    LOOP AT ITAB.
       Module read_table_control.
    ENDLOOP.
    module user_command_0100.
    In this Module read_table_control, You should write the following code
    MODULE read_table_control INPUT.
    MODIFY itab INDEX tabc-current_line."( This will update the
    "ITAB table MARK field with 'X ' whatever we have selected
    "on table control.)
    ENDMODULE.
    4)
    If you want to Delete some of the records from Table control
    follow this code …Create one pushbutton and give Fucnction code to that
    and write below code
    CASE OKCODE.
    WHEN 'CREATE'.
    LOOP AT itab WHERE mark = 'X'.
    "Use UPDATE statement to create new record.
    ENDLOOP.
    ENDCASE.
    I hope that you will get something.
    Regards,
    Venkat.O

Maybe you are looking for