Application Development 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: 

F4 help on table control

Former Member
0 Kudos

Hi,

I created a table control based on an internal table defined in my program. The internal table contains a field named VSTEL. and the corresponding screen element name is WA_VSTEL.

Now when the user presses F4 on this, I am able to display a list of values of my choice, user selects it and that gets associated with the first row's WA_VSTEL.

Now In the second row if I press F4, the value list is displayed, i am able to select the value , but the the selected value does not appear on the WA_VSTEL (2nd row's column !!).

i am sure I need to change my code so that I set the return value from CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

to the corresponding row's WA_VSTEL.

i am not sure how to do that in my code...find below the POV code. any suggestions ??

TYPES: BEGIN OF X_VSTEL,

VSTEL TYPE TVST-VSTEL,

END OF X_VSTEL.

DATA: WA_ITAB TYPE X_VSTEL,

I_TAB LIKE TABLE OF WA_ITAB,

LT_DFIES_CSIT TYPE DFIES OCCURS 0.

CLEAR WA_ITAB.

REFRESH I_TAB.

SELECT DISTINCT VSTEL INTO WA_ITAB FROM TVST.

APPEND WA_ITAB TO I_TAB.

CLEAR WA_ITAB.

ENDSELECT.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

RETFIELD = 'VSTEL'

DYNPPROG = SY-REPID

DYNPNR = SY-DYNNR

DYNPROFIELD = 'WA_VSTEL'

VALUE_ORG = 'S'

TABLES

VALUE_TAB = I_TAB

FIELD_TAB = LT_DFIES_CSIT.

1 ACCEPTED SOLUTION

naimesh_patel
Active Contributor
0 Kudos

You need to get the values from the return table and update the screen field with the value.

Like:


  CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
    EXPORTING
      RETFIELD    = 'NETWR'
      DYNPPROG    = SY-REPID
      DYNPNR      = SY-DYNNR
      DYNPROFIELD = 'WA_ITEM-NETWR'
      VALUE_ORG   = 'S'
    TABLES
      VALUE_TAB   = I_TAB
      FIELD_TAB   = LT_DFIES_CSIT
      RETURN_TAB  = S_RETURN.     "<<



  READ TABLE S_RETURN WITH KEY RETFIELD = 'WA_ITEM-NETWR'.
  IF SY-SUBRC = 0.
    WA_ITEM-NETWR = S_RETURN-FIELDVAL.
  ENDIF.

Regards,

Naimesh Patel

6 REPLIES 6

naimesh_patel
Active Contributor
0 Kudos

You need to get the values from the return table and update the screen field with the value.

Like:


  CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
    EXPORTING
      RETFIELD    = 'NETWR'
      DYNPPROG    = SY-REPID
      DYNPNR      = SY-DYNNR
      DYNPROFIELD = 'WA_ITEM-NETWR'
      VALUE_ORG   = 'S'
    TABLES
      VALUE_TAB   = I_TAB
      FIELD_TAB   = LT_DFIES_CSIT
      RETURN_TAB  = S_RETURN.     "<<



  READ TABLE S_RETURN WITH KEY RETFIELD = 'WA_ITEM-NETWR'.
  IF SY-SUBRC = 0.
    WA_ITEM-NETWR = S_RETURN-FIELDVAL.
  ENDIF.

Regards,

Naimesh Patel

Former Member
0 Kudos

hi,

pass screen field name at dynprofield...

0 Kudos

Alok, How do i get the column table of the table control ??

thanks

0 Kudos

I mean SAP should recognize that this is second row column 1. How can I specify that in my program ??

thks

0 Kudos

If you use CHAIN AND ENDCHAIN in POV. then your value will be directly moved to the Corresponding column. in this case no need of code.

0 Kudos

Hi Vijay,

So u ask me to write like this ??

PROCESS ON VALUE-REQUEST.

CHAIN.

FIELD F11

FIELD F22

FIELD F33

ENDCHAIN.

FIELD F11 MODULE FIELDF11_HELP.

But I get the error message CHAIN ENDCHAIN possible only in PBO or in PAI and not in POV ?????

Any other suggestion or code sample ??

thanks