2020 Jan 23 9:15 PM
Hi all,
I’m having some problems with the POPUP_GET_VALUES_USER_CHECKED FM. When I try to enter a decimal or a currency value the field is shown as input-disabled.
My code is something like the following:
clear: ifields.
ifields-tabname = 'ZTABLE'.
ifields-fieldname = 'TEXT'.
ifields-value = 'COMMENT_DATA'.
ifields-fieldtext = 'COMMENT'.
ifields-field_attr = '05'.
append ifields.
clear: ifields.
ifields-field_obl = 'X'.
ifields-tabname = 'ZTABLE'.
ifields-fieldname = 'NETWR'.
ifields-value = w_amount.
ifields-fieldtext = 'AMOUNT'.
Clear ifields-field_attr.
append ifields.
The first value (fieldname = ‘TEXT’) shows as intended (no boxes, input disabled)
The second value appears disabled for input (??). If instead of a numeric value I substitute for a char field (e.g. a value of ‘M123’ for a fieldname = ‘MATNR’) the field allows input without problems.
Any ideas?
Thanks in advance,
Luis
2020 Jan 24 9:43 AM
If you have a field of type currency amount (predefined type CURR), you must also pass the corresponding currency key (predefined type CUKY) field, otherwise the system can't know how many decimals the currency amount really has.
If you don't pass the CUKY field, you can't input the CURR field.
Example which works:
DATA ifields TYPE TABLE OF sval WITH HEADER LINE.
CLEAR: ifields.
ifields-tabname = 'SBOOK'.
ifields-fieldname = 'PASSNAME'.
ifields-value = 'COMMENT_DATA'.
ifields-fieldtext = 'COMMENT'.
ifields-field_attr = '05'.
APPEND ifields.
CLEAR: ifields.
ifields-field_obl = 'X'.
ifields-tabname = 'SBOOK'.
ifields-fieldname = 'FORCURAM'.
ifields-value = '235.10'.
ifields-fieldtext = 'AMOUNT'.
ifields-field_attr = ''.
APPEND ifields.
CLEAR: ifields.
ifields-field_obl = 'X'.
ifields-tabname = 'SBOOK'.
ifields-fieldname = 'FORCURKEY'.
ifields-value = 'JPY'.
ifields-fieldtext = 'AMOUNT'.
ifields-field_attr = ''.
APPEND ifields.
CALL FUNCTION 'POPUP_GET_VALUES_USER_CHECKED'
EXPORTING
formname = ''
popup_title = ''
programname = ''
TABLES
fields = ifields " Table fields, values and attributes
EXCEPTIONS
error_in_fields = 1.
If you have a field of type currency amount (predefined type CURR), you must also pass the corresponding currency key (predefined type CUKY) field, otherwise the system can't know how many decimals the currency amount really has.
If you don't pass the CUKY field, you can't input the CURR field.
Example which works:
DATA ifields TYPE TABLE OF sval WITH HEADER LINE.
CLEAR: ifields.
ifields-tabname = 'SBOOK'.
ifields-fieldname = 'PASSNAME'.
ifields-value = 'COMMENT_DATA'.
ifields-fieldtext = 'COMMENT'.
ifields-field_attr = '05'.
APPEND ifields.
CLEAR: ifields.
ifields-field_obl = 'X'.
ifields-tabname = 'SBOOK'.
ifields-fieldname = 'FORCURAM'.
ifields-value = '235.10'.
ifields-fieldtext = 'AMOUNT'.
ifields-field_attr = ''.
APPEND ifields.
CLEAR: ifields.
ifields-field_obl = 'X'.
ifields-tabname = 'SBOOK'.
ifields-fieldname = 'FORCURKEY'.
ifields-value = 'JPY'.
ifields-fieldtext = 'AMOUNT'.
ifields-field_attr = ''.
APPEND ifields.
CALL FUNCTION 'POPUP_GET_VALUES_USER_CHECKED'
EXPORTING
formname = ''
popup_title = ''
programname = ''
TABLES
fields = ifields " Table fields, values and attributes
EXCEPTIONS
error_in_fields = 1.
2020 Jan 24 4:01 AM
377cae7333c044888184eb2537b4355e,
The reason is you have not initialized the value for the field and you have made it as mandatory as well. when you assign a character field even a space will be considered as a value. Recommend you initialize the value by providing a default value and check the same functionality again.
Regards!
2020 Jan 24 4:27 AM
Satish,
Thanks for your post.
Maybe I wasn't clear enough in my original post. My problem is with the second set of instructions. As you can see, the ifields-value gets assigned a value (w_amount) and ifields-attr gets cleared beforehand, which means it should be treated as a normal, input capable field.
Regards,
Luis
2020 Jan 24 4:39 AM
377cae7333c044888184eb2537b4355e,
Clearing Firld-Attr is not necessary, form the code i see the field with never hold any value to clear.
Can you check by removing the Obligatory condition for the field?
2020 Jan 24 9:43 AM
If you have a field of type currency amount (predefined type CURR), you must also pass the corresponding currency key (predefined type CUKY) field, otherwise the system can't know how many decimals the currency amount really has.
If you don't pass the CUKY field, you can't input the CURR field.
Example which works:
DATA ifields TYPE TABLE OF sval WITH HEADER LINE.
CLEAR: ifields.
ifields-tabname = 'SBOOK'.
ifields-fieldname = 'PASSNAME'.
ifields-value = 'COMMENT_DATA'.
ifields-fieldtext = 'COMMENT'.
ifields-field_attr = '05'.
APPEND ifields.
CLEAR: ifields.
ifields-field_obl = 'X'.
ifields-tabname = 'SBOOK'.
ifields-fieldname = 'FORCURAM'.
ifields-value = '235.10'.
ifields-fieldtext = 'AMOUNT'.
ifields-field_attr = ''.
APPEND ifields.
CLEAR: ifields.
ifields-field_obl = 'X'.
ifields-tabname = 'SBOOK'.
ifields-fieldname = 'FORCURKEY'.
ifields-value = 'JPY'.
ifields-fieldtext = 'AMOUNT'.
ifields-field_attr = ''.
APPEND ifields.
CALL FUNCTION 'POPUP_GET_VALUES_USER_CHECKED'
EXPORTING
formname = ''
popup_title = ''
programname = ''
TABLES
fields = ifields " Table fields, values and attributes
EXCEPTIONS
error_in_fields = 1.
2020 Jan 24 1:32 PM
Sandra,
Thanks!! That made it.
In one of my tests I had already included a (in my case, non-visible, non-input capable) currency key field without success but, what I hadn’t realized is that in this particular table the currency field references a currency key field in ANOTHER table. As soon as I wrote in the correct table for the currency field the problem solved.
Thanks again,
Luis
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |