Decimal Value display in ALV Field display
Hi Expert,
I need to dispaly one ALV Field "Routine Work Hour" value up to 2 decimal place in ALV output i.e if value is 2.5 then it should display as 2.50.The field which refers to this is ISMNW and the database table is AFRU.Now if this value is maintained in MINUTE unit, then code converts into HOUR unit and correctly outputs to ALV output up to 2 decimal after i changed the field decimal lenght.But for the value which is mainatined in HOUR unit, it correctlty populated into the final internal table upto 2 decimal and this table data while passing into FM " REUSE_GRID_DISPLAY" it only outputs upto 2 deciamal value for the value which is maintained as MINUTE unit in database table AFRU in ALV output, but for other value(Which are maintained in HOUR unit in table AFRU) it still shows 1 decimal length.But the internal table correctly populates these values up to 2 decimal for all unit of work(MINUTE/HOUR) while passing though this above FM.
Please advise where i need to look into.
Thanks
hi,
pass these parameters to fieldcatlog.
e.g.
Fcat-ref_fieldname = 'ISMNW'.
fcat-ref_tabname = 'AFRU'.
fcat-decimalsout = 2.
Hope this will help you.
Regards,
Vijay
Similar Messages
-
Hello All,
I am working with a program that is using the FM REUSE_ALV_GRID_DISPLAY and have an issue with the field display when the layout is changed. For example, I have a date field that will appear blank when the program is run initially. However, when the user changes the layout for the grid, the same field will be populated with 00/00/0000. Is there a way to prevent this display issue from occuring. Any help would be greatly appreciated. Thanks.
JohnHi Rich,
There is quite a bit of code, so I narrowed it down to the parts I think are most relevant. Let me know if you find anything. Thanks.
**Create the field catalogue
FORM field_catalog.
CLEAR int_fcat.
REFRESH int_fcat.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = 'ZRECERTTEST'
i_internal_tabname = 'ITAB'
i_inclname = 'ZRECERTTEST'
CHANGING
ct_fieldcat = int_fcat[]
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3.
LOOP AT int_fcat.
* IF int_fcat-fieldname EQ 'PRUEFLOS'.
* int_fcat-LZERO = 'X'.
* int_fcat-NO_ZERO = 'X'.
* ENDIF.
IF int_fcat-fieldname EQ 'MATNR'.
int_fcat-outputlen = 10.
ENDIF.
IF int_fcat-fieldname EQ 'MAKTX'.
int_fcat-outputlen = 20.
ENDIF.
IF int_fcat-fieldname EQ 'ZTANKID'.
int_fcat-outputlen = 12.
ENDIF.
IF int_fcat-fieldname EQ 'RECOMMEND'.
int_fcat-seltext_l = 'Recommended Re-certification Date'.
int_fcat-seltext_m = 'Recomm Re-cert. Date'.
int_fcat-seltext_s = 'Recomm Recert Dt.'.
ENDIF.
IF int_fcat-fieldname EQ 'ZCERT_DATE'.
int_fcat-seltext_l = 'Certification Date'.
int_fcat-seltext_m = 'Cert. Date'.
int_fcat-seltext_s = 'Cert. Dt.'.
ENDIF.
IF int_fcat-fieldname EQ 'ATFLV'.
int_fcat-outputlen = 6.
int_fcat-seltext_l = 'Material Retest Interval'.
int_fcat-seltext_m = 'Mat Retest Interval'.
int_fcat-seltext_s = 'Retest Int'.
ENDIF.
IF int_fcat-fieldname EQ 'ZRECERTDT'.
int_fcat-seltext_l = 'Recertification Date'.
int_fcat-seltext_m = 'Recert. Date'.
int_fcat-seltext_s = 'Recert Dt.'.
* int_fcat-NO_ZERO = 'X'.
ENDIF.
IF int_fcat-fieldname EQ 'ZRECERTMT'.
int_fcat-seltext_l = 'Recertification Interval'.
int_fcat-seltext_m = 'Recert. Int'.
int_fcat-seltext_s = 'Recert Int'.
ENDIF.
IF int_fcat-fieldname EQ 'ZZPRODH6'.
int_fcat-reptext_ddic = 'Formula Number'.
int_fcat-seltext_l = 'Formula Number'.
int_fcat-seltext_m = 'Formula Number'.
int_fcat-seltext_s = 'Form. No.'.
ENDIF.
IF int_fcat-fieldname EQ 'ATWRT'.
int_fcat-reptext_ddic = 'Spec Owner'.
int_fcat-seltext_l = 'Spec Owner'.
int_fcat-seltext_m = 'Spec Owner'.
int_fcat-seltext_s = 'Spec Owner'.
ENDIF.
IF int_fcat-fieldname EQ 'ZRECERTBY'.
int_fcat-seltext_l = 'Recert Date Changed By'.
int_fcat-seltext_m = 'Recert. Dt Changed By'.
int_fcat-seltext_s = 'Changed By'.
ENDIF.
IF int_fcat-fieldname EQ 'ZRECRTCHGD'.
int_fcat-seltext_l = 'Recert Date Last Changed On'.
int_fcat-seltext_m = 'Recert. Date Changed'.
int_fcat-seltext_s = 'Changed On'.
ENDIF.
* IF int_fcat-fieldname EQ 'ZRECERTDT' OR
* int_fcat-fieldname EQ 'ZRECERTMT'.
* int_fcat-input = 'X'.
* int_fcat-edit = 'X'.
* int_fcat-edit_mask = ' '.
* ENDIF.
IF int_fcat-fieldname EQ 'BOX'.
int_fcat-no_out = 'X'.
ENDIF.
* if int_fcat-fieldname eq 'ZRECNO'.
* int_fcat-no_zero = 'X'.
* endif.
IF int_fcat-fieldname EQ 'ZCERT_STAT'.
int_fcat-outputlen = '00012'.
ENDIF.
MODIFY int_fcat.
ENDLOOP.
***Create the ALV
wa_layout-box_fieldname = 'BOX'.
* wa_layout-group_change_edit = 'X'.
*wa_layout-edit = 'X'.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_buffer_active = 'X'
i_callback_program = v_repid
i_callback_pf_status_set = 'SET_STATUS'
i_callback_user_command = 'USER_COMMAND'
i_grid_title = v_title
is_layout = wa_layout
it_fieldcat = p_int_fcat[]
i_save = 'A'
is_variant = v_variant
it_events = i_events[]
TABLES
t_outtab = p_itab
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. -
IW69 from List Display to ALV Gird Display
Hi All
Transaction IW69 is working as List display for other users and ALV gird for my user. I would like to change from list display to ALV gird for other users too. How could i do this.
Kindly help me.
ThanksI am seeing ony Line1 Line2 Line3 tabs in the path Settings->Layout->Current for other users but the option you specified is there for my user.
thanks -
How to enter decimal values in custom screen field in a screen enhancement
Hi,
there is a requirement to provide field in custom screen that should allow only the numeric values with decilmals in a screen enhancement ?
As i cannot use field with float data type ? what are the alternates i have to do it ?
Please let me know
regards
vishnuHi,
I tried to create a field with NUM value wih 2 decimals by referring to CURR data type...it is giving an error...saying that reference table and field does not exist...
help me out ..
regards
vishnu -
Max number of columns in Alv grid display.
Is there any limitation on number of fields that can be displayed using alv grid display.
Please tell how i can display 199 fields using ALV.
Thanks in advance.I am not sure of the maximum of columns possible.
If you see the col_pos field in the field catalog table it can have only 2 digits. so i would assume it would be only 99 columns, but not sure.
Would get you more information soon.
Thanks,
Balaji -
Not able to download all the rows to excel sheet from alv grid display
Hi experts,
I am not able to download all the rows which are displayed in alv grid display for some material numbers.
for some materials i am able to download, i used two ways to download 1) from icon(local file) on grid 2) menu list->export.
i checked in debugging till selecting the spread sheet pop up window, i am able to see all the data in internal table.
Can you suggest me what will be the problem....
thanks in advance,hi sandeep,
sorry for didnt specify clearly.
note: EX: "asaasdada in this sentence i said " this symbol is special character not the text.
building final internal table code
CALL FUNCTION 'CS_BOM_EXPL_MAT_V2'
EXPORTING
capid = p_capid
datuv = sy-datum
ehndl = '1'
mktls = 'X'
mehrs = 'X'
mmory = '1'
mtnrv = p_matnr
stlal = '1'
stpst = 0
svwvo = 'X'
werks = p_werks
vrsvo = 'X'
TABLES
stb = i_stb
EXCEPTIONS
alt_not_found = 1
call_invalid = 2
material_not_found = 3
missing_authorization = 4
no_bom_found = 5
no_plant_data = 6
no_suitable_bom_found = 7
conversion_error = 8
OTHERS = 9.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
i_stb1[] = i_stb[].
IF NOT i_stb1[] IS INITIAL.
SORT i_stb1 BY idnrk.
DELETE ADJACENT DUPLICATES FROM i_stb1 COMPARING idnrk.
SELECT bmatn ematn FROM ampl INTO TABLE i_ampl
FOR ALL ENTRIES IN i_stb1
WHERE bmatn = i_stb1-idnrk AND
datuv LE sy-datum AND
datub GE sy-datum.
SELECT
matnr
bwkey
verpr
stprs
bwprh
FROM mbew
INTO TABLE i_mbew
FOR ALL ENTRIES IN i_stb1
WHERE
matnr EQ i_stb1-idnrk AND
bwkey EQ i_stb1-werks.
IF NOT i_stb1[] IS INITIAL.
SELECT matnr werks beskz
dzeit webaz plifz
ekgrp
INTO TABLE i_marc
FROM marc
FOR ALL ENTRIES IN i_stb1
WHERE matnr = i_stb1-idnrk
AND werks = i_stb1-werks.
SORT i_marc BY matnr werks.
ENDIF.
CLEAR i_ekpo.
CLEAR i_vend.
IF NOT i_stb1[] IS INITIAL.
SELECT ebeln ebelp matnr werks loekz aedat
netpr peinh
INTO TABLE i_ekpo
FROM ekpo
FOR ALL ENTRIES IN i_stb1
WHERE matnr = i_stb1-idnrk
AND werks = i_stb1-werks.
SORT i_ekpo BY matnr ASCENDING
aedat DESCENDING
ebeln DESCENDING
ebelp DESCENDING.
IF NOT i_ekpo IS INITIAL.
SELECT k~ebeln k~lifnr l~name1
INTO TABLE i_vend
FROM ekko AS k INNER JOIN lfa1 AS l
ON k~lifnr EQ l~lifnr
FOR ALL ENTRIES IN i_ekpo
WHERE ebeln = i_ekpo-ebeln.
SORT i_vend BY ebeln.
ENDIF.
ENDIF.
ENDIF.
i_ampl1[] = i_ampl[].
IF NOT i_ampl1[] IS INITIAL.
SORT i_ampl1 BY ematn.
DELETE ADJACENT DUPLICATES FROM i_ampl1 COMPARING ematn.
SELECT matnr mfrpn mfrnr FROM mara INTO TABLE i_mara
FOR ALL ENTRIES IN i_ampl1
WHERE matnr = i_ampl1-ematn.
ENDIF.
SORT i_ampl BY bmatn.
IF NOT i_stb[] IS INITIAL.
SELECT stlty stlnr stlkn stpoz idnrk potx1 potx2
INTO TABLE i_stpo
FROM stpo
FOR ALL ENTRIES IN i_stb
WHERE stlty = i_stb-stlty
AND stlnr = i_stb-stlnr
AND stlkn = i_stb-stlkn
AND stpoz = i_stb-stpoz
AND idnrk = i_stb-idnrk.
SORT i_stpo BY stlty stlnr stlkn stpoz idnrk.
ENDIF.
LOOP AT i_stb INTO wa_stb.
READ TABLE i_marc INTO wa_marc
WITH KEY matnr = wa_stb-idnrk
werks = wa_stb-werks
BINARY SEARCH.
IF sy-subrc = 0.
wa_outtab-beskz = wa_marc-beskz.
wa_outtab-dzeit = wa_marc-dzeit.
wa_outtab-webaz = wa_marc-webaz.
wa_outtab-plifz = wa_marc-plifz.
wa_outtab-ekgrp = wa_marc-ekgrp.
ENDIF.
READ TABLE i_ekpo INTO wa_ekpo
WITH KEY matnr = wa_stb-idnrk.
IF sy-subrc = 0.
wa_outtab-netpr = wa_ekpo-netpr.
wa_outtab-peinh = wa_ekpo-peinh.
READ TABLE i_vend INTO wa_vend
WITH KEY ebeln = wa_ekpo-ebeln
BINARY SEARCH.
IF sy-subrc = 0.
wa_outtab-lifnr = wa_vend-lifnr.
wa_outtab-name_sup = wa_vend-name1.
ENDIF.
ENDIF.
READ TABLE i_stpo INTO wa_stpo
WITH KEY stlty = wa_stb-stlty
stlnr = wa_stb-stlnr
stlkn = wa_stb-stlkn
stpoz = wa_stb-stpoz
idnrk = wa_stb-idnrk
BINARY SEARCH.
IF sy-subrc = 0.
wa_outtab-potx1 = wa_stpo-potx1.
wa_outtab-potx2 = wa_stpo-potx2.
ENDIF.
READ TABLE i_mbew INTO wa_mbew
WITH KEY
matnr = wa_stb-idnrk
bwkey = wa_stb-werks.
IF sy-subrc IS INITIAL.
MOVE:
wa_mbew-verpr TO wa_outtab-verpr,
wa_mbew-stprs TO wa_outtab-stprs,
wa_mbew-bwprh TO wa_outtab-bwprh.
ENDIF.
wa_outtab-matnr = p_matnr.
wa_outtab-posnr = wa_stb-posnr.
wa_outtab-stufe = wa_stb-stufe.
wa_outtab-idnrk = wa_stb-idnrk.
wa_outtab-ojtxb = wa_stb-ojtxp.
wa_outtab-menge = wa_stb-menge.
wa_outtab-meins = wa_stb-meins.
MOVE: wa_stb-zzitem_draw_no TO wa_outtab-zzitem_draw_no.
IF wa_stb-upskz = 'X'.
SELECT * FROM stpu INTO TABLE i_stpu
WHERE stlty = wa_stb-stlty AND
stlnr = wa_stb-stlnr AND
stlkn = wa_stb-stlkn AND
stpoz = wa_stb-stpoz.
ENDIF.
LOOP AT i_stpu INTO wa_stpu.
wa_outtab-upmng = wa_stpu-upmng.
wa_outtab-ebort = wa_stpu-ebort.
wa_outtab-uposz = wa_stpu-uposz.
CONCATENATE v_ebort wa_stpu-ebort INTO v_ebort
SEPARATED BY space.
ENDLOOP.
MOVE strlen( v_ebort ) TO v_len.
MOVE: 0 TO x,
128 TO y.
DATA : lt_tab TYPE TABLE OF swastrtab.
DATA : ls_tab LIKE LINE OF lt_tab.
DATA : lv_ebort TYPE string.
CLEAR lv_ebort. CLEAR lt_tab.
MOVE v_ebort TO lv_ebort.
CALL FUNCTION 'SWA_STRING_SPLIT'
EXPORTING
input_string = lv_ebort
max_component_length = 128
TABLES
string_components = lt_tab
EXCEPTIONS
max_component_length_invalid = 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.
IF lt_tab[] IS NOT INITIAL.
LOOP AT lt_tab INTO ls_tab.
CLEAR lv_ebort.
MOVE: ls_tab-str TO lv_ebort.
CONDENSE lv_ebort.
MOVE lv_ebort TO wa_outtab-ebort.
APPEND wa_outtab TO i_outtab.
CLEAR:
wa_outtab-matnr,
wa_outtab-posnr,
wa_outtab-zzitem_draw_no,
wa_outtab-ojtxb,
wa_outtab-menge,
wa_outtab-meins,
wa_outtab-uposz,
wa_outtab-upmng,
wa_outtab-verpr,
wa_outtab-stprs,
wa_outtab-bwprh,
wa_outtab-lifnr,
wa_outtab-name_sup,
wa_outtab-potx1,
wa_outtab-potx2,
wa_outtab-netpr,
wa_outtab-peinh.
* wa_outtab-idnrk.
ENDLOOP.
ELSE.
APPEND wa_outtab TO i_outtab.
ENDIF.
CLEAR v_ebort.
CLEAR: wa_stpu.
REFRESH: i_stpu.
LOOP AT i_ampl INTO wa_ampl WHERE bmatn = wa_stb-idnrk.
READ TABLE i_mara INTO wa_mara WITH TABLE KEY matnr = wa_ampl-ematn.
IF sy-subrc = 0.
LOOP AT i_outtab INTO wa_outtab
WHERE
idnrk = wa_stb-idnrk AND
flag NE 'X'.
wa_outtab-mfrpn = wa_mara-mfrpn.
wa_outtab-mfrnr = wa_mara-mfrnr.
SELECT SINGLE name1 FROM lfa1 INTO wa_outtab-name1 WHERE lifnr = wa_mara-mfrnr.
MOVE 'X' TO wa_outtab-flag.
MODIFY i_outtab FROM wa_outtab
TRANSPORTING mfrpn mfrnr name1 flag.
EXIT.
ENDLOOP.
IF sy-subrc <> 0.
CLEAR:
wa_outtab-matnr,
wa_outtab-posnr,
wa_outtab-zzitem_draw_no,
wa_outtab-ojtxb,
wa_outtab-ebort,
* wa_outtab-idnrk,
wa_outtab-menge,
wa_outtab-meins,
wa_outtab-uposz,
wa_outtab-upmng,
wa_outtab-verpr,
wa_outtab-stprs,
wa_outtab-bwprh,
wa_outtab-lifnr,
wa_outtab-name_sup,
wa_outtab-potx1,
wa_outtab-potx2,
wa_outtab-netpr,
wa_outtab-peinh.
wa_outtab-mfrpn = wa_mara-mfrpn.
wa_outtab-mfrnr = wa_mara-mfrnr.
SELECT SINGLE name1 FROM lfa1 INTO wa_outtab-name1 WHERE lifnr = wa_mara-mfrnr.
APPEND wa_outtab TO i_outtab.
ENDIF.
ENDIF.
REFRESH i_stpu.
CLEAR i_stpu.
ENDLOOP. CLEAR: wa_matnr1, wa_mfrnr, wa_outtab.
ENDLOOP.
Edited by: srinivasareddy j on Mar 9, 2011 7:16 AM
Edited by: srinivasareddy j on Mar 9, 2011 7:20 AM -
How to store only decimal values in one variable.
I would like to split decimal values from the amount field.
Ex.
If it is value x = 12345.678
y = 12345
z = 678
like this I have to store in another variable.Hi,
follow the below code.
data:
l_value type string,
l_value1 type string,
l_val(5) type p decimals 3 value '12.345',
l_len type i,
l_len1 type i.
l_value = l_val.
condense l_value.
l_len = strlen( l_value ).
if l_value cs '.'.
l_len = l_len - sy-fdpos - 1.
l_len1 = sy-fdpos + 1.
l_value1 = l_value+l_len1(l_len).
l_value = l_value+0(sy-fdpos).
endif.
write:/ l_value, l_value1.
reward if useful.
Thanks,
Sreeram. -
ALV grid can we remove the repetation values in field & display as one .
Dear Freinds,
i have developed a custom development relating to a salarly report based on the orgunit, the output is coming however i have one doubt in alv output.
right now my internal table data having data as follows : (iam giving only some fields)
orgunit orgdesc Empno Empname
70000905 Human Resources 7056 Richard
70000905 Human Resources 7057 Reymond Jain
70000905 Human Resources 7058 Maria Gulz
70000905 Human Resources 7061 Jacob
now in my output i dont want to have the orgunit value 70000905 and orgdesc (human resources) shouldnt not be repeated . is there any option in ALV where we I can use in
the field cat ( any parameter) where i can set that we can make the orgid as one and remove the repeation.(iam using alv grid function module).
Please help me in this regard
Regards
SyamlaHi,
Before displaying sort ur internal table.
refer this code.
*& Form sub_display_data
text
FORM sub_display_data .
*--To sort the output through material number
DATA : lwa_sort TYPE slis_sortinfo_alv.
DATA : lit_sort TYPE slis_t_sortinfo_alv.
*--Pass the values to the table
lwa_sort-fieldname = 'PERNR'. "Field name in o/p inttable
lwa_sort-tabname = 'it_final2'. "Output Internal table
lwa_sort-spos = '1'. "Sort sequence
lwa_sort-up = 'X'. "Sort in ascending order
lwa_sort-down = ' '. "Sort in descending order
lwa_sort-subtot = 'X'. "Subtotal
APPEND lwa_sort TO lit_sort.
*--Pass the values to the table
lwa_sort-fieldname = 'WORKDATE'. "Field name in o/p inttable
lwa_sort-tabname = 'it_final2'. "Output Internal table
lwa_sort-spos = '2'. "Sort sequence
lwa_sort-up = 'X'. "Sort in ascending order
lwa_sort-down = ' '. "Sort in descending order
lwa_sort-subtot = ' '. "Subtotal
APPEND lwa_sort TO lit_sort.
*--Pass the values to the table
lwa_sort-fieldname = 'WEKLY'. "Field name in o/p inttable
lwa_sort-tabname = 'it_final2'. "Output Internal table
lwa_sort-spos = '3'. "Sort sequence
lwa_sort-up = 'X'. "Sort in ascending order
lwa_sort-down = ' '. "Sort in descending order
lwa_sort-subtot = ' '. "Subtotal
APPEND lwa_sort TO lit_sort.
wa_layout-colwidth_optimize = 'X'.
IF NOT it_final2[] IS INITIAL.
*--Call the function module to display the ALV report
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
is_layout = wa_layout
i_callback_program = v_repid
it_fieldcat = it_fieldcat1[]
i_default = c_chk
i_save = c_save
it_sort = lit_sort
TABLES
t_outtab = it_final2
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.
ELSE.
*--Message No data found
MESSAGE i888 WITH text-017.
LEAVE LIST-PROCESSING.
ENDIF.
ENDFORM. " sub_display_data
Regards,
Prashant -
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 AMHi 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, -
Negative sign display for CURR field in ALV grid report
I have a field BETRG defined as CURR field of length 15, decimal places 2. The value may be negative or positive. In case of negative values I am using EDIT_MSK option in the field catalog to bring the negative sign to the left of the value as shown below.
Quote
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = sy-repid
i_internal_tabname = 'LT_FINAL'
i_inclname = sy-repid
CHANGING
ct_fieldcat = fieldcat[]
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3.
LOOP AT fieldcat.
CASE fieldcat-fieldname.
WHEN 'BETRG'.
fieldcat-ctabname = ' '.
fieldcat-cfieldname = ' '.
fieldcat-edit_mask = 'RRV_______________.__'.
ENDCASE.
MODIFY fieldcat.
ENDLOOP.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_buffer_active = 'X'
i_callback_program = sy-repid
i_grid_title = 'ABCD'
is_layout = gs_layout
it_fieldcat = fieldcat[]
i_save = 'A'
is_variant = gs_save
it_events = gs_events
TABLES
t_outtab = lt_final
EXCEPTIONS
program_error = 1
OTHERS = 2.
Unquote
On displaying the report using 'REUSE_ALV_GRID_DISPLAY' as shown above, when the value of BETRG is a smaller number like say 624, then the ALV output appears as '- 624.00' instead of '-624.00'.
Is there any way that I can remove the space in between the negative sign and the number before displaying the ALV output using 'REUSE_ALV_GRID_DISPLAY'?Hi Deepak,
I tried this and found that this doesn't work in case of currency field. Once you move back the char field (with negative sign to the left and condensed) to the currency field, the negative sign again moves back to the right.
I think that the only way a negative sign can be brought to the left of the currenct field is by using edit_mask of field catalog as I have shown above.
Regards,
Shayeree. -
Decimal values for a field in ALV
Hi,
I created an ALV report.
It has a field which will display the calculated value as '103,839,389'. This should be dispalyed as '103,839,389.00' with decimal value, I mean with 2 decimal places, how can this be achieved?
Thanks,
Kumarhi check this..
use these in populating the fieldcat..
it_fieldcat-decimalsfieldname = fieldname
it_fieldcat-decimalstabname = tabname
it_fieldcat- decimals_out = 2.
regards,
venkat -
ALV Report Displaying QUAN field different in systems
Hi Guys,
I have a field of type QUAN (quantity) on an ALV report that is displaying differently on the Devlopment and QA systems.
If I enter the value '5' in this field in Development and press enter, the value displays as '5.000'. If I enter the value in the QA field, however, the value displayes as '0.005'.
I have looked at domains and everything, but they seem simmilar.
Please advise fi there is something I have overlooked,
Thank you,
ChristiaanHi,
Check in system default parameter settings. It works based on system default parameter settings.
System => User Profile => Own Data
In *Defaults* tab check the *Decimal Notaion* field.
Regards,
Shankar. -
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 -
Currency field in alv grid display
Hi,
I am using alv grid display.I am having one currency field netprice.I want it to be displayed as blank when i am not passing any value.But it gives 0.00 when it is not having any value.How to make it blank instead of 0.00.
Points will be rewarded.
Regards,
Sowmya.HI,
If itab-curr = '0.00' .
itab-curr = ''.
modify itab.
endif. -
Dump when summing up CURR field in ALV GRID display
Hi All,
I am getting dump when I try to sum the CURR field in my ALV Grid Display. The field is of CURR 23. I am using classes and methods to display alv grid.
I tried passing <fs_fieldcat>-do_sum = 'X'. When I did this, it is dumping without even displaying the alv grid.
Here is the part it is throwing dump:
ls_lvc_data-value = space.
clear ls_lvc_data-style.
loop at it_fcat_local assigning <ls_fcat>
where tech ne 'X' and no_out ne 'X'.
if l_invisible eq 'X'.
clear l_invisible.
if <ls_fcat>-do_sum is initial.
continue.
else.
clear ls_lvc_data-col_pos.
endif.
endif.
add 1 to ls_lvc_data-col_pos.
assign component <ls_fcat>-fieldname
of structure <ls_data> to <l_field_value>.
_if sy-subrc ne 0.
message x000(0k).
endif._
Regards,
GuruThomas,
Here is the dump:
Runtime Errors MESSAGE_TYPE_X
Date and Time 10/22/2010 23:30:53
Short text
The current application triggered a termination with a short dump.
What happened?
The current application program detected a situation which really
should not occur. Therefore, a termination with a short dump was
triggered on purpose by the key word MESSAGE (type X).
Error analysis
Short text of error message:
Long text of error message:
Technical information about the message:
Message class....... "0K"
Number.............. 000
Variable 1.......... " "
Variable 2.......... " "
Variable 3.......... " "
Variable 4.......... " "
How to correct the error
Probably the only way to eliminate the error is to correct the program.
If the error occures in a non-modified SAP program, you may be able to
find an interim solution in an SAP Note.
If you have access to SAP Notes, carry out a search with the following
keywords:
"MESSAGE_TYPE_X" " "
"SAPLSLVC" or "LSLVCF36"
"FILL_DATA_TABLE"
If you cannot solve the problem yourself and want to send an error
notification to SAP, include the following information:
1. The description of the current problem (short dump)
To save the description, choose "System->List->Save->Local File
(Unconverted)".
2. Corresponding system log
Display the system log by calling transaction SM21.
Restrict the time interval to 10 minutes before and five minutes
after the short dump. Then choose "System->List->Save->Local File
(Unconverted)".
3. If the problem occurs in a problem of your own or a modified SAP
program: The source code of the program
In the editor, choose "Utilities->More
Utilities->Upload/Download->Download".
4. Details about the conditions under which the error occurred or which
actions and input led to the error.
Source Code Extract
Line
SourceCde
2708
is_subtottxt_info = ls_subtot_info
2709
ip_subtot_line = lr_data
2710
changing
2711
c_subtottxt = l_subtottxt.
2712
ls_lvc_data-value = l_subtottxt.
2713
2714
append ls_lvc_data to ct_lvc_data.
2715
endif.
2716
2717
2718
Column per Fieldcat Entry
2719
2720
ls_lvc_data-value = space.
2721
clear ls_lvc_data-style.
2722
loop at it_fcat_local assigning <ls_fcat>
2723
where tech ne 'X' and no_out ne 'X'.
2724
if l_invisible eq 'X'.
2725
clear l_invisible.
2726
if <ls_fcat>-do_sum is initial.
2727
continue.
2728
else.
2729
clear ls_lvc_data-col_pos.
2730
endif.
2731
endif.
2732
2733
add 1 to ls_lvc_data-col_pos.
2734
2735
assign component <ls_fcat>-fieldname
2736
of structure <ls_data> to <l_field_value>.
2737
if sy-subrc ne 0.
>>>>>
message x000(0k).
2739
endif.
2740
2741
*... work on average
2742
if <ls_fcat>-do_sum eq 'C'.
2743
Initialize average result and entries
2744
<l_field_value> = 0.
2745
clear l_entries.
2746
2747
retrive unit from fieldcatalog
2748
assign space to <l_unit>.
2749
if not <ls_fcat>-cfieldname is initial.
2750
assign component <ls_fcat>-cfieldname
2751
of structure <ls_data> to <l_unit>.
2752
endif.
2753
if not <ls_fcat>-qfieldname is initial.
2754
assign component <ls_fcat>-qfieldname
2755
of structure <ls_data> to <l_unit>.
2756
endif.
2757
Maybe you are looking for
-
Apple TV (2) refuses to stream, getting 2 hour downloads before it will even start help D
-
Hello, Cannot define item attribute values during manual item creation process. Please, help. Maybe I've missed some setup? Application : Advanced Product Catalog Responsibility : Development Manager Oracle Applications : 12.1.3 Development Manager >
-
Execute simple SQL query on Java
Hello, I am a newbie on ADF, I am a web developer used to work with EJBs, WebServices, Servlets and this stuff... But now I am on a project that uses ADF. My opinion, I don´t like this kind of development, drag and drop, I prefer to code on :) but, I
-
hi Say for example i have a table with id and name. and a jsp form with multiple id and name text fields. e.g enter your id and name: textbox textbox textbox textbox textbox textbox 1.when the user fills in all rows, it should be written in database
-
Audio Won't delete HELP!!!
I've tried detaching the audio from the clip and pressing delete, reducing the volume to 0%, even starting the whole project over again and when i go to watch the video in full screen or export it and watch it, the audio is still on all the clips. pl