Editable ALV Quantity problem
Hi all,
In Editable ALV quanity fields store wrong result .
Quanity is of packed type with 3 decomals.
For eg - During display like quanity is 22.245 when i insert quantity like 9 then it makes .009.
Any suggestion welcome.
Regards,
Hi Navdeep singh
Specify the number of decimal places for that field in field catalogue. So that your problem will be resolved.
Venkat
Similar Messages
-
Editable ALV- Quantity field value is getting changed while double clicking
Hi all,
I have created Editable ALV grid using Class concepts. Quantity field is editable in dat. but after changing value and if im double clicking on that field, value is getting changed. eg: 45 is changing to .045. How can i resolve this problem.
Could u plz help.Hi Anu,
One question from my side.
U have displayed the ALV.In that grid u have quantity field.U have changed the value of that field to 45.
When u press enter the value has been changed to .045.Is this u r problem.
U can do onething anu.
Declare one varaible with the local field.
Pass u r quantity field value into that variable.
While displaying thriugh SET_TABLE_FIRST_DISPLAY in your internal table pass this variable.
It will solve u r problem.I think.
Let me if yu have any problem
IF u want u can refer to the program BCALV_EDIT* in se38.
There also u have needful info
Thanks, -
Editable ALV refreshing problem
Hello,
I have an editable ALV and i modify my db table with this alv.
when i run the report and see the alv, i can make changes and modify the db table.
But after first change, alv doesnt see the othe changes, I change editable fields and save but when i debug i see no change at my internal table.
i refresh the internal table but after first change and save, this code doesnt work :
CALL METHOD go_grid2->check_changed_data.
Is there a trick that i dont know?the code which i give above is for refresh, for data change try this declaration
SET HANDLER event_receiver->handle_data_changed FOR g_grid.
CALL METHOD g_grid->register_edit_event
EXPORTING
i_event_id = cl_gui_alv_grid=>mc_evt_modified.
when you clicked SAVE button first you must call this method : CALL METHOD g_grid->check_changed_data . -
Dear all,
Im using REUSE_ALV_Grid and displaying 2 Fields of Qyantity type as editable .
On display when i cahnge muy Quantity to '50' and press save tha value is automatically cahnged to '0.50'.
Can any one tell me what is the problemJust try with the input 50.00
( Don't type 50 , otherwise it will take 0.50 )
Because the decimal place in quantity field is 2. you have to change it
from 2 to 0.
Or change the decimal place in Is_fieldcat to your own entries. -
Editable ALV - Strnage problems.
I have couple of issues which are really mind blowing:
I am doing a module pool program using <u><b>OO ABAP.</b></u>
I have a parameter field on my selection screen to choose the required layout variant.First execution works fine.Issues are
1. When I go back to 1st screen from this and choose another variant using f4 or manually also... Display is still executed with the former variant only. I handled clear and refresh of all variables when i press BACK.
2. Enter second screen by choosing some layout variant in first screen and scroll the ALV manually, it works fine. But the problem is when I scroll the ALV using the ball on the mouse, layout changes. i.e.. all the fields are displayed on the ALV.
Did any one come across such strange problems?
Experts, please put on your thinking cap and pass on some ideas to solve these.
Many Thanks for your help.
KiranHi,
U can use g_alv_grid->refresh_table_display.
IF g_alv_grid IS INITIAL.
CALL METHOD g_alv_grid->set_table_for_first_display
EXPORTING
is_layout = g_layout
i_save = space
is_variant = wa_vari
it_toolbar_excluding = i_toolbar_excl
CHANGING
it_fieldcatalog = i_fieldcat
it_outtab = i_outtab.
ELSE.
CALL METHOD g_alv_grid->refresh_table_display.
ENDIF.
thanks, -
Editable ALV Quantity/Decimal field
Hi,
I have one column in ALV output which is editable .I have defined that in this way:
data :input type resb-bdmng.
fieldcatalog-fieldname = 'INPUT'.
fieldcatalog-seltext_m = ' Scrap'.
fieldcatalog-col_pos = fieldcatalog-col_pos + 1.
fieldcatalog-input = 'X'.
fieldcatalog-edit ='X'.
APPEND fieldcatalog TO fieldcatalog.
CLEAR fieldcatalog.
But if we edit the field in the output it gives error : " Too many decimal places ( maximum 0)"
If we add fieldcatalog-datatype = 'DECIMAL'. then it works fine but in that case it throws dump for toolbar button " Export to the local file " Its functinality is copied from standard interface SAPLKKBL program The dump is The current statement requires chaarater data type object .It cant take decimal fieldcatalogtype . If we remove fieldcatalog-datatype = 'DECIMAL'. then this button works fine but in this case the first error comes "Too many decimal places ( maximum 0)"
Please suggest how can I remove first error without setting fieldcatalog-datatype = 'DECIMAL'. property.
Will definetly ..... if its helpfulhi,
This is a common problrm when yu want to display the values in decimals...if the datatype is any other than character, if u try to export to file,it will throw dump.change the datatype into character in ur internal table itself ,,then calculte the values in decimals and insert to this fieldand display.Now it will allow edit and wont throw dump
Edited by: soniya baboo on Jan 23, 2009 8:07 AM -
Problem in editable alv table .
hello friends ,
i am facing a problem in editable alv ,the problem is while saving my data in internal table through editable alv one of my numeric field is being wrongly updated .
for eg : if i am entering '2.00 ' in the field the value updated is 0.02.
regards ,
arpit.Dear Arpit
Please check the below code and it may very useful
TABLES: VBAK, VBAP.
TYPE-POOLS: SLIS, ICON.
DATA: BEGIN OF ITAB OCCURS 0,
VBELN LIKE VBAK-VBELN,
ERDAT LIKE VBAK-ERDAT,
END OF ITAB.
DATA: BEGIN OF JTAB OCCURS 0,
VBELN LIKE VBAP-VBELN,
MATNR LIKE VBAP-MATNR,
KWMENG LIKE VBAP-KWMENG,
END OF JTAB.
DATA: TB_FCAT TYPE SLIS_T_FIELDCAT_ALV,
WA_FCAT LIKE LINE OF TB_FCAT,
WA_LAYOUT TYPE SLIS_LAYOUT_ALV,
TB_EVENT TYPE SLIS_T_EVENT,
WA_EVENT LIKE LINE OF TB_EVENT,
TB_HEADER TYPE SLIS_T_LISTHEADER,
WA_HEADER LIKE LINE OF TB_HEADER,
WA_KEYINFO TYPE SLIS_KEYINFO_ALV.
CLEAR WA_FCAT.
WA_FCAT-ROW_POS = '1'.
WA_FCAT-COL_POS = '1'.
*WA_FCAT-REF_FIELDNAME = 'VBELN'.
WA_FCAT-REF_TABNAME = 'VBAK'.
*WA_FCAT-OUTPUTLEN = '10'.
WA_FCAT-FIELDNAME = 'VBELN'.
WA_FCAT-EDIT = 'X'.
WA_FCAT-SELTEXT_M = 'DOCUMENT'.
APPEND WA_FCAT TO TB_FCAT.
CLEAR WA_FCAT.
WA_FCAT-ROW_POS = '1'.
WA_FCAT-COL_POS = '2'.
*WA_FCAT-REF_FIELDNAME = 'ERDAT'.
WA_FCAT-REF_TABNAME = 'VBAK'.
WA_FCAT-FIELDNAME = 'ERDAT'.
*WA_FCAT-EDIT = 'X'.
WA_FCAT-SELTEXT_M = 'DATE'.
APPEND WA_FCAT TO TB_FCAT.
CASE SY-UCOMM.
WHEN 'VBELN'.
WA_FCAT-SELTEXT_M = 'SURENDRA'.
MODIFY TB_FCAT FROM WA_FCAT.
ENDCASE.
SELECT VBELN ERDAT FROM VBAK INTO CORRESPONDING FIELDS OF TABLE ITAB UP TO 15 ROWS.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = SY-REPID
IS_LAYOUT = WA_LAYOUT
IT_FIELDCAT = TB_FCAT
TABLES
T_OUTTAB = ITAB
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Thanks
Surendra P -
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. -
Problem While Saving the editable ALV GRID
Dear Experts,
I have a scenario in which i am display the ALV(using class) with some data in the custom container of module pool screen in the non-editable mode.Also i have save and edit buttons.If i click the edit button i have written the code to edit the some columns in the ALV grid, it is working fine.After editing it,when i click the save button then ALV has to refreshed with edited data and then it should go to non editable mode but it is not working.I have written the code for changing the editable ALv to non editable mode as follows :
call method c_alvgd->set_ready_for_input
exporting
i_ready_for_input = 0.
*****Row and column of the alv are refreshed after changing values
stable-row = 'X'.
stable-col = 'X'.
*REfreshed ALV display with the changed values
*This ALV is non editable and contains new values
call method c_alvgd->refresh_table_display
exporting
is_stable = stable
exceptions
finished = 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.
Could you Suggest me solution for this issue ?
Thanks & Regards,
R.Dhineshraj.Dhinesh,
I suppose that you are able to get your changes values on screen but not able to get your field in DISPLAY mode from editable mode, let me know if this is not your problem.
When you press SAVE, after the PAI, again PBO will run and hence the editable code for that field will overwrite which will keep it editable.
So, do something like this.
data: gv_edit value 'X'..... "global variable in TOP include
PBO....
loop at ...
if gv_edit = 'X'.
CALL METHOD lo_alv->set_ready_for_input
EXPORTING
i_ready_for_input = 1.
else.
CALL METHOD lo_alv->set_ready_for_input
EXPORTING
i_ready_for_input = 0.
endif.
endloop.
PAI.
when 'SAVE'.
gv_edit = space.
When 'EDIT'.
gv_edit = 'X'.
Regards,
Diwakar -
Problem with Foreign Key check in an editable ALV
Hi,
I've implemented an editable ALV.
The underlying context node is referenced to a structure and within the structure the foreign keys are defined.
In my example, I have two editable columns with different foreign key checks.
My problem is, the foreign key check works only for one column.
So if I enter in both columns incorret values, only a message for the first column is thrown,
but not for the second column!
Only if I enter two errors in one(!) column (in two rows), than I get two error messages.
Examples:
does not work:
COL1 | COL2
err1 | err2 -> only one error message is displayed (for err1)
It works in this case:
COL1 | COL2
err1 | ok
err2 | ok
=> two messages for err1 and err2
and in this case
COL1 | COL2
err1 | ok
ok | err2
=> two messages for err1 and err2
I've found nothing in OSS. My system is a 7.00 with SP18, so OSS 1153492 is already implemented.
Do I somenthing wrong or is this an error in SAP?
Thanks,
AndreasHi Lekha,
thank you very much for your support!
I try to give you an example.
In general, you need an editable ALV with at least two columns.
The node for the ALV table in the component controller has to be assigned to a dictionary structure!
That is very important, otherwise the foreign key check will not work!
And the two fields in this dictionary structure have to be assigned to a "check table".
Prerequisition: NW70 SP16 or higher! See oss note 1153492.
Maybe an easy way to reproduce it is using the WD component WDT_FLIGHTLIST_EDIT.
So copy this component to a Z-component.
Than create a dictionary structure for the node "NODE_FLIGHTTAB" with the same 10 fields as the node attributes.
In your new dictionary structure, assign to the fields CARRID and CONNID the check tables SCARR and SPFLI. (see table SFLIGHT).
Than make both columens (CARRID and CONNID) editable.
This has to be done in the "RESULTVIEW" in the method "INIT".
You can user the following code:
lr_column = lr_column_settings->get_column( 'CARRID' ).
create object lr_input_field
exporting
value_fieldname = 'CARRID'.
lr_column->set_cell_editor( lr_input_field ).
lr_column = lr_column_settings->get_column( 'CONNID' ).
create object lr_input_field
exporting
value_fieldname = 'CONNID'.
lr_column->set_cell_editor( lr_input_field ).
Copy this code below this code:
lr_column_settings ?= l_value.
lr_column = lr_column_settings->get_column( 'PRICE' ).
create object lr_input_field
exporting
value_fieldname = 'PRICE'.
lr_column->set_cell_editor( lr_input_field ).
Than just activate all, create a Web Dynpro Application and your are ready to test it.
To test it, do the following:
Append/Insert an empty row.
Enter a CARRID and CONNID that does not exist and press ENTER.
My result: only one error message is displayed for the wrong CARRID, but no error message for CONNID!
Insert a new row.
Enter in the first row, column CARRID an invalid value and in the second(!) row in column CONNNID.
Than you get two(!) error messages. That's the behavior I expect.
So thank you very much in advance for your help!
Regards,
Andreas -
ALV QUANTITY field Geting converted into decimals ?
Hi All ,
I have developed an alv report .In that the quantity field is made editable after editing the quantity when i save it .It gets converted into decimals.Suppose if i give 77 its getting reflected as .077 all the field name ,table name ,reference field name, reference table name, quantity field data type has been passed but the problem persists.If there is any one whos has come across this kind of scenario please share your thoughts on this.
Best Regards,
SreeramHi Sreeram,
I am not gettin this issue. See below code :
If you are gettiing the same issue with the below code then it has something to do with your user settings.
Go to Menu Item System -> User Profile -> Own Data -> Defaults ->Decimal Notation.
Set it to 1,234,567.89 and save. Now try the program again.
REPORT z_test.
TYPE-POOLS: slis.
TYPES : BEGIN OF ty_ekpo,
ebeln TYPE ebeln,
ebelp TYPE ebelp,
ktmng TYPE ktmng,
menge TYPE bstmg,
END OF ty_ekpo.
DATA: it_ekpo TYPE TABLE OF ty_ekpo,
it_fieldcat TYPE slis_t_fieldcat_alv.
SELECT ebeln ebelp ktmng menge
FROM ekpo
INTO TABLE it_ekpo
UP TO 20 ROWS.
PERFORM add_fieldcat USING 'EBELN'.
PERFORM add_fieldcat USING 'EBELP'.
PERFORM add_fieldcat USING 'KTMNG'.
PERFORM add_fieldcat USING 'MENGE'.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-repid
it_fieldcat = it_fieldcat
TABLES
t_outtab = it_ekpo
EXCEPTIONS
program_error = 1
OTHERS = 2
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
FORM add_fieldcat USING p_fieldname TYPE slis_fieldcat_alv-fieldname.
DATA: wa_fieldcat TYPE slis_fieldcat_alv.
CLEAR wa_fieldcat.
wa_fieldcat-fieldname = p_fieldname.
wa_fieldcat-tabname = 'IT_EKPO'.
wa_fieldcat-ref_fieldname = p_fieldname.
wa_fieldcat-ref_tabname = 'EKPO'.
IF p_fieldname EQ 'KTMNG'.
wa_fieldcat-edit = 'X'.
ENDIF.
APPEND wa_fieldcat TO it_fieldcat.
ENDFORM. " ADD_FIELDCAT
Regards,
Jovito -
Dear Friends,
I have editable ALV and capturing there save event its working properly.
so my problem is..
when i change there cell values can i capture that event like follows.
in my editable column only can be change 0-100 value cant be <0 or >100 values.
is it possible ....
please reply me....if possible give some sample plz....
Thanks in AdvanceHi Nelson,
Check out this code.
*& Report ZST_ALV_DATA_CHANGE_EVENT
REPORT ZST_ALV_DATA_CHANGE_EVENT.
CLASS lcl_grid DEFINITION
class lcl_grid DEFINITION.
PUBLIC SECTION.
methods: handle_data_changed
for event data_changed of cl_gui_alv_grid
IMPORTING er_data_changed.
endclass. "lcl_grid DEFINITION
CLASS lcl_grid IMPLEMENTATION
class lcl_grid IMPLEMENTATION.
method handle_data_changed.
perform validation using er_data_changed.
endmethod. "handle_data_changed
endclass. "lcl_grid IMPLEMENTATION
types: begin of ty_itab,
vbeln TYPE vbap-vbeln,
posnr TYPE vbap-posnr,
netwr TYPE vbap-netwr,
end of ty_itab.
data: lt_itab TYPE TABLE OF ty_itab,
lw_itab TYPE ty_itab.
data: lt_fcat type lvc_t_fcat,
lw_fcat TYPE lvc_s_fcat.
data: l_grid TYPE REF TO cl_gui_alv_grid,
l_custom TYPE REF TO cl_gui_custom_container,
l_class TYPE ref to lcl_grid.
start-of-selection.
select vbeln
posnr
netwr
from vbap
into table lt_itab
up to 50 rows.
delete lt_itab where posnr ne '000010'.
perform build_fieldcatalog.
call screen 200.
*& Module STATUS_0200 OUTPUT
text
MODULE STATUS_0200 OUTPUT.
SET PF-STATUS 'ZST_GUI'.
SET TITLEBAR 'xxx'.
if l_custom is initial.
CREATE OBJECT L_CUSTOM
EXPORTING
PARENT =
CONTAINER_NAME = 'CUSTOM'
STYLE =
LIFETIME = lifetime_default
REPID =
DYNNR =
NO_AUTODEF_PROGID_DYNNR =
EXCEPTIONS
CNTL_ERROR = 1
CNTL_SYSTEM_ERROR = 2
CREATE_ERROR = 3
LIFETIME_ERROR = 4
LIFETIME_DYNPRO_DYNPRO_LINK = 5
others = 6
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CREATE OBJECT L_GRID
EXPORTING
I_SHELLSTYLE = 0
I_LIFETIME =
I_PARENT = l_custom
I_APPL_EVENTS = space
I_PARENTDBG =
I_APPLOGPARENT =
I_GRAPHICSPARENT =
I_NAME =
I_FCAT_COMPLETE = SPACE
EXCEPTIONS
ERROR_CNTL_CREATE = 1
ERROR_CNTL_INIT = 2
ERROR_CNTL_LINK = 3
ERROR_DP_CREATE = 4
others = 5
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL METHOD L_GRID->SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING
I_BUFFER_ACTIVE =
I_BYPASSING_BUFFER =
I_CONSISTENCY_CHECK =
I_STRUCTURE_NAME =
IS_VARIANT =
I_SAVE =
I_DEFAULT = 'X'
IS_LAYOUT =
IS_PRINT =
IT_SPECIAL_GROUPS =
IT_TOOLBAR_EXCLUDING =
IT_HYPERLINK =
IT_ALV_GRAPHICS =
IT_EXCEPT_QINFO =
IR_SALV_ADAPTER =
CHANGING
IT_OUTTAB = lt_itab[]
IT_FIELDCATALOG = lt_fcat[]
IT_SORT =
IT_FILTER =
EXCEPTIONS
INVALID_PARAMETER_COMBINATION = 1
PROGRAM_ERROR = 2
TOO_MANY_LINES = 3
others = 4
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
create OBJECT l_class.
endif.
ENDMODULE. " STATUS_0200 OUTPUT
*& Module USER_COMMAND_0200 INPUT
text
MODULE USER_COMMAND_0200 INPUT.
if sy-ucomm = 'EXIT'.
leave program.
elseif sy-ucomm = 'SAVE'.
set HANDLER l_class->handle_data_changed for l_grid.
data: l_char TYPE c.
CALL METHOD L_GRID->CHECK_CHANGED_DATA
IMPORTING
E_VALID = l_char.
endif.
ENDMODULE. " USER_COMMAND_0200 INPUT
*& Form BUILD_FIELDCATALOG
text
--> p1 text
<-- p2 text
FORM BUILD_FIELDCATALOG .
clear lw_fcat.
lw_fcat-fieldname = 'VBELN'.
lw_fcat-scrtext_l = 'Sales document'.
append lw_fcat to lt_fcat.
clear lw_fcat.
lw_fcat-fieldname = 'POSNR'.
lw_fcat-scrtext_l = 'Sales document'.
append lw_fcat to lt_fcat.
clear lw_fcat.
lw_fcat-fieldname = 'NETWR'.
lw_fcat-scrtext_l = 'Quantity'.
lw_fcat-edit = 'X'.
append lw_fcat to lt_fcat.
ENDFORM. " BUILD_FIELDCATALOG
*& Form VALIDATION
text
-->P_ER_DATA_CHANGED text
FORM VALIDATION USING er_data_changed TYPE REF TO
cl_alv_changed_data_protocol.
data: temp type vbap-netwr.
DATA: ls_good TYPE lvc_s_modi.
DATA wa LIKE LINE OF lt_good_cells.
CALL METHOD l_grid->register_edit_event
EXPORTING
i_event_id = cl_gui_alv_grid=>mc_evt_modified.
LOOP AT er_data_changed->mt_good_cells INTO ls_good.
CASE ls_good-fieldname.
WHEN 'NETWR'. "Your fieldname
CALL METHOD er_data_changed->get_cell_value "Get the changed value
EXPORTING
i_row_id = ls_good-row_id
i_fieldname = ls_good-fieldname
IMPORTING
e_value = temp. "Your temp variable
if temp > 1000000.
message e000(8i) with 'amount should not be greater than 200'.
endif.
"Make your validations here.
ENDCASE.
endloop.
ENDFORM. " VALIDATION
in the ZST_GUI
there are two function code 'SAVE' and 'EXIT'.
regards,
Santosh Thorat -
Check unchanged data in an editable alv grid
Hi,
I have a problem with my editable ALV. As long as I'm changing my data the event DATA_CHANGED is raised and my fields are checked correctly. But what about unchanged data like appended rows. In that case no changes have been made and the event is not triggered.
Even if i raise the event by using the method:
CALL METHOD gr_grid1->check_changed_data
IMPORTING
e_valid = lv_valid
CHANGING
c_refresh = lv_refresh.
there are no changed data so that my checks:
FORM data_changed USING lr_data_changed TYPE REF TO
cl_alv_changed_data_protocol.
DATA: ls_mod_cells TYPE lvc_s_modi.
DATA: ls_cells TYPE lvc_s_modi,
lv_value TYPE lvc_value ,
lv_matnr TYPE matnr,
lv_maktx TYPE maktx,
lv_error TYPE c.
CLEAR lv_error.
LOOP AT lr_data_changed->mt_good_cells INTO ls_mod_cells.
CASE ls_mod_cells-fieldname.
WHEN 'MATNR'.
CALL METHOD lr_data_changed->get_cell_value
EXPORTING
i_row_id = ls_mod_cells-row_id
i_fieldname = 'MATNR'
IMPORTING
e_value = lv_value.
* CHECK MARA SEGMENT
SELECT SINGLE mara~matnr
makt~maktx INTO (lv_matnr,
lv_maktx)
FROM mara AS mara
INNER JOIN makt AS makt
ON mara~matnr = makt~matnr
WHERE mara~matnr = lv_value AND
makt~spras = sy-langu.
IF NOT sy-subrc IS INITIAL.
CALL METHOD lr_data_changed->add_protocol_entry
EXPORTING
i_msgid = 'M3'
i_msgno = '305'
i_msgty = 'E'
i_msgv1 = lv_value
i_fieldname = ls_mod_cells-fieldname
i_row_id = ls_mod_cells-row_id.
lv_error = 'X'.
ELSE.
CALL METHOD lr_data_changed->modify_cell
EXPORTING
i_row_id = ls_mod_cells-row_id
i_fieldname = 'MAKTX'
i_value = lv_maktx.
ENDIF.
WHEN OTHERS.
ENDCASE.
ENDLOOP.
ENDFORM.
are not working.
Thank you for your help
Gregor
Edited by: Gregor Sure on Oct 13, 2009 1:58 PMTry to capture the event DATA_CHANGED_FINISHED. You can use the method REGISTER_EDIT_EVENT of the class CL_GUI_ALV_GRID to register the edit events.
Regards,
Naimesh Patel -
Retrieve front end values of editable alv in same format
I have a problem to retrieve the front end values in editable alv filled by user.
I am able to get it from MODIFIED CELL method but it gives the values after
alv automatically conversion. For example if user filled 1 in cell of type numc
then i want to keep it as 1 not as 00..001 format of numc.
Same for when user fill alphbets in small letter the alv convert it in CAPS.
I want to retain it as it as filled by user.
Example: User filled aAbBcFG in a cell
then it should update in database in same format not like AABBCFG as alv did
<offer removed by moderator>
Edited by: Rocky_S on Jan 20, 2011 7:50 AM
Edited by: Rocky_S on Jan 20, 2011 7:51 AM
Edited by: Thomas Zloch on Jan 20, 2011 11:24 PMHi Srinivas I have used CONVERSION_EXIT_ALPHA_OUTPUT for number input. My problem is that
when user fill 0 in the alv cell then alv automatically convert it into 00000000. My field is of type numc
that why it converts in 00000000. I want to retrieve it as the user fill in alv cell. Through this function
module the import parameter parameter is of numc format not as filled by user. In my case if it is 0
then then i should retrieve it as it is.
My actual scenario is i have a numc type field in alv and i want to keep it as mandatory. For which i am
writing a logic. Because in my table there is a valid entry of 0. If user do not fill 0 then it takes automatically
0 as input because of initial value of numc field. I want to restict it. I can not convert this field as char.
Give me some logic to make numeric field mandatory. -
Update ZTable from editable ALV
Hi All,
i'm calling a Function Module from within a Badi Class ( Workorder_Update) which uses an ALV to Add Comments in a Field of the ALV for Transportation to a ZTable. Therefore the ALV is set to editable.
The Problem is that if the User does not press 'enter' after she/he added the Comment, the value is not send back to the internal Table wich updates the ZTab. If the User presses 'enter' ONLY the Comment is transported but the remainder of the Fields are cleared.
This is part of the Coding:
Before Calling FM -->
+ IF wa_header_old-pronr NE wa_header-pronr.
CLEAR wa_zthlog.
wa_zthlog-uzeit = sy-uzeit.
wa_zthlog-aufnr = wa_header-aufnr.
wa_zthlog-objnr = wa_header-objnr.
wa_zthlog-vornr = wa_operation-vornr.
wa_zthlog-ktext = wa_header-ktext.
wa_zthlog-aenam = sy-uname.
wa_zthlog-aedat = sy-datum.
wa_zthlog-larnt = wa_operation-larnt.
wa_zthlog-pronr = wa_header-pronr.
wa_zthlog-arbei = wa_operation-arbei.
wa_zthlog-dauno = wa_operation-dauno.
wa_zthlog-dauno = wa_operation-dauno.
wa_zthlog-ltxa1 = wa_operation-ltxa1.
wa_zthlog-arbid = wa_operation-arbid.
wa_zthlog-fieldname = 'PRONR'.
wa_zthlog-matkl = wa_operation-matkl.
wa_zthlog-preis = wa_operation-preis.
wa_zthlog-waers = wa_header-waers.
wa_zthlog-old_value = wa_header_old-pronr.
wa_zthlog-new_value = wa_header-pronr.
Fill t_zthlog - Call FM
APPEND wa_zthlog TO t_zthlog.
ENDIF.
ENDLOOP.
Secure Values before change
MOVE t_zthlog TO y_zthlog.+
Calling FM -->
+function z_thlog.
t_zthlog[] = c_zthlog[].
call screen 0100 starting at 10 3.
c_zthlog[] = t_zthlog[].
endfunction.+
ALV Grid - Processing -->
+module output_0100 output.
Fill Fieldcatalog
call function 'LVC_FIELDCATALOG_MERGE'
exporting
i_structure_name = 'ZTHLOG'
changing
ct_fieldcat = gt_fieldcat[]
exceptions
inconsistent_interface = 1
program_error = 2
others = 3.
if g_custom_container is initial.
Prepare ALV
create object g_custom_container
exporting container_name = g_container.
create object grid1
exporting i_parent = g_custom_container.
g_repid = sy-repid.
gs_layout-grid_title = 'Änderungsprotokoll'.
gs_layout-zebra = 'X'.
gs_layout-cwidth_opt = 'X'.
gs_variant-report = g_repid.
gs_variant = '/default'.
gs_layout-edit = 'X'.
Call ALV
call method grid1->set_table_for_first_display
exporting
i_structure_name = 'ZTHLOG'
is_layout = gs_layout
i_save = 'A'
is_variant = gs_variant
changing
it_outtab = t_zthlog
it_fieldcatalog = gt_fieldcat[].
Ready for Input
call method grid1->set_ready_for_input
exporting
i_ready_for_input = 1.
Eventregistration
call method grid1->register_edit_event
exporting
i_event_id = cl_gui_alv_grid=>mc_evt_enter.
create object g_event_receiver.
set handler g_event_receiver->handle_data_changed for grid1.
else.
Refresh, if filled
call method grid1->refresh_table_display.
endif.
set Cursor
call method cl_gui_control=>set_focus
exporting
control = grid1.
endmodule. " output_0100 OUTPUT+
There are alot of fields so the manual creation of the fieldcatalog should be avoided if possible.
Any Help is appreciated!
Best Regards
StefanHi,
Check this
* Module Pai INPUT *
* PAI module *
module pai input.
save_ok = ok_code.
clear ok_code.
call method grid1->check_changed_data
importing
e_valid = v_valid.
" After this system will automatically update your changed data into
" internal table t_zthlog
case save_ok.
when 'EXIT'.
perform f_exit_program.
when 'CANC'.
perform f_exit_program.
when 'BACK'.
perform f_exit_program.
when 'SAVE'.
perform f_save_data.
endcase.
endmodule. " Pai INPUT
aRs
Maybe you are looking for
-
Adobe X Standard not recognising scanner
I've just installed AcrobatX Standard and in the installation it will not recognise my network scanner and has stopped all other programmes recognising the scanner too! Can anyone help?
-
How to export a video with an alpha channel that can be switched off
Hi! I'm stuck with something that I think might have a simple solution: I need my video to have an alpha channel while still keeping all the RGB information in place too. This is for Syntheyes, which can take the alpha channel for a video and use it
-
Building & Consuming Async Web Service
I'm fairly new to web services. I built a WCF Web Service. It works fine when making synchronous calls. I'm stuck trying to make an async call. On the client side in Visual Studio, I get a "Cannot await TestWebServices.QuotingEngineService.SmallG
-
DF ,EF ,MF , all of file structure
DF(Dedicated File) ,EF(Elementary File) ,MF(Master File) all of file structure ISO 7816-4 tell data in card will be in tree structure SELECT file with get FCI come with response Now I'm confuse how to keep these type of file to javacard? Are these fi
-
Hi; I have this code: function LoadLogo():void parent_container = new Sprite(); addChild(parent_container) var path:String = "images/logo.png"; var req:URLRequest = new URLRequest(path);