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 in select options

Former Member
0 Likes
598

hi,

i am using the select options statment,if i want to bring the data in F4 for MARD-LGPBE how to bring the values,can any body tell me which function module we can use.

Thanks,

5 REPLIES 5
Read only

Former Member
0 Likes
569

Hi Ram,

use At selection screen on value request statement.

regards,

Chandra.

Read only

Former Member
0 Likes
569

Please check this link. It helps you a lot.

http://help.sap.com/saphelp_47x200/helpdata/en/9f/db9a2e35c111d1829f0000e829fbfe/frameset.htm

regards,

Chandra.

Note: Please reward if helpful.

Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
569

This field appears to be free text and that you can put anything you want in it in the material master, that said, this makes for a performance problem when you are trying to do F4 help. You have to read the entire MARD table and get all of the bins and then show them in the F4. This code below will do what you want, but again, there is a performance problem. When the program starts, it gets all of the bins for the F4 help. So you may see a delay in the selection screen being thrown, in my system it takes about 7 seconds.


report zrich_0001 .

tables: mard.


data: begin of imard occurs 0,
      lgpbe type MARD-LGPBE,
      end of imard.

select-options s_lgpbe for mard-lgpbe.

initialization.

  select lgpbe into table imard from mard.

  sort imard ascending by lgpbe.
  delete adjacent duplicates from imard comparing lgpbe.


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

  call function 'F4IF_INT_TABLE_VALUE_REQUEST'
       exporting
            retfield    = 'LGPBE'
            dynprofield = 'S_LGPBE'
            dynpprog    = sy-cprog
            dynpnr      = sy-dynnr
            value_org   = 'S'
       tables
            value_tab   = imard.

start-of-selection.

Regards,

Rich Heilman

Read only

messier31
Active Contributor
0 Likes
569

Hi Ram,

You can use below func module to get F4 help on select option field.

<b>F4IF_INT_TABLE_VALUE_REQUEST F4</b>

It returns the values selected in an internal table.

Check this example code

<b>*GLOBAL DECLARATION</b>

  • Declare your internal table say ITAB_VALUE

  • Populate ITAB_VALUE with values yuo want for F4 help

t_return like ddshretval occurs 0 with header line.

<b>*CODE TO WRITTEN IN EVENT</b>

  • AT SELECTION-SCREEN VALUE-REQUEST ON S_OPTION-LOW &

  • AT SELECTION-SCREEN VALUE-REQUEST ON S_OPTION-HIGH

call function 'F4IF_INT_TABLE_VALUE_REQUEST'

exporting

<i>* Name of field in internal table for which F4 help will return value (in caps)</i>

retfield = 'FIELD'

value_org = 'S'

tables

value_tab = ITAB_VALUE

return_tab = t_return

exceptions

parameter_error = 1

no_values_found = 2

others = 3.

if sy-subrc = 0.

read table t_return index 1.

s_option-low = t_return-fieldval.

endif.

Hope this helps you..let me know if u have ny prob.

Enjoy SAP.

Pankaj Singh

Read only

Former Member
0 Likes
569

What about creating a search-help for this field ?