‎2010 Jan 26 9:55 AM
Hi,
There is a peculiar problem occuring with F4 functionality function module.
In my case, i have defined an internal table (I_F4) with Sales Organization and Sales org Description as fields.
Then, in custum screen, i the 'Sales Organzation' field should have F4 option, in which the internal table I_F4 values should be listed.
If the user selects any of the value from F4 option, the selected value should be populated in the input box of 'Sales Organization.
But, in my case, the Sales Organization's description is getting populated inthe screen filed instead of Sales organzation.
The screen filed is named as zvbap_so1-zzvkorg.
Please help me out to overcome this issue.
data: begin of i_f4 occurs 0,
vkorg like tvko-vkorg,
vtext like tvkot-vtext,
end of i_f4.
DATA: V_VKORG1 LIKE DFIES-FIELDNAME value 'I_F4-VKORG'.
CONSTANTS: C_VKORG LIKE HELP_INFO-DYNPROFLD VALUE 'ZVBAP_SO1-ZZVKORG'.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
* DDIC_STRUCTURE = ' '
RETFIELD = V_VKORG1
* PVALKEY = ' '
DYNPPROG = SY-CPROG
DYNPNR = SY-DYNNR
DYNPROFIELD = C_VKORG
* STEPL = 0
WINDOW_TITLE = 'SEARCH HELP'
* VALUE = ' '
VALUE_ORG = 'S'
* MULTIPLE_CHOICE = ' '
* DISPLAY = ' '
* CALLBACK_PROGRAM = ' '
* CALLBACK_FORM = ' '
* MARK_TAB =
* IMPORTING
* USER_RESET =
TABLES
VALUE_TAB = I_F4
* 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.
*ELSE.
*
*READ TABLE IT_VAL INDEX 1.
*IF SY-SUBRC EQ 0.
*ENDIF.
*
ENDIF.Regards
Pavan
‎2010 Jan 26 10:40 AM
Is this a module pool or report program ???
For module pool check link:[http://www.saptechies.com/how-to-add-f4-help-to-a-field-on-screen-module-pool/]
In report program this works
data: begin of i_f4 occurs 0,
vkorg like tvko-vkorg,
vtext like tvkot-vtext,
end of i_f4.
parameters:p_vkorg type vkorg.
at selection-screen on value-request for p_vkorg.
i_f4-vkorg = '123'.
i_f4-vtext = 'ABC'.
append i_f4.
i_f4-vkorg = '445'.
i_f4-vtext = 'DEF'.
append i_f4.
if i_f4[] is not initial.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
RETFIELD = 'VKORG'
DYNPPROG = SY-CPROG
DYNPNR = SY-DYNNR
DYNPROFIELD = 'P_VKORG'
VALUE_ORG = 'S'
TABLES
VALUE_TAB = i_f4[]
EXCEPTIONS
parameter_error = 1
no_values_found = 2
others = 3.
endif.
‎2010 Jan 26 10:12 AM
Hello
Try this:
DATA: V_VKORG1 LIKE DFIES-FIELDNAME value 'VKORG'. " instead of 'I_F4-VKORG'
CONSTANTS: C_VKORG LIKE HELP_INFO-DYNPROFLD VALUE 'ZZVKORG'. " instead of 'ZVBAP_SO1-ZZVKORG'
‎2010 Jan 26 10:33 AM
Hi Maroz,
Thanks a ton for your tip.. Its working fine now..!!!
Now can i make the input field in such a way that the user has to enter the value only by choosing F4 option.. He should nt be allowed to enter manually or should not be allowed to edit using keyboard...
The input filed in my case is on custom screen....
How to do this...???
Appreciate your help in this regard....
Regards
Pavan
‎2010 Jan 26 10:57 AM
Hello
If dialog programm: screen painter -> field attributes -> set "Foriegn key check"
If selection-screen: PARAMETERS vkorg type vkorg VALUE CHECK.
‎2010 Jan 26 11:00 AM
Use the LOOP AT SCREEN statement.
F1 help on ABAP keyword otherwise do a search on SCN, and you will find what you need.
‎2010 Jan 26 10:38 AM
Hi Pavan,
Please check the field name in the screen.
The purchase organization field should be C_VKORG as you specified in the function module.
DYNPROFIELD = C_VKORGRegards
Pinaki
‎2010 Jan 26 10:40 AM
Is this a module pool or report program ???
For module pool check link:[http://www.saptechies.com/how-to-add-f4-help-to-a-field-on-screen-module-pool/]
In report program this works
data: begin of i_f4 occurs 0,
vkorg like tvko-vkorg,
vtext like tvkot-vtext,
end of i_f4.
parameters:p_vkorg type vkorg.
at selection-screen on value-request for p_vkorg.
i_f4-vkorg = '123'.
i_f4-vtext = 'ABC'.
append i_f4.
i_f4-vkorg = '445'.
i_f4-vtext = 'DEF'.
append i_f4.
if i_f4[] is not initial.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
RETFIELD = 'VKORG'
DYNPPROG = SY-CPROG
DYNPNR = SY-DYNNR
DYNPROFIELD = 'P_VKORG'
VALUE_ORG = 'S'
TABLES
VALUE_TAB = i_f4[]
EXCEPTIONS
parameter_error = 1
no_values_found = 2
others = 3.
endif.