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

Problem with F4 functionality in custom screen

Former Member
0 Likes
731

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

1 ACCEPTED SOLUTION
Read only

kesavadas_thekkillath
Active Contributor
0 Likes
673

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.

6 REPLIES 6
Read only

Former Member
0 Likes
673

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'

Read only

0 Likes
673

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

Read only

0 Likes
673

Hello

If dialog programm: screen painter -> field attributes -> set "Foriegn key check"

If selection-screen: PARAMETERS vkorg type vkorg VALUE CHECK.

Read only

0 Likes
673

Use the LOOP AT SCREEN statement.

F1 help on ABAP keyword otherwise do a search on SCN, and you will find what you need.

Read only

Former Member
0 Likes
673

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_VKORG

Regards

Pinaki

Read only

kesavadas_thekkillath
Active Contributor
0 Likes
674

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.