Convert type x to type c?

Is there a function to convert data from type x to type c?

Hi christophe,
did you check in [SDN|how to convert vale of type  x  to  type c ?].
so that you will get an idea before posting.
Regards!

Similar Messages

  • Can't be converted to a char type filed

    Hi everyone,
    I have a report, when I am executing it displays the following error<b> I:ZVMS:999 No Data related to COGS Found</b>
    If i check it in syntax error it displays the below in waring symbol.
    "TAB_COGS" cannot be converted to a character-type filed.
    "TOTALS" cannot be converted to a character-type filed.
    just for your reference I am enclosing my code
    report zvmapslabr_246_map message-id zvms line-size 220.
    tables:
            mkpf, mseg, likp, lips, konv,  vbak, vbap, vbpa, t005, t941l, mvke,  mara, marc, tvlvt.
    types: begin of type_mkpf,        budat type bldat,        mblnr type mblnr,
             vgart type vgart,        blart type blart,        xblnr type xblnr,      
             matnr type matnr,  bwart type bwart, erfmg type erfmg,  lgort type lgort_d,
    end of type_mkpf.
    types: begin of type_vbeln,
             vbeln type vbeln,
           end of type_vbeln.
    types: begin of type_lips,
            vbeln type vbeln,        posnr type posnr,        matnr type matnr,
            vgbel type vgbel,        vgpos type vgpos,       
    end of type_lips.
    types: begin of type_datum,
            matnr type matnr,        datum type dats,
    end of type_datum.
    data:begin of i_mvke occurs 0,
         matnr like mara-matnr,
         end of i_mvke.
    data:begin of i_marc occurs 0,
         matnr like mara-matnr,
    end of i_marc.
    data: t_mkpf type standard table of type_mkpf,
          h_mkpf type standard table of type_mkpf,
          tmkpf type type_mkpf.
    data: t_vbeln type sorted table of type_vbeln with unique key vbeln,
          tvbeln type type_vbeln.
    data: t_lips type standard table of type_lips,
          tlips type type_lips,
          hlips type lips.
    data: begin of rt_outtab occurs 0,
          vbeln like vbak-vbeln,      auart like vbak-auart,      audat like vbak-audat,
          vkorg like vbak-vkorg,      vtweg like vbak-vtweg,      knumv like vbak-knumv,
          augru like vbak-augru,      bsark like vbak-bsark,      matnr like vbap-matnr,
          kwmeng like vbap-kwmeng,      abrvw  like vbak-abrvw,
          posnr like vbap-posnr,      matkl like vbap-matkl,      vkaus like vbap-vkaus,
          route like vbap-route,      land1 like vbpa-land1,
    end of rt_outtab.
    data: begin of wa_outtab,
          vbeln like vbak-vbeln,      auart like vbak-auart,      audat like vbak-audat,
          vkorg like vbak-vkorg,      vtweg like vbak-vtweg,      knumv like vbak-knumv,
          augru like vbak-augru,      bsark like vbak-bsark,      matnr like vbap-matnr,
          kwmeng like vbap-kwmeng,      abrvw  like vbak-abrvw,
          posnr like vbap-posnr,      matkl like vbap-matkl,      vkaus like vbap-vkaus,
          route like vbap-route,      land1 like vbpa-land1,
    end of wa_outtab.
    data: begin of tab_cogs occurs 0,
              matkl  like vbap-matkl,          matnr  like vbap-matnr,
              fkimg  type p decimals 0,          amount type p decimals 4,
              unit   type p decimals 2,
    end   of tab_cogs,
    begin of tab_rord occurs 0,
              matkl  like vbap-matkl,          matnr  like vbap-matnr,
              fkimg  type p decimals 0,          amount type p decimals 4,
              unit   type p decimals 2,
    end   of tab_rord,
    begin of tab_frgt occurs 0,
              route  like likp-route,          matnr  like vbap-matnr,
              fkimg  type p decimals 0,          amount type p decimals 4,
    end of tab_frgt,
    begin of totals occurs 1000,
              descr(40),
              fkimg type p decimals 0,
              amount type p decimals 4,
              unit  type p decimals 2,
          end of totals,
          begin of totalsff occurs 1000,
              descr(40),
              fkimg type p decimals 0,
              amount type p decimals 4,
              unit  type p decimals 2,
          end of totalsff,
            gjahr like  bapi0002_4-fiscal_year,
            month like  bapi0002_4-fiscal_period,
            desc(40),
            kschl like konv-kschl.
    data: begin of cs_marc.
            include structure marc.
    data: end of cs_marc.
    data: in_konv like konv occurs 0  with header line.
    DATA: TEMP_ZOGM LIKE KOnV-KBETR,
          TEMP_ZOGt LIKE KOnV-KBETR,
          TEMP1_ZOGM LIKE KOnV-KBETR,
          TEMP1_ZOGt LIKE KOnV-KBETR,
          temp1_vprs like konv-kbetr,
          temp_vprs like konv-kbetr.
    ranges: r_matnr for mvke-matnr,
            r_matkl for mara-matkl,
            r_abrvw for vbak-abrvw.
    selection-screen begin of block sel01 with frame title text-001.
    select-options: so_matnr for vbap-matnr,
                    so_vkorg for vbak-vkorg default '0065',
                    so_vtweg for vbak-vtweg default '02',
                    so_auart for vbak-auart,
                    so_werks for marc-werks default '0012'.
    select-options: so_budat for mkpf-budat,
                    so_mblnr for mkpf-mblnr,
                    so_bwart for mseg-bwart default '601'.
    selection-screen skip 1.
    parameters: date_in like vbrk-fkdat default sy-datum,
                invoice(15)  default 'MAPSYYYYMM'.
    selection-screen end of block sel01.
    selection-screen skip 1.
    selection-screen begin of block sel02 with frame title text-002.
    parameters: fix_gr1 like konv-kwert default '1.40',
                fix_gr2 like konv-kwert default '1.25'.
    selection-screen skip 1.
    parameters: reorders like konv-kwert default '2.95'.
    selection-screen end of block sel02.
    selection-screen skip 1.
    selection-screen begin of block sel03 with frame title text-003.
    parameters: fore_g radiobutton group mode,
                back_g radiobutton group mode.
    parameters: file2 like rlgrap-filename default 'C:\ZMAPSDAT.TXT',
                file4 like rlgrap-filename default 'C:\ZMAPSDAT_TOTALS.TXT'.
    parameters: file3 like rlgrap-filename default '/usr/sap/maps_labr.dat',
                file5 like rlgrap-filename default
                                            '/usr/sap/maps_labr_totals.dat'.
    selection-screen end of block sel03.
    initialization.
      call function 'BAPI_COMPANYCODE_GET_PERIOD'
           exporting
                companycodeid = '0046'
                posting_date  = sy-datum
           importing
                fiscal_year   = gjahr
                fiscal_period = month.
      if month eq 01.
        move 12 to month.
        gjahr = gjahr - 1.
      else.
        month = month - 1.
      endif.
      move: gjahr to invoice+04(04).
      move: month to invoice+08(04).
      move '750' to r_matkl-low.
      move 'I'  to r_matkl-sign.
      move 'EQ' to r_matkl-option.
      append r_matkl.
      move '751' to r_matkl-low.
      move 'I'  to r_matkl-sign.
      move 'EQ' to r_matkl-option.
      append r_matkl.
      move '760' to r_matkl-low.
      move 'I'  to r_matkl-sign.
      move 'EQ' to r_matkl-option.
      append r_matkl.
      move '761' to r_matkl-low.
      move 'I'  to r_matkl-sign.
      move 'EQ' to r_matkl-option.
      append r_matkl.
      move '620' to r_matkl-low.
      move 'I'  to r_matkl-sign.
      move 'EQ' to r_matkl-option.
      append r_matkl.
      move '765' to r_matkl-low.
      move '770' to r_matkl-high.
      move 'I'  to r_matkl-sign.
      move 'BT' to r_matkl-option.
      append r_matkl.
      move '624' to r_matkl-low.
      move '628' to r_matkl-high.
      move 'I'  to r_matkl-sign.
      move 'BT' to r_matkl-option.
      append r_matkl.
    Change D. Fitzgerald - excluded useage range
    clear r_abrvw.
    refresh r_abrvw.
    USCOMP3 ******
      move 'MC3' to r_abrvw-low.
      move 'I'  to r_matkl-sign.
      move 'EQ' to r_matkl-option.
      append r_abrvw.
    USCOMP4 ******
      move '220' to r_abrvw-low.
      move 'I'  to r_matkl-sign.
      move 'EQ' to r_matkl-option.
      append r_abrvw.
    Change D. Fitzgerald - excluded useage range
    if fore_g = 'X' and
    ( file3 is initial or file5 is initial ) .
    message e000.
    elseif back_g  = 'X' and
    ( file2 is initial or file4 is initial ) .
    message e001.
    endif.
    start-of-selection.
      perform get_orders.
      perform get_values.
    end-of-selection.
      perform download.
      perform file_out.
    *&      Form  get_orders
    form get_orders.
      select matnr into corresponding fields of table i_mvke from mara
                   where matnr  in so_matnr
                   and   lvorm  eq space
                   and   matkl  in r_matkl.
      loop at i_mvke.
        clear marc.
        select single * from marc where matnr eq i_mvke-matnr
                                  and   werks in so_werks.
        if sy-subrc = 0.
          move-corresponding marc to i_marc.
          append i_marc.
          clear  i_marc.
        endif.
      endloop.
      refresh r_matnr.
      free    r_matnr.
      loop at i_marc.
        r_matnr-low = i_marc-matnr.
        r_matnr-sign = 'I'.
        r_matnr-option = 'EQ'.
        append r_matnr.
      endloop.
      select mkpfbudat mkpfmblnr mkpfvgart mkpfblart mkpf~xblnr
             msegmatnr msegbwart msegerfmg mseglgort
                        into table t_mkpf
                        from mkpf inner join mseg
                         on mkpfmblnr eq msegmblnr
                         where mkpf~budat in so_budat
                         and   mkpf~vgart eq 'WL'
                         and   mkpf~blart eq 'WL'
                         and   mkpf~mjahr eq so_budat-low+0(4)
                         and   mkpf~mblnr in so_mblnr
                         and   mseg~bwart in so_bwart
                         and   mseg~matnr in r_matnr
                         and   mseg~pargb in so_vkorg.
      sort t_mkpf by bwart matnr budat ascending.
      loop at t_mkpf into tmkpf from sy-tabix.
        tvbeln-vbeln = tmkpf-xblnr.
        insert tvbeln into table t_vbeln.
      endloop.
      if not t_vbeln is initial.
        select likp~vbeln
               lipsposnr lipsmatnr lipsvgbel lipsvgpos
               into table t_lips
               from likp inner join lips
               on likpvbeln eq lipsvbeln
               for all entries in t_vbeln
               where likp~vbeln eq t_vbeln-vbeln
               and   lips~matnr in so_matnr.
      endif.
      if not t_lips is initial.
        select avbeln aauart aaudat avkorg a~vtweg
               aknumv aaugru absark aabrvw b~matnr
               bkwmeng bposnr bmatkl bvkaus b~route
            into corresponding fields of table rt_outtab
            from vbak as a inner join
                 vbap as b on bvbeln = avbeln
                 for all entries in t_lips
            where a~vbeln eq t_lips-vgbel
            and   b~matnr eq t_lips-matnr
            and   a~vkorg in so_vkorg
            and   b~vkaus not in ('MC3','220').
           and   b~vkaus not in r_abrvw.
      endif.
      sort rt_outtab by vbeln matnr.
      loop at rt_outtab into wa_outtab.
        clear vbpa.
        select single land1   from vbpa
          into vbpa-land1
          where vbeln eq wa_outtab-vbeln
          and   posnr le '009999'
          and   parvw eq 'WE'.
        if sy-subrc eq 0.
          wa_outtab-land1 = vbpa-land1.
          modify rt_outtab from wa_outtab.
        endif.
      endloop.
    endform.                    " get_orders
    *&      Form  get_values
    form get_values.
      loop at rt_outtab into wa_outtab.
      perform calc_freight.
        perform calc_cogs.
      endloop.
    endform.                    " get_values
    *&      Form  check_cogs
    form check_cogs.
      perform value_cond using 'VPRS'.
      tab_cogs-matkl  = wa_outtab-matkl.
      tab_cogs-matnr  = wa_outtab-matnr.
      tab_cogs-fkimg  = wa_outtab-kwmeng.
    *change for MAP
      if konv-kpein = '1'.
        tab_cogs-amount = wa_outtab-kwmeng * konv-kbetr.
      elseif  konv-kpein = '1000'.
        clear: TEMP_zogm, TEMP1_zogm,
            TEMP_zogt, TEMP1_zogt,
            TEMP_vprs, TEMP1_vprs.
    check ZOGM
         read table in_konv with key KSCHL = 'ZOGM'.
          if sy-subrc eq 0 .
              clear: TEMP_zogm, TEMP1_zogm.
                     TEMP_zogm  = in_KOnV-KBETR.
                     TEMP1_zogm  = in_KOnV-Kwert.
          endif.
    check ZOGT
          read table in_konv with key KSCHL = 'ZOGT'.
           if sy-subrc eq 0.
              clear: TEMP_zogt, TEMP1_zogt.
                     TEMP_zogt  = in_KOnV-KBETR.
                     TEMP1_zogt  = in_KOnV-Kwert.
             endif.
    check VPRS
        Temp_vprs = TEMP_zogm + TEMP_zogT.
        Temp1_vprs = TEMP1_zogm + TEMP1_zogT.
       if konv-kwert  <> Temp1_vprs.
         tab_cogs-amount = Temp1_vprs.
       else.
         tab_cogs-amount = konv-kwert.
       endif.
      endif.
      totals-amount   = tab_cogs-amount.
      collect tab_cogs.
      clear  tab_cogs.
    endform.                    " check_cogs
    *&      Form  check_reorders
    form check_reorders.
    tab_rord-matkl = wa_outtab-matkl.
    tab_rord-matnr = wa_outtab-matnr.
    tab_rord-fkimg = wa_outtab-kwmeng.
    tab_rord-amount = reorders * wa_outtab-kwmeng.
    totals-fkimg    = wa_outtab-kwmeng.
    totals-descr    = 'Reorders'.
    totals-amount   = tab_rord-amount.
    collect  tab_rord.
    clear   tab_rord.
      perform value_cond using 'VPRS'.
      tab_rord-matkl  = wa_outtab-matkl.
      tab_rord-matnr  = wa_outtab-matnr.
      tab_rord-fkimg  = wa_outtab-kwmeng.
    *change for MAP
      if konv-kpein = '1'.
        tab_rord-amount = wa_outtab-kwmeng * konv-kbetr.
      elseif  konv-kpein = '1000'.
        clear: TEMP_zogm, TEMP1_zogm,
            TEMP_zogt, TEMP1_zogt,
            TEMP_vprs, TEMP1_vprs.
    check ZOGM
         read table in_konv with key KSCHL = 'ZOGM'.
          if sy-subrc eq 0 .
              clear: TEMP_zogm, TEMP1_zogm.
                     TEMP_zogm  = in_KOnV-KBETR.
                     TEMP1_zogm  = in_KOnV-Kwert.
          endif.
    check ZOGT
          read table in_konv with key KSCHL = 'ZOGT'.
           if sy-subrc eq 0.
              clear: TEMP_zogt, TEMP1_zogt.
                     TEMP_zogt  = in_KOnV-KBETR.
                     TEMP1_zogt  = in_KOnV-Kwert.
             endif.
    check VPRS
        Temp_vprs = TEMP_zogm + TEMP_zogT.
        Temp1_vprs = TEMP1_zogm + TEMP1_zogT.
       if konv-kwert  <> Temp1_vprs.
         tab_rord-amount = Temp1_vprs.
       else.
         tab_rord-amount = konv-kwert.
       endif.
      endif.
      totals-amount   = tab_rord-amount.
    totals-fkimg    = wa_outtab-kwmeng.
      collect  tab_rord.
      clear   tab_rord.
    endform.                    " check_reorders
    *&      Form  value_cond
    form value_cond using p_kschl.
    CHECK THE CONDITIONS for ZOGM and ZOGT
    clear in_konv.
    refresh in_konv.
      select * from konv into table in_konv
                       where knumv = wa_outtab-knumv
                         and kposn = wa_outtab-posnr.
      clear konv.
      select single * from konv where   knumv = wa_outtab-knumv
                                  and   kposn = wa_outtab-posnr
                                  and   kappl = 'V'
                                  and   kschl = p_kschl.
      check sy-subrc eq 0.
    endform.                    " value_cond
    *&      Form  calc_freight
    form calc_freight.
    perform value_cond using 'ZMFR'.
    tab_frgt-route  = wa_outtab-route.
    tab_frgt-matnr  = wa_outtab-matnr.
    tab_frgt-fkimg  = wa_outtab-kwmeng.
    tab_frgt-amount = wa_outtab-kwmeng * konv-kbetr.
    totals-fkimg    = wa_outtab-kwmeng.
    totals-descr    = 'Freight'.
    totals-amount   = tab_frgt-amount.
    collect  tab_frgt.
    clear    tab_frgt.
    endform.                    " calc_freight
    *&      Form  calc_cogs
    form calc_cogs.
      if  wa_outtab-matkl eq '750' or wa_outtab-matkl eq '751'.
      if  wa_outtab-bsark ne  'S'.
        if  wa_outtab-bsark = 'S' or wa_outtab-bsark = 'R'.
          totals-fkimg    = wa_outtab-kwmeng.
        totals-descr    = 'Welcome Kits - Fulfillment'.
          totals-descr    = 'Replacements'.
          totals-descr    = 'Reorders'.
          perform  check_reorders.
         else.
          totals-fkimg    = wa_outtab-kwmeng.
          totals-descr    = 'Welcome Kits - COGS'.
          perform  check_cogs.
         endif.
      endif.
      if  wa_outtab-matkl eq '760' or wa_outtab-matkl eq '761'.
      if  wa_outtab-bsark ne  'S'.
        if  wa_outtab-bsark = 'S' or wa_outtab-bsark = 'R'.
          totals-fkimg    = wa_outtab-kwmeng.
        totals-descr    = 'Update Kits - Fulfillment'.
        totals-descr    = 'Reorders'.
          totals-descr    = 'Replacements'.
          perform  check_reorders.
         else.
          totals-fkimg    = wa_outtab-kwmeng.
          totals-descr    = 'Update Kits - COGS'.
          perform  check_cogs.     endif.
      endif.
    If ( wa_outtab-matkl >= '765' and wa_outtab-matkl <= '770' ) or
       ( wa_outtab-matkl >= '620' and wa_outtab-matkl <= '630' ).
    if ( wa_outtab-matkl >= '765' and wa_outtab-matkl <= '770' ) or
        ( wa_outtab-matkl >= '624' and wa_outtab-matkl <= '628' ) or
          wa_outtab-matkl = '620'.
    new DF
        if  wa_outtab-bsark = 'S' or wa_outtab-bsark = 'R'.
          totals-fkimg    = wa_outtab-kwmeng.
         totals-descr    = 'Reorders - Fulfillment'.
         totals-descr    = 'Reorders'.
           totals-descr    = 'Replacements'.
          perform  check_reorders.
        else.
          totals-fkimg    = wa_outtab-kwmeng.
          totals-descr    = 'Misc SKU'.
          perform  check_cogs.
        endif.
       if wa_outtab-bsark = 'S'.
         perform check_reorders.
       endif.
    *************new DF
      endif.
      collect totals.
      clear   totals.
    endform.                    " calc_cogs
    *&      Form  download
    form download.
    *Step 1
      if not tab_cogs[] is initial.
        sort tab_cogs by matkl.
        write: /  'Material Group',
               /  'Material',
               45 'Quantity',
               70 'Amount',
              105 'Unit Price'.
        loop at tab_cogs.
          on change of tab_cogs-matkl.
            write:/    tab_cogs-matkl.
          endon.
          clear  tab_cogs-unit.
          tab_cogs-unit = tab_cogs-amount / tab_cogs-fkimg.
          write:/    tab_cogs-matnr,
                 40  tab_cogs-fkimg,
                 65  tab_cogs-amount,
                100  tab_cogs-unit.
        endloop.
      else.
        message i999 with 'No Data related to COGS Found'.
        stop.
      endif.
    *Step 2
    if not tab_frgt[] is initial.
       sort tab_frgt by route.
       write: /  'Dispatch Type',
              /  'Material',
              45 'Quantity',
              70 'Amount'.
             105 'Unit Price'.
       loop at tab_frgt.
         on change of tab_frgt-route.
           write:/    tab_frgt-route.
         endon.
         write:/    tab_frgt-matnr,
                40  tab_frgt-fkimg,
                65  tab_frgt-amount.
       endloop.
    else.
       message i999 with 'No Data related to Freight Found'.
       stop.
    endif.
    *Step 3
      if not tab_rord[] is initial.
        sort tab_rord by matkl.
        write: /  'Material Group',
               /  'Material',
               45 'Quantity',
               70 'Amount',
              105 'Unit Price'.
        loop at tab_rord.
          on change of tab_rord-matkl.
            write:/    tab_rord-matkl.
          endon.
          clear  tab_rord-unit.
          tab_rord-unit = tab_rord-amount / tab_rord-fkimg.
          write:/    tab_rord-matnr,
                 40  tab_rord-fkimg,
                 65  tab_rord-amount,
                100  tab_rord-unit.
        endloop.
      else.
        message i999 with 'No Data related to Reorders Found'.
        stop.
      endif.
    *Step 4
      if not totals[] is initial.
        sort totals by descr.
        perform fulfillment.
        write: /  'Cogs',
               45 'Quantity',
               70 'Amount',
              105 'Unit Price'.
        loop at totals.
          clear totals-unit.
          totals-unit = totals-amount / totals-fkimg.
          write: /  totals-descr,
                 40 totals-fkimg,
                 65 totals-amount,
                100 totals-unit.
        endloop.
        write: /  'Fulfillment',
               45 'Quantity',
               70 'Amount',
              105 'Unit Price'.
        loop at totalsff.
          clear totalsff-unit.
          totalsff-unit = totalsff-amount / totalsff-fkimg.
          write: /  totalsff-descr,
                 40 totalsff-fkimg,
                 65 totalsff-amount,
                100 totalsff-unit.
        endloop.
      else.
        message i999 with 'No Data related to Final Found'.
        stop.
      endif.
    endform.                    " download
    *&      Form  fulfillment
    form fulfillment.
      loop at totals.
       if totals-descr  = 'Welcome Kits - Fulfillment'.
         if totals-descr  = 'Welcome Kits - COGS'.
          totalsff-descr  = 'Welcome Kits - Fulfillment'.
          totalsff-fkimg  = totals-fkimg.
          totalsff-amount = totals-fkimg * fix_gr1.
        delete totals.
          append totalsff.
          clear  totalsff.
        endif.
       if totals-descr  = 'Update Kits - Fulfillment'.
         if totals-descr  = 'Update Kits - COGS'.
          totalsff-descr  = 'Update Kits - Fulfillment'.
          totalsff-fkimg  = totals-fkimg.
          totalsff-amount = totals-fkimg * fix_gr2.
        delete totals.
          append totalsff.
          clear  totalsff.
        endif.
      if totals-descr   = 'Reorders - Fulfillment'.
        if totals-descr   = 'Reorders'.
          totalsff-descr  = 'Reorders - Fulfillment'.
          totalsff-fkimg  = totals-fkimg.
          totalsff-amount = totals-fkimg * reorders.
          delete totals.
          append totalsff.
          clear  totalsff.
        endif.
      endloop.
    endform.                    " fulfillment
    *&      Form  file_out
          text
    -->  p1        text
    <--  p2        text
    FORM file_out.
    if not tab_cogs[] is initial.
      append lines of tab_rord to tab_cogs.
    endif.
    if fore_g = 'X'.   "program run in foreground.
    check not file2 is initial.
    CALL FUNCTION 'WS_DOWNLOAD'
       EXPORTING
       BIN_FILESIZE                  = ' '
       CODEPAGE                      = ' '
         FILENAME                      = file2
         FILETYPE                      = 'DAT'
       MODE                          = ' '
       WK1_N_FORMAT                  = ' '
       WK1_N_SIZE                    = ' '
       WK1_T_FORMAT                  = ' '
       WK1_T_SIZE                    = ' '
       COL_SELECT                    = ' '
       COL_SELECTMASK                = ' '
       NO_AUTH_CHECK                 = ' '
    IMPORTING
       FILELENGTH                    =
       TABLES
         DATA_TAB                      = tab_cogs
       FIELDNAMES                    =
       EXCEPTIONS
         FILE_OPEN_ERROR               = 1
         FILE_WRITE_ERROR              = 2
         INVALID_FILESIZE              = 3
         INVALID_TYPE                  = 4
         NO_BATCH                      = 5
         UNKNOWN_ERROR                 = 6
         INVALID_TABLE_WIDTH           = 7
         GUI_REFUSE_FILETRANSFER       = 8
         CUSTOMER_ERROR                = 9
         OTHERS                        = 10
    IF SY-SUBRC <> 0.
      MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    CALL FUNCTION 'WS_DOWNLOAD'
       EXPORTING
       BIN_FILESIZE                  = ' '
       CODEPAGE                      = ' '
         FILENAME                      = file4
         FILETYPE                      = 'DAT'
       MODE                          = ' '
       WK1_N_FORMAT                  = ' '
       WK1_N_SIZE                    = ' '
       WK1_T_FORMAT                  = ' '
       WK1_T_SIZE                    = ' '
       COL_SELECT                    = ' '
       COL_SELECTMASK                = ' '
       NO_AUTH_CHECK                 = ' '
    IMPORTING
       FILELENGTH                    =
       TABLES
         DATA_TAB                      = totals
       FIELDNAMES                    =
       EXCEPTIONS
         FILE_OPEN_ERROR               = 1
         FILE_WRITE_ERROR              = 2
         INVALID_FILESIZE              = 3
         INVALID_TYPE                  = 4
         NO_BATCH                      = 5
         UNKNOWN_ERROR                 = 6
         INVALID_TABLE_WIDTH           = 7
         GUI_REFUSE_FILETRANSFER       = 8
         CUSTOMER_ERROR                = 9
         OTHERS                        = 10
    IF SY-SUBRC <> 0.
      MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    else.              "program run in background.
    check not file3 is initial.
    open dataset file3 for output.
      IF sy-subrc = 0.
       loop at tab_cogs.
         write:/ tab_cogs.
        IF sy-subrc <> 0.
          EXIT.
        ELSE.
        ENDIF.
       ENDLOOP.
      endif.
    CLOSE DATASET file3.
    open dataset file5 for output.
      IF sy-subrc = 0.
       loop at totals.
         write:/ totals.
        IF sy-subrc <> 0.
          EXIT.
        ELSE.
        ENDIF.
       ENDLOOP.
      endif.
    CLOSE DATASET file5.
    endif.
    ENDFORM.                    " file_out
    <b>CAN ANYONE TELL ME WHERE IS THE MISTAKE.....</b>
    Raju.
    Message was edited by:
            pratap mandapati

    Hi pratap,
    this message is issued by your(?) program (see line 550) to inform you that no data has been found.
    The syntax warnings are not the reason.
    Further analysis is not possible without your actual database contents.
    Regards,
    Clemens

  • CAST Not working for me - Arithmetic overflow error converting int to data type numeric - error

    GPM is DECIMAL(5,2)
    PRICE is DECIMAL(11,4)
    COST is DECIMAL(7,2)
    Trying to update the Gross Profit Margin % field and I keep getting the "Arithmetic overflow error converting int to data type numeric" error.
    UPDATE SMEMODETAIL SET SMD_GPM = (SMD_PRICE-SMD_COST) / SMD_PRICE * 100
    FROM SMEMODETAIL WHERE SMD_PRICE<>0 AND SMD_QUANTITY<>0
    Example record:
    SMD_PRICE    SMD_COST    GPM%
    1.8500            1.62                12.4324324324324300
    I added cast and I still get the error.
    How do I format to get this to work?
    Thanks!

    Hi GBerthume,
    The error is caused by some value such as 1000.01 of the expression (SMD_PRICE-SMD_COST) / SMD_PRICE * 100 exceeds the
    precision of the column(DECIMAL(5,2)). The example data doesn't cause the overflow error for the value of the expression is 12.43 which is in the scope of DECIMAL(5,2).
    USE TestDB
    CREATE TABLE SMEMODETAIL
    SMD_PRICE DECIMAL(11,4),
    SMD_COST DECIMAL(7,2),
    SMD_GPM DECIMAL(5,2)
    INSERT INTO SMEMODETAIL(SMD_PRICE,SMD_COST) SELECT 1.8500,1.62
    UPDATE SMEMODETAIL SET SMD_GPM = (SMD_PRICE-SMD_COST) / SMD_PRICE * 100
    FROM SMEMODETAIL WHERE SMD_PRICE<>0-- AND SMD_QUANTITY<>0
    SELECT * FROM SMEMODETAIL
    DROP TABLE SMEMODETAIL
    The solution of your case can be either scale the DECIMAL(5,2) or follow the suggestion in Scott_morris-ga's to check and fix your data.
    If you have any question, feel free to let me know.
    Eric Zhang
    TechNet Community Support

  • Urgent!!! How to convert received mail 'content type?

    How to convert received mails 'content type from text/plain to multipart/*?

    you cannot change the content type of a Message object which has been received. What you can do is create an instance of a MimeMessage class and set the content type as multipart and then add the received message as a bodypart to that message.
    You can look at the javamail example codes as to how to create a new MimeMessage with multipart content.
    anurag

  • Arithmetic Overflow error converting float to data type numeric

    Hi,
    Am facing strange issue,I have function which returns money datatype and assigning the return money value to float datatype in table.
    Error msg:
    Msg 8115, Level 16, State 6, Procedure GBCalcCatalogPriceNewV2, Line 204
    Arithmetic overflow error converting float to data type numeric.
    The statement has been terminated.
    Strange thing is the same stored procedure is working fine in production environment,but in the deveopment i see this error.Am scared if the same happens in the production environment.Please advice and advance
    thanks
    Regards
    RAj

    Strange thing is the same stored procedure is working fine in production environment,
    How could that be strange? This is an error that occurs depending on the data. Accidents that are waiting to happen will happen sooner or later.
    Then again, a development database may be more prone to such errors, because data that entered are completely out of whack with real life data. Still it is a warning sign. If you have some place where you convert data from float to numeric, you must consider
    the risk that the float value is outside the range for the numeric data type. How do you prevent that from happening? Maybe a CHECK constraint on the column? Of if the data origins from a money column, use a numeric data type with sufficient precision.
    Erland Sommarskog, SQL Server MVP, [email protected]

  • Convert p type into c type

    hii experts,
    i have a structure.
    In that i use
    V(8) TYPE P.
    but when i save the file it gives dump.
    it needs TYPE C.
    so how i convert tthat PACKED type inco CHAR type.
    Please provide me the code.
    thanks
    babbal

    Hi,
    do like this.
    data : v_num(8)  type p,
              v_num1(8) type N,
             v_num2(8) type c.
    v_num1 = v_num.
    v_num2  = v_num1.
    Regards
    Sandeep REddy

  • I want to convert the quantity(datau2019s type - QUAN) in words.

    Hi All,
    I want to convert the quantity(datau2019s type - QUAN) in words.
    I am using function module SPELL_AMOUNT. But I donu2019t use input parameter u201CCURRENCYu201D because I use the quantity instead of amount.
    But my problem is when i pass quantity value such as 195.500 without input parameter u201Ccurrencyu201D its just giving me output as ONE HUNDRED NINETY-FIVE THOUSAND FIVE HUNDRED in the field u201CSPELL-WORDu201D( the field u201CSPELL-DECWORDu201D is empty) instead of ONE HUNDRED NINETY-FIVE in the field u201CSPELL-WORDu201D and FIFTY in the field u201CSPELL-DECWORDu201D.
    DATA:
      v_fkimg1 TYPE vbrp-fkimg value '195.500',
      wa_spell TYPE spell.
      CALL FUNCTION 'SPELL_AMOUNT'
        EXPORTING
          amount    = v_fkimg1
          filler    = ' '
          language  = sy-langu
        IMPORTING
          in_words  = wa_spell
        EXCEPTIONS
          not_found = 1
          too_large = 2
          OTHERS    = 3.
      write: / wa_spell-word, wa_spell-decword.
    What should i do to solve this problem.
    Is there any other fn module or am i giving some wrong input?
    Plz suggest me.
    Regards,
    Sergey.

    Hi,
    Use FM 'HR_IN_CHG_INR_WRDS' as follows :
    CALL FUNCTION 'HR_IN_CHG_INR_WRDS'
    EXPORTING
    amt_in_num = b
    IMPORTING
    amt_in_words = a
    EXCEPTIONS
    data_type_mismatch = 1.
    This will give you amount with decimal values as well but here there is another problem like if u give input as 19.50 it gives output as :
    NINETEEN RUPPESS FIFTY PAISE.
    May be after out put can do operation like find string and delete rupees and paise from the that.
    Hope this would be of some help!!!
    Regards,
    Lalit Kabra

  • Which Acrobat or Adobe product is best to subscribe to for converting Word files (all types) to pdf files and visa versa?

    Which Acrobat or Adobe product is best to subscribe to for converting Word files (all types) to pdf files and visa versa?
    Thank you!

    Probably PDF Pack: Reliably Create PDFs, Convert PDFs, & Merge PDFs Online | Adobe PDF Pack

  • Converting a master follower type Cam Grinding Machine to CNC

    I was searching for information about cam grinding machine conversions and saw website that talked about  Converting a Master follower type Cam grinding machine to a machine
    that uses data files which contain lobe profile information to control the movement of the machine. The website had information about the conversion which said they used National
    Instruments Hardware and LabView Software to control precision servos. The company mentioned in the Website was MAYURAS this company apparently is in India. I've Had no luck contacting them.
    We own one of the Master Follower Type Machines and for years I have considered converting it to Computer Numeric Control. We already Generate the precise  profiles using 
    in house software and software purchased from other vendors. The software generates files accurate to .000001" Unfortunately  the masters we generate now are only accurate  to .0005"  this is because our Vertical machining centers are only accurate to .0005"     
         My company has used National Instruments CVI package to generate a Software package for adjusting and monitoring our Engine management System. We have been using the CVI package for over 10 years to control our Hardware.

    I had hoped to contact someone who had converted this type of machine to find out more about the hardware and software used. Also to get a better idea of how well
    the converted machine has performed over time and what the cost of the conversion might be.

  • Convert TYPE string to TYPE p in a UNICODE system

    Hi-
    I've got a string that contains an amount and I want to convert it into a TYPE p in my program to store as a proper amount in the database.
    I can't do a simple move or use FMs like HMRC_AMOUNT_STRING_CONVERT as I am in a Unicode system and it errors if I try these.
    How can I do it.
    Example.
    parameters p_amount type string.
    start-of-selection.
    data l_amount TYPE p decimals 2.
    MOVE p_amount TO l_amount.
    =>compile error.

    Hi   Tristan.....
    IN PARAMETERS we ca have only have predefined data
    The data types valid for parameters include The built-in ABAP types c, d, i, n, p, t, and x
    You cannot use data type F, references and aggregate types.
    But you are using type STRING which is not allowed.
    so you are getting a compiler error.
    Suresh.....

  • Converting type P to type C

    I am having some trouble converting some data from type P to type C.  I am only new to abap so please bear with me
    I have two variables
    DATA gv_shifttime TYPE p.
    DATA lv_shifttime type c.
    I do some calculations and put the result in gv_shifttime.
    When I run the code
    lv_shifttime = gv_shifttime.
    all I get in lv_shifttime is *

    Hi,
    So why do you want to convert a packed type into character type? Can't you display directly, i mean to say, can't you directly add it to commentery directly?
    Or is there any necessicity that you need to convert it in character format?
    Also, when you define character type variable you need to spcify length, otherwise it takes default length which is 1 in this case.
    You need to define your variable as
    DATA lv_shifttime type char10.
    It defines variable lv_shifttime with length 10.
    Thanks,
    Archana

  • Convert type p to type c

    Hello,
    I need to convert a variable of type P into a variable of type C.
    I tried already to just assign it:
    DATA:
    varc type c,
    varc type p.
    varp = 1000.
    varc = varp.
    But then varc has always * as value.
    Then I tried the command unpack which should do it according to SAP help:
    UNPACK varp TO varc.
    But then my varc always has 0 as value.
    Any suggestions?
    Thanks
    Anne

    Hi Anne,
    Check this link
    http://help.sap.com/saphelp_webas620/helpdata/EN/fc/eb3434358411d1829f0000e829fbfe/content.htm
    Try MOVE statement and check.
    Hope this helps you
    Edited by: Harsh Bhalla on Jan 19, 2010 10:43 PM

  • Convert avi type 1 to type 2 ???

    How / best way / software to Convert avi type 1 to type 2 for use in PPro?

    The classic for this has been the Ulead free tool.
    http://www.ulead.com/download/dvconverter/download.htm
    When I looked for the site for it today, I see a post (on another site) that it may not convert clips over 4 Gigs correctly (and without any error message). Anyone know whether this is true?

  • Converting Float to P type without rounding

    Hello people,
    I'm looking for a function, or even a pease of code to convert F variables to P variables without rounding the value.
    Thanks alot,
    Daniel Marchena
    Edited by: danielmp on Nov 28, 2011 1:22 PM

    Thank's a lot everyone.
    The following code solved my problem:
    REPORT  ZNAME.
    DATA: FLOAT         TYPE f,
               PACKED(15) TYPE p DECIMALS 3.
    DATA: GV_STR TYPE STRING,
                GV_STR1 TYPE STRING,
                GV_STR2 TYPE STRING.
    GV_STR = FLOAT.
    SPLIT GV_STR AT '.' INTO GV_STR1 GV_STR2.
    CLEAR GV_STR.
    CONCATENATE GV_STR1 '.' GV_STR2+0(3) INTO GV_STR. " here in this step 3 is the number of decimals you wish to have
    PACKED = GV_STR.
    WRITE PACKED.

  • Arithmetic overflow error converting expression to data type int

    Hi
        iam creating on sp for  the  database total size , used mb and  free size .  percentage free . 
     in  this purpose i was creating on sps, with in the sp iam was writing  one select statement . it  statement is    
    SELECT [Drivename] ,[DataSizedUsedMB],[DriveFreeSizeMB],DriveTotalSizeMB,
      CAST( (DriveFreeSizeMB/DriveTotalSizeMB)*  100 AS NUMERIC(5,2))
       As
      [PercentFree] ,[DateRecorded] FROM 
    SELECT SUBSTRING([physical_name],1,1) AS Drivename,
      CAST(((SUM(COALESCE(size,0)))*8)/1024 AS NUMERIC(20,2)) AS DriveTotalSizeMB,
      CAST(((SUM( COALESCE( FILEPROPERTY( [name],'SpaceUsed'),0)))*8)/1024 AS NUMERIC(20,2)) AS DataSizedUsedMB,
      CAST(((SUM(COALESCE(size,0))-SUM(COALESCE(fileproperty([name],'spaceused'),0)))*8/1024)AS NUMERIC(20,2)) AS DriveFreeSizeMB
      ,SYSDATETIME()  AS [DateRecorded]
    FROM sys.master_files 
    GROUP BY SUBSTRING([physical_name],1,1))  AS Data
      it was executive one  server with out error  but the same select  statement is writing antoher server iam geeting  belo error.
    "@ErrorDesc: Line 24 - Line 13- Arithmetic overflow error converting expression to data type int." 
      how to slove this issue..
    please help me...

    Change 8 to 8E0, to make it a float literal. The data type of
    SUM(COALESCE(size,0)))*8)
    is int, since all components are int, and it can easily overflow the size for an int. If you use 8E0, you get a float, and the entire expression will be float.
    Erland Sommarskog, SQL Server MVP, [email protected]

Maybe you are looking for

  • Error/warning in dict. Activator while activating the infocube

    Hi All,     When we are trying to add one of the characteristic info object into Infocube, the system throws following message. deleted the index ,then also same issue. Activation of Objects with Type InfoCube Checking Objects with Type InfoCube Chec

  • Dynamic creation of context nodes and ui elements

    Hi, I have created context nodes dynamically. And i also want to create UI elements dynamically wherein i want to bind the attribute from the context node to it. For example i want to create a drop down by index and bind one of the attributes in the

  • Mac Mini and startup drives

    I'm not having a problem, but I'm helping my brother, who is new to Macs, with his new Mac Mini. He's having trouble with one drive he wants to use as a mirror-image backup drive; somewhere in the back of my mind I recall reading something about not

  • Reg passing values to a link

    Hi all, Is it possible to pass values to a link. The requirement is i need to pass some values to a standard transaction link and the values which i pass should go to the respective fields of the link. Can anyone suggest? Thanks and Regards, Sneha.

  • Page opens in a particular section of the document on CommandButton click

    Hi all, In my application the new url to go is decided at run time. This is done in the commandButton processAction(ActionEvent event) method. Now the problem is that the new page to be opened in a particular section of the current page .. say for ex