Guest User

Untitled

a guest
Nov 13th, 2017
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Action()
  2. {
  3.  
  4.     sapgui_open_connection_ex(connection_string1,
  5.         "",
  6.         "con[0]");
  7.  
  8.     sapgui_select_active_connection("con[0]");
  9.  
  10.     sapgui_select_active_session("ses[0]");
  11.  
  12.     sapgui_select_active_window("wnd[0]");
  13.  
  14.     sapgui_window_resize("149",
  15.         "25",
  16.         BEGIN_OPTIONAL,
  17.             "AdditionalInfo=sapgui104",
  18.         END_OPTIONAL);
  19.  
  20.     /*Before running script, enter password in place of asterisks in logon function*/
  21.  
  22.     lr_think_time(4);
  23.  
  24.     sapgui_logon("NWBCUSER",
  25.         "mercury",
  26.         "800",
  27.         "EN",
  28.         BEGIN_OPTIONAL,
  29.             "AdditionalInfo=sapgui1012",
  30.         END_OPTIONAL);
  31.  
  32.     sapgui_tree_set_selected_node("VA01 - Create Sales Order",
  33.         shell1,
  34.         "F00003",
  35.         BEGIN_OPTIONAL,
  36.             "AdditionalNodeInfo=Favorites;VA01 - Create Sales Order",
  37.             "AdditionalInfo=sapgui1013",
  38.         END_OPTIONAL);
  39.  
  40.     sapgui_tree_double_click_node("VA01 - Create Sales Order",
  41.         shell1,
  42.         "F00003",
  43.         BEGIN_OPTIONAL,
  44.             "AdditionalNodeInfo=Favorites;VA01 - Create Sales Order",
  45.             "AdditionalInfo=sapgui1014",
  46.         END_OPTIONAL);
  47.  
  48.     lr_think_time(4);
  49.  
  50.     sapgui_set_text("VBAK-AUART",
  51.         "12",
  52.         ctxtVBAK1,
  53.         BEGIN_OPTIONAL,
  54.             "AdditionalInfo=sapgui1017",
  55.         END_OPTIONAL);
  56.  
  57.     sapgui_set_text("Sales Organization",
  58.         "ss",
  59.         ctxtVBAK2,
  60.         BEGIN_OPTIONAL,
  61.             "AdditionalInfo=sapgui1018",
  62.         END_OPTIONAL);
  63.  
  64.     sapgui_set_focus(ctxtVBAK2,
  65.         BEGIN_OPTIONAL,
  66.             "AdditionalInfo=sapgui1019",
  67.         END_OPTIONAL);
  68.  
  69.     sapgui_send_vkey(F4,
  70.         BEGIN_OPTIONAL,
  71.             "AdditionalInfo=sapgui1021",
  72.         END_OPTIONAL);
  73.  
  74.     sapgui_select_active_window("wnd[1]");
  75.  
  76.     sapgui_window_scroll_to_row("0",
  77.         BEGIN_OPTIONAL,
  78.             "AdditionalInfo=sapgui1025",
  79.         END_OPTIONAL);
  80.  
  81.     sapgui_set_focus(lbl1,
  82.         BEGIN_OPTIONAL,
  83.             "AdditionalInfo=sapgui1024",
  84.         END_OPTIONAL);
  85.  
  86.     sapgui_send_vkey(F2,
  87.         BEGIN_OPTIONAL,
  88.             "AdditionalInfo=sapgui1028",
  89.         END_OPTIONAL);
  90.  
  91.     sapgui_select_active_window("wnd[0]");
  92.  
  93.     sapgui_set_focus(ctxtVBAK3,
  94.         BEGIN_OPTIONAL,
  95.             "AdditionalInfo=sapgui1031",
  96.         END_OPTIONAL);
  97.  
  98.     sapgui_send_vkey(F4,
  99.         BEGIN_OPTIONAL,
  100.             "AdditionalInfo=sapgui1033",
  101.         END_OPTIONAL);
  102.  
  103.     sapgui_select_active_window("wnd[1]");
  104.  
  105.     sapgui_window_scroll_to_row("0",
  106.         BEGIN_OPTIONAL,
  107.             "AdditionalInfo=sapgui1037",
  108.         END_OPTIONAL);
  109.  
  110.     sapgui_set_focus(lbl2,
  111.         BEGIN_OPTIONAL,
  112.             "AdditionalInfo=sapgui1036",
  113.         END_OPTIONAL);
  114.  
  115.     sapgui_send_vkey(F2,
  116.         BEGIN_OPTIONAL,
  117.             "AdditionalInfo=sapgui1040",
  118.         END_OPTIONAL);
  119.  
  120.     sapgui_select_active_window("wnd[0]");
  121.  
  122.     sapgui_set_focus(ctxtVBAK4,
  123.         BEGIN_OPTIONAL,
  124.             "AdditionalInfo=sapgui1043",
  125.         END_OPTIONAL);
  126.  
  127.     sapgui_send_vkey(F4,
  128.         BEGIN_OPTIONAL,
  129.             "AdditionalInfo=sapgui1045",
  130.         END_OPTIONAL);
  131.  
  132.     sapgui_select_active_window("wnd[1]");
  133.  
  134.     sapgui_window_scroll_to_row("0",
  135.         BEGIN_OPTIONAL,
  136.             "AdditionalInfo=sapgui1049",
  137.         END_OPTIONAL);
  138.  
  139.     sapgui_set_focus(lbl3,
  140.         BEGIN_OPTIONAL,
  141.             "AdditionalInfo=sapgui1048",
  142.         END_OPTIONAL);
  143.  
  144.     sapgui_send_vkey(F2,
  145.         BEGIN_OPTIONAL,
  146.             "AdditionalInfo=sapgui1052",
  147.         END_OPTIONAL);
  148.  
  149.     sapgui_select_active_window("wnd[0]");
  150.  
  151.     sapgui_set_focus(ctxtVBAK5,
  152.         BEGIN_OPTIONAL,
  153.             "AdditionalInfo=sapgui1055",
  154.         END_OPTIONAL);
  155.  
  156.     sapgui_send_vkey(F4,
  157.         BEGIN_OPTIONAL,
  158.             "AdditionalInfo=sapgui1057",
  159.         END_OPTIONAL);
  160.  
  161.     sapgui_select_active_window("wnd[1]");
  162.  
  163.     sapgui_press_button("Continue   (Enter)",
  164.         btn1,
  165.         BEGIN_OPTIONAL,
  166.             "AdditionalInfo=sapgui1060",
  167.         END_OPTIONAL);
  168.  
  169.     sapgui_press_button("Continue   (Enter)",
  170.         btn1,
  171.         BEGIN_OPTIONAL,
  172.             "AdditionalInfo=sapgui1063",
  173.         END_OPTIONAL);
  174.  
  175.     sapgui_set_focus(ctxtG_SELFLD_TAB1,
  176.         BEGIN_OPTIONAL,
  177.             "AdditionalInfo=sapgui1066",
  178.         END_OPTIONAL);
  179.  
  180.     sapgui_send_vkey(F2,
  181.         BEGIN_OPTIONAL,
  182.             "AdditionalInfo=sapgui1068",
  183.         END_OPTIONAL);
  184.  
  185.     sapgui_select_active_window("wnd[2]");
  186.  
  187.     sapgui_window_close(
  188.         BEGIN_OPTIONAL,
  189.             "AdditionalInfo=sapgui1071",
  190.         END_OPTIONAL);
  191.  
  192.     sapgui_select_active_window("wnd[1]");
  193.  
  194.     sapgui_set_focus(txtG_SELFLD_TAB1,
  195.         BEGIN_OPTIONAL,
  196.             "AdditionalInfo=sapgui1074",
  197.         END_OPTIONAL);
  198.  
  199.     sapgui_send_vkey(F2,
  200.         BEGIN_OPTIONAL,
  201.             "AdditionalInfo=sapgui1076",
  202.         END_OPTIONAL);
  203.  
  204.     sapgui_select_active_window("wnd[2]");
  205.  
  206.     sapgui_grid_select_cell("'Sales Office' (2, Description)",
  207.         shell2,
  208.         "2",
  209.         "TEXT",
  210.         BEGIN_OPTIONAL,
  211.             "AdditionalInfo=sapgui1079",
  212.         END_OPTIONAL);
  213.  
  214.     sapgui_grid_select_rows("'Sales Office', 2",
  215.         shell2,
  216.         "2",
  217.         BEGIN_OPTIONAL,
  218.             "AdditionalInfo=sapgui1080",
  219.         END_OPTIONAL);
  220.  
  221.     sapgui_grid_double_click_current_cell("'Sales Office' (2, Description)",
  222.         shell2,
  223.         BEGIN_OPTIONAL,
  224.             "CurrentRow=2",
  225.             "CurrentCell=TEXT",
  226.             "AdditionalInfo=sapgui1081",
  227.         END_OPTIONAL);
  228.  
  229.     sapgui_select_active_window("wnd[1]");
  230.  
  231.     sapgui_set_focus(txtG_SELFLD_TAB1,
  232.         BEGIN_OPTIONAL,
  233.             "AdditionalInfo=sapgui1084",
  234.         END_OPTIONAL);
  235.  
  236.     sapgui_press_button("Cancel   (F12)",
  237.         btn2,
  238.         BEGIN_OPTIONAL,
  239.             "AdditionalInfo=sapgui1086",
  240.         END_OPTIONAL);
  241.  
  242.     sapgui_select_active_window("wnd[0]");
  243.  
  244.     sapgui_send_vkey(F4,
  245.         BEGIN_OPTIONAL,
  246.             "AdditionalInfo=sapgui1089",
  247.         END_OPTIONAL);
  248.  
  249.     sapgui_select_active_window("wnd[1]");
  250.  
  251.     sapgui_window_close(
  252.         BEGIN_OPTIONAL,
  253.             "AdditionalInfo=sapgui1092",
  254.         END_OPTIONAL);
  255.  
  256.     sapgui_select_active_window("wnd[0]");
  257.  
  258.     sapgui_status_bar_get_text("paramStatusBarText",
  259.         BEGIN_OPTIONAL,
  260.             "Recorded status bar text: Choose a valid function",
  261.             "AdditionalInfo=sapgui1097",
  262.         END_OPTIONAL);
  263.  
  264.     lr_think_time(6);
  265.  
  266.     sapgui_set_text("Sales Office",
  267.         "1",
  268.         ctxtVBAK5,
  269.         BEGIN_OPTIONAL,
  270.             "AdditionalInfo=sapgui1098",
  271.         END_OPTIONAL);
  272.  
  273.     sapgui_set_text("Sales Group",
  274.         "2",
  275.         ctxtVBAK6,
  276.         BEGIN_OPTIONAL,
  277.             "AdditionalInfo=sapgui1099",
  278.         END_OPTIONAL);
  279.  
  280.     sapgui_set_focus(ctxtVBAK6,
  281.         BEGIN_OPTIONAL,
  282.             "AdditionalInfo=sapgui10100",
  283.         END_OPTIONAL);
  284.  
  285.     sapgui_press_button("Back   (F3)",
  286.         btn3,
  287.         BEGIN_OPTIONAL,
  288.             "AdditionalInfo=sapgui10102",
  289.         END_OPTIONAL);
  290.  
  291.     sapgui_press_button("Log off   (Shift+F3)",
  292.         btn4,
  293.         BEGIN_OPTIONAL,
  294.             "AdditionalInfo=sapgui10105",
  295.         END_OPTIONAL);
  296.  
  297.     sapgui_select_active_window("wnd[1]");
  298.  
  299.     sapgui_press_button("Yes",
  300.         btnSPOP1,
  301.         BEGIN_OPTIONAL,
  302.             "AdditionalInfo=sapgui10108",
  303.         END_OPTIONAL);
  304.  
  305.     return 0;
  306. }
Add Comment
Please, Sign In to add comment