Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

POPUP_GET_VALUES_USER_CHECKED – Input disabled?

luis_rod
Participant
0 Likes
3,205

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

1 ACCEPTED SOLUTION
Read only

Sandra_Rossi
Active Contributor
0 Likes
2,587

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.
5 REPLIES 5
Read only

former_member1716
Active Contributor
0 Likes
2,587

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!

Read only

0 Likes
2,587

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

Read only

0 Likes
2,587

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?

Read only

Sandra_Rossi
Active Contributor
0 Likes
2,588

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.
Read only

2,587

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