In ALV Grid to eliminate the zero.
Hi Experts,
i am working with abap hr .In my grid there is location allowances amount is 2750.00. I want to eliminate the .00.
I tried with SHIFT l_res RIGHT DELETING TRAILING '0(2)'.But this not working. Can any body suggest how to eliminate the .00 .Please its very urgent.
Regards,
Mithun.
Hi ,
you can use Write-to statement with decimals to decide how many decimal point you want.
Code Looks like:
write ls_eban-preis DECIMALS 0 to ls_str1-preis.
here ls_str1-preis should be of type characters.
if requirement is somtimes you want show decimals sometimes not then code should be.
if cond
write ls_eban-preis DECIMALS 0 to ls_str1-preis.
else.
write ls_eban-preis DECIMALS 2 to ls_str1-preis.
endif.
append ls_STR to LT_STR.
here LT_STR is of type of table which you are going to show at ALV.
Regards
Manish
Similar Messages
-
Need to eliminate the Zero values in the marker text in Bar chart
Hi all,
I have a requrement where i have to show the values in the BAR chart . so i have used the following syntax,
<MarkerText visible="true" markerTextPlace="MTP_TOP"/>
but the condition is i have to eliminate the zero value. i.e when the value is zero it should not be shown.
Kindly pelase help me to solve this.
Many thanks in advance,
Regards,
Dhaya.Hi all,
I found the solution .
below is wat i did.
i have created a variable and inside the group, i ahev assigned and i will check for the conidion whether it is zero or not. if it is Zero then i will display null .
<RowData>
<xsl:for-each-group select=".//SALARY_SCALE" group-by="SALGRADE" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:sort select="SALGRADE"/>
<xsl:variable name="Fcnt" > <xsl:value-of select="sum(current-group()[GENDER='Female']/COUNT) div $total * 100 "/> </xsl:variable>
<Cell><xsl:value-of select="xdoxslt:ifelse($Fcnt=0,'',$Fcnt)"/></Cell>
</xsl:for-each-group>
</RowData>
Regards,
Dhaya. -
Row seperator in the ALV grid display after the various highest level prod.
Hi,
I have a requirement like user wants a row seperator against the various high level products (Each parent material)in ALV Grid display.We made this change but quantity and pricey fields showing the zero's in the blank line.i know that if we use NO-ZERO
in the ALV field catalog , we can remove the zero's from blank line. But other zerou2019s will remove from rest of the line items. User want's the zero's in other line items, but not in the blank line.
We can convert packed fileds into character format, but this will effect to the summing the quantity, price coumns.
If any body have idea on above mentioned.
Regards,
SK.Hi Suresh,
There is no short cut for this requirement. You have to do following steps.
1. Change the data type of column to char.
2. Programatically find the totals.
Reagards,
Anversha -
Header row in ALV Grid, based on the data in the table
Hi All,
I have a requirement wherein, based on the data in the table used for ALV, i need to add rows as sort of header in the ALV display.
For e.g. my table has
Appl No. Item Material Desc. Cost -> Column Heading
1 10 400 Excavation 10.00 -> Data
1 20 400 Footing 10.00
2 10 400 Excavation 10.00
2 20 400 Footing 10.00
For every new Appl No., i need to add a row, or sort of header specifying the appl no. details. means
Appl No. Item Material Desc. Cost
Appli. No. 1 Date: 01/01/1009 -> my requirement
1 10 400 Excavation 10.00
1 20 400 Footing 10.00
Appli. No. 2 Date: 02/01/1009
2 10 400 Excavation 10.00
2 20 400 Footing 10.00
Is this possible in ALV my any means? Currently i m using normal ALV Grid
Regards,
JanakiHi..
Try like this... I think u have Application number and date in ur table ... First get the total table data into internal table.. and to add the row
*Declare the var1 as 0 and var2.
loop at internal table
*var1 = var1 +1
when application number =var1
concatenate : 'Appli. No.' (table- appli no field) 'Date:' (table-date field) into var2.
perform display(some name)
*endloop.
*form display...
alv display part.. first give that var2 like eg.. wa_alv-field= 'var2'.
end form.
Hope this will help u .....
Regards,
Abaper -
ALV GRID download truncates the last digit of invoice
Hi Experts,
I am facing a production issue related to ALV grid download. When we click export to local file -> spread sheet,
if it is downloaded to Excel file, invoice last digit is truncated.
Can any body face this problem ?
Please let me know if any body has clue to solve this strange issue.
Thanks,
Balaji.T.Hi,
check the type of field used for invoice list. Make it type vbeln. Also try using EXit_alpha_output FM and modify the table for invoice numbers.
Thanks,
Sam. -
ALV REPORT: read selected checkbox in alv grid and process the pushbutton
my requirement is to check some rows from alv grid and the press the pushbutton. Thereby following things should process:
select all checked rows into an itab and call the transaction code CJ01 for all
entries......
I am finding the problem that when I select the checkbox....the internal table doesnt recognize the boxes as checked ones......
thanks in advance...
Kartikey Singh,Data: ref1 type ref to cl_gui_alv_grid.
CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
IMPORTING
E_GRID = ref1.
call method ref1->check_changed_data.
loop at t_output where Flag = 'X'.
if t_output-VKUEGRU is initial.
message e000 with text-110.
endif.
endloop. -
Sending the rows in an ALV grid chosen by the user to another report
Hello Experts!
I am facing a problem with respect to ALV grid using OOABAP.
I am displaying an ALV grid. The user selects a few rows from this grid and clicks on a button called "Update" which i have incorporated into the grid.
Once the user clicks on update, i should call another report passing only the rows selected by the user. I am using the method "get_selected_rows" do get the indices of the rows selected. But, i am unable to proceed from here. How do i incorporate this logic in my code? Can anyone give me some sample code?
Thanks and Regards,
SmithaHi Smitha
Get the rows of the ALV into an internal table . You are right in using the method GET_SELECTED_ROWS.
Suppose li_tab is the internal table in which you have the rows of ALV.
Write this statement in the report from which you are transporting.
EXPORT li_tab TO MEMORY ID sy-repid.
Write this statement in the report to which you are transporting.
IMPORT sel_tab = li_tab FROM MEMORY ID 'Z_Report_Name'.
hope it works.
Reward points if helpful. -
Automatically eliminates the zeros in front of other numbers
Numbers and Excel automatically get rid of the zeros in front of another number (like 1,2,3,4 etc)
How do I fix this?It is probably that I do not fully understand your question. I'm reading it that you want to see the leading zeroes. Here's the Excel method mentioned above:
Regards, -
ALV grid control, Adding the push Button in the Toolbar
Hello All,
I am facing a problem when trying to do calculation based on the button added at the toolbar of interactive ALV list.
When I click on the toolbar button Compute, the ALV should calculate the
multiplication of the Qty (manually entered by a user) & price per unit already available in the ALV & show it the Column Total value.
Presently when I try to do this using
Method handle_user_command.
modifying the inetrnal table GT_FINAL_OUTPUT
with the Total price value .
& updating the column Total price (Qty * price) in the Internal table
After doing this I am agin calling the below function
CALL METHOD g_grid->set_table_for_first_display
EXPORTING
i_structure_name = 'GT_FINAL_OUTPUT'
is_layout = gs_layout
CHANGING
it_fieldcatalog = gt_fieldcat
it_outtab = GT_FINAL_OUTPUT[].
At above function it gives short dump or sometimes it does not update the ALV screen with the new updated value of Total price .
The short dump comes states the error of unassigned field symbol.
Kindly suggest a program where we can do manipulation at the editable ALV.
Or solution to above issue .
Regards,
AnuragYou should only be calling the SET_TABLE_FOR_FIRST_DISPLAY one time in the PBO of your screen, otherwise you should be using the REFRESH_TABLE_DISPLAY method. IN your PBO, check that the instance of the alv_container is alive, if so, do not call the SET method, rather call the REFRESH method.
if alv_container is initial.
create object......
create object g_grid.....
call method g_grid->set_table_for_first_display......
else.
call method g_grid->refresh_table_display( ).
endif.
Regards,
Rich HEilman -
ALV Grid display in the middle of window
Hi all,
When I m refering to the past queries in the forum I read that specifying these values
I_SCREEN_START_COLUMN
I_SCREEN_START_LINE
I_SCREEN_END_COLUMN
I_SCREEN_END_LINE in the FM reuse_alv_grid_display
we can display the output of alv in the middle of the window. But when I specify these values a new window is popped up in which the o/p of ALV is displayed. Actually what is the significance of thses values ? If I want to display in the middle of the window but not in a new window, so what should I do for this.
Regards,
Vijay.Hi Neil,
REPORT Z_ALV_CHANGEHEADER.
type-pools slis.
data : begin of itab occurs 0 ,
carrid like sflight-carrid,
connid like sflight-connid,
fldate like sflight-fldate,
end of itab.
select carrid connid fldate from sflight into corresponding fields
of table itab.
data : i_fieldcat type slis_t_fieldcat_alv.
data : wa_fieldcat type slis_fieldcat_alv.
wa_fieldcat-row_pos = 0.
wa_fieldcat-col_pos = 1.
wa_fieldcat-fieldname = 'CARRID'.
wa_fieldcat-tabname = 'ITAB'.
wa_fieldcat-SELTEXT_L = 'Carrier Id'.
append wa_fieldcat to i_fieldcat.
clear wa_fieldcat.
wa_fieldcat-row_pos = 0.
wa_fieldcat-col_pos = 2.
wa_fieldcat-fieldname = 'CONNID'.
wa_fieldcat-tabname = 'ITAB'.
wa_fieldcat-SELTEXT_L = 'Connection Id'.
append wa_fieldcat to i_fieldcat.
clear wa_fieldcat.
wa_fieldcat-row_pos = 0.
wa_fieldcat-col_pos = 3.
wa_fieldcat-fieldname = 'FLDATE'.
wa_fieldcat-tabname = 'ITAB'.
wa_fieldcat-SELTEXT_L = 'Flight Date'.
append wa_fieldcat to i_fieldcat.
clear wa_fieldcat.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER = ' '
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = 'Z_ALV_CHANGEHEADER'
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = ' '
I_CALLBACK_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 =
IT_FIELDCAT = i_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 = 30
I_SCREEN_START_LINE = 10
I_SCREEN_END_COLUMN = 90
I_SCREEN_END_LINE = 70
IT_ALV_GRAPHICS =
IT_HYPERLINK =
IT_ADD_FIELDCAT =
IT_EXCEPT_QINFO =
I_HTML_HEIGHT_TOP =
I_HTML_HEIGHT_END =
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
t_outtab = 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.
I have posted my code . Please check and tell me where I have gone wrong.
Regards,
Vijay. -
Material num truncated while downloading the data into excel in ALV GRID
Hi,
I developed a report with ALV GRID display. The reoport is having Material number as one of the column. The report shows the total 10 digit material number. When i tried to downlaod the report into an excel sheet or a TXT file, material number in the text file shows only the last two digits.
Please let me know if you have any solution for this.
URGENTHi,
I developed a report with ALV GRID display. The reoport is having Material number as one of the column. The report shows the total 10 digit material number. When i tried to downlaod the report into an excel sheet or a TXT file, material number in the text file shows only the last two digits.
Please let me know if you have any solution for this.
URGENT -
How to send the ALV GRID output to spool by using the print button in std t
How to send the ALV GRID output to spool by using the print button in standard tool bar.
We have created a button in the va02 transaction. If user click on the button the new screen will be display on that screen we are populating the alv grid output using the oops concept. But i am unable to send the output to spool using the print button in the standard tool bar.
I am able to display the Print parameter dialog box but i am not able to send it to spool.
Kindly help.
Thanks In Advance.
G.V.RamanaHi Shaik,
There is not properties button in my print screen.
MODULE user_command_0900 INPUT.
WHEN 'EXCEL'.
PERFORM excel_download.
WHEN 'PRI'.
PERFORM print_output.
form Print_output.
CALL FUNCTION 'RSPO_LIST_LAYOUT_FITS'
EXPORTING
columns = 80
device = 'ANY '
lines = 65
maxpenality = 1999
TABLES
layouts = lt_layouts1
EXCEPTIONS
unknown_device = 1
OTHERS = 2.
IF sy-subrc = 0.
LOOP AT lt_layouts1.
IF lt_layouts1-penality < 1000 AND
lt_layouts1-penality < l_min_penality.
l_layout = lt_layouts1-layout.
l_min_penality = lt_layouts1-penality.
ENDIF.
ENDLOOP.
IF NOT l_layout IS INITIAL.
CALL FUNCTION 'GET_PRINT_PARAMETERS'
EXPORTING
mode = 'CURRENT'
line_size = 80 "#EC *
new_list_id = l_new_list_id
no_dialog = l_no_dialog
layout = l_layout
IMPORTING
out_archive_parameters = rs_arc_params
out_parameters = rs_pri_params
valid = l_valid
EXCEPTIONS
archive_info_not_found = 1
invalid_print_params = 2
invalid_archive_params = 3
OTHERS = 4.
IF sy-subrc NE 0. " INS SLIN
ENDIF. " INS SLIN
IF rs_pri_params-linsz LT 80 OR
rs_pri_params-linsz LT gt_stack-s_lprint-width.
gt_stack-print_line_break = 'X'.
ELSE.
CLEAR gt_stack-print_line_break.
ENDIF.
IF l_valid NE 'X'.
rs_pri_params = ls_pri_params_sav.
rs_arc_params = ls_arc_params_sav.
ENDIF.
ENDIF.
ENDIF.
endform. " Print_output
CALL METHOD gv_cost_tot_alv_grand->set_table_for_first_display
EXPORTING
is_layout = gs_layout_cost_tot_grand
CHANGING
it_fieldcatalog = gt_fcat_cost_tot_grand[]
it_outtab = gt_cost_tot_grand[].
Please check my code -
The Visible attribute on alv grid column is not changed after Change Layout
Setup:
I have a program that displays output in an ALV grid (using cl_salv_table).
The ALV grid is displayed within a custom control on a subscreen.
I have 4 subscreens being used on a tabstrip control. So I have 4 ALV grids total (one on each subscreen).
On each ALV grid, I have set the set_layout_change function to true so that the user can hide and unhide columns etc. on each grid via the button on the alv grid toolbar.
I also allow the user to dowload the contents of all 4 grids to excel. To do this I have a custom button that when clicked goes to each ALV grid - gets the column metadata (via cl_salv_columns_table-get() ) and checks the visibility to determine if the column should be downloaded or not (via cl_salv_column-is_visible() ) to excel.
The Problem:
As I said I have 4 grids being displayed via a tab control. Let's say the user is on tab 1 and unhides some columns on the alv grid 1 via the Change Layout... button. And then the user navigates to tab 2. If they click the download button at that point - when the download code is run and it checks the visibility of the columns on alv grid 1 - the changes that were made via the Change Layout... button have not synchronized yet. When I call is_visible() for a column that was unhid it still comes back as false.
The only way I have found to remedy this is to make the user click on a button on the alv grid's toolbar before navigating to a different tab to force the synchronization between the changes made and the backend column metadata. However, this is not the best option and requires training for the user that they have to do this for the download to work correctly.
The Question:
1) why is the Change Layout... button not automatically synchronizing the changes it made to the back end? Is there a way to make it do this?
2) OR, is there a way that I can force the synchronization within the code and not force the user to click a button on the alv grid? If there is a way to force the synchronization - where do I put that code? As far as I can tell, when I switch between tabs - I am unable to catch that action in my PAI events.
Thanks in advance for any help.I was able to resolve this issue with a satisfactory solution.
In my program I had a local class definition to handle the grids' events. When the synchronization wasn't working I only had two events defined: for link_click and added_functions.
I created another definition for event after_salv_function:
on_after_salv_function for event after_salv_function of cl_salv_events importing e_salv_function
There is no code in the method implementation - but adding this event handler now causes a synchronization to occur after the Change Layout is done. -
ALV GRID DISPLAY and a Parameter entry in the same screen how ?
Hi,
I am newbie to ABAP and I am trying to figure out ways to display an ALV grid along with the parameter field into which the user enters his/ her values in the same screen.To be clear, when I have a parameter type specified, my screen just lets me display that one field into which the user is asked to enter a value but I want to display the table as well as the user input field in the same screen.
Any help would be appreciated.
Thanks a lot. I appreciate that.
-VHi,
I think the easiest way to do that is by means of docking container . I will assume you are using selection-screen, but you can also achieve that with normal screen.
- first you need to place your field in selection screen which I believe you already have
- now during AT SELECTION-SCREEN OUTPUT you check if something is entred to that field
- if so you create instance of docking container (docking it at left hand side) then inside you place you alv with selected data for that field value
So the code which fulfils that would be
PARAMETERS pa_carr TYPE scarr-carrid.
DATA: gr_dock_cont TYPE REF TO cl_gui_docking_container,
gr_alv TYPE REF TO cl_gui_alv_grid.
DATA: it_spfli TYPE TABLE OF spfli.
AT SELECTION-SCREEN OUTPUT.
IF pa_carr IS NOT INITIAL.
SELECT * FROM spfli INTO TABLE it_spfli UP TO 10 ROWS
WHERE carrid = pa_carr .
IF gr_dock_cont IS NOT BOUND.
CREATE OBJECT gr_dock_cont
EXPORTING
side = cl_gui_docking_container=>dock_at_left
extension = 500.
CREATE OBJECT gr_alv
EXPORTING
i_parent = gr_dock_cont.
CALL METHOD gr_alv->set_table_for_first_display
EXPORTING
i_structure_name = 'SPFLI'
CHANGING
it_outtab = it_spfli.
ELSE.
CALL METHOD gr_alv->refresh_table_display.
ENDIF.
ENDIF.
Regards
Marcin -
How can I hide the marker button in an ALV GRID line?
Hi all,
I am switching an old program from ALV LIST to ALV GRID. In the old list, I put a checkbox on each line to abilify the user to mark some lines. However, there are some lines that I don't want the user to select. In the list, I set the field for the box name to "*" (asterisk) and in the list, the checkbox is not input enabled.
Now in the grid, this does not function any more. all lines are markable. How can I deactivate the marker function for some lines?
Greetings
JörgHi,
use the below snippet in your code
DATA: ls_celltab TYPE lvc_s_styl.
REFRESH pt_celltab.
IF p_mode EQ text-103.
*§2a.Use attribute CL_GUI_ALV_GRID=>MC_STYLE_ENABLED to set a cell
to status "editable".
ls_celltab-fieldname = c_character1.
ls_celltab-style = cl_gui_alv_grid=>mc_style_enabled.
ls_celltab-style2 = cl_gui_alv_grid=>mc_style_f4.
INSERT ls_celltab INTO TABLE pt_celltab.
ls_celltab-fieldname = c_character2.
ls_celltab-style = cl_gui_alv_grid=>mc_style_enabled.
ls_celltab-style2 = cl_gui_alv_grid=>mc_style_f4.
INSERT ls_celltab INTO TABLE pt_celltab.
ls_celltab-fieldname = c_character3.
ls_celltab-style = cl_gui_alv_grid=>mc_style_enabled.
ls_celltab-style2 = cl_gui_alv_grid=>mc_style_f4.
INSERT ls_celltab INTO TABLE pt_celltab.
ls_celltab-fieldname = text-107.
ls_celltab-style = cl_gui_alv_grid=>mc_style_enabled.
ls_celltab-style2 = cl_gui_alv_grid=>mc_style_f4.
INSERT ls_celltab INTO TABLE pt_celltab.
ls_celltab-fieldname = c_selectionid.
ls_celltab-style = cl_gui_alv_grid=>mc_style_disabled.
INSERT ls_celltab INTO TABLE pt_celltab.
Regards
Maybe you are looking for
-
How to track the mouseClick() on seperators between JTable TableHeader?
Hi, Can anybody help me out telling how to track a mouseEvent on the JTable's TableHeader seperators, i.e. the seperators between the TableHeaders? Thanks in advance Logical_new_developer
-
Dialog hidden automatically when browser is in full screen mode
Hello all, I have an applet which shows a modal dialog automatically. It works fine when the applet is shown in the IE browser in normal mode. The window disappears automatically within few seconds when the browser is in Full Screen Mode. Does any on
-
Purchase order with referance to Purchase requisition
Dear All, This is the requirement of <b>Purchase order creation with reference to Purchase requisition only at the same time this requirement need to control particular document type ( Ex: Standard purchase Order) only .</b>Based on this other docu
-
SRM 7. 0 with ECC 6.0 Enhancement Pack
1) My client just upgraded their R/3 to ECC 6.0, but no Enhancement Pack. 2) They are trying to upgrade from SRM 5.0 to SRM 7.0 in the near futures. 3) During their first SRM phase, their scenario is limited to the following: a. R/3 RFQs are pushed t
-
The Apple website boasts the ability to create 2 page spreads, and I can't seem to figure out how to do this?