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

POV Changes Feld Value When Input = 0

kurt_slater3
Explorer
0 Likes
1,541

Hi Experts...

I have programmed a POV for a table control field. Under certain conditions the field will not be open for input by changing the <table control>-cols-screen-input field. This is done in PBO. So far so good. The problem is, when I trigger the F4 input help when the field is not ready for input, the F4 returns the selected value to the field and overwrites the previous value.

How is this possible? Any ideas on how to prevent this from happening?

Regards

KS

1 ACCEPTED SOLUTION
Read only

kurt_slater3
Explorer
0 Likes
1,457

Experts...

Thanks to all who mentioned the DISPLAY parameter. I was aware of this parameter, but I've noticed that I don't have any problems with another screen field that is not in a table control but also has a POV F4. It's only the table control POV F4 that allows the field to be replaced even when the field INPUT attribute = 0.

Does this mean I have to get the index of the table control and then check the INPUT attribute and set the DISPLAY parameter accordingly?

Wow! Really?

Regards

KS

11 REPLIES 11
Read only

Former Member
0 Likes
1,457

Hi Slater,

[Check this Post.|]

Check what you are passing to the DISPLAY parameter of your Fucntion Module.

Cheerz

Ram

Read only

Former Member
0 Likes
1,457

Dear KS,

Please find the below code it may useful for u

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
    EXPORTING
*   DDIC_STRUCTURE         = ' '
      RETFIELD               = 'NUM'
*   PVALKEY                = ' '
*   DYNPPROG               = ' '
*   DYNPNR                 = ' '
*   DYNPROFIELD            = ' '
*   STEPL                  = 0
*   WINDOW_TITLE           =
*   VALUE                  = ' '
     VALUE_ORG              = 'S'
*   MULTIPLE_CHOICE        = ' '
*   DISPLAY                = ' '
*   CALLBACK_PROGRAM       = ' '
*   CALLBACK_FORM          = ' '
*   MARK_TAB               =
* IMPORTING
*   USER_RESET             =
    TABLES
      VALUE_TAB              = ITAB
*   FIELD_TAB              =
*   RETURN_TAB             =
*   DYNPFLD_MAPPING        =
* EXCEPTIONS
*   PARAMETER_ERROR        = 1
*   NO_VALUES_FOUND        = 2
*   OTHERS                 = 3
            .
  IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.

in the above function module itab is internal table which have the falues for ur f4 and NUM is the fields which is fields for that particular f4.

and also check in the screen painter attributes

in Program if the check box of output only is selected if selected than uncheck that

Thanks

Surendra P

Read only

Former Member
0 Likes
1,457

Hi Kurt,

Try this out,

whenever your screen field in not ready for input set W_DISPLAY = 'X'.

and use it further in the below F4 function.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

  • DDIC_STRUCTURE = ' '

RETFIELD = '<return_field>'

  • PVALKEY = ' '

  • DYNPPROG = ' '

  • DYNPNR = ' '

  • DYNPROFIELD = ' '

  • STEPL = 0

  • WINDOW_TITLE =

  • VALUE = ' '

VALUE_ORG = 'S'

  • MULTIPLE_CHOICE = ' '

DISPLAY = W_DISPLAY -


> if this is 'X' the function will not return value

  • CALLBACK_PROGRAM = ' '

  • CALLBACK_FORM = ' '

  • MARK_TAB =

  • IMPORTING

  • USER_RESET =

TABLES

VALUE_TAB = <internal_table>

  • FIELD_TAB =

  • RETURN_TAB =

  • DYNPFLD_MAPPING =

  • EXCEPTIONS

  • PARAMETER_ERROR = 1

  • NO_VALUES_FOUND = 2

  • OTHERS = 3

.

IF SY-SUBRC 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

hope it helps you,

Regards,

Abhijit G. Borkar

Read only

kurt_slater3
Explorer
0 Likes
1,458

Experts...

Thanks to all who mentioned the DISPLAY parameter. I was aware of this parameter, but I've noticed that I don't have any problems with another screen field that is not in a table control but also has a POV F4. It's only the table control POV F4 that allows the field to be replaced even when the field INPUT attribute = 0.

Does this mean I have to get the index of the table control and then check the INPUT attribute and set the DISPLAY parameter accordingly?

Wow! Really?

Regards

KS

Read only

0 Likes
1,457

when pressing f4, in debugging mode can you check the attributes of that particular field in tabcontrol.

Read only

0 Likes
1,457

Keshav

That's exactly what I've been trying to do during the POV event but I haven't been able to find a way to do it.

<TABLE CONTROL>-CURRENT_LINE appears to always = 1 during POV, now suppose the user triggers POV for line 3 (I use GET CURSOR to get the index) now how do I read the screen attributes of line 3 in the table control when I only have access to the current screen attributes of the table control where CURRENT_LINE = 1?

<TABLE CONTROL> is a deep structure, not an internal table where I can read an entry based on a table index.

Regards

KS

Read only

0 Likes
1,457

The last property in table control is a deep structure, i think the fieldname is COL.

While debugging double click on it, you will see the columns of table control each having its own scrren atrributes.

Hi and im sure that this problem is due to some attributes settings.

Read only

0 Likes
1,457

Or in screen painter double click on that particular field, mark output field check box only.

Read only

0 Likes
1,457

Hmm, just tested that "loop at screen" logic again and it only works for first POV... this option looks better:


*
* In POV
*
  data:
    l_repid             type d020s-prog,
    l_stepl             type i,
    ls_dynpread         type dynpread,
    lt_dynpread         type table of dynpread.

  clear: lt_dynpread, lt_dynpread[]. "required even though local

  call function 'DYNP_GET_STEPL'   "current TC screen line
    importing
      povstepl = l_stepl
    exceptions
      others   = 0.

  clear: ls_dynpread.
  ls_dynpread-fieldname = 'GT_DATA-FIELD1'.
  ls_dynpread-stepl     = l_stepl.
  append ls_dynpread to lt_dynpread.

  l_repid = sy-repid.
  call function 'DYNP_VALUES_READ'
    exporting
      dyname     = l_repid
      dynumb     = '0400' "your screen number
    tables
      dynpfields = lt_dynpread
    exceptions
      others     = 0.

  read table lt_dynpread into ls_dynpread
    with key fieldname = 'GT_DATA-FIELD1'
             stepl     = l_stepl.

  if ls_dynpread-fieldinp is initial.
    message s398(00) with 'Search help is not available for output field'
      space space space.
    exit.
  endif.
*
* ... else do your searchhelp logic...
*

Jonathan

Read only

0 Likes
1,457

Jonathan

Your solution is right on the money - it worked beautifully. I guess we never stop learning ABAP, huh? Thank-you.

Regards

KS

Read only

Former Member
0 Likes
1,457

Firstly, yes, it is sometime useful to have an output field maintainable by a search help which is why SAP allow it, although the default behaviour in F4IF_FIELD_VALUE_REQUEST is not to do this (unless you set the display parameter to "F" = force).

SAP code uses the function module DYNP_VALUES_READ to read the input / display state of the field - the "fieldinp" attribute should be empty if display only, so you could implement a call to this in your POV logic.

( edited: loop at screen alternative removed )

Jonathan