08-04-2008 10:51 PM
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.
08-04-2008 11:32 PM
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
08-04-2008 11:32 PM
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
08-05-2008 5:56 AM
08-05-2008 2:24 PM
Alok, How do i get the column table of the table control ??
thanks
08-05-2008 2:25 PM
I mean SAP should recognize that this is second row column 1. How can I specify that in my program ??
thks
08-05-2008 2:29 PM
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.
08-05-2008 6:59 PM
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