Help with this total number

hi to all experts,
i have a requirement to print the sub total of quantity  for a particular delievery order and material . but im not getting the exact quantity ( it should be  65000) im getting 780000 what might be the error.It is happening only in DO for others the quantity is correct . what might be the error. Please help me with this issue . Here is the report
TABLES: vbak, vbrk.
TABLES: likp. "CN5
DATA: BEGIN OF t_itab OCCURS 50,
        vbeln LIKE vbrk-vbeln,
        kunag LIKE vbrk-kunag,
        name1 LIKE kna1-name1,
        fkdat LIKE vbrk-fkdat,
        kunnr LIKE likp-kunnr, "CN5
      END OF t_itab.
DATA: BEGIN OF t_itab1 OCCURS 50,
        name1 LIKE kna1-name1,
        fkdat LIKE vbrk-fkdat,
        vbeln LIKE vbrp-vbeln,
        venum LIKE vekp-venum,
        matnr LIKE vbrp-matnr,
*    start insert CN4
        matwa LIKE vbrp-matwa,
*    end insert CN4
        vhilm LIKE vekp-vhilm,
        zuonr LIKE vbrk-zuonr,
        ihrez LIKE vbkd-ihrez,
        posnr LIKE vbrp-posnr,
        aubel LIKE vbrp-aubel,
        aupos LIKE vbrp-aupos,
        vgbel LIKE vbrp-vgbel,
        maktx LIKE makt-maktx,
        desctn LIKE makt-maktx,
        bstkd LIKE vbkd-bstkd,
*        ihrez LIKE vbkd-ihrez,
        vemng TYPE p,
        brgew LIKE vekp-brgew,
        ntgew LIKE vekp-ntgew,
*        tavol LIKE vekp-tavol,
        tavol TYPE p DECIMALS 5,
        ctnno TYPE i,
        kunag LIKE vbrk-kunag,
        kunnr LIKE likp-kunnr, "CN5
      END OF t_itab1.
DATA: BEGIN OF t_canc OCCURS 50,
        sfakn LIKE vbrk-sfakn,
        fkart LIKE vbrk-fkart,
      END OF t_canc.
DATA: t_disp LIKE t_itab1 OCCURS 50 WITH HEADER LINE.
DATA: t_disp1 LIKE t_itab1 OCCURS 50 WITH HEADER LINE.
DATA: g_date(10),
      g_tot_ctnno TYPE i,
      g_tot_vemng TYPE p,
      g_tot_brgew LIKE vekp-brgew,
      g_tot_ntgew LIKE vekp-ntgew,
*      g_tot_tavol LIKE vekp-tavol,
      g_tot_tavol TYPE p DECIMALS 5,
      g_gtot_ctnno TYPE i,
      g_gtot_vemng TYPE p,
      g_gtot_brgew LIKE vekp-brgew,
      g_gtot_ntgew LIKE vekp-ntgew,
*      g_gtot_tavol LIKE vekp-tavol.
      g_gtot_tavol TYPE p DECIMALS 5.
SELECTION-SCREEN BEGIN OF BLOCK mysel WITH FRAME TITLE text-003.
SELECT-OPTIONS:
  p_vkorg FOR vbak-vkorg OBLIGATORY,
  date FOR sy-datum OBLIGATORY.
*--> Start delete "CN6
*  cust FOR vbrk-kunag,
*<--End delete "CN6
*--> Start insert "CN6
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS sold RADIOBUTTON GROUP pt.      "Sold To Party
SELECTION-SCREEN COMMENT 3(20) text-001 FOR FIELD sold.
SELECTION-SCREEN POSITION 45.
PARAMETERS ship RADIOBUTTON GROUP pt.     "Ship To Party
SELECTION-SCREEN COMMENT 48(20) text-002 FOR FIELD ship.
SELECTION-SCREEN END OF LINE.
*<-- End insert "CN6
SELECT-OPTIONS : so_kunnr FOR likp-kunnr.  "CN5
SELECTION-SCREEN END OF BLOCK mysel.
*         START-OF-SELECTION.                                          *
START-OF-SELECTION.
  PERFORM get_data.
  PERFORM get_disp_data.
  PERFORM refresh_data.
  PERFORM display_rep.
*&      Form  CheckAuthority
*       text
*      -->VKORG      text
*      -->VTWEG      text
FORM checkauthority USING vkorg vtweg.
  CALL FUNCTION 'Z_AUTHORITY_CHECK'
    EXPORTING
      module             = 'SD'
      vkorg              = vkorg
*     EKORG              =
*     WERKS              =
*     BUKRS              =
      vtweg              = vtweg
*     SPART              =
*     PRCTR              =
    EXCEPTIONS
      no_authority       = 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.
ENDFORM.                    "CheckAuthority
*       FORM get_data                                                 *
FORM get_data.
*--> Start delete "CN6
*  DATA:chrvkorg LIKE vbrk-vkorg,
*       chrvtweg LIKE vbrk-vtweg.
*<--End delete "CN6
*--> Start insert "CN6
  DATA: BEGIN OF l_vbrk OCCURS 0,
          vbeln LIKE t_itab-vbeln,
          fkdat LIKE t_itab-fkdat,
          kunnr LIKE t_itab-kunnr,
          chrvkorg LIKE vbrk-vkorg,
          chrvtweg LIKE vbrk-vtweg,
        END OF l_vbrk.
*<--End insert "CN6
*--> Start delete "CN5
*  SELECT vbeln fkdat kunag vkorg vtweg INTO (t_itab-vbeln, t_itab-fkdat,
*                                             t_itab-kunag, chrvkorg, chrvtweg)
*                           FROM vbrk  WHERE fkdat IN date
*                                        AND kunag IN cust
*                                        AND vkorg IN p_vkorg
*                                        AND fkart = 'ZF2'.
*<--End delete "CN5
*--> Start delete "CN6
*--> Start insert "CN5
*  SELECT a~vbeln a~fkdat a~kunag a~vkorg a~vtweg c~kunnr
*    INTO (t_itab-vbeln, t_itab-fkdat, t_itab-kunag, chrvkorg, chrvtweg, t_itab-kunnr)
*    FROM vbrk AS a
*    INNER JOIN vbrp AS b ON a~vbeln = b~vbeln
*    INNER JOIN likp AS c ON b~vgbel = c~vbeln
*    WHERE a~fkdat IN date
*      AND a~kunag IN cust
*      AND a~vkorg IN p_vkorg
*      AND a~fkart = 'ZF2'
*      AND c~kunnr IN so_kunnr.
*<--End insert "CN5
*<--End delete "CN6
*--> Start insert "CN6
  IF sold ='X'.
    SELECT vbeln fkdat kunag vkorg vtweg
      INTO TABLE l_vbrk
      FROM vbrk
      WHERE fkdat IN date
        AND vkorg IN p_vkorg
        AND fkart = 'ZF2'
        AND kunag IN so_kunnr.
  ELSEIF ship = 'X'.
    SELECT a~vbeln a~fkdat c~kunnr a~vkorg a~vtweg
      INTO TABLE l_vbrk
      FROM vbrk AS a
      INNER JOIN vbrp AS b ON a~vbeln = b~vbeln
      INNER JOIN likp AS c ON b~vgbel = c~vbeln
      WHERE a~fkdat IN date
      AND a~vkorg IN p_vkorg
      AND a~fkart = 'ZF2'
      AND c~kunnr IN so_kunnr.
  ENDIF.
  LOOP AT l_vbrk.
    t_itab-vbeln = l_vbrk-vbeln.
    t_itab-fkdat = l_vbrk-fkdat.
    t_itab-kunnr = l_vbrk-kunnr.
*<--End insert "CN6
    PERFORM checkauthority USING l_vbrk-chrvkorg l_vbrk-chrvtweg.
    IF sy-subrc = 0.
      APPEND t_itab.
      CLEAR t_itab.
    ENDIF.
*    CLEAR chrvtweg.   "CN6
  ENDLOOP.    "CN6
  PERFORM check_cancelled_doc.
  LOOP AT t_itab.
    SELECT SINGLE name1 INTO (t_itab-name1)
                        FROM kna1
*                        WHERE kunnr = t_itab-kunag. "CN5
                        WHERE kunnr = t_itab-kunnr. "CN5
    MODIFY t_itab.
    CLEAR t_itab.
  ENDLOOP.
  PERFORM get_data1.
  PERFORM get_data2.
ENDFORM.                    "get_data
*       FORM check_cancelled_doc                                      *
FORM check_cancelled_doc.
*--> Start delete "CN6
*SELECT fkart sfakn INTO (t_canc-fkart, t_canc-sfakn)
*                       FROM vbrk WHERE fkdat IN date
*                                 AND   kunag IN so_kunnr
*                                 AND   vkorg IN p_vkorg
*                                 AND   fkart = 'ZS1'.
*      APPEND t_canc.
*      CLEAR t_canc.
*    ENDSELECT.
*<-- End delete "CN6
*--> Start insert "CN6
  IF sold ='X'.
    SELECT fkart sfakn INTO (t_canc-fkart, t_canc-sfakn)
                       FROM vbrk WHERE fkdat IN date
                                 AND   kunag IN so_kunnr
                                 AND   vkorg IN p_vkorg
                                 AND   fkart = 'ZS1'.
      APPEND t_canc.
      CLEAR t_canc.
    ENDSELECT.
  ELSE.
    SELECT fkart sfakn INTO (t_canc-fkart, t_canc-sfakn)
                      FROM vbrk WHERE fkdat IN date
                                AND   vkorg IN p_vkorg
                                AND   fkart = 'ZS1'.
      APPEND t_canc.
      CLEAR t_canc.
    ENDSELECT.
  ENDIF.
*<-- End insert "CN6
  LOOP AT t_itab.
    READ TABLE t_canc WITH KEY sfakn = t_itab-vbeln.
    IF sy-subrc = 0.
      DELETE t_itab WHERE vbeln = t_canc-sfakn.
    ENDIF.
  ENDLOOP.
ENDFORM.                    "check_cancelled_doc
*       FORM get_data1                                                *
FORM get_data1.
  LOOP AT t_itab.
*--> Start insert "CN6
    t_itab1-kunnr = t_itab-kunnr.
*<-- End insert "CN6
* start delete CN4
*    SELECT vbeln posnr matnr aubel aupos vgbel
*                  INTO (t_itab1-vbeln, t_itab1-posnr,
*                        t_itab1-matnr, t_itab1-aubel, t_itab1-aupos, t_itab1-vgbel)
*                  FROM vbrp
*                  WHERE vbeln = t_itab-vbeln.
* end delete CN4
*  start insert CN4
    SELECT vbeln posnr matnr aubel aupos vgbel matwa
                INTO (t_itab1-vbeln, t_itab1-posnr,
                      t_itab1-matnr, t_itab1-aubel, t_itab1-aupos, t_itab1-vgbel, t_itab1-matwa)
                FROM vbrp
                WHERE vbeln = t_itab-vbeln.
*  end insert CN4
      MOVE-CORRESPONDING t_itab TO t_itab1.
      APPEND t_itab1.
      CLEAR t_itab1.
    ENDSELECT.
  ENDLOOP.
*  SORT t_itab1 BY matnr vgbel.
*  SORT t_itab1 BY fkdat name1 ihrez.
  DELETE ADJACENT DUPLICATES FROM t_itab1 COMPARING matnr vgbel.
  LOOP AT t_itab1.
    SELECT SINGLE bstkd INTO (t_itab1-bstkd)
                        FROM vbkd
                        WHERE vbeln = t_itab1-aubel.
    SELECT SINGLE ihrez INTO (t_itab1-ihrez)
                        FROM vbkd
                        WHERE vbeln = t_itab1-aubel
                          AND posnr = t_itab1-aupos.
*CN2 inserted start by yongchun
    IF sy-subrc NE 0.
      SELECT SINGLE ihrez INTO (t_itab1-ihrez)
                          FROM vbkd
                          WHERE vbeln = t_itab1-aubel
                            AND posnr = '000000'.
    ENDIF.
*CN2 inserted end by yongchun
    SELECT SINGLE maktx INTO (t_itab1-maktx)
                        FROM makt
                        WHERE matnr = t_itab1-matnr.
    SELECT SINGLE zuonr INTO (t_itab1-zuonr)
                        FROM vbrk
                        WHERE vbeln = t_itab1-vbeln.
    MODIFY t_itab1.
    CLEAR t_itab1.
  ENDLOOP.
ENDFORM.                                                    "get_data1
*       FORM get_data2                                                *
FORM get_data2.
  LOOP AT t_itab1.
    SELECT venum vemng INTO (t_itab1-venum, t_itab1-vemng)
                        FROM vepo
                        WHERE vbeln = t_itab1-vgbel
                        AND   matnr = t_itab1-matnr.
      SELECT SINGLE brgew ntgew vhilm
                   INTO (t_itab1-brgew, t_itab1-ntgew,
                         t_itab1-vhilm)
                   FROM vekp
*                   WHERE vbeln_gen = t_itab1-vgbel
                   WHERE vpobjkey = t_itab1-vgbel
                   AND   venum = t_itab1-venum.
      SELECT SINGLE volum INTO (t_itab1-tavol)
                          FROM mara
                          WHERE matnr = t_itab1-vhilm.
      IF sy-subrc = 0.
        PERFORM convert_volume USING t_itab1-vhilm CHANGING t_itab1-tavol.
      ENDIF.
      SELECT SINGLE maktx INTO (t_itab1-desctn)
                          FROM makt
                          WHERE matnr = t_itab1-vhilm.
      MOVE-CORRESPONDING t_itab1 TO t_disp.
      APPEND t_disp.
      CLEAR t_disp.
    ENDSELECT.
  ENDLOOP.
ENDFORM.                                                    "get_data2
*       FORM get_disp_data                                            *
FORM get_disp_data.
  DATA: l_ctnno TYPE i,
        l_vemng TYPE p,
        l_brgew LIKE vekp-brgew,
        l_ntgew LIKE vekp-ntgew,
*        l_tavol LIKE vekp-tavol.
        l_tavol TYPE p DECIMALS 5.
  t_disp1[] = t_disp[].
  SORT t_disp1 BY vbeln matnr vhilm.
  SORT t_disp BY vbeln venum matnr vhilm.  "CN1 inserted by yongchun
  DELETE ADJACENT DUPLICATES FROM t_disp1 COMPARING vbeln matnr vhilm.
  LOOP AT t_disp1.
    LOOP AT t_disp WHERE vbeln = t_disp1-vbeln
                   AND   matnr = t_disp1-matnr
                   AND   vhilm = t_disp1-vhilm.
*CN1 removed start by yongchun
*      l_ctnno = l_ctnno + 1.
*      l_vemng = l_vemng + t_disp-vemng.
*      l_brgew = l_brgew + t_disp-brgew.
*      l_ntgew = l_ntgew + t_disp-ntgew.
*      l_tavol = l_tavol + t_disp-tavol.
*CN1 removed end
*CN1 insert start by yongchun
      AT NEW venum.
        READ TABLE t_disp INDEX sy-tabix.
        l_ctnno = l_ctnno + 1.
        l_brgew = l_brgew + t_disp-brgew.
        l_ntgew = l_ntgew + t_disp-ntgew.
        l_tavol = l_tavol + t_disp-tavol.
      ENDAT.
      l_vemng = l_vemng + t_disp-vemng.
*CN1 insert end
    ENDLOOP.
    MOVE l_ctnno TO t_disp1-ctnno.
    MOVE l_vemng TO t_disp1-vemng.
    MOVE l_brgew TO t_disp1-brgew.
    MOVE l_ntgew TO t_disp1-ntgew.
    MOVE l_tavol TO t_disp1-tavol.
    MODIFY t_disp1.
    CLEAR: l_ctnno, l_vemng, l_brgew,
           l_ntgew, l_tavol, t_disp1.
  ENDLOOP.
ENDFORM.                    "get_disp_data
*       FORM refresh_Data                                             *
FORM refresh_data.
  CLEAR: t_itab, t_itab1, t_disp.
  REFRESH: t_itab, t_itab1, t_disp.
ENDFORM.                    "refresh_data
*       FORM display_rep                                              *
FORM display_rep.
  DATA:
    chrctnno(12) TYPE c,
    chrihrez(12) TYPE c,
    chrvemng(13) TYPE c,
    chrbrgew(18) TYPE c,
    chrntgew(18) TYPE c,
    chrtavol(18) TYPE c,
    chrmatnr(40) TYPE c,
*--> Start insert "CN6
    chrkunnr(10) TYPE c,
*<-- End insert "CN6
    chrzuonr LIKE vbrk-zuonr,
*  CN3 start insert
      t_index LIKE sy-tabix.
*  CN3 end insert
*  SORT t_disp1 BY name1 vbeln fkdat.
*CN1 start change by yongchun
*  SORT t_disp1 BY name1 fkdat vbeln ihrez .
*-->CN5
*Note: report already sorted by name1 (changed to ship-to-party)
*<--CN5
  SORT t_disp1 BY name1 ihrez fkdat vbeln venum .
*CN1 end change by yongchun
  LOOP AT t_disp1.
*  CN3 start insert
    t_index = sy-tabix.
*  CN3 end insert
    chrctnno = t_disp1-ctnno.
    chrzuonr = t_disp1-zuonr.
    chrihrez = t_disp1-ihrez.
    chrvemng = t_disp1-vemng.
    chrbrgew = t_disp1-brgew.
    chrntgew = t_disp1-ntgew.
    chrtavol = t_disp1-tavol.
*--> Start insert "CN6
    chrkunnr = t_disp1-kunnr.
    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
      EXPORTING
        input     = chrkunnr
      IMPORTING
        output    = chrkunnr.
*<-- End insert "CN6
    CONDENSE: t_disp1-desctn, chrbrgew, chrntgew, chrtavol, chrvemng, chrctnno.
*   Format material number
*start delete CN4
*    PERFORM GetLongMatnr USING t_disp1-matnr
*                      CHANGING chrMatnr.
* end delete CN4
* start insert CN4
    PERFORM getlongmatnr USING t_disp1-matnr t_disp1-matwa
                    CHANGING chrmatnr.
    PERFORM date_format.
    AT NEW name1.
      NEW-PAGE.
      WRITE: /2 t_disp1-name1, 40 chrkunnr.       "CN6
    ENDAT.
    AT NEW vbeln.
      CONDENSE t_disp1-vbeln NO-GAPS.
      CONDENSE chrzuonr NO-GAPS.
      WRITE: /4 t_disp1-vbeln, '/', chrzuonr, 59 g_date, 76 chrihrez.    "CN6
    ENDAT.
*    WRITE: /10(20) t_disp1-maktx,
*            35(20) t_disp1-bstkd,
*            55(15) t_disp1-vemng,
*            75(10) t_disp1-ctnno,
*            90(30) t_disp1-desctn,
*            120(18) t_disp1-brgew,
*            140(18) t_disp1-ntgew,
*            160(18) t_disp1-tavol.
*           /10(12) t_disp1-ihrez,
*CN1 change start by yongchun
    WRITE:/5(40) chrmatnr,
          45(20) t_disp1-bstkd,
          65(15) chrvemng.
    AT NEW venum.
*  CN3 start delete
*      READ TABLE t_disp1 INDEX sy-tabix.
*  CN3 end delete
*   CN3 start insert
      READ TABLE t_disp1 INDEX t_index.
*   CN3 end insert
      WRITE: 80(5) chrctnno,
             85(25) t_disp1-desctn,
             120(10) chrbrgew,
             130(10) chrntgew,
             140(18) chrtavol.
    ENDAT.
*CN1 change end
    PERFORM sub_total.
    AT END OF vbeln.
      PERFORM grand_total.
      PERFORM write_sub_total.
    ENDAT.
    AT END OF name1.
      PERFORM write_grand_total.
    ENDAT.
  ENDLOOP.
ENDFORM.                    "display_rep
*       FORM date_format                                              *
FORM date_format.
  CLEAR g_date.
  CONCATENATE t_disp1-fkdat+6(2)
              t_disp1-fkdat+4(2)
              t_disp1-fkdat(4) INTO g_date SEPARATED BY '.'.
ENDFORM.                    "date_format
*       FORM SUB_TOTAL                                                *
FORM sub_total.
  g_tot_vemng = g_tot_vemng + t_disp1-vemng.
  g_tot_ctnno = g_tot_ctnno + t_disp1-ctnno.
  g_tot_brgew = g_tot_brgew + t_disp1-brgew.
  g_tot_ntgew = g_tot_ntgew + t_disp1-ntgew.
  g_tot_tavol = g_tot_tavol + t_disp1-tavol.
ENDFORM.                    "sub_total
*       FORM write_sub_total                                          *
FORM write_sub_total.
  DATA:
    chrvemng(18) TYPE c,
    chrctnno(18) TYPE c,
    chrbrgew(18) TYPE c,
    chrntgew(18) TYPE c,
    chrtavol(18) TYPE c.
  chrvemng = g_tot_vemng.
  chrctnno = g_tot_ctnno.
  chrbrgew = g_tot_brgew.
  chrntgew = g_tot_ntgew.
  chrtavol = g_tot_tavol.
  CONDENSE: chrbrgew, chrntgew, chrtavol, chrvemng, chrctnno.
*  WRITE: /15 sy-uline(200),
*         /10 'TOTAL',
*          55(15) g_tot_vemng,
*          75(10) g_tot_ctnno,
*         120(18) g_tot_brgew,
*         140(18) g_tot_ntgew,
*         160(18) g_tot_tavol,
  WRITE: /11 sy-uline(200),
      /5 'TOTAL',
       65(15) chrvemng,
       80(10) chrctnno,
      120(18) chrbrgew,
      130(18) chrntgew,
      140(18) chrtavol,
      /11 sy-uline(200).
  CLEAR: g_tot_vemng, g_tot_ctnno, g_tot_brgew,
         g_tot_ntgew, g_tot_tavol.
ENDFORM.                    "write_sub_total
*       FORM GRAND_TOTAL                                              *
FORM grand_total.
  g_gtot_vemng = g_gtot_vemng + g_tot_vemng.
  g_gtot_ctnno = g_gtot_ctnno + g_tot_ctnno.
  g_gtot_brgew = g_gtot_brgew + g_tot_brgew.
  g_gtot_ntgew = g_gtot_ntgew + g_tot_ntgew.
  g_gtot_tavol = g_gtot_tavol + g_tot_tavol.
ENDFORM.                    "grand_total
*       FORM WRITE_GRAND_TOTAL                                        *
FORM write_grand_total.
  DATA:
    chrvemng(18) TYPE c,
    chrctnno(18) TYPE c,
    chrbrgew(18) TYPE c,
    chrntgew(18) TYPE c,
    chrtavol(18) TYPE c.
  chrvemng = g_gtot_vemng.
  chrctnno = g_gtot_ctnno.
  chrbrgew = g_gtot_brgew.
  chrntgew = g_gtot_ntgew.
  chrtavol = g_gtot_tavol.
  CONDENSE: chrbrgew, chrntgew, chrtavol, chrvemng, chrctnno.
  SKIP.
*  WRITE: /10 'GRAND TOTAL',
*          55(15) g_gtot_vemng,
*          75(10) g_gtot_ctnno,
*         120(18) g_gtot_brgew,
*         140(18) g_gtot_ntgew,
*         160(18) g_gtot_tavol,
  WRITE: /5 'GRAND TOTAL',
          65(15) chrvemng,
          80(10) chrctnno,
         120(18) chrbrgew,
         130(18) chrntgew,
         140(18) chrtavol,
         /11 sy-uline(200).
  CLEAR: g_gtot_vemng, g_gtot_ctnno, g_gtot_brgew,
         g_gtot_ntgew, g_gtot_tavol.
ENDFORM.                    "write_grand_total
*       top_of_page                                                   *
TOP-OF-PAGE.
  PERFORM sub_top_of_page.
  PERFORM column_header.
*       FORM sub_top_of_page                                          *
FORM sub_top_of_page.
  IF date-high IS INITIAL.
    date-high = date-low.
  ENDIF.
  SKIP.
  WRITE :/45 'JOHN WHILE SPRINGS (S) PTE. LTD.',
          130 'Page', 135 sy-pagno, 170 '',
         /45 'Packing List Report',
         /45 'Invoice Date FROM ', date-low , '-', date-high,
         130 'Date:', 135 sy-datum, 170 ''.
  ULINE.
ENDFORM.                    "sub_top_of_page
*       FORM column_header                                            *
FORM column_header.
*--> Start insert "CN6
  DATA: l_party(13) TYPE c.
  IF sold = 'X'.
    l_party = 'Sold To Party'.
  ELSEIF ship = 'X'.
    l_party = 'Ship To Party'.
  ENDIF.
*<-- End insert "CN6
  WRITE: /4  'Invoice / DO Number', 40 l_party, 59 'Invoice Date', 76 'Buyer Code',     "CN6
*         /10 'Part ID/Rev',
*          35 'PO No.',
*          65 'Qty',
*          75 'Carton No.',
*          95 'Carton Size',
*          125 'Gross Wt(KG)',
*          147 'Net Wt(KG)',
*          167 'Volume(M3)'.
*           /10 'Buyer Code',
            /5 'Part ID/Rev',
             45 'PO No.',
             65 'Qty',
             72 'Carton No.',
             85 'Carton Size',
            114 'Gross Wt(KG)',
            127 'Net Wt(KG)',
            138 'Volume(M3)'.
  ULINE.
ENDFORM.                    "column_header
*      Form  Convert_Volume
FORM convert_volume  USING    l_itab1_vhilm
                     CHANGING l_itab1_tavol.
  DATA: unit_1 LIKE t006-msehi,
        unit_2 LIKE t006-msehi VALUE 'M3',
        var1 TYPE f,
        var2 TYPE f,
        var3 TYPE f,
        var4 LIKE t006-andec VALUE 3,
        l_volum TYPE p DECIMALS 5,
        dimid  LIKE t006-dimid VALUE 'VOLUME',
        l_voleh LIKE t006-msehi.
  SELECT SINGLE voleh FROM mara INTO l_voleh
         WHERE matnr = l_itab1_vhilm.
  IF sy-subrc = 0.
    unit_1 = l_voleh.
    CALL FUNCTION 'CONVERSION_FACTOR_GET'
      EXPORTING
        no_type_check        = ' '
        unit_in              = unit_1
        unit_out             = unit_2
      IMPORTING
        add_const            = var1
        denominator          = var2
        numerator            = var3
        decimals             = var4
        dimension            = dimid
      EXCEPTIONS
        conversion_not_found = 1
        overflow             = 2
        type_invalid         = 3
        units_missing        = 4
        unit_in_not_found    = 5
        unit_out_not_found   = 6
        OTHERS               = 7.
    IF sy-subrc = 0.
      l_volum =  l_itab1_tavol  * ( var3 / var2 ) + var1.
      l_itab1_tavol = l_volum.
    ENDIF.
  ENDIF.
ENDFORM.                    " Convert_Volume
*start delete CN4
*FORM GetLongMatnr USING shortMatnr CHANGING longMatnr.
*DATA:
*  intLength TYPE i,
*  rowMARA LIKE MARA.
*  CALL FUNCTION 'CONVERSION_EXIT_MATN2_OUTPUT'
*    EXPORTING
*      INPUT         = shortMatnr
*    IMPORTING
*      OUTPUT        = longMatnr.
** Format the material number
** Get the material type
*  SELECT SINGLE *
*    INTO rowMARA
*    FROM MARA
*   WHERE matnr = shortMatnr.
*   intLength = strlen( longMatnr ).
**  Remove prefix.
*   IF rowMARA-mtart = 'ZFPT' OR rowMARA-mtart = 'ZMFG' OR rowMARA-mtart = 'ZSEC' OR
*      rowMARA-mtart = 'ZTOL' OR rowMARA-mtart = 'ZTRD'.
*      intLength = intLength - 2.
**     Remove 1st 2 characters of prefix
*      longMatnr = longMatnr+2(intLength).
**   ELSEIF rowMARA-mtart = 'ZRAW'.
***     Remove prefix - 1st 2 characters.
**      intLength = intLength - 2.
**      longMatnr = longMatnr+2(intLength).
***     Remove last 4 digits
**      intLength = intLength - 4.
**      longMatnr = longMatnr+0(intLength).
*   ENDIF.
*ENDFORM.
*end delete CN4
*start insert CN4
FORM getlongmatnr USING shortmatnr tmp_matwa CHANGING longmatnr.
  DATA:
    intlength TYPE i,
    rowmara LIKE mara.
  IF shortmatnr = tmp_matwa.
    CALL FUNCTION 'CONVERSION_EXIT_MATN2_OUTPUT'
      EXPORTING
        input  = shortmatnr
      IMPORTING
        output = longmatnr.
* Format the material number
* Get the material type
    SELECT SINGLE *
      INTO rowmara
      FROM mara
     WHERE matnr = shortmatnr.
    intlength = STRLEN( longmatnr ).
*  Remove prefix.
    IF rowmara-mtart = 'ZFPT' OR rowmara-mtart = 'ZMFG' OR rowmara-mtart = 'ZSEC' OR
       rowmara-mtart = 'ZTOL' OR rowmara-mtart = 'ZTRD'.
      intlength = intlength - 2.
*     Remove 1st 2 characters of prefix
      longmatnr = longmatnr+2(intlength).
    ENDIF.
  ELSE.
*  if material entered is different
    longmatnr = tmp_matwa.
    CALL FUNCTION 'CONVERSION_EXIT_MATN2_OUTPUT'
      EXPORTING
        input  = longmatnr
      IMPORTING
        output = longmatnr.
  ENDIF.
ENDFORM.                    "GetLongMatnr
*end insert CN4

But when I executed above sql query I got some of the users also listed in the output who were not using TFS and also some service accounts.
Could you please confirm why this is happening.

Similar Messages

  • I need help with my serial number.  I downloaded soundbooth cs3 to restore my downloaded puchase, but my serial number is not being accepted.  I have 16 more days to resolve this.

    I need help with my serial number.  I downloaded soundbooth cs3 to restore my downloaded purchase, but my serial number is not being accepted.  I have 16 more days to resolve this.  I don't need tech support, I just need the software I purchased to work for me.  That's not to much to ask, is it?  Can anyone from adobe help me please?
    Chris

    Error "The serial number is not valid for this product" | Creative Suite

  • I cannot download updates to Photoshop Elements 9.  I get an error message that my serial number is not recognized or eligible.  Can you help with this?

    I cannot download updates to Photoshop Elements 9.  I get an error message that my serial number is not recognized or eligible.  Can you help with this?

    Hi,
    Which operating system are you running on?
    What updates are you trying to download?
    The last update was 9.0.3 - check by loading the editor and going to Help -> About Photoshop Elements
    The last supported Camera raw is ACR 6.5 - check by loading the editor and going to Help -> About Plug-ins -> Camera Raw
    Do you have a reason to update?
    Brian

  • I have a 19 digit Adobe Photoshop Elements 12 Serial number.  It should be 24.  Any help with this?

    I have a 19 digit Adobe Photoshop Elements 12 Serial number.  It should be 24.  Any help with this?

    Where are you looking for the serial number?
    If you have the disks, the number commencing 1057 is usually inside the packaging. It’s necessary to pull out the white inner box.
    If you purchased this some while ago and the product, the serial number should be in your Adobe account. Click on the red Adobe logo (top left on this web page) sign-in with your Adobe ID (email & password) and choose Manage Account. You should be able to browse your purchase history and registered products.

  • My calendar will no longer let me add new event or delete them, it comes up with an error saying "cannot save event, no end date set" or "event does not belong to that event store". can anyone help with this?

    my calendar will no longer let me add new event or delete them, it comes up with an error saying "cannot save event, no end date set" or "event does not belong to that event store". can anyone help with this?

    Hi,
    To configure your ODBC DataSource, go to Control Panel ---> DataSources(ODBC) (If you are in a Windows environment).
    Select the tab System DSN. If you have not added your data source, then do so by clicking on the Add button. If you have added the datasource, click on the Configure button to configure it.
    Give the datasource name, then the database name.
    You have to give the hostname, service name and server name. I guess, in most cases, the datasource name and host name will be the same, service name and server name will be the same. If you are using TCP/IP, the protocol will be onsoctcp.
    There will be a file named Services under C:\WINNT\system32\drivers\etc where you have to give the port number for accessing this server.
    It will be like this <service name> <portnumber>/tcp
    Hope this helps...
    best wishes,
    Nish

  • Please I really need help with this video problem.

    Hi!
    Please I need help with this app I am trying to make for an Android cellphone and I've been struggling with this for a couple of months.
    I have a main flash file (video player.fla) that will load external swf files. This is the main screen.When I click the Sets Anteriores button I want to open another swf file called sets.swf.The app is freezing when I click Sets Anteriores button
    Here is the code for this fla file.
    import flash.events.MouseEvent;
    preloaderBar.visible = false;
    var loader:Loader = new Loader();
    btHome.enabled = false;
    var filme : String = "";
    carregaFilme("home.swf");
    function carregaFilme(filme : String ) :void
      var reqMovie:URLRequest = new URLRequest(filme);
      loader.load(reqMovie);
      loader.contentLoaderInfo.addEventListener(Event.OPEN,comeco);
      loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS,progresso);
      loader.contentLoaderInfo.addEventListener(Event.COMPLETE,completo);
      palco.addChild(loader); 
    function comeco(event:Event):void
              preloaderBar.visible = true;
              preloaderBar.barra.scaleX = 0;
    function progresso(e:ProgressEvent):void
              var perc:Number = e.bytesLoaded / e.bytesTotal;
              preloaderBar.percent.text = Math.ceil(perc*100).toString();
              preloaderBar.barra.scaleX =  perc;
    function completo(e:Event):void
              preloaderBar.percent.text = '';
              preloaderBar.visible = false;
    btHome.addEventListener(MouseEvent.MOUSE_DOWN,onHomeDown);
    btHome.addEventListener(MouseEvent.MOUSE_UP,onHomeUp);
    btSets.addEventListener(MouseEvent.MOUSE_DOWN,onSetsDown);
    btSets.addEventListener(MouseEvent.MOUSE_UP,onSetsUp);
    btVivo.addEventListener(MouseEvent.MOUSE_DOWN,onVivoDown);
    btVivo.addEventListener(MouseEvent.MOUSE_UP,onVivoUp);
    btHome.addEventListener(MouseEvent.CLICK,onHomeClick);
    btSets.addEventListener(MouseEvent.CLICK,onSetsClick);
    function onSetsClick(Event : MouseEvent) : void
              if (filme != "sets.swf")
                          filme = "sets.swf";
                          carregaFilme("sets.swf");
    function onHomeClick(Event : MouseEvent) : void
              if (filme != "home.swf")
                          filme = "home.swf";
                          carregaFilme("home.swf");
    function onHomeDown(Event : MouseEvent) : void
              btHome.y += 1;
    function onHomeUp(Event : MouseEvent) : void
              btHome.y -= 1;
    function onSetsDown(Event : MouseEvent) : void
              btSets.y += 1;
    function onSetsUp(Event : MouseEvent) : void
              btSets.y -= 1;
    function onVivoDown(Event : MouseEvent) : void
              btVivo.y += 1;
    function onVivoUp(Event : MouseEvent) : void
              btVivo.y -= 1;
    Now this is the sets.fla file:
    Here is the code for sets.fla
    import flash.utils.Timer;
    import flash.events.TimerEvent;
    var video:Video;
    var nc:NetConnection;
    var ns:NetStream;
    var t : Timer = new Timer(1000,0);
    var meta:Object = new Object();
    this.addEventListener(Event.ADDED_TO_STAGE,init);
    function init(e:Event):void{
    video= new Video(320, 240);
    addChild(video);
    video.x = 80;
    video.y = 100;
    nc= new NetConnection();
    nc.connect(null);
    ns = new NetStream(nc);
    ns.addEventListener(NetStatusEvent.NET_STATUS, onStatusEvent);
    ns.bufferTime = 1;
    ns.client = meta;
    video.attachNetStream(ns);
    ns.play("http://www.djchambinho.com/videos/segundaquinta.flv");
    ns.pause();
    t.addEventListener(TimerEvent.TIMER,timeHandler);
    t.start();
    function onStatusEvent(stat:Object):void
              trace(stat.info.code);
    meta.onMetaData = function(meta:Object)
              trace(meta.duration);
    function timeHandler(event : TimerEvent) : void
      if (ns.bytesLoaded>0&&ns.bytesLoaded == ns.bytesTotal )
                ns.resume();
                t.removeEventListener(TimerEvent.TIMER,timeHandler);
                t.stop();
    The problem is when I test it on my computer it works but when I upload it to my phone it freezes when I click Sets Anteriores button.
    Please help me with this problem I dont know what else to do.
    thank you

    My first guess is you're simply generating an error. You'll always want to load this on your device in quick debugging over USB so you can see any errors you're generating.
    Outside that, if you plan on accessing anything inside the SWF you should be loading the SWF into the correct context. Relevant sample code:
    var context:LoaderContext = new LoaderContext();
    context.securityDomain = SecurityDomain.currentDomain;
    context.applicationDomain = ApplicationDomain.currentDomain;
    var urlReq:URLRequest = new URLRequest("http://www.[your_domain_here].com/library.swf");
    var ldr:Loader = new Loader();
    ldr.load(urlReq, context);
    More information:
    http://help.adobe.com/en_US/ActionScript/3.0_ProgrammingAS3/WS5b3ccc516d4fbf351e63e3d118a9 b90204-7de0.html
    If you're doing this on iOS you'll need to stripped SWFs if you plan on using any coding (ABC) inside the files. You mentioned iOS so I won't get into that here, but just incase, here's info on stripping external SWFs:
    http://blogs.adobe.com/airodynamics/2013/03/08/external-hosting-of-secondary-swfs-for-air- apps-on-ios/

  • Anybody can help with this SQL?

    The table is simple, only 2 columns:
    create table personpay(
    id integer primary key,
    pay number(8,2) not null);
    So the original talbe looks like this:
    ID PAY
    1 800
    2 400
    3 1200
    4 500
    5 600
    6 1900
    The requirement is to use one single query(no pl/sql) to show something lile the following, in other words, for each ID, the pay is the sum of all before itself and itself. So the query result looks like this:
    ID PAY
    1 800
    2 1200
    3 2400
    4 2900
    5 3500
    6 5400
    Again, just use one sql. No pl/sql. Anybody can help with this? I really appreciate that.
    thanks,

    Eh, people are so "analytically minded" that can't even notice a simple join?
    Counting Ordered Rows
    Let’s start with a basic counting problem. Suppose we are given a list of integers, for example:
    x
    2
    3
    4
    6
    9
    and want to enumerate all of them sequentially like this:
    x      #
    2      1
    3      2
    4      3
    6      4
    9      5
    Enumerating rows in the increasing order is the same as counting how many rows precede a given row.
    SQL enjoys success unparalleled by any rival query language. Not the last reason for such popularity might be credited to its proximity to English . Let examine the informal idea
    Enumerating rows in increasing order is counting how many rows precede a given row.
    carefully. Perhaps the most important is that we referred to the rows in the source table twice: first, to a given row, second, to a preceding row. Therefore, we need to join our number list with itself (fig 1.1).
    Cartesian Product
    Surprisingly, not many basic SQL tutorials, which are so abundant on the web today, mention Cartesian product. Cartesian product is a join operator with no join condition
    select A.*, B.* from A, B
    Figure 1.1: Cartesian product of the set A = {2,3,4,6,9} by itself. Counting all the elements x that are no greater than y produces the sequence number of y in the set A.
    Carrying over this idea into formal SQL query is straightforward. As it is our first query in this book, let’s do it step by step. The Cartesian product itself is
    select t.x x, tt.x y
    from T t, T tt
    Next, the triangle area below the main diagonal is
    select t.x x, tt.x y
    from T t, T tt
    where tt.x <= t.x
    Finally, we need only one column – t.x – which we group the previous result by and count
    select t.x, count(*) seqNum
    from T t, T tt
    where tt.x <= t.x
    group by t.x
    What if we modify the problem slightly and ask for a list of pairs where each number is coupled with its predecessor?
    x      predecessor
    2      
    3      2
    4      3
    6      4
    9      6
    Let me provide a typical mathematician’s answer, first -- it is remarkable in a certain way. Given that we already know how to number list elements successively, it might be tempted to reduce the current problem to the previous one:
    Enumerate all the numbers in the increasing order and match each sequence number seq# with predecessor seq#-1. Next!
    This attitude is, undoubtedly, the most economical way of thinking, although not necessarily producing the most efficient SQL. Therefore, let’s revisit our original approach, as illustrated on fig 1.2.
    Figure 1.2: Cartesian product of the set A = {2,3,4,6,9} by itself. The predecessor of y is the maximal number in a set of x that are less than y. There is no predecessor for y = 2.
    This translates into the following SQL query
    select t.x, max(tt.x) predecessor
    from T t, T tt
    where tt.x < t.x
    group by t.x
    Both solutions are expressed in standard SQL leveraging join and grouping with aggregation. Alternatively, instead of joining and grouping why don’t we calculate the count or max just in place as a correlated scalar subquery:
    select t.x,
    (select count(*) from T tt where tt.x <= t.x) seq#
    from T t
    group by t.x
    The subquery always returns a single value; this is why it is called scalar. The tt.x <= t.x predicate connects it to the outer query; this is why it is called correlated. Arguably, leveraging correlated scalar subqueries is one the most intuitive techniques to write SQL queries.
    How about counting rows that are not necessarily distinct? This is where our method breaks. It is challenging to distinguish duplicate rows by purely logical means, so that various less “pure” counting methods were devised. They all, however, require extending the SQL syntactically, which was the beginning of slipping along the ever increasing language complexity slope.
    Here is how analytic SQL extension counts rows
    select x, rank() over(order by x) seq# from T; -- first problem
    select x, lag() over(order by x) seq# from T; -- second problem
    Many people suggest that it’s not only more efficient, but more intuitive. The idea that “analytics rocks” can be challenged in many ways. The syntactic clarity has its cost: SQL programmer has to remember (or, at least, lookup) the list of analytic functions. The performance argument is not evident, since non-analytical queries are simpler construction from optimizer perspective. A shorter list of physical execution operators implies fewer query transformation rules, and less dramatic combinatorial explosion of the optimizer search space.
    It might even be argued that the syntax could be better. The partition by and order by clauses have similar functionality to the group by and order by clauses in the main query block. Yet one name was reused, and the other had been chosen to have a new name. Unlike other scalar expressions, which can be placed anywhere in SQL query where scalar values are accepted, the analytics clause lives in the scope of the select clause only. I have never been able to suppress an impression that analytic extension could be designed in more natural way.

  • Need help with this Pascal Triangle code....

    Hey everyonr i am totally new to Java... so need your help with this code...
    the function makeRows gives me problems... main is correct ... can someone fix my makeRows... i don't see what's wrong
    public class Pascal {
      /** Return ragged array containing the first nRows rows of Pascal's
       *  triangle.
      public static int[][] makeRows(int nRows) {
            int[][] mpr  = new int[nRows+1][];
            int l=0; int r=0;
            for (int row = 0; row < nRows; row++) {
              mpr[row] = new int[row+1];  //index starts at 0
              if (row==0) {
                mpr[0][0]= 1;
                    if (row==1) {
                mpr[1][0]= 1;
                mpr[1][1]= 1;
              if (row>=2) {
                 for (int j = 0; j <= row; j++) {
                    if (j==0)               {l=0;} else {l=mpr[row-1][j-1];}
                    if (j==mpr[row].length-1) {r=0;} else{r=mpr[row-1][j];}
                    mpr[row][j] = l + r;
            return mpr;
      public static void main(String[] args) {
             if (args.length != 1) {
               System.out.println("usage: java " + Pascal.class.getName() + " N_ROWS");
               System.exit(1);
             int nRows = Integer.parseInt(args[0]);
             if (nRows > 0) {
               int[][] pascal = makeRows(nRows);
               for (int[] row : pascal) {
              for (int v : row) System.out.print(v + " ");
              System.out.println("");
         }this makeRows function should return ragged array containing the first nRows rows of Pascal's triangle
    thanks
    Edited by: magic101 on May 9, 2008 4:03 PM

    magic,
    i think corlettk meant that some people might not know what pascal's triangle is.
    also, you didnt say what was wrong with your code, just that it was wrong.
    asking smart questions is about giving as much information you can to get the
    best answer. i would throw a System.out.print between every line of your
    algorithm. i would also supply us with the values you are getting for each row.
    also, this question is asked all the time here. do a forum search.
    1
    11
    121
    1331
    14641

  • I need advise and help with this problem . First , I have been with Mac for many years ( 14 to be exact ) I do have some knowledge and understanding of Apple product . At the present time I'm having lots of problems with the router so I was looking in to

    I need advise and help with this problem .
    First , I have been with Mac for many years ( 14 to be exact ) I do have some knowledge and understanding of Apple product .
    At the present time I'm having lots of problems with the router so I was looking in to some info , and come across one web site regarding : port forwarding , IP addresses .
    In my frustration , amongst lots of open web pages tutorials and other useless information , I come across innocent looking link and software to installed called Genieo , which suppose to help with any router .
    Software ask for permission to install , and about 30 % in , my instinct was telling me , there is something not right . I stop installation . Delete everything , look for any
    trace in Spotlight , Library . Nothing could be find .
    Now , every time I open Safari , Firefox or Chrome , it will open in my home page , but when I start looking for something in steed of Google page , there is
    ''search.genieo.com'' page acting like a Google . I try again to get raid of this but I can not find solution .
    With more research , again using genieo.com search eng. there is lots of articles and warnings . From that I learn do not use uninstall software , because doing this will install more things where it come from.
    I do have AppleCare support but its to late to phone them , so maybe there some people with knowledge , how to get this of my computer
    Any help is welcome , English is my learned language , you may notice this , so I'm not that quick with the respond

    Genieo definitely doesn't help with your router. It's just adware, and has no benefit to you at all. They scammed you so that they could display their ads on your computer.
    To remove it, see:
    http://www.thesafemac.com/arg-genieo/
    Do not use the Genieo uninstaller!

  • I need help with this script please ASAP

    So I need this to work properly, but when ran and the correct answer is chosen the app quits but when the wrong answer is chosen the app goes on to the next question. I need help with this ASAP, it is due tommorow. Thank you so much for the help if you can.
    The script (Sorry if it's a bit long):
    #------------Startup-------------
    display dialog "Social Studies Exchange Trviva Game by Justin Parzik" buttons {"Take the Quiz", "Cyaaaa"} default button 1
    set Lolz to (button returned of the result)
    if Lolz is "Cyaaaa" then
    killapp()
    else if Lolz is "Take the Quiz" then
              do shell script "say -v samantha Ok starting in 3…2…1…GO!"
    #------------Question 1-----------
              display dialog "Around age 11, many boys left their fathers to become…" buttons {"Scholars", "Warriors", "Apprentices"}
              set A1 to (button returned of the result)
              if A1 is "Apprentices" then
                        do shell script "say -v samantha Correct Answer"
              else
                        do shell script "say -v samantha Wrong Answer"
      #----------Question 2--------
                        display dialog "Most children were taught
    to read so that they could understand the…" buttons {"Music of Mozart", "Bible", "art of cooking"}
                        set A2 to (button returned of the result)
                        if A2 is "Bible" then
                                  do shell script "say -v samantha Correct Answer"
                        else
                                  do shell script "say -v samantha Wrong Answer"
      #------------Question 3---------
                                  display dialog "In the 1730s and 1740s, a religious movement called the_______swept through the colonies." buttons {"Glorius Revolution", "Great Awakening", "The Enlightenment"}
                                  set A3 to (button returned of the result)
                                  if A3 is "Great Awakening" then
                                            do shell script "say -v samantha Correct Answer"
                                  else
                                            do shell script "say -v samantha Wrong Answer"
      #-----------Question 4--------
                                            display dialog "_______ was
    a famous American Enlightenment figure." buttons {"Ben Franklin", "George Washington", "Jesus"}
                                            set A4 to (button returned of the result)
                                            if A4 is "Ben Franklin" then
                                                      do shell script "say -v samantha Correct Answer"
                                            else
                                                      do shell script "say -v samantha Wrong Answer"
      #----------Question 5-------
                                                      display dialog "______ ownership gave colonists political rights as well as prosperity." buttons {"Land", "Dog", "Slave"}
                                                      set A5 to (button returned of the result)
                                                      if A5 is "Land" then
                                                                do shell script "say -v samantha Correct Answer"
                                                      else
                                                                do shell script "say -v samantha Wrong Answer"
      #---------Question 6--------
                                                                display dialog "The first step toward guaranteeing these rights came in 1215. That
    year, a group of English noblemen forced King John to accept the…" buttons {"Declaration of Independence", "Magna Carta", "Constitution"}
                                                                set A6 to (button returned of the result)
                                                                if A6 is "Magna Carta" then
                                                                          do shell script "say -v samantha Correct Answer"
                                                                else
                                                                          do shell script "say -v samantha Wrong Answer"
      #----------Question 7--------
                                                                          display dialog "England's cheif lawmaking body was" buttons {"the Senate", "Parliament", "King George"}
                                                                          set A7 to (button returned of the result)
                                                                          if A7 is "Parliament" then
                                                                                    do shell script "say -v samantha Correct Answer"
                                                                          else
                                                                                    do shell script "say -v samantha Wrong Answer"
      #--------Question 8-----
                                                                                    display dialog "Pariliament decided to overthrow _______ for not respecting their rights" buttons {"King James II", "King George", "King Elizabeth"}
                                                                                    set A8 to (button returned of the result)
                                                                                    if A8 is "King James II" then
                                                                                              do shell script "say -v samantha Correct Answer"
                                                                                    else
                                                                                              do shell script "say -v samantha Wrong Answer"
      #--------Question 9------
                                                                                              display dialog "Parliament named ___ and ___ as England's new monarchs in something called ____." buttons {"William/Mary/Glorius Revolution", "Adam/Eve/Great Awakening", "Johhny/Mr.Laphalm/Burning of the hand ceremony"}
                                                                                              set A9 to (button returned of the result)
                                                                                              if A9 is "William/Mary/Glorius Revolution" then
                                                                                                        do shell script "say -v samantha Correct Answer"
                                                                                              else
                                                                                                        do shell script "say -v samantha Wrong Answer"
      #---------Question 10-----
                                                                                                        display dialog "After accepting the throne William and Mary agreed in 1689 to uphold the English Bill of _____." buttons {"Money", "Colonies", "Rights"}
                                                                                                        set A10 to (button returned of the result)
                                                                                                        if A10 is "Rights" then
                                                                                                                  do shell script "say -v samantha Correct Answer"
                                                                                                        else
                                                                                                                  do shell script "say -v samantha Wrong Answer"
      #---------Question 11------
                                                                                                                  display dialog "By the late 1600s French explorers had claimed the ___ River Valey" buttons {"Mississippi", "Ohio", "Hudson"}
                                                                                                                  set A11 to (button returned of the result)
                                                                                                                  if A11 is "Ohio" then
                                                                                                                            do shell script "say -v samantha Correct Answer"
                                                                                                                  else
                                                                                                                            do shell script "say -v samantha Wrong Answer"
      #------Question 12---------
                                                                                                                            display dialog "______ was sent to ask the French to leave 'English Land'." buttons {"Johhny Tremain", "George Washington", "Paul Revere"}
                                                                                                                            set A12 to (button returned of the result)
                                                                                                                            if A12 is "George Washington" then
                                                                                                                                      do shell script "say -v samantha Correct Answer"
                                                                                                                            else
                                                                                                                                      do shell script "say -v samantha Wrong Answer"
      #---------Question 13-------
                                                                                                                                      display dialog "_____ proposed the Albany Plan of Union" buttons {"George Washingon", "Ben Franklin", "John Hancock"}
                                                                                                                                      set A13 to (button returned of the result)
                                                                                                                                      if A13 is "Ben Franklin" then
                                                                                                                                                do shell script "say -v samantha Correct Answer"
                                                                                                                                      else
                                                                                                                                                do shell script "say -v samantha Wrong Answer"
      #--------Question 14------
                                                                                                                                                display dialog "The __________ declared that England owned all of North America east of the Mississippi" buttons {"Proclomation of England", "Treaty of Paris", "Pontiac Treaty"}
                                                                                                                                                set A14 to (button returned of the result)
                                                                                                                                                if A14 is "" then
                                                                                                                                                          do shell script "say -v samantha Correct Answer"
                                                                                                                                                else
                                                                                                                                                          do shell script "say -v samantha Wrong Answer"
      #-------Question 15-------
                                                                                                                                                          display dialog "Braddock was sent to New England so he could ______" buttons {"Command an attack against French", "Scalp the French", "Kill the colonists"}
                                                                                                                                                          set A15 to (button returned of the result)
                                                                                                                                                          if A15 is "Command an attack against French" then
                                                                                                                                                                    do shell script "say -v samantha Correct Answer"
                                                                                                                                                          else
                                                                                                                                                                    do shell script "say -v samantha Wrong Answer"
      #------TheLolQuestion-----
                                                                                                                                                                    display dialog "____ is the name of the teacher who runs this class." buttons {"Mr.White", "Mr.John", "Paul Revere"} default button 1
                                                                                                                                                                    set LOOL to (button returned of the result)
                                                                                                                                                                    if LOOL is "Mr.White" then
                                                                                                                                                                              do shell script "say -v samantha Congratulations…you…have…common…sense"
                                                                                                                                                                    else
                                                                                                                                                                              do shell script "say -v alex Do…you…have…eyes?"
                                                                                                                                                                              #------END------
                                                                                                                                                                              display dialog "I hope you enjoyed the quiz!" buttons {"I did!", "It was horrible"}
                                                                                                                                                                              set endmenu to (button returned of the result)
                                                                                                                                                                              if endmenu is "I did!" then
                                                                                                                                                                                        do shell script "say -v samantha Your awesome"
                                                                                                                                                                              else
                                                                                                                                                                                        do shell script "say -v alex Go outside and run a lap"
                                                                                                                                                                              end if
                                                                                                                                                                    end if
                                                                                                                                                          end if
                                                                                                                                                end if
                                                                                                                                      end if
                                                                                                                            end if
                                                                                                                  end if
                                                                                                        end if
                                                                                              end if
                                                                                    end if
                                                                          end if
                                                                end if
                                                      end if
                                            end if
                                  end if
                        end if
              end if
    end if

    Use code such as:
    display dialog "Around age 11, many boys left their fathers to become…" buttons {"Scholars", "Warriors", "Apprentices"}
    set A1 to (button returned of the result)
    if A1 is "Apprentices" then
    do shell script "say -v samantha Correct Answer"
    else
    do shell script "say -v samantha Wrong Answer"
    return
    end if
    #----------Question 2--------
    display dialog "Most children were taught to read so that they could understand the…" buttons {"Music of Mozart", "Bible", "art of cooking"}
    set A2 to (button returned of the result)
    if A2 is "Bible" then
    do shell script "say -v samantha Correct Answer"
    else
    do shell script "say -v samantha Wrong Answer"
    return
    end if
    (90444)

  • My iPod touch was stolen and recovered.  I can use my Apple id for this site but the theif changed the Apple id needed to update apps etc and I do not know how to delete his acct. Any help with this will be greatly

    My iPod touch was stolen and recovered.  I can use my Apple id for this site but the theif changed the Apple id needed to update apps etc and I do not know how to delete his acct. Any help with this will be greatly appreciate

    If the thief enabled activation lock on the device, then there is nothing that can be done.  Only the password for the Apple ID that it is locked with can disable activation lock.

  • HT1365 Hi can anyone help with this issue regarding my wireless magic mouse? When im on google chrome and scrolling down the page i always have youtube running in the background but the audio cuts/spits/pops can anyone help me with this?

    Hi can anyone help with this issue regarding my wireless magic mouse? When im on google chrome and scrolling down the page i always have youtube running in the background but the audio cuts/spits/pops can anyone help me with this?

    The figures you mention only make sense on your intranet.  Are you still using the same wireless router.  The verizon one is somewhat limited as far as max wireless-n performace.  For one thing it only has a 2.4 radio.   I like many people who wanted wireless-n performance before they even added a wireless-n gigabit router, have my own handling my wireless-n network.

  • HT4356 I'm using my iPod and an Epson XP-810 printer to print pages from websites and emails and etc.  How do I print just 1 page out of 14 pages .  I don't see any settings on my iPod and can't find settings on the printer .   Can someone help with this

    I'm using my iPod and an Epson XP-810 printer to print pages from websites and emails and etc. 
    How do I print just 1 page out of 14 pages . 
    I don't see any settings on my iPod and can't find settings on the printer .  
    Can someone help with this problem

    Google show that you have to cut what you want to print and then paste it into a new app and print from that app.
    http://www.ipadforums.net/new-member-introductions-site-assistance/63145-printin g-one-page-ipad-2-a.html

  • Since updating to FF 8 I can no longer use Multirow book marks, can anyone help with this issue?

    Since updating to FF 8 I can no longer use Multi-row book marks, can anyone help with this issue? the one I used is here http://multirowbookmarkstoolbar.com/

    Try the support site:
    *http://multirowbookmarkstoolbar.com/forum
    *Multirow Bookmarks Toolbar Plus: https://addons.mozilla.org/firefox/addon/multirow-bookmarks-toolbarplus/

Maybe you are looking for

  • Lock Timeouts and Heap Space Exhaustion

    I'm having some trouble figuring out the best way to handle resource constraints in my application. Generally speaking, the application works well after starting for about a day or so, but inevitably starts generating "Lock timeout" messages and even

  • Auto-update of figure/images in Pages

    Dear all, I'm just wondering whether Pages has a feature allowing it to auto-update images you import into it, i.e., if I insert an image in pages and then decide I need to edit it some-more in Photoshop, can you make it update by itself in Pages? I

  • Query takes a long time on EBAN table

    Hi, I am trying to execute a simple select statement on EBAN table. This query takes unexpectionally longer time to execute. Query is : SELECT banfn bnfpo ernam badat ebeln ebelp       INTO TABLE gt_eban       FROM eban FOR ALL ENTRIES IN gt_ekko_ekp

  • Display irrespective of mandatory restriction

    hi sap, i have screen and first 3fields are mandatory fields. my requirment is... when give the purch.grp.no  and press display it should give the record which already existing. but now due to the mandatory restriction it is asking me to fill those 2

  • Best strategy for archiving some of your calendar

    I'd like to archive all events in my calendar pre-2004. I'd also like to be able to re-import these events at a later date both as a separate calendar (which can be deleted again) and/or back into the calendar that they came from. What is the best st