‎2012 May 16 9:36 AM
I have made the field NETPR editable in an ALV.
When I give value NETPR = 50 the value changes to 0.50 after saving.
Can anyone help me regarding this?
‎2012 May 16 2:03 PM
Hi,
please add one more line to your filedcat for NETPR.
wa_fieldcat-fieldname = 'NETPR'.
wa_fieldcat-scrtext_m = 'Net Price'.
wa_fieldcat-col_pos = 4.
wa_fieldcat-edit = 'X'.
wa_fieldcat-datatype = 'CURR'.
append wa_fieldcat to it_fieldcat.
clear wa_fieldcat.
It should work.
‎2012 May 16 9:41 AM
It is because of decimal places of NETPR which is 2.Were you are using it.
‎2012 May 16 10:10 AM
it has got length 11 with 2 decimal places. Try using the decimal places also.
‎2012 May 16 10:22 AM
Hi Sagar,
Thanks for your response.
I tried giving 20.00, still it takes as 0.20
Regards,
Riya
‎2012 May 16 10:24 AM
‎2012 May 16 10:40 AM
Hi Riya,
Kindly check the below link.
http://help.sap.com/saphelp_erp2004/helpdata/en/ff/4649b1f17411d2b486006094192fe3/content.htm
‎2012 May 16 10:40 AM
‎2012 May 16 10:51 AM
I think the value of NZD is too low.So it is displaying like it.
Note 456691 - FAQ: Price determination in purchasing
Can I use net prices that have more than 11 digits (including decimal places)?
Answer:
The field for the net price can be filled only with 11 characters (including 2 decimal places). A larger value usually leads to an overflow error ('price overflow error'). You can avoid this error by i) reducing the related quantity, ii) splitting the material item into several items, or iii) changing the price unit of measure accordingly.
The same applies for effective prices, which cannot exceed 13 digits (including 2 decimal places).
If you have further questions about this, we recommend that you open a customer message and forward it to SAP Development Support.
See also Note 584997.
‎2012 May 16 10:42 AM
Send the code u have used to create field symbol. and
there can be problem in your Decimal Notations in standard setting. Just goto SU01 enter ur userid
go to defaults tab and check what is Decimal Notation there and set acc to ur requirement.
‎2012 May 16 10:50 AM
What Dhruvin mentioned also a probability. Give a shot at that also.
Go to SU01->Give your user name->Go to tab Defaults->Check the decimal notation field and pick one from the drop down.
‎2012 May 16 10:53 AM
Hi,
Please find the code below.
PERFORM build_fieldcatalog.
PERFORM set_specific_field_attributes.
PERFORM display_alv_report.
FORM BUILD_FIELDCATALOG .
wa_fieldcat-fieldname = 'VBELN'.
wa_fieldcat-scrtext_m = 'Document No'.
wa_fieldcat-col_pos = 0.
wa_fieldcat-outputlen = 10.
wa_fieldcat-emphasize = 'X'.
wa_fieldcat-key = 'X'.
append wa_fieldcat to it_fieldcat.
clear wa_fieldcat.
wa_fieldcat-fieldname = 'POSNR'.
wa_fieldcat-scrtext_m = 'Line Item'.
wa_fieldcat-col_pos = 1.
append wa_fieldcat to it_fieldcat.
clear wa_fieldcat.
wa_fieldcat-fieldname = 'MATNR'.
wa_fieldcat-scrtext_m = 'Material No'.
wa_fieldcat-col_pos = 2.
append wa_fieldcat to it_fieldcat.
clear wa_fieldcat.
wa_fieldcat-fieldname = 'QUANT'.
wa_fieldcat-scrtext_m = 'Quantity'.
wa_fieldcat-col_pos = 3.
wa_fieldcat-edit = 'X'. "sets whole column to be editable
append wa_fieldcat to it_fieldcat.
clear wa_fieldcat.
wa_fieldcat-fieldname = 'NETPR'.
wa_fieldcat-scrtext_m = 'Net Price'.
wa_fieldcat-col_pos = 4.
wa_fieldcat-edit = 'X'. "sets whole column to be editable
append wa_fieldcat to it_fieldcat.
clear wa_fieldcat.
wa_fieldcat-fieldname = 'VRKME'.
wa_fieldcat-scrtext_m = 'Unit'.
wa_fieldcat-col_pos = 5.
append wa_fieldcat to it_fieldcat.
clear wa_fieldcat.
wa_fieldcat-fieldname = 'MWSBP'.
wa_fieldcat-scrtext_m = 'Tax'.
wa_fieldcat-col_pos = 6.
append wa_fieldcat to it_fieldcat.
clear wa_fieldcat.
wa_fieldcat-fieldname = 'NETWR'.
wa_fieldcat-scrtext_m = 'Total Price'.
wa_fieldcat-col_pos = 7.
append wa_fieldcat to it_fieldcat.
clear wa_fieldcat.
ENDFORM. " BUILD_FIELDCATALOG
FORM DISPLAY_ALV_REPORT .
gd_repid = sy-repid.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC'
EXPORTING
i_callback_program = gd_repid
i_callback_pf_status_set = 'STATUS_SET'
i_callback_user_command = 'USER_COMMAND'
is_layout_lvc = gd_layout
it_fieldcat_lvc = it_fieldcat
i_save = 'X'
TABLES
t_outtab = gdt_vbap
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.
ENDFORM. " DISPLAY_ALV_REPORT
FORM status_set USING rt_extab TYPE slis_t_extab.
SET PF-STATUS 'EDIT1' EXCLUDING rt_extab.
ENDFORM. "status_set
FORM SET_SPECIFIC_FIELD_ATTRIBUTES .
DATA ls_stylerow TYPE lvc_s_styl .
DATA lt_styletab TYPE lvc_t_styl .
LOOP AT gdt_vbap INTO gds_vbap.
ls_stylerow-fieldname = 'QUANT' .
INSERT ls_stylerow into table gds_vbap-field_style.
ls_stylerow-fieldname = 'NETPR' .
INSERT ls_stylerow into table gds_vbap-field_style.
MODIFY gdt_vbap FROM gds_vbap.
ENDLOOP.
ENDFORM.
FORM user_command USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
CASE sy-ucomm.
WHEN '&DATA_SAVE'.
loop at gdt_vbap into gds_vbap.
MODIFY gdt_vbap FROM gds_vbap TRANSPORTING NETPR.
ENDLOOP.
ENDCASE.
ENDFORM.
‎2012 May 16 2:03 PM
Hi,
please add one more line to your filedcat for NETPR.
wa_fieldcat-fieldname = 'NETPR'.
wa_fieldcat-scrtext_m = 'Net Price'.
wa_fieldcat-col_pos = 4.
wa_fieldcat-edit = 'X'.
wa_fieldcat-datatype = 'CURR'.
append wa_fieldcat to it_fieldcat.
clear wa_fieldcat.
It should work.
‎2012 May 17 5:36 AM
‎2012 May 17 2:54 AM
Hi,
Try the suggestion of or you can try this:
wa_fieldcat-fieldname = 'NETPR'.
wa_fieldcat-scrtext_m = 'Net Price'.
wa_fieldcat-col_pos = 4.
wa_fieldcat-edit = 'X'. "sets whole column to be editable
wa_fieldcat-ref_table = 'VBAP'.
wa_fieldcat-ref_field = 'NETPR'.
append wa_fieldcat to it_fieldcat.
clear wa_fieldcat.
I tried it and it worked! ^_^
Regards,
Jake