ALV QUANTITY field Geting converted into decimals ?

Hi All ,
I have developed an alv report .In that the quantity field is made editable after editing the quantity when i save it .It gets converted into decimals.Suppose if i give 77 its getting reflected as .077 all the field name ,table name ,reference field name, reference table name, quantity field data type has been passed but the problem persists.If there is any one whos has come across this kind of scenario please share your thoughts on this.
Best Regards,
Sreeram

Hi Sreeram,
I am not gettin this issue. See below code :
If you are gettiing the same issue with the below code then it has something to do with your user settings.
Go to Menu Item System -> User Profile -> Own Data -> Defaults ->Decimal Notation.
Set it to 1,234,567.89 and save. Now try the program again.
REPORT z_test.
TYPE-POOLS: slis.
TYPES : BEGIN OF ty_ekpo,
          ebeln TYPE ebeln,
          ebelp TYPE ebelp,
          ktmng TYPE ktmng,
          menge TYPE bstmg,
        END OF ty_ekpo.
DATA: it_ekpo TYPE TABLE OF ty_ekpo,
      it_fieldcat TYPE slis_t_fieldcat_alv.
SELECT ebeln ebelp ktmng menge
  FROM ekpo
  INTO TABLE it_ekpo
  UP TO 20 ROWS.
PERFORM add_fieldcat USING 'EBELN'.
PERFORM add_fieldcat USING 'EBELP'.
PERFORM add_fieldcat USING 'KTMNG'.
PERFORM add_fieldcat USING 'MENGE'.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
   i_callback_program                = sy-repid
   it_fieldcat                       = it_fieldcat
  TABLES
    t_outtab                          = it_ekpo
EXCEPTIONS
   program_error                     = 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.
FORM add_fieldcat  USING  p_fieldname TYPE slis_fieldcat_alv-fieldname.
  DATA: wa_fieldcat TYPE slis_fieldcat_alv.
  CLEAR wa_fieldcat.
  wa_fieldcat-fieldname = p_fieldname.
  wa_fieldcat-tabname = 'IT_EKPO'.
  wa_fieldcat-ref_fieldname = p_fieldname.
  wa_fieldcat-ref_tabname = 'EKPO'.
  IF p_fieldname EQ 'KTMNG'.
    wa_fieldcat-edit = 'X'.
  ENDIF.
  APPEND wa_fieldcat TO it_fieldcat.
ENDFORM.                    " ADD_FIELDCAT
Regards,
Jovito

Similar Messages

  • ALV: Quantity field displays both blank and 0 value.

    Hi,
    My ALV has a quantity field. The requirement is for the first time displaying the value of this column always blank but once user change it to 0, it should keep 0 value.
    I implemented the first requirement by setting the property Display Leading Zeros in Formatting area to "Zeros as Blanks" for the corresponding attribute/node in context. The problem is whenever I key in 0 then enter --> the value of this field is always set back to null.
    I have another solution is using type char instead of type quantity. But this is the last choice because I don't want to validate and make the char field works as the numeric field.
    Please help.
    Thanks,
    Khanh
    Edited by: khaliachika on Jul 16, 2010 12:36 AM

    Hi Anu,
    One question from my side.
    U have displayed the ALV.In that grid u have quantity field.U have changed the value of that field to 45.
    When u press enter the value has been changed to .045.Is this u r problem.
    U can do onething anu.
    Declare one varaible with the local field.
    Pass u r quantity field value into that variable.
    While displaying thriugh SET_TABLE_FIRST_DISPLAY in your internal table pass this variable.
    It will solve u r problem.I think.
    Let me if yu have any problem
    IF u want u can refer to the program BCALV_EDIT* in se38.
    There also u have needful info
    Thanks,

  • Editable ALV- Quantity field value is getting changed while double clicking

    Hi all,
         I have created Editable ALV grid using Class concepts. Quantity field is editable in dat. but after changing value and if im double clicking on that field, value is getting changed. eg: 45 is changing to .045. How can i resolve this problem.
    Could u plz help.

    Hi Anu,
    One question from my side.
    U have displayed the ALV.In that grid u have quantity field.U have changed the value of that field to 45.
    When u press enter the value has been changed to .045.Is this u r problem.
    U can do onething anu.
    Declare one varaible with the local field.
    Pass u r quantity field value into that variable.
    While displaying thriugh SET_TABLE_FIRST_DISPLAY in your internal table pass this variable.
    It will solve u r problem.I think.
    Let me if yu have any problem
    IF u want u can refer to the program BCALV_EDIT* in se38.
    There also u have needful info
    Thanks,

  • Blank field getting converted into wrong date

    Dear All,
    I have one date field in SAP table in which there are some entries and some blank entries.
    when Proxy is sending this data from ECC blank entries are converted into 00000000 and through XI in file
    this
    00000000 entry for date getting converted into wrong date like 30.11.0002 in file.
    I have taken data type as string do I need to take data type as date.
    My doubt is if there is no entry in table why it is convertng to  00000000  and after passing from XI why it is converting into
    30.11.0002 .
    Regards

    Hi ,
    My date format like this
    source --yyyyMMDD
    target-DD.MM.YYYY
    so if
    source is
    00000000
    should comes like this
    target
    00.00.0000
    but it is converting into
    30.11.0002
    every where in file values for 00000000 is coming like 30.11.0002
    Regards

  • String field value convert into Date with validation

    Dear all,
    I need some help if someone can please?
    Actually I am getting date in string format as 20110315 or 20111025 or so on. I could use to date function for this for conversion but what if 20091432 which is wrong so I can hadle this.
    Actually I m using oracle 10g and using anonymous pl SQL block . Can't write function or procedure for this. So I am extracting all the data including date as above and setting some flag so if date is correct then y otherwise no. Pls help. I think I have described everything what exactly I want?
    If date is correct then insert in the different table otherwise setting flag if date is not correct. I.e. bdate varchar2
    Best regards,
    Edited by: Irha10 on 26-Jul-2012 12:29

    Why wouldn't you be able to use a function or procedure in your anonymous block?
    SQL> declare
      2  --
      3   function is_valid_date
      4    ( p_str in varchar2
      5    , p_format in varchar2 default 'yyyymmdd'
      6    )
      7    return varchar2
      8    as
      9      dt date;
    10    begin
    11      dt := to_date(p_str, p_format);
    12      return 'Valid';
    13    exception
    14      when others
    15      then
    16        return 'Invalid'; 
    17    end;
    18  --
    19  begin 
    20    for rec in ( select 20110315 str from dual union
    21                 select 20111025 from dual union
    22                 select 20091432 from dual
    23               )
    24            
    25    loop
    26      dbms_output.put_line(rec.str||'  '||is_valid_date(rec.str));
    27    end loop;
    28  end;
    29  /
    20091432  Invalid
    20110315  Valid
    20111025  Valid
    PL/SQL procedure successfully completed.Just a small example, instead of dbms_output, you could do an update of a 'Valid' column etc. etc...

  • Convert quantity field

    Hi All,
    How would I convert quantity field thats coming into XI as 6.000 to 6?? On the receiving side quantity is of integer data type.

    use the standard function 'formatNum' to achieve this...
    the parameter of 'formatNum' should be set to '#'....
    Thanks,
    Renjith
    Message was edited by:
            Renjith Andrews

  • Reg: Quantity field taking as decimal values

    Dear Experts
    In the Bapi BAPI_SALESORDER_SIMULATE the structure BAPIITEMIN contains a field Req_qty that has the data element WMENGC which is taking the input with 3 decimal points even though the domain doesnt contains any decimals, because of this im facing the problem while giving the input.
    Is there any functional requirement to avoid that quantity field taking those 3 decimals
    eg: Original Value: 1000
          Input Value(Converted Value)    : 1.000
    Kindly suggest me a solution to sort out the issue.
    Regards
    Arun.P

    well i suspect that this bapi also has a currency field, which you should fill.
    If he knows the currency he should be able to find out how much decimals there are customized for this currency, and then probably he will do it right.
    oh lol you are talking of quantities and not values... sorry forget about my comment...
    Edited by: Florian Kemmer on Jul 22, 2010 2:37 PM

  • How to truncate the decimals in the ALV report for the quantity field

    Hi All,
    I have to display a quantity field and units of measure in the ALV output. If the units of measure eq 'PC' i should not display the decimal places for quantity in the alv output, otherwise i have to display the decimals in the output. How to do this....any help would be highly rewarded. I knew that for this type of cases decimal_o will not work.

    Hi,
    Declare one more Internal table same as output table. In that intead of that quantity field, declare field_name(15) type c.
    data temp type i.
    Loop at itab.
    if field = 'PC'.
    temp = qunantity field.
    field_name =temp.
    else.
    field_name = quantity field.
    endif.
    endif.
    endloop.

  • Quantity field for user input in interactive alv

    hi,
    i have created an interactive alv report that allows user to key in quantity fields using fm "REUSE_ALV_LIST_DISPLAY'. then quantity field is referred to MARD-LABST for instance, with 3 decimals point. When i tried to key in quantity as '9', it then will be converted into 0.009 by using cl_gui_alv_grid->check_changed_data( ). May i know what the root causes are and also how to resolve it using same fm??? Thanks.

    Hi,
    In the field catalog, for the field set the attribute DECIMALS to 3.
    This should resolve your issue.
    Regards,
    Sagar

  • Quantity field in ALV

    Hello All,
          I am using OO - ALV in which I am displaying a quantity field.This field is an editable field and if user tries to change the value and SAVE , it is taking some wrong values.
    Say suppose I am having 1.000 as the initial value and if user changes it to 2.000 and saves it is converted to .002.
    I tried with qfieldname , ref_fieldname of fieldcat but of no use. Anything apart from this will be highly appreciated.
    Regards,
    Dhwani

    User might be changing the value to only 2 and you might have declared the fieldcat with 2-3 decimal places. If you enter value with decimals say 2.001 it will take.
    Otherwise you need to replace it with char value as Nanda has suggested.
    Hope it helps.
    Thanks,
    Jayant

  • ALV output converted into PDF format and send that PDF to user through mail

    Hi Experts,
    I have report earlier its output was in alv grid.
    Now i want that ALV output converted into PDF format.And that PDF output send to user through mail.
    Can u please tell how to do?
    My code is here(output is displaying in ALV grid).
    INCLUDE <icon>.
    TYPE-POOLS: slis, kkblo.
    TABLES : zmsd_freight_hdr, zmsd_freight_det, zmsd_blinfo, zmsd_diheader.
    TABLES : lfa1.
    DATA : t_hdr   LIKE   zmsd_freight_hdr   OCCURS 0 WITH HEADER LINE,
           T_DET   LIKE   ZMSD_FREIGHT_DET   OCCURS 0 WITH HEADER LINE,
           t_bl    LIKE   zmsd_blinfo        OCCURS 0 WITH HEADER LINE,
           t_di    LIKE   zmsd_diheader      OCCURS 0 WITH HEADER LINE.
    DATA: BEGIN OF t_det OCCURS 0.
            INCLUDE STRUCTURE zmsd_freight_det.
    DATA    type(30).
    DATA: END OF t_det.
    DATA: v_target2(30),
          v_zsammg LIKE t_det-zsammg,
          v_gsttotal LIKE t_det-zamount.
    DATA : BEGIN OF t_data OCCURS 0,
             zsammg       LIKE  zmsd_freight_hdr-zsammg,
             zdidbl       LIKE  zmsd_freight_hdr-zdidbl,
             zvkorg       LIKE  zmsd_freight_hdr-zvkorg,
             zinvno       LIKE  zmsd_freight_hdr-zinvno,
             zttlamt      LIKE  zmsd_freight_hdr-zttlamt,
             zstatus      LIKE  zmsd_freight_hdr-zstatus,
             ztype        LIKE  zmsd_freight_hdr-ztype,
             zconfirm     LIKE  zmsd_freight_hdr-zconfirm,
             zconfirmdate LIKE  zmsd_freight_hdr-zconfirmdate,
             erdat        LIKE  zmsd_freight_hdr-erdat,
             ernam        LIKE  zmsd_freight_hdr-ernam,
             erzet        LIKE  zmsd_freight_hdr-erzet,
             aedat(10),
             aenam        LIKE  zmsd_freight_hdr-aenam,
             aezet        LIKE  zmsd_freight_hdr-aezet,
             zline        LIKE  zmsd_freight_det-zline,
             zfptype      LIKE  zmsd_freight_det-zfptype,
             zchrcode     LIKE  zmsd_freight_det-zchrcode,
             zcurcode     LIKE  zmsd_freight_det-zcurcode,
             zqty         LIKE  zmsd_freight_det-zqty,
             zuom         LIKE  zmsd_freight_det-zuom,
             zrate        LIKE  zmsd_freight_det-zrate,
             zamount      LIKE  zmsd_freight_det-zamount,
             zexrate      LIKE  zmsd_freight_det-zexrate,
           zccode       LIKE  zmsd_blinfo-zccode,      "MADK991565
             zccode       like  ZMSD_FREIGHT_HDR-zfcode, "MADK991565
             zbldate(10),
             zbl          LIKE  zmsd_blinfo-zbl,
             type(3),
             waerk        LIKE  zmsd_freight_det-zcurcode,
             zamountl     LIKE  zmsd_freight_det-zamount,
           END OF t_data.
    DATA : w_layout      TYPE   slis_layout_alv,
           w_catalog     TYPE   slis_fieldcat_alv,
           t_catalog     TYPE   slis_t_fieldcat_alv,
           w_sort        TYPE   slis_sortinfo_alv,
           t_sort        TYPE   slis_t_sortinfo_alv.
    DATA   V_ZINVNO    like   T_HDR-ZINVNO.                   "MADK991565
    DATA : v_count  TYPE  i.
    SELECTION-SCREEN BEGIN OF BLOCK a0 WITH FRAME TITLE text-001.
    PARAMETERS     :  p_zvkorg LIKE zmsd_freight_hdr-zvkorg  OBLIGATORY .
    SELECT-OPTIONS :  s_zdidbl FOR  zmsd_freight_hdr-zdidbl             ,
                      s_zccode FOR  lfa1-lifnr                          ,
                      s_status FOR  zmsd_freight_hdr-zstatus            ,
                      s_ztype  FOR  zmsd_freight_hdr-ztype              ,
                      s_erdat  FOR  zmsd_freight_hdr-erdat              ,
                      s_ernam  FOR  zmsd_freight_hdr-ernam              ,
                      s_zconfd FOR  zmsd_freight_hdr-zconfirmdate       .
    PARAMETERS     :  p_zconf  AS   CHECKBOX                            .
    SELECTION-SCREEN END OF BLOCK a0.
    SELECTION-SCREEN BEGIN OF BLOCK a1 WITH FRAME TITLE text-002.
    PARAMETERS     :  p_hdr    RADIOBUTTON GROUP rad DEFAULT 'X'        ,
                      p_det    RADIOBUTTON GROUP rad                    .
    SELECTION-SCREEN END OF BLOCK a1.
    INITIALIZATION.
    AT SELECTION-SCREEN.
    START-OF-SELECTION.
      PERFORM get_data.
      PERFORM process.
      PERFORM display.
    END-OF-SELECTION.
      PERFORM fm_get_num_pages.
    AT USER-COMMAND.
    AT LINE-SELECTION.
    TOP-OF-PAGE.
      PERFORM fm_top_of_page USING '7010' sy-title space.
    FORM get_data.
      SELECT   *
        FROM   zmsd_freight_hdr
        INTO   TABLE t_hdr
       WHERE   zvkorg        EQ  p_zvkorg
         AND   zdidbl        IN  s_zdidbl
         AND   zstatus       IN  s_status
         AND   ztype         IN  s_ztype
         AND   erdat         IN  s_erdat
         AND   ernam         IN  s_ernam
         AND   zconfirmdate  IN  s_zconfd
         AND   ZFCODE        IN  S_ZCCODE.                      "MADK991565
      IF p_zconf = 'X'.
        DELETE t_hdr WHERE zconfirm NE 'C'.
      ENDIF.
      CHECK NOT t_hdr[] IS INITIAL.
      SELECT   *
        FROM   zmsd_blinfo
        INTO   TABLE t_bl
         FOR   ALL ENTRIES IN t_hdr
       WHERE   zsammg = t_hdr-zsammg.
      SORT t_bl BY zsammg.
      SELECT   *
        FROM   zmsd_diheader
        INTO   TABLE t_di
         FOR   ALL ENTRIES IN t_hdr
       WHERE   zsammg = t_hdr-zsammg.
      SORT t_di BY zsammg.
    IF P_DET = 'X'. "MADK933361
      SELECT   *
        FROM   zmsd_freight_det
        INTO   TABLE t_det
         FOR   ALL ENTRIES IN t_hdr
       WHERE   zsammg  =  t_hdr-zsammg
       AND ZINVNO =  T_HDR-ZINVNO .                           "MADK991565
    SORT t_det BY zsammg zline.                            "MADK991565
       SORT T_DET BY ZSAMMG ZINVNO ZLINE.                     "MADK991565
    ENDIF. "MADK933361
    ENDFORM.
    FORM process.
      REFRESH t_data.
      CLEAR v_gsttotal.                                         "MADK933361
      LOOP AT t_hdr.
    Start of MADK933361
        CLEAR: v_target2.
        v_zsammg = t_hdr-zsammg.
        V_ZINVNO = T_HDR-ZINVNO.                                "MADK991565
       AT NEW zsammg.                                         "MADK991565
         AT NEW ZINVNO.                                         "MADK991565
          PERFORM get_gst_value.
        ENDAT.
    End of MADK933361
        PERFORM move_header.
        CHECK t_data-zccode IN s_zccode.
        IF p_det = 'X'.
    CSF Project Changes Starts   DEV34    MADK985782
        LOOP AT T_DET WHERE ZSAMMG = T_HDR-ZSAMMG..
          LOOP AT t_det WHERE zsammg = t_hdr-zsammg AND
                              zinvno = t_hdr-zinvno.
    CSF Project Changes Ends     DEV34    MADK985782
            PERFORM move_header.
            CHECK t_data-zccode IN s_zccode.
            MOVE-CORRESPONDING t_det TO t_data.
            t_data-zamountl = t_data-zamount * t_data-zexrate.
            APPEND t_data.
            CLEAR t_data.
          ENDLOOP.
        ELSE.
          APPEND t_data.
          CLEAR t_data.
        ENDIF.
        AT END OF zsammg.
          CLEAR v_gsttotal.
        ENDAT.
    *Start of changes for  IS090901289-PIA MADK991565
        AT END OF ZINVNO.
          CLEAR V_GSTTOTAL.
        ENDAT.
    *End of changes for  IS090901289-PIA MADK991565
      ENDLOOP.
    ENDFORM.
    FORM move_header.
      MOVE-CORRESPONDING t_hdr TO t_data.
      t_data-zttlamt = t_data-zttlamt + v_gsttotal.             "MADK933361
      t_data-waerk = 'SGD'.
      IF NOT t_hdr-aedat IS INITIAL.
        WRITE: t_hdr-aedat TO t_data-aedat.
      ELSE.
        CLEAR : t_data-aedat.
      ENDIF.
      READ TABLE t_bl WITH KEY zsammg = t_hdr-zsammg BINARY SEARCH.
      IF sy-subrc EQ 0.
      t_data-zccode  = t_bl-zccode.   "MADK991565
        T_DATA-ZCCODE = T_HDR-ZFCODE.   "MADK991565     
        IF NOT t_bl-zbldate IS INITIAL.
          WRITE: t_bl-zbldate TO t_data-zbldate.
        ENDIF.
        t_data-zbl     = t_bl-zbl.
        t_data-type    = 'DBL'.
      ELSE.
        READ TABLE t_di WITH KEY zsammg = t_hdr-zsammg BINARY SEARCH.
        IF sy-subrc EQ 0.
        t_data-zccode  = t_di-zdiforcode.     "MADK991565
          T_DATA-ZCCODE = T_HDR-ZFCODE.         "MADK991565
          t_data-type    = 'DI'.
        ENDIF.
      ENDIF.
    ENDFORM.
    FORM display.
      IF t_data[] IS INITIAL.
        MESSAGE s398(00) WITH 'No Data Selected'.
        EXIT.
      ENDIF.
      DATA : l_repid LIKE sy-repid.
      l_repid = sy-repid.
      REFRESH t_catalog.
      CLEAR   t_catalog.
      w_layout-cell_merge = 'X'.
      PERFORM map_fields.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
           EXPORTING
                i_callback_program      = l_repid
                i_callback_user_command = 'ALV_USER_COMMAND'
                is_layout               = w_layout
                it_fieldcat             = t_catalog[]
                i_grid_title            = sy-title
                i_save                  = 'A'
                it_sort                 = t_sort[]
           TABLES
                t_outtab                = t_data
           EXCEPTIONS
                program_error           = 1
                OTHERS                  = 2.
      IF sy-subrc <> 0.
      ENDIF.
    ENDFORM.
    FORM map_fields.
    Sort Order
      CLEAR v_count.
      PERFORM sf USING 'ZDIDBL'   'X'  'X'.
    Fields to be displayed
      CLEAR v_count.
      IF p_hdr = 'X'.
        PERFORM af USING :
       DESCRIPTION       FIELD        LEN   RTABLE             RFIELD
        'DI/DBL         ' 'ZDIDBL'     '14' '                ' '        ',
        'Type           ' 'TYPE'       '04' '                ' '        ',
        'Forwarder Code ' 'ZCCODE'     '14' '                ' '        ',
        'BL Number      ' 'ZBL'        '14' '                ' '        ',
        'BL Date        ' 'ZBLDATE'    '10' '                ' '        ',
        'Invoice Number ' 'ZINVNO'     '15' '                ' '        ',
        'Extraction     ' 'ZSTATUS'    '05' 'ZMSD_FREIGHT_HDR' 'ZSTATUS ',
        'Freight Type   ' 'ZTYPE'      '05' 'ZMSD_FREIGHT_HDR' 'ZTYPE   ',
        'Confirmation   ' 'ZCONFIRM'   '05' 'ZMSD_FREIGHT_HDR' 'ZCONFIRM',
        'Confirm Date   ' 'ZCONFIRMDATE' '10' 'ZMSD_FREIGHT_HDR'
    'ZCONFIRMDATE',
        'Total Amount   ' 'ZTTLAMT'    '18' '                ' '        ',
        'Created On     ' 'ERDAT'      '10' '                ' '        ',
        'Created By     ' 'ERNAM'      '10' '                ' '        ',
        'Changed On     ' 'AEDAT'      '10' '                ' '        ',
        'Changed By     ' 'AENAM'      '10' '                ' '        '.
      ELSE.
        PERFORM af USING :
       DESCRIPTION         FIELD     LEN   RTABLE             RFIELD
        'DI/DBL           ' 'ZDIDBL'   '14' '                ' '        ',
        'Type             ' 'TYPE'     '04' '                ' '        ',
        'Forwarder Code   ' 'ZCCODE'   '14' '                ' '        ',
        'BL Number        ' 'ZBL'      '14' '                ' '        ',
        'BL Date          ' 'ZBLDATE'  '10' '                ' '        ',
        'Invoice Number   ' 'ZINVNO'   '15' '                ' '        ',
        'Extraction       ' 'ZSTATUS'  '05' 'ZMSD_FREIGHT_HDR' 'ZSTATUS ',
        'Freight Type     ' 'ZTYPE'    '05' 'ZMSD_FREIGHT_HDR' 'ZTYPE   ',
        'Confirmation     ' 'ZCONFIRM' '05' 'ZMSD_FREIGHT_HDR' 'ZCONFIRM',
        'Confirm Date     ' 'ZCONFIRMDATE' '10' 'ZMSD_FREIGHT_HDR'
    'ZCONFIRMDATE',
        'Total Amount     ' 'ZTTLAMT'  '18' '                ' '        ',
        'Freight Payment  ' 'ZFPTYPE'  '14' '                ' '        ',
        'Charge Code      ' 'ZCHRCODE' '10' '                ' '        ',
        'Currency         ' 'ZCURCODE' '08' '                ' '        ',
        'Quantity         ' 'ZQTY'     '13' '                ' '        ',
        'UoM              ' 'ZUOM'     '04' '                ' '        ',
        'Rate             ' 'ZRATE'    '15' '                ' '        ',
        'Amt(Foreign Curr)' 'ZAMOUNT'  '16' '                ' '        ',
        'Exchange Rate    ' 'ZEXRATE'  '13' '                ' '        ',
        'Amt(Local Curr)  ' 'ZAMOUNTL' '16' '                ' '        ',
        'Created On       ' 'ERDAT'    '10' '                ' '        ',
        'Created By       ' 'ERNAM'    '10' '                ' '        ',
        'Changed On       ' 'AEDAT'    '10' '                ' '        ',
        'Changed By       ' 'AENAM'    '10' '                ' '        '.
      ENDIF.
    ENDFORM.
    FORM af USING text
                  field
                  len
                  table
                  reffield.
      v_count = v_count + 1.
      w_catalog-col_pos       = v_count.
      w_catalog-fieldname     = field.
      w_catalog-ref_tabname   = table.
      w_catalog-ref_fieldname = reffield.
      w_catalog-seltext_s     = text.
      w_catalog-seltext_m     = text.
      w_catalog-seltext_l     = text.
      w_catalog-outputlen     = len.
      IF field = 'ZTTLAMT' OR field = 'ZAMOUNTL'.
        w_catalog-no_zero     = 'X'.
        w_catalog-cfieldname  = 'WAERK'.
        w_catalog-datatype    = 'CURR'.
      ENDIF.
    IF FIELD = 'ZRATE' OR FIELD = 'ZAMOUNT'.
      IF field = 'ZAMOUNT'.
        w_catalog-no_zero     = 'X'.
        w_catalog-cfieldname  = 'ZCURCODE'.
        w_catalog-datatype    = 'CURR'.
      ENDIF.
      IF field = 'ZQTY' OR field = 'ZRATE'.
        w_catalog-no_zero     = 'X'.
        w_catalog-datatype  =  'DEC'.
      ENDIF.
      APPEND w_catalog TO t_catalog.
      CLEAR  w_catalog.
    ENDFORM.
    FORM sf    USING   fieldname  sortup  group.
      v_count = v_count + 1.
      CLEAR w_sort.
      w_sort-fieldname = fieldname.
      w_sort-spos      = v_count.
      w_sort-up        = sortup.
      w_sort-group     = group.
      APPEND w_sort TO t_sort.
    ENDFORM.
    FORM alv_user_command USING  in_ucomm    LIKE sy-ucomm
                                 in_selfield TYPE slis_selfield.
      DATA: lfs_data LIKE t_data.
      IF in_ucomm = '&IC1'.
        READ TABLE t_data INDEX in_selfield-tabindex INTO lfs_data.
        CHECK NOT lfs_data-zdidbl IS INITIAL.
        IF lfs_data-type = 'DBL'.
          DATA: l_zdbl LIKE zmsd_diheader-zdinum.
          l_zdbl = in_selfield-value.
          EXPORT l_zdbl TO MEMORY ID 'VBL'.
          CALL TRANSACTION 'ZMSD_BL01'.
        ENDIF.
        IF lfs_data-type = 'DI'.
          DATA: v_dinum LIKE zmsd_diheader-zdinum.
          v_dinum = in_selfield-value.
          EXPORT v_dinum TO MEMORY ID 'VDI'.
          CALL TRANSACTION 'ZMSD_DI01'.
        ENDIF.
      ENDIF.
    ENDFORM.
    FORM get_gst_value.
      LOOP AT t_det WHERE zsammg = v_zsammg
         AND ZINVNO = V_ZINVNO.                              "MADK991565
        CHECK t_data-zccode IN s_zccode.
        t_det-zamount  = t_det-zamount * t_det-zexrate.
        SELECT SINGLE  y0mmtarget2
                INTO   v_target2
                FROM   y0mmipstranslate
                WHERE  y0mmdatatype = '70' AND
                       y0mmsource = t_det-zchrcode.
        SELECT SINGLE y0mmtarget1
               INTO   t_det-type
               FROM   y0mmipstranslate
               WHERE  y0mmdatatype = '76' AND
                      y0mmsource = v_target2.
        IF t_det-type NE '3Z'.
          v_gsttotal    = v_gsttotal +
                               ( t_det-zamount * 5 / 100 ).
        ENDIF.
      ENDLOOP.
    Regards,
    Raj.

    Hello,
    Following is the procedure to convert alv output to spool and then it to PDF Format.
    After we display the ALV, we can check whether it is running in the background using system field u2018sy-batchu2018. Then,we call an function module named u2018GET_JOB_RUNTIME_INFOu2019 to get the current job information. Then go to spool request table tbtcp to get the spool id.
    Get current job details
      CALL FUNCTION u2018GET_JOB_RUNTIME_INFOu2019
           IMPORTING
                eventid                 = gd_eventid
                eventparm               = gd_eventparm
                external_program_active = gd_external_program_active
                jobcount                = gd_jobcount
                jobname                 = gd_jobname
                stepcount               = gd_stepcount
           EXCEPTIONS
                no_runtime_info         = 1
                OTHERS                  = 2.
    SELECT * FROM  tbtcp
                     INTO TABLE it_tbtcp
                     WHERE      jobname     = gd_jobname
                               AND jobcount = gd_jobcount
                               AND stepcount = gd_stepcount
                               AND listident <> u20180000000000u2032
                               ORDER BY   jobname
                                                   jobcount
                                                   stepcount.
      READ TABLE it_tbtcp INTO wa_tbtcp INDEX 1.
    Finally, we can call function module u2018CONVERT_ABAPSPOOLJOB_2_PDFu2018 to convert spool reqeust(which is stored in OTF format) to PDF format. Then we can call either function module u2018SO_DOCUMENT_SEND_API1u2032 or SAP BCS (Business Communication Service) to send the pdf as an email attachment.
    CALL FUNCTION u2018CONVERT_ABAPSPOOLJOB_2_PDFu2019
           EXPORTING
                src_spoolid              = gd_spool_nr
                no_dialog                = c_no
                dst_device               = c_device
           IMPORTING
                pdf_bytecount = gd_bytecount
           TABLES
                pdf = it_pdf_output
           EXCEPTIONS
                err_no_abap_spooljob     = 1
                err_no_spooljob          = 2
                err_no_permission        = 3
                err_conv_not_possible    = 4
                err_bad_destdevice       = 5
                user_cancelled           = 6
                err_spoolerror           = 7
                err_temseerror           = 8
                err_btcjob_open_failed   = 9
                err_btcjob_submit_failed = 10
                err_btcjob_close_failed  = 11
                OTHERS                   = 12.
    Regards,
    Sayali
    Edited by: Sayali Paradkar on Apr 20, 2010 12:51 PM

  • Quantity field to be shown on 1ST line only for purchase order items in ALV

    Dear All,
    I am fetching data from purchase order history table (EKBE) where PO line items contains multiple times. User does not want to view  fields that are repeating multiple times in all lines, but in the top line. By sorting the same in ALV , I can do the same with character type fields, but how to do the same with quantity fields. One way out is converting the same into character fields. Is there any other way. Please give me some solution. Also while sorting , the number which gets repeated (i.e Items in PO for different PO's ) does not gets displayed. I want my program to display them.
    Thanks,
    Debopriyo Mallick

    Try this
    loop at ist_mseg into wa_mseg.
      ON CHANGE OF wa_mseg-con.
        move '111' to wa_mseg-con1.
        modify ist_mseg from wa_mseg.
      ENDON.
    endloop.
    loop at ist_mseg into wa_mseg.
      if wa_mseg-con1 ne '111'.
        move 0 to wa_mseg-menge.
        move 0 to wa_mseg-netpr.
      endif.
      modify ist_mseg from wa_mseg.
    endloop.
    mseg-con is the concatenation of ebeln and ebelp values.
    pk

  • Removing Zeros from a quantity field in ALV

    HI ,
    i have req of removing the zeros after decimal point in while displaying in ALV.
    e.g 3.000 --> '3' .
    I do not need the decimal values.
    Is there any FM or field catalogue parameter to control this.
    I am using CL_GUI_ALV_GRID for ALV display.
    Thaks.

    Hi,
      Whay you can do is...
    Copy the Quantity with out zeros into Char field and display.
    Thanks & Regards,
    Vamsi.

  • Regarding Editable Quantity field in ALV Grid

    Hi Experts,
    I need your advice in this 2 scenarios.
    1.I have a scenario where quantity field in output is editable and the user wants the quantity field printed without thousand separator. If i take a char field and display the field is editable then user may mistakenly type a,bcd...z/ special characters which it should not capture. Is there any char data type data element which accepts only integers. Because after that i need to save that value in z database table quantity field.
    2. when there i raised an error message after validation of that editable field in alv output(by events), the user wants all other rows in that grid as uneditable except the row which has got error till this error is solved. Is this possible. If yes how.
    Please share your valuable suggestions.

    Hi abilash n      
    as in dictionary, all quantity fields should have a reference to the unit field which then defines the number of decimals.
    The rest is done automatically as long as you do it standard way. In field catalog you have to set the fcat-qfieldname to the name of the field that has the unit.
    If you do so, also totals will be grouped by unit.
    SAP has really done a great thing by inventing  units for quantities (and currency keys for currency amounts). Only developers do not understand and thus refuse to use it.
    Regards,
    Clemens

  • ALV Display for Quantity Field

    Hi All,
    I am working on ALV classes.
    I have a quantity field which needs to be displayed without decimals.
    When I declare the data type as type p decimals 0,It is displayed correctly but when I change the field with a value using the method handle_data_changed it gives a value multiplied by 10 always. i.e., when the new value is 5 it gives the value as 50.
    I tried referencing the Unit value but it doesn't work.
    Any views on suppressing the decimal values without getting the value multiplied by 10 is highly appreciated.
    Thank you in advance.
    Regards,
    K.S.

    Hello Kandasamy,
                                 Change the reference field that points to the ALV display field to a non decimal field and then use the Integer variable assignment for  removing the decimals  during teh BAPi or database fetch.
    Hope this answers your question.
    Thanks,
    Greetson

Maybe you are looking for

  • Acrobat Pro 9: have upgrade serial number. Where can I find qualifying version serial number purchased in 2005?

    I purchased Acrobat 9 Pro many years ago. Apparently, this is considered an Upgrade. I do not have the original serial number for whatever product I had purchased in 2005.  Last year, Adobe provided me with a serial number. This year, the company wil

  • How to improve too dark recording

    Hi, I just bought FCPX a few months ago and up till now I'm really overwelmed by it's prossibilities. Now on my problem. I have 4 different cam recordings of the same school musical recorded in a theatre and I'm using multicam clips to make a nice re

  • Problem in installing Netscape Messaging Server in Windows2000 Professional

    I have installed NMS 4.15 on Win 2K Professional.Setup completed successfully.When I logged in Console I can able to see only Administration server and Directory Server,but Messaging Server is not listed. When I tried to uninstall,it shows the Messag

  • Use powershell to read Environment tab checkbox from ADUC

    Hello all, In ADUC, when you pull up a user, you can see an "Environment" tab, which contains a checkbox for "Start the following program at logon:". Here's a picture: What I would like to do is use PowerShell to see if this checkbox is checked for a

  • Passing variables for custom built SQR

    Hi : There is a custom build application in our EBS suite and we are trying to add a new program to the application. The SQR Program works likes this. 1. Calculates functional part and prints out the report. 2. Also generates the report in a text fil