‎2010 Jan 18 10:54 AM
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.
‎2010 Jan 18 11:00 AM
Hi Arpit ,
Try to Use DECIMALS property of the field catalog
wa_fieldcat-decimals = '2'.This will solve your problem.
Regards,
Nikhil
‎2010 Jan 18 10:57 AM
>
> 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.
Hi Arpit,
Please provide us with your code so that we can review it and let you know where the problem is.
Regards
Sikha
‎2010 Jan 18 10:57 AM
Hi,
the easiest way is to set ref_table and ref_fieldname for this field in fieldcatalog.
Set this values according thie column in the table you are updating values.
Regards,
Frisoni
‎2010 Jan 18 11:00 AM
Hi Arpit ,
Try to Use DECIMALS property of the field catalog
wa_fieldcat-decimals = '2'.This will solve your problem.
Regards,
Nikhil
‎2010 Jan 18 12:45 PM
‎2010 Jan 18 11:00 AM
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
‎2010 Jan 18 11:18 AM
hi Arpit ,
you can solve your problem by two ways.....
In fieldcatalog
APPEND these two fields
WA_FIELDCAT-REF_FIELD = ' '. " refrence field
WA_FIELDCAT-REF_TABLE = ' ' . " refrence table
OR ,
APPEND this field
WA_FIELDCAT-INTTYPE = 'C'.hope this will help you
Regards
Gaurav