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: 

restriction in search help(F4) accordin to the input

Former Member
0 Kudos

hi

i have populated profit centre and company using joins in F4(usingF4IF_INT_TABLE_VALUE_REQUEST) now

my requirement is i wanna display the profit centre based upon the company code...

i.e

in f4 it should display the proit centre according to the company code entered in selection screen

how can i do it????

My select screen contain 

Company code
fiscal year
date
profit centre 

code

at selection-screen on value-request for so_prctr-low.

  select cepct~prctr cepct~ltext cepc~bukrs
                    from cepct join cepc
                    on cepct~prctr = cepc~prctr
                    into corresponding fields of table it_cepct
                    where cepct~spras = 'EN' .

  call function 'F4IF_INT_TABLE_VALUE_REQUEST'
    exporting

      retfield               = 'PRCTR'
     value                  = '*'
     value_org              = 'S'
    tables
      value_tab              = it_cepct
     return_tab             = ret_tab

   exceptions
     parameter_error        = 1
     no_values_found        = 2
     others                 = 3
            .
  if sy-subrc <> 0.

  endif.

so when i enter the company code accordingly the profit centre should be populated...

9 REPLIES 9

nabheetscn
Active Contributor
0 Kudos

Hello,

Find the master table and implement the same.

Regards,

Nabheet

Former Member
0 Kudos

Hi ,

You have to use first DYNP_VALUES_READ to read the Company Code entered on the selection-screen. Then According to it you have to fetch the data & passit to F4IF_INT_TABLE_VALUE_REQUEST.

So when you enter the Company Code According to the company code it will fetch the Profit center & then the same will be passed to the second function module & when you click on F4 you will get the Profit centers against the entered company code.

Also have a look at the below link for the code snippet

[;

Hope this helps you.

Kindly set to resolve if it helps you.

Regards

Abhii...

Edited by: Abhii on Nov 13, 2009 9:53 AM

Former Member
0 Kudos

at selection-screen on value-request for so_prctr-low.

select cepctprctr cepctltext cepc~bukrs

from cepct join cepc

on cepctprctr = cepcprctr

into corresponding fields of table it_cepct

where cepct~spras = 'EN'

and cepc~bukrs IN so_bukrs . " or EQ p_bukrs (depends on if you have company code as SO or parameter)

call function 'F4IF_INT_TABLE_VALUE_REQUEST'

exporting

retfield = 'PRCTR'

value = '*'

value_org = 'S'

tables

value_tab = it_cepct

return_tab = ret_tab

exceptions

parameter_error = 1

no_values_found = 2

others = 3

.

if sy-subrc 0.

endif.

0 Kudos

thanks for trying to help ....but pls dont write the code like this.... jus like watever u think....... hows it possible ????

fo*r Jagrik Adrian *

Edited by: Beginers on Nov 13, 2009 10:10 AM

0 Kudos

Hi Friend,

Please use the concept I explained. You will definitely succeed in your requirement.

Regards

Abhii...

0 Kudos

Sorry, of course it is not so simple. Try a solution with creating own search help and assigning it to your own data dictionary structure. Than define selection screen parameters using the created structure and you won't need any coding to handle search help. To understand what I mean just try to create a simple report having 2 parameters p_matnr type risa0-matnr and p_sernr type risa0-sernr. After pressing F4 in p_sernr field a search help values will be restricted according to matnr. This solution works only for parameters and not for select-options, but maybe it will be useful for you (you are not mentioning whether it is your requirement to use select-options or it is enough for you to use parameters). Also as far as I know, using FM DYNP_VALUES_READ will not work for select-options, because it reads only elements on dynpro and for select-options you may enter multiple values which are not displayed on dynpro.

Former Member
0 Kudos

Hi,

In this case DYNP_VALUES_READ must be used like I said earlier. So wehn we enter COMPANY CODE in company code & press F4 on Profit Center field automatically, all the profit centers that belongs to the company code are populated in the F4 help.

This is a dynamic concept.

Regards

Abhii...

Former Member
0 Kudos

hi

at selection-screen on value-request for so_prctr-low.

select cepctprctr cepctltext cepc~bukrs

from cepct join cepc

on cepctprctr = cepcprctr

into corresponding fields of table it_cepct

where cepct~spras = 'EN'

and cepc~bukrs eq selectio-screen bukrs like s_bukrs..

call function 'F4IF_INT_TABLE_VALUE_REQUEST'

exporting

retfield = 'PRCTR'

value = '*'

value_org = 'S'

tables

value_tab = it_cepct

return_tab = ret_tab

exceptions

parameter_error = 1

no_values_found = 2

others = 3

.

if sy-subrc 0.

endif.

0 Kudos

Hi ,

In this case this will not work. His requirement is like When we enter company code, the Profit center should be automatically populated. This happens dynamically according to the concept I have explained.

Kindly try & set to resolved if it helps you.

Regards

Abhii....