OOPs ALV report Fieldcatalog Editing a currency field
Hi all,
I have created an OOP's ALV report. I have made one of the currency field editable. when I am changing the value in any cell and go out of the cell(or move to other cell using arrow keys or click some were in the grid) it is taking '.' after 2 digits from the right.
for example if I take 10 it is converting to 0.10, if I take 100 it is becomnig 1.00, if I take 100.00 it is becoming 1.00. If I take 123.45 I am getting a pop up box with message "Too many decimal places"
the fieldcatalog values are as follows
WA_FIELDCAT-FIELDNAME = 'ORD_VAL'.
WA_FIELDCAT-SCRTEXT_M = 'Ord Value'.
WA_FIELDCAT-COL_POS = 11.
wa_fieldcat-no_zero = 'X'.
WA_FIELDCAT-OUTPUTLEN = 14.
WA_FIELDCAT-CURRENCY = 'INR'.
wa_fieldcat-decimals_o = '2'.
wa_fieldcat-no_zero = 'X'.
WA_FIELDCAT-EDIT = 'X'.
APPEND WA_FIELDCAT TO IT_FIELDCAT.
CLEAR WA_FIELDCAT.
Can anybody please help me. As If I edit the field it should take the values what I input.
Thanks in Advance.
Hi ,
The CURR field is the currency unit field in the table ITAB.
I am just confused with your answer. in my case the final internal table is T_CHKQTY1 shall I take that or anything else. I have taken WA_FIELDCAT-CTABNAME = 'CURR'. but the system is thrownig an error as The data object has no component with CTABNAME but there is a component called TABNAME.
Can you please currect me.
Similar Messages
-
Need a sample program for hierarchial oops ALV report
Hello experts,
I Need a sample program for hierarchial oops ALV report.Hi,
Check the following sample code...
T A B L E S
tables : ekko.
data definition
types : begin of ty_ekko,
ebeln type ekko-ebeln,
lifnr type ekko-lifnr,
bsart type ekko-bsart,
aedat type ekko-aedat,
ernam type ekko-ernam,
end of ty_ekko.
types : begin of ty_eket,
ebeln type ekpo-ebeln,
ebelp type ekpo-ebelp,
werks type ekpo-werks,
matnr type ekpo-matnr,
menge type eket-menge,
wamng type eket-wamng,
netpr type ekpo-netpr,
end of ty_eket.
data : it_ekko type table of ty_ekko,
it_eket type table of ty_eket.
data: ob_hieralv type ref to cl_salv_hierseq_table.
data: it_binding type salv_t_hierseq_binding,
is_binding type salv_s_hierseq_binding.
S E L C T O P T I O N S
select-options : s_ebeln for ekko-ebeln.
S T A R T O F S E L E C T I O N
start-of-selection.
select ebeln
lifnr
bsart
aedat
ernam from ekko
into corresponding fields of table it_ekko
where ebeln in s_ebeln.
if sy-subrc eq 0.
select aebeln aebelp
awerks amatnr
bmenge bwamng
a~netpr from ekpo as a join eket as b
on amandt = bmandt
and aebeln = bebeln
and aebelp = bebelp
into corresponding fields of table it_eket
where a~ebeln in s_ebeln.
endif.
is_binding-master = 'EBELN'.
is_binding-slave = 'EBELN'.
append is_binding to it_binding.
*TRY.
call method cl_salv_hierseq_table=>factory
exporting
t_binding_level1_level2 = it_binding
importing
r_hierseq = ob_hieralv
changing
t_table_level1 = it_ekko
t_table_level2 = it_eket .
*CATCH cx_salv_data_error .
*CATCH cx_salv_not_found .
*ENDTRY.
call method ob_hieralv->display( ).
Cheers,
Ram -
Display tooltip on oops alv report data.
hi friends,
I have a requirement to display tooltip information on OOPS ALV Report data.
I done tooltip for the header but i also want to do for it displaying data.
Eg.
10 material no. display in the list while i took cursor on 1st material no. then it will display me 1 st material description as tooltip.
similarly, for 2, 3 and so on.
Regards,
Narendrahi,
i think that´s not possible....
but you can try to work with Drop Down fields....
add to output table a table LVC_T_DROP (like colours of a cell )
Values could be your material descriptions...
maybe its also possible to click on a field ( GET_CURRENT_CELL )
after react with same ucomm like Drop Down.....
bestreg
Robert -
OOP ALV report custom control performance problem
HI
how to write OOP ALV report without custom control.. Actually with custom control which taking long time... and time out happens for huge selection of data..
Regards
Roops.timeout is not an alv problem. If you try to display a "huge" amount of data, any display technology will fail. Even sap programs fail, their wise solution is to ask user to restrict data to be displayed. Or reduce database selection time, or display amount. Or propose the user to download data as a spool, or output to a file on server.
Otherwise, read some advices about how to handle timeout in [Note 25528 - Parameter rdisp/max_wprun_time|http://service.sap.com/sap/support/notes/25528].
About your question, if you still want to try, look at [example code with alv class cl_salv_table for simple display|http://help.sap.com/saphelp_nw2004s/helpdata/en/f9/1ab54099de3726e10000000a1550b0/frameset.htm] -
Create a Procedural ALV Report with editable fields and save the changes
Hi,
I am new to ABAP. I have created a Procedural ALV Report with 3 fields. I want to make 2 fields editable. When executed, if the fields are modified, I want to save the changes. All this I want to do without using OO concepts. Please help . Also, I checked out the forum and also the examples
BCALV_TEST_GRID_EDIT_01
BCALV_TEST_GRID_EDIT_02
BCALV_TEST_GRID_EDIT_04_FORMS
BCALV_TEST_GRID_EDITABLE
BCALV_EDIT_01
BCALV_EDIT_02
BCALV_EDIT_03
BCALV_EDIT_04
BCALV_EDIT_05
BCALV_EDIT_06
BCALV_EDIT_07
BCALV_EDIT_08
BCALV_FULLSCREEN_GRID_EDIT
But all these are using OO Concepts.
Please help.
Regards,
SmruthiTABLES: ekko.
TYPE-POOLS: slis. "ALV Declarations
*Data Declaration
TYPES: BEGIN OF t_ekko,
ebeln TYPE ekpo-ebeln,
ebelp TYPE ekpo-ebelp,
statu TYPE ekpo-statu,
aedat TYPE ekpo-aedat,
matnr TYPE ekpo-matnr,
menge TYPE ekpo-menge,
meins TYPE ekpo-meins,
netpr TYPE ekpo-netpr,
peinh TYPE ekpo-peinh,
line_color(4) TYPE c, "Used to store row color attributes
END OF t_ekko.
DATA: it_ekko TYPE STANDARD TABLE OF t_ekko INITIAL SIZE 0,
wa_ekko TYPE t_ekko.
*ALV data declarations
DATA: fieldcatalog TYPE slis_t_fieldcat_alv WITH HEADER LINE,
gd_tab_group TYPE slis_t_sp_group_alv,
gd_layout TYPE slis_layout_alv,
gd_repid LIKE sy-repid.
START-OF-SELECTION.
PERFORM data_retrieval.
PERFORM build_fieldcatalog.
PERFORM build_layout.
PERFORM display_alv_report.
*& Form BUILD_FIELDCATALOG
Build Fieldcatalog for ALV Report
FORM build_fieldcatalog.
fieldcatalog-fieldname = 'EBELN'.
fieldcatalog-seltext_m = 'Purchase Order'.
fieldcatalog-col_pos = 0.
fieldcatalog-outputlen = 10.
fieldcatalog-emphasize = 'X'.
fieldcatalog-key = 'X'.
fieldcatalog-do_sum = 'X'.
fieldcatalog-no_zero = 'X'.
APPEND fieldcatalog TO fieldcatalog.
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'EBELP'.
fieldcatalog-seltext_m = 'PO Item'.
fieldcatalog-col_pos = 1.
APPEND fieldcatalog TO fieldcatalog.
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'STATU'.
fieldcatalog-seltext_m = 'Status'.
fieldcatalog-col_pos = 2.
APPEND fieldcatalog TO fieldcatalog.
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'AEDAT'.
fieldcatalog-seltext_m = 'Item change date'.
fieldcatalog-col_pos = 3.
APPEND fieldcatalog TO fieldcatalog.
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'MATNR'.
fieldcatalog-seltext_m = 'Material Number'.
fieldcatalog-col_pos = 4.
APPEND fieldcatalog TO fieldcatalog.
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'MENGE'.
fieldcatalog-seltext_m = 'PO quantity'.
fieldcatalog-edit = 'X'
fieldcatalog-col_pos = 5.
APPEND fieldcatalog TO fieldcatalog.
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'MEINS'.
fieldcatalog-seltext_m = 'Order Unit'.
fieldcatalog-col_pos = 6.
APPEND fieldcatalog TO fieldcatalog.
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'NETPR'.
fieldcatalog-seltext_m = 'Net Price'.
fieldcatalog-col_pos = 7.
fieldcatalog-outputlen = 15.
fieldcatalog-datatype = 'CURR'.
APPEND fieldcatalog TO fieldcatalog.
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'PEINH'.
fieldcatalog-seltext_m = 'Price Unit'.
fieldcatalog-col_pos = 8.
APPEND fieldcatalog TO fieldcatalog.
CLEAR fieldcatalog.
ENDFORM. " BUILD_FIELDCATALOG
*& Form BUILD_LAYOUT
Build layout for ALV grid report
FORM build_layout.
gd_layout-no_input = 'X'.
gd_layout-colwidth_optimize = 'X'.
gd_layout-totals_text = 'Totals'(201).
gd_layout-info_fieldname = 'LINE_COLOR'.
ENDFORM. " BUILD_LAYOUT
*& Form DISPLAY_ALV_REPORT
Display report using ALV grid
FORM display_alv_report.
gd_repid = sy-repid.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = gd_repid
i_callback_pf_status_set = 'STATUS'
i_callback_top_of_page = 'TOP-OF-PAGE'
i_callback_user_command = 'USER_COMMAND'
i_grid_title = outtext
is_layout = gd_layout
it_fieldcat = fieldcatalog[]
it_special_groups = gd_tabgroup
IT_EVENTS = GT_XEVENTS
i_save = 'X'
is_variant = z_template
TABLES
t_outtab = it_ekko
EXCEPTIONS
program_error = 1
OTHERS = 2.
ENDFORM. " DISPLAY_ALV_REPORT
*& Form DATA_RETRIEVAL
Retrieve data form EKPO table and populate itab it_ekko
FORM data_retrieval.
DATA: ld_color(1) TYPE c.
SELECT ebeln ebelp statu aedat matnr menge meins netpr peinh
UP TO 10 ROWS
FROM ekpo
INTO TABLE it_ekko.
LOOP AT it_ekko INTO wa_ekko.
ld_color = ld_color + 1.
IF ld_color = 8.
ld_color = 1.
ENDIF.
CONCATENATE 'C' ld_color '10' INTO wa_ekko-line_color.
MODIFY it_ekko FROM wa_ekko.
ENDLOOP.
ENDFORM. " DATA_RETRIEVAL
FORM top-of-page *
FORM top-of-page.
WRITE:/ 'This is First Line of the Page'.
ENDFORM.
FORM status *
FORM status USING rt_extab TYPE slis_t_extab. .
SET PF-STATUS 'ALV'.
ENDFORM.
FORM USER_COMMAND *
--> RF_UCOMM *
--> RS *
FORM user_command USING rf_ucomm LIKE sy-ucomm
rs TYPE slis_selfield.
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.
CASE rf_ucomm.
when 'SAVE'.
get all the modified entries and store them in an internal table and udpate them in to the required transaction or your custom table.
endcase.
endform.
ENDFORM.
here u need to 2 performs for PF status and USER_COMMAND in the ALV parameters.
create a custom PF status and create push buttons and assign your ok codes in your PF status.
if the field has to be edited in the ALV then pass EDIT = 'X' for that field in the fieldcatlog preparation.
Hope this will help you.
Regards,
phani. -
Urgent : Problem with Editable ALV Grid for Quantity and Currency Fields
Hi All,
I am using Editable ALV Grid display and have quantity and value as editable fields in the display.
When user changes these values these values are not changing properly .
For the quantity field the domain is MENG13 with 3 deciamal places and here if we enter 500 it takes it as 0.500 .
The same problem is for the currency field. Here the Domain is WERT7 with 3 decimal places.
Here also it takes last 2 digits after decimal places by default.
Please advice how to get proper values in this case from ALV editable fields.
Thanks and Regards
Harshad
Edited by: Harshad Rahirkar on Dec 25, 2007 7:39 AMfor all the currency field , it will display like that only.
u have to manipulate uin program before displaying.
if they are giving 500, in program multiply with 100 and move it to table.
when u are getting from table, divinde and display.
this is what I am doing.
Reward if helpfull. -
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
NagendraHi,
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 -
Reg: ALV report download to excel currency columns
Hi All,
While downloading the alv report to excel, currency fields with negative sign(less than 0) is downloading without negative sign.
And field catalog wad declared as 'CURR' field for that particular column, if I declared as 'CHAR', i am getting shortdump.
Can any one tell me how to get the negative sign.
Thanks in advance.Hi,
Do you use ALV to excel standard functionality or your own code to excel?
Please provide more information.
Thanks, -
Urgent: about the checkbox in OOP ALV report
Hi Experts,
I had use OOP method to display my ALV report. In the report I have a checkbox for each line. I had set this check box use below statements:
gt_fieldcat_record-tabname = 'GT_ISSUE_INT'.
gt_fieldcat_record-fieldname = 'CHECKBOX'.
gt_fieldcat_record-checkbox = 'X'.
gt_fieldcat_record-edit = 'X'.
APPEND gt_fieldcat_record.
When I press the save button, then I will save the lines to my Z-table which its GT_ISSUE_INT-CHECKBOX = 'X'.
Now I click the checkbox to select several lines in my ALV report and then press save, but it do not work. Then I check the internal table GT_ISSUE_INT in debugger, I found the GT_ISSUE_INT-CHECKBOX = ' '. Above statements is not correct for the checkbox?? Or I need additional statements to move 'X' to GT_ISSUE_INT-CHECKBOX?? Please help!!!Thanks.Hi,
If u want to read check box status from list, need to call function module explicitly.
see the sample code:
case sy-ucomm.
when 'SAVE'.
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 GT_ISSUE_INT to workarea.
____ continue writing ur code.
function module read the data from list . and save the changes that made on list.
when u debug, u can see the check box status as 'X' after exucut\ing this fm and method.
reward if helpful.
regards,
swapna -
Oops alv report not getting displayed
Hi experts,
I have REQUIREMENT WHERE I NEED TO DISPLAY THREE REPORTS USING ALAV OOPS.
I have maintained a FM to call alv rport.
,I have two validations to make at to different location in report. The report needs to be displayed only after I perform two different validations.
Issue is
I call this ALV reprt Fm once at : AT SELECTION SCREEN OUTPUT
and second time at : START OF SELECTION...
Now I can see the ALV report ( oops with three reports in one container) very well when i call it from : AT SECETION SCREEN OUTPUT( Here I perform one of teh two validations which I have mentioned above...The validation performed here is of Selction screen valiudation).
ButNow when I perform another validation at START OF SELECTIOn...here I cannot see the ALV report...TEH screen appearing is blank...
I am calling teh SAME OOPS ALV Function Module from both the locations...( START of SEL and AT selc O/p)..
I have debugged teh code and checked teh feidcatalogue genration as well s output table .and also structure
parameteers .. all of tehm are getting populated in both the cases ,,, but dont know why thye output doesnot appear in th last call..
please help ., I am stuck up...
TX a ton in adv...
Regards,
KTHi Kshitija T,
START-OF-SELECTION is processed in PAI of selection screen - as soon as all processing is done, the program flow will return, initialize your program an all of it's objects and display the selection screen again.
I solved this by disabling the default report status EXECUTE button and used AT-SELECTION-SCREEN events.
Regards,
Clemens -
How to raise error message from PAI of oops ALV report
Hi All,
I have a requirement to raise error message form editable oops alv . After entering the data and then press SAVE button .
Please help.
Thanks in AdvanceHI SK,
Write a Local class (Event Handeler) to handel the events. In Editable ALV once the user enter a value, CL_GUI_ALV_GRID will raise an event called DATA_CHANGED.
1. Define and Implement a local class to handle that event.
In the implementation of this class you need to get data from imported object to an internal table, then compare the same with the ALV output table.
* Local Class to handler the events raised from the ALV Grid
CLASS LCL_EVENT_HANDLER DEFINITION.
PUBLIC SECTION.
* Method to handel EDIT event, DATA_CHANGED of CL_GUI_ALV_GRID
METHODS : ON_DATA_CHANGE FOR EVENT DATA_CHANGED OF CL_GUI_ALV_GRID
IMPORTING ER_DATA_CHANGED.
ENDCLASS.
* Event handler class Implementation
CLASS LCL_EVENT_HANDLER IMPLEMENTATION.
METHOD ON_DATA_CHANGE.
DATA : LT_MODIFY TYPE LVC_T_MODI,
LS_MODIFY TYPE LVC_S_MODI.
* Copying changed data into intenal table from Object
LT_MODIFY = ER_DATA_CHANGED->MT_MOD_CELLS.
* Modifying the ouptut table with the changed values
IF LT_MODIFY[] IS NOT INITIAL.
*Compare the ALV Output table with LT_MODIFY
ENDIF.
ENDMETHOD.
ENDCLASS.
Then raise a message on required condition in the same method.
Note: To trigger the above method, you need to set event handler before displaying ALV (before calling method SET_TABLE_FOR_FIRST_DISPLAY)
* Creating object for the Local event handler class
CREATE OBJECT GR_HANDLER.
* Set handler (call method of Event_handler) to handler Edit event
SET HANDLER GR_HANDLER->ON_DATA_CHANGE FOR GR_GRID.
Regards,
Vijay -
To develope an alv report or module pool and field link.. and effor require
HI,
I want to display the fields with sort functionality with fields
kunnr kna1 table
name1 kna1
and email id from table ADR6 field SMTP_ADDR
my question ison mapping
from kna1 we can get field kunnr and name1
and adrnr
to put in adr6 to fetch email id
can anyoe suggest on select statements link as table kna1 has one unique kunnr
but it can have multiple name1 and adrnr
so how to pick the kunnr ,name 1 and adrnr from table kna1 and map to
adr6 table
as witinn the table kna1 there can be multiple name1 related to one single kunnr
so wil it be like
select kunnr from kna1..into it_kunnr
then select nam1 from table kna2 for all entrirs in It_kunnr
or firse selet kunnr name1 from kna1 into table it_kunnr
pls suggest an appropiat select statament
and i suppose this can be achevied by alv report no need for moudle pool
regards
Aroraopened a new thread with changes subject
-
Crystal Report can't add Currency field when connect to SAP Infosets.
Hi,
I created a simple Crystal Report which connect SAP Infosets.
Everything is fine except I add a "Currency" field into report. Three errors returned.
Fail to retrieve data from database -> Database connector error :'Syntax error in program SAPLHRPADINA1' -> Database connector Error: 'RFC_CLOSED'
Do you have any idea?Hi,
can you run a InfoSet query based on the InfoSet ?
Can you create a QuickView on top of the InfoSet ?
ingo -
Re: Alv report grouped under certain fixed field
Hello,
My problem is : I have to display an ALV report under grouped format like :-
PLANT
MRP Controller
Material Group ABC
Material 12345 Delinquent WEEK 1 WEEK 2 WEEK 3 WEEK 4
Stock Level
Open PO
Sales Forecast
Actual Sales Orders
Shortage/Overage
Material 23456 Delinquent WEEK 1 WEEK 2 WEEK 3 WEEK 4
Stock Level
Open PO
Sales Forecast
Actual Sales Orders
Shortage/Overage
PLANT
MRP Controller
Material Group BCD
Material 55345 Delinquent WEEK 1 WEEK 2 WEEK 3 WEEK 4
Stock Level
Open PO
Sales Forecast
Actual Sales Orders
Shortage/Overage
Material 55456 Delinquent WEEK 1 WEEK 2 WEEK 3 WEEK 4
Stock Level
Open PO
Sales Forecast
Actual Sales Orders
Shortage/Overage
and so on....
Please help me to solve this problem. Points sure.It is possible , But i never tried it.
Supporting Transaction: FBL1N -
In ALV report list edit a field and insert our own text
Hi
In a report when I am in third list using ALV a field which is disabled should be enabled and have to insert the new value in it and save.
please tell me how to do it using classes and methods and also using ALV's.
Promise to reward points.
Regards
MacSee these threads
Re: Making selected alv rows editable
Re: selective edit in ALV grid
Regards,
Ravi
Maybe you are looking for
-
Server 2012 R2 - No response from the UmRdpService service and more...
Hi! We have a Remote Desktop Services Deployment with the following: LIC01 – Windows 2012 R2 - Licensing RDCB01 – Windows 2012 – Connection Broker RDWA02 – Windows 2012 R2 – Web Access RDG01 – Windows 2012 R2 - Gateway RDG02 – Windows 2012 R2 - Gatew
-
IOS iWork how to change legend labels
Hi. Having trouble with Numbers for iOS. I made a spreadsheet and placed a chart and connected the columns to display the information in the chart. I'd like to add a legend, but when I do, I get "untitled" for each color (or column) in the chart. I'v
-
Working with multiple layers in CS 3 ?
In order to work with multiple layers in cs3, I first need to open few images to work with,and when I open few images it only shows last image that I opened.Frist images can't be seen in workspace, and when I open new document I can't see not even on
-
We have 200 different version of same report(difference is in their filters) and our users want to schedule these report to run once a week. So we created a report with 200 ibots and asked user to subscribe these ibots and customise their subsciption
-
Time machine corrupted sparsebundle? how to repair? time machine restore not working
On my macbook pro, after starting with Cmd-R, I erased the hard disk, re-installed Mavericks and I want to restore my back up with Time Machine. I select the NAS where the backup is, it sees the backup file but it says: "There is a problem with this