Value in ALV report

Hi experts,
I have an ALV report.
In the ALV report one of the field is Currency conversion rate to USD.
For this i am fetching value from TCURR-UKURS.
The value is taken into an internal table.
I have seen in the internal table the value is coming correctly. like: suppose the value is 1,114.10000- in that perticulat field. then the same value is coming in my final internal table.
But in the report display it is coming as /1,114.10000
Please help me out
regards,
charles

Check the field-reference what is your ALV-field pointing at. Maybe this reference is pointing at a field, which enables only positive numbers.
And if you just modified it, don't forget about the ALV-cache, which stores a lot of setting about ALV grids while you are logged in.
To clear ALV cache you can use a transaction (but I forgot it ), or you can log off and relogin to SAP.
Happy developing
Tamá

Similar Messages

  • Display Currency symbol with value in ALV Report

    Hi Experts,
    I need to display currency symbol with value in ALV Report like if currency type is dollar then $200.
    Here I am using field catalog type slis_t_fieldcat_alv and suing field merge catalog FM: 'REUSE_ALV_FIELDCATALOG_MERGE'
    I tried like this
        IF <fs_fieldcat>-fieldname = 'STPRS'.
          <fs_fieldcat>-seltext_s = 'Std Cost '.
          <fs_fieldcat>-seltext_m = 'Std Cost'.
          <fs_fieldcat>-seltext_l = 'Std Cost '
           <fs_fieldcat>-tabname = 'MBEW'.
          <fs_fieldcat>-ctabname = 'T001'.
          <fs_fieldcat>-cfieldname ='WAERS'.
          <fs_fieldcat>-datatype = 'CURR'.
        ENDIF.
    Please any one can suggest the solution for this.
    Advance Thanks.
    Regards,
    Bala Achari

    Hİ,
    Check this link.
    http://wiki.sdn.sap.com/wiki/pages/viewpage.action?pageId=24379571
    Take care.
    Çağatay

  • Tool Tip Text for field values in ALV report

    Hi,
    How to get the tool tip text for the field values in ALV report.
    Thanks & Regards,
    Pallavi.

    Hi,
    In fieldcatalog specify the TOOLTIP.
    <b>
    LVC_S_FCAT-TOOLTIP
    </b>
    In this speicfyteh tooltip you want.
    Then append this to the fieldcatalog.
    Hope this solves ur problem.

  • Decimal point  for Price value in  ALV Report

    HI,
    I have created ALV report,
    I have 2 price fields in ALV report
    For first field i have to display  in the below format.
    If the value of the field is 3601152 then I have to display it as 36011.52 
    For second field I have to display in the below format
    if the  value is 2494 then I have to display it as 2495.00
    else if the value is 3498.73,then I need not to do anything.
    that means If there is no decimal point, then I have to keep decimal point.
    Thanks&Regards
    RamaDevi

    HI,
    you can work with search and concatenate.
    value1 = 3601152
    search value1 for '.' .
    if sy-subrc eq 0.
      concatenate value1(5) '.' value1(2)+5 into text.
    Or value1 = value1 / 100.
    endif.
    Regards
    Nicole

  • Display only first value of the repeated values  in ALV report

    Hi,
    Test Data
    Doc No   Net Val   billing Doc value Qty
    1000      2000.00    567850.00
    1000      2000.00    567850.00
    1000      2000.00    567850.00
    2000      6000.00    767850.00
    In this type of ALV Report in which only the First field value of the repeated value  should be displayed.
    Doc No   Net Val   billing Doc value Qty
    1000      2000.00    567850.00
    2000      6000.00    767850.00
    I can display document value as like expected result in SORT ORDER in LAYOUT but the Quantity value,Net value  which cannot be done in SORT ORDER in LAYOUT.
    Please tell me the suitable solution.

    For a Sales Order there are two Invoice.
    Sales doc     Invoice No    Billed Qty    Net value                     Qtywith  material no
    5000              900             234774.00    456.00000                 65             123
                                             234774.00    456.00000                 25             456
                                             234774.00    456.00000                 35             898
                                             234774.00    456.00000                 20             496
                          901            634774.00    256.00000                 50               746
                                            634774.00    256.00000                 10               456
                                            634774.00    256.00000                 20               545
                                            634774.00    256.00000                 30               869
    I  need to print this billed Qty and Net value  only once in first line and it should not be deleted.
    I need the result like this
    Sales doc     Invoice No    Billed Qty    Net value                     Qtywith          material no
    5000              900             234774.00    456.00000                 65                     123
                                                                                    25                     456
                                                                                    35                     898
                                                                                    20                     496
    5001              901            634774.00    256.00000                 50                       746
                                                                                    10                       456
                                                                                    20                       545
                                                                                    30                       869               
    The same value should not be repeated for Billed Qty and Net Value.
    I can do that for Sales doc in sort order in layout but i couldn't do for Billed qty and Net Value.
    Please  help.

  • Is it possible to display Suffix values in ALV Report

    Hi,
    Is it possible to display a suffix value in the output of ALV Report? If so how I can proceed? Please let me know an example.
    Thanks,
    Sekhar.J

    Hi Siddarth,
    I am sorry for the typo. It shold be Sub Script, Not a Suffix.
    Let  us take an example H2O, If we print it in this way it won't be meaning full, So i want to display this like
    H Subscript 2 O. I have a requirement for a column to always to display this kind of values, Is it Possible?
    Thanks,
    Sekhar.J

  • How to Input Value in  ALV report at reuntime...?

    Dear All,
    How to Input Value or change the value of a field in  ALV report at runtime...?
    regards,

    HI,
    To input value in ALV you have to make it editable.
    to change values at runtime you have to capture some events and then change your values in internal table which is used to display alv.
    Here is an example of editable ALV.
    <b>REPORT ZWA_ALV_EDITABLE_FM .
    type-pools: slis.
    data: gs_layout type slis_layout_alv.
    DATA: d_ref TYPE REF TO data.
    DATA: itab type table of fmfint.
    SELECT * FROM fmfint
    INTO TABLE itab.
    gs_layout-edit = 'X'.
    * Call ABAP List Viewer (ALV)
    call function 'REUSE_ALV_GRID_DISPLAY'
         exporting
              i_callback_program      = 'ZWA_ALV_EDITABLE_FM'
              i_callback_user_command = 'USER_COMMAND'
              i_structure_name        =  'fmfint'
              is_layout               = gs_layout
         tables
              t_outtab                = itab.
    form user_command using r_ucomm type sy-ucomm
                            rs_selfield type slis_selfield.
      if r_ucomm = '&DATA_SAVE'.
        message i000(SU) with 'saved'.
        MODIFY fmfint FROM TABLE itab.
        call function 'REUSE_ALV_LIST_DISPLAY'
             exporting
                  i_structure_name = 'fmfint'
             tables
                  t_outtab         = itab.
      endif.
    endform.</b>
    Regards,
    Wasim Ahmed

  • How to read the check box value in alv report

    hi experts,
    i m working on one alv report where i m using the check box for field selection in alv display.
    but i don't know how to read the only selected fields.
    wa_fieldcat-fieldname = 'BOX'.
      wa_fieldcat-tabname = 'IT_HEADER'.
      wa_fieldcat-seltext_m = 'Box'.
      wa_fieldcat-checkbox = 'X'.
      wa_fieldcat-input = 'X'.
      wa_fieldcat-edit = 'X'.
      APPEND wa_fieldcat TO i_fieldcat.
      CLEAR wa_fieldcat.
      wa_fieldcat-fieldname = 'AUFNR'.
      wa_fieldcat-tabname = 'IT_HEADER'.
      wa_fieldcat-seltext_m = 'Sales Doc'.
      wa_fieldcat-hotspot = 'X'.
      APPEND wa_fieldcat TO i_fieldcat.
      CLEAR wa_fieldcat.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
         i_callback_program                = v_repid
         I_CALLBACK_PF_STATUS_SET          = 'SET_PF_STATUS'
         i_callback_user_command           = 'USER_COMMAND'
         i_callback_top_of_page            = 'TOP_OF_PAGE'
         it_fieldcat                       = i_fieldcat[]
         i_save                            = 'A'
         it_events                         = v_events
        TABLES
          t_outtab                          = it_header
    EXCEPTIONS
      PROGRAM_ERROR                     = 1
      OTHERS                            = 2
    *&      Form  USER_COMMAND
          text
         -->R_UCOMM    text
         -->,          text
         -->RS_SLEFIELDtext
    FORM user_command USING r_ucomm LIKE sy-ucomm
    rs_selfield TYPE slis_selfield.
      CASE r_ucomm.
    when '&RELEAS'.
    endcase
    endform.
    i gone through some already posted que for same problem i tried options like
    loop at it_header.
    endloop.
    but i m getting box field empty.
    is there i missed something? plz sugeest.. if u have any other solution plz post...

    Have this code in your user command fm:
    * For capturing changed data
      CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
        IMPORTING
          e_grid = w_grid.
      CALL METHOD w_grid->check_changed_data
        IMPORTING
          e_valid = w_valid.
      IF w_valid = 'X'.
    loop at itab where mark = 'X'.
    endloop.
    ENDIF.
    Regards,
    Ravi

  • Sub-Script  Value in ALV  Report Output

    Hi,
    Let us take an example Hydrogen - H2, If we print it in this way it won't be meaning full, So i want to display this like H Subscript 2.
    I have a requirement for a column in an ALV Report.
    Is it Possible? Please give me an example.
    Thanks,
    Sekhar.J

    Hi Sekhar
    One thing you could do would be to make the number of atoms ( ! ) bold.
    Have a lok at the FM REUSE_ALV_GRID_DISPLAY_LVC.
    Pushpraj

  • Right Align the Currency values in ALV report

    Hi Friends,
    I have developed a report and displayed the output using the ALV. I have columns for currency values in the output table.
    The fields for currency values are character fields. The values in the table for display, is properly right aligned (default for currency values). But in the output, the currency values are left aligned.
    Since I need blank lines in the output table after each entry, I have used the character fields in the output table so that I can clear them and append it to get the blank line.
    Please suggest me to get the currency values right aligned.
    Thanks in advance.

    try with this field in field catalog.
             just(1)        type c,        " (R)ight (L)eft (C)ent.
    for the currency field add this field too in field catalog. it will work.

  • Copy values in ALV reports (cmd+Y/ctrl+Y) in SAPGUI for Java 7.00 rev.4?

    Hi all,
    I'm using SAPGUI for Java 7.00 rev.4 in Mac OSX.
    I use intensively ALV GRID reports. I do frequently need to copy multiple cells values from one column.
    In Windows GUI I do ctrl+Y, than select the area containing the cells and the values are copied in the clipboard.
    In Java GUI (OSX) but I cannot do cmd+Y on more cells of the same column!!!!!
    Any suggestion? Am I doing something wrong? Is it a known issue?
    Many thanks,
    Lorenzo

    Hello Lorenzo,
    you might have seen the release notes of SAP GUI for Java 7.10 rev 5 regarding the grid control.
    It has seen major changes (and improvements) in its core which have been a lot of work.
    The developer is now getting closer to the point where it is reasonable to implement add-on functionality like copying the content of multiple cells.
    It is planned for SAP GUI for Java 7.20, but it is not clear yet if it will be available also as part of a 7.10 revision.
    Best regards
    Rolf-Martin

  • Color for negative Values in ALV Report

    I want to change the color for negative values displayed in ALV list diplay report. Eg. -5 in Quantity should be changed to orange. Kindly help me
    Thanks

    Check the below program and bold one are important ( which is similar to MD05 Traffic lights )
    REPORT ZWM_BIN_STOCK_REQ no standard page heading
                        message-id zwave.
    D A T A   D E C L A R A T I O N ****************************
    Tables
    tables :zpwvbap,
             mara,
             marc,
             makt,
             vbap,
             zshift,
             marm,
             lqua.
    TYPE-POOLS: SLIS.
    Internal Table for Sales order
    data : begin of i_vbap occurs 0,
           matnr like zpwvbap-matnr," Material #
           ZZCUTOFF like zpwvbak-ZZCUTOFF," Cutoff Time
           vlpla like zpwvbap-vlpla,
           kwmeng like zpwvbap-kwmeng," Quantity
           vrkme  like zpwvbap-vrkme, " Sales Unit
           meins like zpwvbap-meins, " Unit of measure
           end of i_vbap.
    Internal Table for final Processing
    data : begin of i_final occurs 0,
           date(8) type c,
           matnr like zpwvbap-matnr," Material #
           zzshift like zshift-zzshift, " Wave Drop
           maktx like makt-maktx," Desc
           lgpla like lagp-lgpla, " Pick Bin
           pverme like lqua-verme," Stock at Pick Bin
           prverme like lqua-verme," Stock at Prod Bin
           kwmeng like zpwvbap-kwmeng," Requiremnet from Wave Drop
           vrkme  like zpwvbap-vrkme, " Sales Unit
          meins like zpwvbap-meins," Unit of measure
           end of i_final.
    Internal Table for Output
    data : begin of i_output occurs 0,
         <b>  field type c, " Traffic Lights</b>     
          zzshift like zshift-zzshift, " Wave Drop
           matnr like zpwvbap-matnr," Material #
           maktx like makt-maktx," Desc
           lgpla like lagp-lgpla, " Pick Bin
           pverme like lqua-verme," Stock at Pick Bin
           prverme like lqua-verme," Stock at Prod Bin
           kwmeng like zpwvbap-kwmeng," Requiremnet from Wave Drop
           vrkme like zpwvbap-vrkme," Sales Unit
          meins like zpwvbap-meins," Unit of measure
           diff like zpwvbap-kwmeng, " Diffrence
           end of i_output.
    Work Area for Final Internal Table
    data wa_final like i_final.
    data :  w_zzcutoff(12) TYPE c,
            v_date type sy-datum,
            v_time(4) type c,
            v_fldate(12) type c,
            v_fhdate(12) type c,
            v_pverme like lqua-verme,
            v_prverme like lqua-verme,
            v_diff like zpwvbap-kwmeng.
    Variables for new check box
    data : v_nverme like lqua-verme.
    Internal Table for Pick Bin
    data : begin of i_verme occurs 0,
           verme like lqua-verme,
           end of i_verme.
    Internal table for Prod Bin
    data : begin of i_pverme occurs 0,
           verme like lqua-verme,
           end of i_pverme.
    Variables for ALV
    DATA: FIELDCAT           TYPE SLIS_T_FIELDCAT_ALV,
          FIELDCAT_LN        LIKE LINE OF FIELDCAT,
          SORTCAT            TYPE SLIS_T_SORTINFO_ALV,
          SORTCAT_LN         LIKE LINE OF SORTCAT,
          EVENTCAT           TYPE SLIS_T_EVENT,
          EVENTCAT_LN        LIKE LINE OF EVENTCAT,
          LAYOUT             TYPE SLIS_LAYOUT_ALV,
          C_TOP_OF_PAGE      TYPE SLIS_FORMNAME VALUE 'TOP_OF_PAGE',
          g_user_command TYPE slis_formname VALUE 'USER_COMMAND',
          GT_LIST_TOP_OF_PAGE TYPE SLIS_T_LISTHEADER.
    DATA: COL_POS TYPE I,
          P_LIGNAM TYPE SLIS_FIELDNAME VALUE  'FIELD'.
    DATA : V_REPID LIKE SY-REPID,
           flag type c.
    S E L E C T I O N - S C R E E N *************************
    selection-screen : begin of block blk with frame title text-001.
    parameter : p_plant like marc-werks obligatory default '1000'.
    select-options : s_date for sy-datum obligatory ,
                     s_shift for zshift-zzshift,
                     s_matnr for mara-matnr,
                     s_dept for zpwvbap-zzdept,
                     s_pdept for marc-ZZPRODDEPT.
    selection-screen: end of block blk.
    parameters : p_check as checkbox ."default 'X'.
    ranges r_cutoff for  w_zzcutoff.
    I N I T I A L I Z A T I O N ****************************
    initialization.
      V_REPID = SY-REPID.
      s_date-low = sy-datum + 1.
      append s_date.
    S T A R T - O F - S E L E C T I O N  ***********************
    start-of-selection.
    Get the Shift Data.
      PERFORM GET_SHIFT_DETAILS.
    Get the data from ZPWVBAP Table
      PERFORM GET_DATA_VBAP.
    E N D - O F - S E L E C T I O N **********************
    end-of-selection.
      if not i_output[] is initial.
        sort i_output by field zzshift matnr.
    Reset the all Fiedcatlog.
        PERFORM RESETVALUES.
    Traffic Lights
        PERFORM BUILD_LAYOUT.
    Fill the fieldcatlog values
        PERFORM FILL_FIELDCATLOG.
    Call the List Function module
        PERFORM CALL_lIST.
      endif.
    *&      Form  GET_SHIFT_DETAILS
          Get the Cutoff Time.
    FORM GET_SHIFT_DETAILS.
      clear : v_fldate,
              v_fhdate.
      if not s_shift-low is initial.
        clear: v_time,
               v_date.
        if s_shift-low = '1'.
          v_time = '2000'.
        elseif s_shift-low = '2'.
          v_time = '2300'.
        endif.
        v_date = s_date-low - 1.
        concatenate v_date v_time into v_fldate.
      endif.
      if not s_shift-high is initial.
        clear : v_date,
                v_time.
        if s_shift-high = '1'.
          v_time = '2000'.
        elseif s_shift-high = '2'.
          v_time = '2300'.
        endif.
        if not s_date-high is initial.
          v_date = s_date-high - 1.
        else.
          v_date = s_date-low - 1.
        endif.
        concatenate v_date v_time into v_fhdate.
      endif.
      if not v_fhdate is initial.
        r_cutoff-low = v_fldate.
        r_cutoff-high = v_fhdate.
        r_cutoff-sign = 'I'.
        r_cutoff-option = 'BT'.
        append r_cutoff.
      endif.
    ENDFORM.                    " GET_SHIFT_DETAILS
    *&      Form  GET_DATA_VBAP
          Get the data from ZPWVBAP Table
    FORM GET_DATA_VBAP.
    Get the data from ZPWVBAP and ZPWVBAK Table
      if not v_fhdate is initial.
        select matnr ZZCUTOFF  vlpla sum( kwmeng ) vrkme meins
                     into table i_vbap
                     from zpwvbap as a inner join zpwvbak as b on
                                   a~vbeln = b~vbeln
                                   where a~werks = p_plant
                                   and   a~matnr in s_matnr
                                   and b~vdatu in s_date
                                   and a~zzdept in s_dept
                                   and b~zzcutoff in r_cutoff
                                  group by matnr zzcutoff vlpla vrkme meins.
      elseif not v_fldate is initial.
        select matnr ZZCUTOFF vlpla sum( kwmeng ) vrkme meins
                           into table i_vbap
                           from zpwvbap as a inner join zpwvbak as b on
                                   a~vbeln = b~vbeln
                                   where a~werks = p_plant
                                   and   a~matnr in s_matnr
                                   and b~vdatu in s_date
                                   and a~zzdept in s_dept
                                   and b~zzcutoff = v_fldate
                               group by matnr zzcutoff vlpla vrkme meins.
      else.
        select matnr ZZCUTOFF vlpla sum( kwmeng ) vrkme meins
                              into table i_vbap
           from zpwvbap as a inner join zpwvbak as b on
                                   a~vbeln = b~vbeln
                                   where a~werks = p_plant
                                   and   a~matnr in s_matnr
                                   and b~vdatu in s_date
                                   and a~zzdept in s_dept
                                   and b~zzcutoff in r_cutoff
                                group by matnr zzcutoff vlpla vrkme meins .
      endif.
      if sy-subrc ne 0.
        message i000(zwave) with 'No data found for given selection'.
        stop.
      endif.
      sort i_vbap by zzcutoff matnr.
      loop at i_vbap.
        clear : v_pverme,
                v_prverme.
    Compare the data with pick method
        select single zzpick from marc into marc-zzpick
                             where matnr = i_vbap-matnr
                             and   werks = p_plant
                             and   zzpick = '01'.
        if sy-subrc ne 0.
          continue.
        endif.
    Compare the data from MARC Table with Production Department
        select single zzPRODdept from marc into marc-zzPRODdept
                             where matnr = i_vbap-matnr
                             and werks = p_plant
                             and  zzPRODdept in s_pdept.
        if sy-subrc ne 0.
          continue.
        endif.
    Get the Material Description from MAKT Table
        Select single maktx from makt into makt-maktx
                            where matnr = i_vbap-matnr
                            and   spras = 'E'.
        if sy-subrc eq 0.
          i_final-maktx = makt-maktx.
        endif.
    Get the Pick Bin
        i_final-lgpla = i_vbap-vlpla.
        refresh i_verme.
        clear i_verme.
    Get the stock at Pick bin
        select verme  from lqua into table i_verme
                            where lgpla = i_vbap-vlpla
                            and   matnr = i_vbap-matnr
                            and   LGNUM = '100'.
        if sy-subrc eq 0.
          loop at i_verme.
            v_pverme = v_pverme + i_verme-verme.
          endloop.
          if sy-subrc eq 0.
            i_final-pverme = v_pverme.
          endif.
        endif.
        refresh i_pverme.
        clear i_pverme.
    Get the stock at Production bin
        select  verme from lqua into table i_pverme
                           where matnr = i_vbap-matnr
                           and   LGNUM = '100'
                       and ( lgpla = '9595959595' or
                             lgpla = '2222222222' or
                             lgpla = '5555555555' or
                             lgpla = '3232323232' or
                             lgpla = '8080808080' or
                             lgpla = '4040404040' or
                             lgpla = '9090909090' ).
        if sy-subrc eq 0.
          loop at i_pverme.
            v_prverme = v_prverme + i_pverme-verme.
          endloop.
          if sy-subrc eq 0.
            i_final-prverme = v_prverme.
          endif.
        endif.
    Compare the unit of measure and sales unit
        if i_vbap-vrkme ne i_vbap-meins.
    Get the data from MARM Table ( Unit of measure )
          select single * from marm into marm
                               where matnr = i_vbap-matnr
                               and   meinh = i_vbap-vrkme.
          if sy-subrc eq 0.
            i_final-pverme = ( i_final-pverme * marm-umren ) / marm-umrez.
          endif.
        endif.
    Material #
        i_final-matnr = i_vbap-matnr.
    Quantity from ZPWVBAP
        i_final-kwmeng = i_vbap-kwmeng.
    Unit of Measure
       i_final-meins = i_vbap-meins.
    Sales Unit
        i_final-vrkme = i_vbap-vrkme.
    Wave Drop
        if i_vbap-ZZCUTOFF+8(4) = '2000' .
          i_final-zzshift = '1'.
        endif.
        if i_vbap-zzcutoff+8(4) = '2300'.
          i_final-zzshift = '2'.
        endif.
        i_final-date = i_vbap-zzcutoff+0(8).
        append i_final.
        clear : i_final,
                i_vbap.
    **Difference
       i_output-diff = i_output-pverme - i_vbap-kwmeng.
    Traffic Lights Depends on value
       if i_output-pverme > i_output-kwmeng.
         i_output-field = '3'.
       elseif i_output-pverme < i_output-kwmeng.
         i_output-field = '1'.
       elseif i_output-pverme = i_output-kwmeng.
         i_output-field = '2'.
       endif.
       append i_output.
       clear : i_output,
               i_vbap.
      endloop.
      refresh i_vbap.
      sort i_final by date matnr zzshift.
    Processing the internal table to get same material with pick quantity
    deduction even it for 2nd shift
      loop at i_final.
    Move the data into work area in order remove #
        move i_final to wa_final.
        clear : flag.
        at new matnr.
          move : wa_final-matnr to i_output-matnr," Material #
                 wa_final-maktx to i_output-maktx," Desc
                 wa_final-lgpla to i_output-lgpla," Pick Bin
                 wa_final-kwmeng to i_output-kwmeng," Order qty
                 wa_final-zzshift to i_output-zzshift," Shift
                 wa_final-pverme to i_output-pverme, " Pick bin qty
                 wa_final-vrkme  to i_output-vrkme," Sales Unit
                 wa_final-prverme to i_output-prverme. " Prod Bin Qty
    Difference
          i_output-diff = i_output-pverme - i_output-kwmeng.
    New logic for Only HMR Department
        <b>  if p_check = 'X'.
            if i_output-pverme < i_output-kwmeng.
              v_nverme = i_output-pverme + i_output-prverme.
              if v_nverme > i_output-kwmeng.
               if i_output-pverme < i_output-kwmeng.
               i_output-field = '2'.
                else.
    Traffic Lights Depends on value
                i_output-field = '3'.
                endif.
              elseif v_nverme < i_output-kwmeng.
                i_output-field = '1'.
              elseif v_nverme = i_output-kwmeng.
                i_output-field = '2'.
              endif.
            elseif i_output-pverme > i_output-kwmeng.
              i_output-field = '3'.
            elseif i_output-pverme = i_output-kwmeng.
              i_output-field = '3'.
            endif.
          else.
    Traffic Lights Depends on value
            if i_output-pverme > i_output-kwmeng.
              i_output-field = '3'.
            elseif i_output-pverme < i_output-kwmeng.
              i_output-field = '1'.
            elseif i_output-pverme = i_output-kwmeng.
              i_output-field = '2'.
            endif.
          endif.
          move i_output-diff to v_diff.
          flag = 'X'.
        endat.</b>
        if flag ne 'X'.
          move : wa_final-matnr to i_output-matnr," Material #
                 wa_final-maktx to i_output-maktx," Desc
                 wa_final-lgpla to i_output-lgpla," Pick Bin
                 wa_final-kwmeng to i_output-kwmeng," Order qty
                 wa_final-zzshift to i_output-zzshift," Shift
                 wa_final-vrkme  to i_output-vrkme," Sales Unit
                 wa_final-prverme to i_output-prverme. " Prod Bin Qty
      Move Diffrence value
          move v_diff to i_output-pverme.
          clear: v_diff.
    New logic for Only HMR Department
    New logic for Only HMR Department
          if p_check = 'X'.
            if i_output-pverme < i_output-kwmeng.
              v_nverme = i_output-pverme + i_output-prverme.
              if v_nverme > i_output-kwmeng.
              if i_output-pverme < i_output-kwmeng.
               i_output-field = '2'.
                else.
    Traffic Lights Depends on value
                i_output-field = '3'.
                endif.
    Traffic Lights Depends on value
               i_output-field = '3'.
              elseif v_nverme < i_output-kwmeng.
                i_output-field = '1'.
              elseif v_nverme = i_output-kwmeng.
                i_output-field = '2'.
              endif.
            elseif i_output-pverme > i_output-kwmeng.
              i_output-field = '3'.
            elseif i_output-pverme = i_output-kwmeng.
              i_output-field = '3'.
            endif.
    i_output-diff = i_output-pverme - i_output-kwmeng.
          else.
    Difference
            i_output-diff = i_output-pverme - i_output-kwmeng.
    Traffic Lights Depends on value
            if i_output-pverme > i_output-kwmeng.
              i_output-field = '3'.
            elseif i_output-pverme < i_output-kwmeng.
              i_output-field = '1'.
            elseif i_output-pverme = i_output-kwmeng.
              i_output-field = '2'.
            endif.
          endif.
        endif.
        append i_output.
        clear : i_output,
                wa_final,
                i_final,
                 v_nverme.
      endloop.
      sort i_output by field zzshift matnr.
    ENDFORM.                    " GET_DATA_VBAP
    *&      Form  RESETVALUES
          Reset the all fieldcatlogs
    FORM RESETVALUES.
      FIELDCAT_LN-KEY = SPACE.
      FIELDCAT_LN-DO_SUM = SPACE.
      FIELDCAT_LN-NO_OUT = SPACE.
      FIELDCAT_LN-QFIELDNAME = SPACE.
      FIELDCAT_LN-HOTSPOT = SPACE.
      FIELDCAT_LN-OUTPUTLEN = '0'.
      CLEAR: fieldcat_ln-seltext_l, fieldcat_ln-seltext_m,
             fieldcat_ln-seltext_s, fieldcat_ln-reptext_ddic.
    ENDFORM.                    " RESETVALUES
    *&      Form  FILL_FIELDCATLOG
          Fill the Fieldcatlog values
    FORM FILL_FIELDCATLOG.
      DATA: ls_fieldcat TYPE slis_fieldcat_alv.
    Trafiic Light
      CLEAR LS_FIELDCAT.
      LS_FIELDCAT-FIELDNAME    = 'FIELD'.
      LS_FIELDCAT-TABNAME    = 'I_OUTPUT'.
      LS_FIELDCAT-OUTPUTLEN    = 7.
      LS_FIELDCAT-col_pos    = '1'.
      ls_fieldcat-seltext_L = 'Lights'.
      ls_fieldcat-seltext_s = 'Lights'.
      ls_fieldcat-seltext_m = 'Lights'.
      APPEND LS_FIELDCAT TO FIELDCAT.
    Wave Drop
      CLEAR LS_FIELDCAT.
      LS_FIELDCAT-FIELDNAME    = 'ZZSHIFT'.
      LS_FIELDCAT-TABNAME    = 'I_OUTPUT'.
      LS_FIELDCAT-OUTPUTLEN    = 9.
      LS_FIELDCAT-col_pos    = '2'.
      ls_fieldcat-seltext_L = 'Wave Drop'.
      APPEND LS_FIELDCAT TO FIELDCAT.
    Material
      CLEAR LS_FIELDCAT.
      LS_FIELDCAT-FIELDNAME    = 'MATNR'.
      LS_FIELDCAT-ref_fieldname = 'MATNR'.
      LS_FIELDCAT-ref_tabname = 'MARA'.
      LS_FIELDCAT-TABNAME    = 'I_OUTPUT'.
      LS_FIELDCAT-OUTPUTLEN    = 18.
      LS_FIELDCAT-col_pos    = '3'.
      ls_fieldcat-seltext_L = 'Material'.
      APPEND LS_FIELDCAT TO FIELDCAT.
    Description
      CLEAR LS_FIELDCAT.
      LS_FIELDCAT-FIELDNAME    = 'MAKTX'.
      LS_FIELDCAT-TABNAME    = 'I_OUTPUT'.
      LS_FIELDCAT-OUTPUTLEN    = 40.
      LS_FIELDCAT-col_pos    = '4'.
      ls_fieldcat-seltext_L = 'Description'.
      APPEND LS_FIELDCAT TO FIELDCAT.
    Pick Bin
      CLEAR LS_FIELDCAT.
      LS_FIELDCAT-FIELDNAME    = 'LGPLA'.
      LS_FIELDCAT-TABNAME    = 'I_OUTPUT'.
      LS_FIELDCAT-OUTPUTLEN    = 15.
      LS_FIELDCAT-col_pos    = '5'.
      ls_fieldcat-seltext_L = 'Pick Bin'.
      APPEND LS_FIELDCAT TO FIELDCAT.
    Trafiic Light
      CLEAR LS_FIELDCAT.
      LS_FIELDCAT-FIELDNAME    = 'PVERME'.
      LS_FIELDCAT-TABNAME    = 'I_OUTPUT'.
      LS_FIELDCAT-OUTPUTLEN    = 16.
      LS_FIELDCAT-col_pos    = '6'.
      ls_fieldcat-seltext_L = 'Stock at Pick Bin'.
      APPEND LS_FIELDCAT TO FIELDCAT.
    Stock at Prod Bin
      CLEAR LS_FIELDCAT.
      LS_FIELDCAT-FIELDNAME    = 'PRVERME'.
      LS_FIELDCAT-TABNAME    = 'I_OUTPUT'.
      LS_FIELDCAT-OUTPUTLEN    = 16.
      LS_FIELDCAT-col_pos    = '7'.
      ls_fieldcat-seltext_L = 'Stock at Prod Bin'.
      APPEND LS_FIELDCAT TO FIELDCAT.
    Req from wave drop
      CLEAR LS_FIELDCAT.
      LS_FIELDCAT-FIELDNAME    = 'KWMENG'.
      LS_FIELDCAT-TABNAME    = 'I_OUTPUT'.
      LS_FIELDCAT-OUTPUTLEN    = 23.
      LS_FIELDCAT-col_pos    = '8'.
      ls_fieldcat-seltext_L = 'Requirement from Wave Drop'.
      APPEND LS_FIELDCAT TO FIELDCAT.
    Sales Unit
      CLEAR LS_FIELDCAT.
      LS_FIELDCAT-FIELDNAME    = 'VRKME'.
      LS_FIELDCAT-TABNAME    = 'I_OUTPUT'.
      LS_FIELDCAT-OUTPUTLEN    = 12.
      LS_FIELDCAT-col_pos    = '9'.
      ls_fieldcat-seltext_L = 'Sales Unit'.
      APPEND LS_FIELDCAT TO FIELDCAT.
    Unit of Measure
      CLEAR LS_FIELDCAT.
      LS_FIELDCAT-FIELDNAME    = 'MEINS'.
      LS_FIELDCAT-TABNAME    = 'I_OUTPUT'.
      LS_FIELDCAT-OUTPUTLEN    = 9.
      LS_FIELDCAT-col_pos    = '10'.
      ls_fieldcat-seltext_L = 'UNIT'.
      ls_fieldcat-no_out = 'X'.
      APPEND LS_FIELDCAT TO FIELDCAT.
    Diffference
      CLEAR LS_FIELDCAT.
      LS_FIELDCAT-FIELDNAME    = 'DIFF'.
      LS_FIELDCAT-TABNAME    = 'I_OUTPUT'.
      LS_FIELDCAT-OUTPUTLEN    = 12.
      LS_FIELDCAT-col_pos    = '11'.
      ls_fieldcat-seltext_L = 'Difference'.
      APPEND LS_FIELDCAT TO FIELDCAT.
    ENDFORM.                    " FILL_FIELDCATLOG
    *&      Form  CALL_lIST
          Use ALV Function module to display output
    FORM CALL_lIST.
    Top - of - Page
      PERFORM COMMENT_BUILD USING GT_LIST_TOP_OF_PAGE[].
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
      I_INTERFACE_CHECK                 = ' '
      I_BYPASSING_BUFFER                =
      I_BUFFER_ACTIVE                   = ' '
          I_CALLBACK_PROGRAM                = V_REPID
      I_CALLBACK_PF_STATUS_SET          = ' '
        I_CALLBACK_USER_COMMAND           = g_user_command
          I_CALLBACK_TOP_OF_PAGE            = C_TOP_OF_PAGE
      I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
      I_CALLBACK_HTML_END_OF_LIST       = ' '
      I_STRUCTURE_NAME                  =
      I_BACKGROUND_ID                   = ' '
      I_GRID_TITLE                      =
      I_GRID_SETTINGS                   =
          IS_LAYOUT                         = LAYOUT
          IT_FIELDCAT                       = FIELDCAT
      IT_EXCLUDING                      =
      IT_SPECIAL_GROUPS                 =
      IT_SORT                           =
      IT_FILTER                         =
      IS_SEL_HIDE                       =
      I_DEFAULT                         = 'X'
      I_SAVE                            = ' '
      IS_VARIANT                        =
      IT_EVENTS                         =
      IT_EVENT_EXIT                     =
      IS_PRINT                          =
      IS_REPREP_ID                      =
      I_SCREEN_START_COLUMN             = 0
      I_SCREEN_START_LINE               = 0
      I_SCREEN_END_COLUMN               = 0
      I_SCREEN_END_LINE                 = 0
      IT_ALV_GRAPHICS                   =
      IT_ADD_FIELDCAT                   =
      IT_HYPERLINK                      =
      I_HTML_HEIGHT_TOP                 =
      I_HTML_HEIGHT_END                 =
      IT_EXCEPT_QINFO                   =
    IMPORTING
      E_EXIT_CAUSED_BY_CALLER           =
      ES_EXIT_CAUSED_BY_USER            =
        TABLES
          T_OUTTAB                          = I_OUTPUT
       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.
    ENDFORM.                    " CALL_lIST
    *&      Form  BUILD_LAYOUT
          text
    FORM BUILD_LAYOUT.
      LAYOUT-GET_SELINFOS = 'X'.
    Now we want a traffic light to say if the Truck is deleted
    the variable p_lignam contains the name in IREPO which stores the
    value for the traffic light
      LAYOUT-LIGHTS_FIELDNAME = P_LIGNAM.
      layout-HEADER_TEXT = 'Lights'.
      LAYOUT-LIGHTS_CONDENSE =  'X'.
    ENDFORM.                    " BUILD_LAYOUT
    *&      Form  COMMENT_BUILD
          text
         -->P_GT_LIST_TOP_OF_PAGE[]  text
    FORM COMMENT_BUILD USING    LT_TOP_OF_PAGE TYPE
                                            SLIS_T_LISTHEADER.
      data : v_day(2) type c,
             v_mon(2) type c,
             v_year(4) type c,
             v_ldate(10) type c,
             v_hdate(10) type c.
      DATA: LS_LINE TYPE SLIS_LISTHEADER.
      data: d_date like sy-datum.
      clear : v_ldate,
              v_hdate.
    Header Information.
    LIST HEADING LINE: TYPE H
      CLEAR LS_LINE.
      LS_LINE-TYP  = 'H'.
    LS_LINE-KEY:  NOT USED FOR THIS TYPE
      LS_LINE-INFO = 'Bin Replenishment report for HMR'.
      APPEND LS_LINE TO LT_TOP_OF_PAGE.
    STATUS LINE: TYPE S
      CLEAR LS_LINE.
      LS_LINE-TYP  = 'S'.
      LS_LINE-KEY  = TEXT-003.
    LS_LINE-INFO = TEXT-003.
      APPEND LS_LINE TO LT_TOP_OF_PAGE.
    STATUS LINE: TYPE S
      CLEAR LS_LINE.
      LS_LINE-TYP  = 'S'.
    LS_LINE-KEY  = TEXT-003.
    LS_LINE-INFO = TEXT-003.
      APPEND LS_LINE TO LT_TOP_OF_PAGE.
    Get the data ( s_date_low) into proper format.
      v_year = s_date-low+0(4).
      v_mon = s_date-low+4(2).
      v_day = s_date-low+6(2).
      concatenate v_mon '/' v_day '/' v_year into v_ldate.
      clear : v_mon,
              v_year,
              v_day.
    Get the data ( s_date_high) into proper format.
      v_year = s_date-high+0(4).
      v_mon  = s_date-high+4(2).
      v_day  = s_date-high+6(2).
      concatenate v_mon '/' v_day '/' v_year into v_hdate.
      clear : v_mon,
              v_year,
              v_day.
    Delivery date
      if not s_date-low is initial .
        if not s_date-high is initial.
          CLEAR LS_LINE.
          LS_LINE-TYP  = 'S'.
          LS_LINE-KEY  = 'Delivery date From:'.
          LS_LINE-INFO = v_ldate.
          APPEND LS_LINE TO LT_TOP_OF_PAGE.
          CLEAR LS_LINE.
          LS_LINE-TYP  = 'S'.
          LS_LINE-KEY  = 'Delivery date To :'.
          LS_LINE-INFO =  v_hdate.
          APPEND LS_LINE TO LT_TOP_OF_PAGE.
        endif.
      endif.
      if not s_date-low is initial.
        if  s_date-high is initial.
          CLEAR LS_LINE.
          LS_LINE-TYP  = 'S'.
          LS_LINE-KEY  = 'Delivery date :'.
          LS_LINE-INFO = v_ldate.
          APPEND LS_LINE TO LT_TOP_OF_PAGE.
        endif.
      endif.
    Wave Drop
      if not S_SHIFT-LOW is initial.
        if not S_SHIFT-high is initial.
          CLEAR LS_LINE.
          LS_LINE-TYP  = 'S'.
          LS_LINE-KEY  = 'Wave Drop From :'.
          LS_LINE-INFO = s_shift-low.
          APPEND LS_LINE TO LT_TOP_OF_PAGE.
          CLEAR LS_LINE.
          LS_LINE-TYP  = 'S'.
          LS_LINE-KEY  = 'Wave Drop to :'.
          LS_LINE-INFO = s_shift-high.
          APPEND LS_LINE TO LT_TOP_OF_PAGE.
        endif.
      endif.
      if not S_SHIFT-LOW is initial.
        if S_SHIFT-high is initial.
          CLEAR LS_LINE.
          LS_LINE-TYP  = 'S'.
          LS_LINE-KEY  = 'Wave Drop :'.
          LS_LINE-INFO = s_shift-low.
          APPEND LS_LINE TO LT_TOP_OF_PAGE.
         CLEAR LS_LINE.
         LS_LINE-TYP  = 'S'.
         LS_LINE-KEY  = 'Wave Drop to :'.
         LS_LINE-INFO = s_shift-high.
         APPEND LS_LINE TO LT_TOP_OF_PAGE.
        endif.
      endif.
    Department
      if not s_dept-low is initial .
        if not s_dept-high is initial.
          CLEAR LS_LINE.
          LS_LINE-TYP  = 'S'.
          LS_LINE-KEY  = 'Department From :'.
          LS_LINE-INFO = s_dept-low.
          APPEND LS_LINE TO LT_TOP_OF_PAGE.
          CLEAR LS_LINE.
          LS_LINE-TYP  = 'S'.
          LS_LINE-KEY  = 'Department to :'.
          LS_LINE-INFO = s_dept-high.
          APPEND LS_LINE TO LT_TOP_OF_PAGE.
        endif.
      endif.
      if not s_dept-low is initial .
        if  s_dept-high is initial.
          CLEAR LS_LINE.
          LS_LINE-TYP  = 'S'.
          LS_LINE-KEY  = 'Department :'.
          LS_LINE-INFO = s_dept-low.
          APPEND LS_LINE TO LT_TOP_OF_PAGE.
        endif.
      endif.
    Production Department
      if not S_PDEPT-LOW is initial.
        if not S_PDEPT-high is initial.
          CLEAR LS_LINE.
          LS_LINE-TYP  = 'S'.
          LS_LINE-KEY  = 'Production Department From :'.
          LS_LINE-INFO = S_PDEPT-LOW.
          APPEND LS_LINE TO LT_TOP_OF_PAGE.
          CLEAR LS_LINE.
          LS_LINE-TYP  = 'S'.
          LS_LINE-KEY  = 'Production Department to :'.
          LS_LINE-INFO = S_PDEPT-high.
          APPEND LS_LINE TO LT_TOP_OF_PAGE.
        endif.
      endif.
      if not S_PDEPT-LOW is initial.
        if  S_PDEPT-high is initial.
          CLEAR LS_LINE.
          LS_LINE-TYP  = 'S'.
          LS_LINE-KEY  = 'Production Department :'.
          LS_LINE-INFO = S_PDEPT-LOW.
          APPEND LS_LINE TO LT_TOP_OF_PAGE.
        endif.
      endif.
    ENDFORM.                    " COMMENT_BUILD
          FORM TOP_OF_PAGE                                              *
    FORM TOP_OF_PAGE.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          IT_LIST_COMMENTARY       = GT_LIST_TOP_OF_PAGE
      I_LOGO                   =
      I_END_OF_LIST_GRID       =
    ENDFORM.
          FORM USER_COMMAND                                             *
    FORM user_command USING r_ucomm LIKE sy-ucomm
                rs_selfield TYPE slis_selfield.                 "#EC CALLED
      CASE R_UCOMM.
        WHEN '&IC1'.
          read table i_output index rs_selfield-tabindex.
          SET PARAMETER ID 'MAT' FIELD i_output-matnr.
          SET PARAMETER ID 'WRK' FIELD p_plant.
          if not i_output-matnr is initial.
            call transaction 'MD04' and skip first screen.
          endif.
      ENDCASE.
    ENDFORM.
    the above code i mentioned 1,2 ,3 values  ,1 will have green color,2 will have yellow color,3 will have red color.
    Thanks
    Seshu

  • How to validate values in alv report with check table

    Hi All,
    I have created one editable ALV in which user can enter material(matnr). Now I want to validate the value entered by the user before saving it to my custom table. I am using 'SLIS_T_FIELDCAT_ALV' as field catalog. Is there any field in this which I need to pass to validate material. I don't want to go for coding for this. I tried to search for this but did not get anything. Please help.
    Regards,
    Manish Sethia

    Hi Andreas,
    I tried but that is not working. Do I need to handle some event or command to get it validated. My code is as follows.
    FORM f_build_field_catalouge USING  p_fieldname   TYPE any
                              p_tabname     TYPE any
                              p_inputlen   TYPE any
                              p_fieldtext   TYPE any
                              p_edit         TYPE any
                              CHANGING p_col_pos TYPE any.
      CLEAR wa_fcat.
      p_col_pos = p_col_pos + 1.
      wa_fcat-fieldname       = p_fieldname .
      wa_fcat-tabname         = p_tabname.
      IF p_fieldname = 'MATNR'.
        wa_fcat-ref_tabname = 'MARA'.
        wa_fcat-ref_fieldname = 'MATNR'.
      ELSEIF p_fieldname = 'MATPGRP'.
        wa_fcat-ref_tabname = 'ZOTC_FLEX_MAT'.
        wa_fcat-ref_fieldname = 'MATPGRP'.
      ENDIF.
      wa_fcat-intlen          =  p_inputlen . "colume width
      wa_fcat-seltext_m       = p_fieldtext.
      wa_fcat-edit            = p_edit ."'X'.
      wa_fcat-col_pos         = p_col_pos.
      APPEND wa_fcat TO t_fcat.
    ENDFORM. 
    But this one is not working.
    Regards

  • Standard program showing wrong values in ALV report

    Hi All,
    Standard Report 'RFBILA00' (Balance sheet P+L Statement) ,when i excute for classical list the output showing correct.
    But with the same test data when i run for ALV Grid control showing wrong valuse like.
    with same company code comparision year,comparision period ,comp periods...when i run classical list:
    PROFIT/LOSS BEFORE TAXATION                                 5,194,871.12-
    RETAINED PROFIT/LOSS FOR THE PERIOD                    5,194,871.12-
    NET PROFIT/(LOSS)                                                        5,194,871.12.
    when i run in ALV for same above data, the result is:
    PROFIT/LOSS BEFORE TAXATION                           9,307,137.09
    RETAINED PROFIT/LOSS FOR THE PERIOD              5,194,871.12-
    NET PROFIT/(LOSS)                                                 22,076,715.82.
    Please help on this....and this is standard report.. y its showing different for same data.
    Thank you
    Anu.

    Hi ,
    Same program  excuted once by selecting classical list is showing correct. And with same data excuted with ALV grid list showing wrong valuse.
    when selected with Classical list: for company code:8000,Reporting periods: 1-9,Reporting year:2009,Comparison periods:1-8
    Comparison year-2009.
    PROFIT/LOSS BEFORE TAXATION 5,194,871.12-
    RETAINED PROFIT/LOSS FOR THE PERIOD 5,194,871.12-
    NET PROFIT/(LOSS) 5,194,871.12.
    when i run in ALV for same above data, the result is: for company code:8000,Reporting periods: 1-9,Reporting year:2009,Comparison periods:1-8 Comparison year-2009.
    PROFIT/LOSS BEFORE TAXATION 9,307,137.09
    RETAINED PROFIT/LOSS FOR THE PERIOD 5,194,871.12-
    NET PROFIT/(LOSS) 22,076,715.82.
    Thank You,
    Anu.

  • Subtotal in alv report based on the particular field value

    Hi,
    As per my requirement, i need to do subtotal of quntity field based on the material number field value in alv report.
    Ex:  if material number falls 1 to 10 then i need to be calculate and display subtotal qty amount with text " total of the mat1" and if material number falls 11 to 20 then again i need to be claculate and display subtotal qty amount with text "total of the mat2". similarily i need to display the details.
    <removed_by_moderator>
    Regards
    Nagendra

    Hi,
    Ex: if material number falls 1 to 10 then i need to be calculate and display subtotal qty amount with text " total of the mat1" and if material number falls 11 to 20 then again i need to be claculate and display subtotal qty amount with text "total of the mat2". similarily i need to display the details.
    What you can do is in your output table, you will have to create an auxilary field, lets call it as material group (groupid). Now you can do a subtotal on the material group. However the logic to determine what materials belong to which group should be coded. I guess you might be having some logic for that.
    So lets say that material 1 to 10 as G1 ( group 1 ) and material 11 to 20 as G2 ( group 2 )
    The output of the internal table would be
    Groupid  matnr ...
    1  1
    1  2
    1  3.....and so on
    2  11
    2  12
    2  13....upto 20.
    Now in the fieldcatalog assign an 'X' to the 'dosum' parameter to the field Groupid
    In the sort info do the following :
    gs_sort-fieldname = 'GROUPID'.
    gs_sort-spos = 1.
    gs_sort-up = 'X'.
    gs_sort-subtot = 'X'. ***CRUCIAL STATEMENT****
    append gs_sort to gt_sort.
    Now pass all this data to the alv grid function. And you are done.
    regards,
    Advait

Maybe you are looking for