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: 

Problem with the F4 when all the fields are mandatory!!!

Former Member
0 Kudos

Hi All,

I have a field in the selection screen S_KUNNR as mandatory field and I need to get the F4 help for that field. For that I have implemented the below code. Its working fine after filling values in all mandatory fields. But my problem is that f4 should happen before filling all mandatory fields.

For your info, I have total 4 fields in the selection P_VKORG(1), P_VTWEG(2), P_SPART(3) and S_KUNNR(4). I am filling the values in the same order as well. After filling the P_SPART I am pressing F4 on S_KUNNR, that time its giving u2018No values foundu2019. But if I enter some values in S_KUNNR then I press F4 its displaying the F4 listu2026

As I know that we need to fill the all mandatory fields, and then only the PAI will trigger on selection-screen. Thatu2019s y the below select statement is failing initially.

Can u please suggest me, how to handle this situation.


at selection-screen on value-request for s_kunnr-low.
*  select knvp~kunnr
  select knvp~kunn2
         kna1~name1 from knvp inner join kna1 on
         knvp~kunn2 eq kna1~kunnr
         into table i_knvp_data
         where knvp~parvw eq 'RE'    and
               knvp~vkorg eq p_vkorg and
               knvp~vtweg eq p_vtweg and
               knvp~spart eq p_spart.

  if sy-subrc eq 0.
    sort i_knvp_data.
  endif.

  call function 'F4IF_INT_TABLE_VALUE_REQUEST'              "#EC *
    exporting
      retfield        = `KUNNR`
      dynpprog        = sy-repid
      dynpnr          = sy-dynnr
      dynprofield     = `S_KUNNR`
      value_org       = 'S'
    tables
      value_tab       = i_knvp_data
    exceptions
      parameter_error = 1
      no_values_found = 2
      others          = 3.

3 REPLIES 3

Former Member
0 Kudos

This message was moderated.

0 Kudos

Hi Rakesh,

I canu2019t change the obligatory additions!! And I didnu2019t understand in which we can impleetn that code in At Selection-screen Output??

Can u please provide me some snippet!!!

0 Kudos

Hi,

First remove all obligatory aditions..

Then use..

AT SELECTION-SCREEN command..

Inide that write codes like this.

if S_VKORG[] is initial.

MESSAGE 'Enter value for sales organisation' Type 'E'.

endif.

Cheers,

Rakesh