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

Search help

Former Member
0 Likes
643

Hi ,

I have a field on a screen and i need to provide search help for that ....that search help i have created in abap dictnory .

Now my question is my search help should not displsay all available values it has to display values for the screen field depedning up on the other values on the screen .

i.e search help values depends on the other values present on the screen

Thanks ,

1 ACCEPTED SOLUTION
Read only

former_member195383
Active Contributor
0 Likes
571

After PIA under PROCESS ON VALUE-REQUEST.

FIELD wf_field1 MODULE m_valuerequest_wf_field1.

write the module MODULE m_valuerequest_wf_field1 as

MODULE m_valuerequest_wf_field1.

CALL FUNCTION 'DYNP_VALUES_READ' to collect the tb_dynpfields from dynpfields under the tables section of FM.This way you read dynamically the value of a screen field say wf_field2.

Using tb_dynpfields-fieldvalue you can fetch the required values from the data base that u wanna use in the search help.

then call the FM.

F4IF_INT_TABLE_VALUE_REQUEST, using those values..Your search help will come bases on the entries of the other field wf_field2

ENDMODULE.

Regards

Rudra

6 REPLIES 6
Read only

Former Member
0 Likes
571

This message was moderated.

Read only

former_member195383
Active Contributor
0 Likes
572

After PIA under PROCESS ON VALUE-REQUEST.

FIELD wf_field1 MODULE m_valuerequest_wf_field1.

write the module MODULE m_valuerequest_wf_field1 as

MODULE m_valuerequest_wf_field1.

CALL FUNCTION 'DYNP_VALUES_READ' to collect the tb_dynpfields from dynpfields under the tables section of FM.This way you read dynamically the value of a screen field say wf_field2.

Using tb_dynpfields-fieldvalue you can fetch the required values from the data base that u wanna use in the search help.

then call the FM.

F4IF_INT_TABLE_VALUE_REQUEST, using those values..Your search help will come bases on the entries of the other field wf_field2

ENDMODULE.

Regards

Rudra

Read only

anversha_s
Active Contributor
0 Likes
571

Hi,

Go for dynamic F4 help.

Check this standard program which exactly matches your requirement.

se38->

demo_dynpro_f4_help_module

.

Regards,

Anver

Read only

Former Member
0 Likes
571

Hi,

I dont think by using search help, you will fullfill your requirement.

you have to write code for F4 in your program itself.

process on value-request.

field v_shift module shift_f4.

field v_pernr module pernr_f4. in your screen.

module pernr_f4 input.

*if it_emp is INITIAL.

if t001w-werks is not initial.

select pernr

werks

emp_name

desig

from zps_emp

into table it_emp

where werks = t001w-werks.

else.

select pernr

werks

emp_name

desig

from zps_emp

into table it_emp.

endif.

*endif.

sort it_emp by pernr.

program = sy-repid.

dynnum = sy-dynnr.

call function 'F4IF_INT_TABLE_VALUE_REQUEST'

exporting

retfield = 'PERNR'

dynpprog = program

dynpnr = dynnum

dynprofield = 'V_PERNR'

value_org = 'S'

tables

value_tab = it_emp[]

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.

endif.

endmodule. " pernr_f4 INPUT

This may fullfill your requirement.

Thanks & regards

Read only

Former Member
0 Likes
571

hi ,

let me expxlain u with example:

if requirement in selection screen.is :

There are 2parameters in selection screen. For e.g. matnr and werks.

,If I am giving matnr then respect to that matnr i should get only those plant in F4 help.

solution:

AT SELECTION-SCREEN ON VALUE-REQUEST FOR werks.

select the werks based on plant in internal.table 
use f.m

F4IF_INT_TABLE_VALUE_REQUEST.
and pass the i.tab here in 

tables
value_t = i.tab

Or

Follow the psudo code below.

Note: it_matnr has only single field MATNR.

    • Return table to handle selected field in F4 help **

data: it_return like ddshretval occurs 0 with header line.
 
parameters: p_matnr type marc-matnr,
                  p_werks type marc-werks.
 
at selection-screen on value-request for p_repnam.
 
  select matnr
         from marc
         into table it_matnr
         where werks eq p_werks.
 
  call function 'F4IF_INT_TABLE_VALUE_REQUEST'
    exporting
      retfield         = 'OBJ_NAME'
      dynpprog         = sy-cprog
      dynpnr           = sy-dynnr
      value_org        = 'S'
      callback_program = sy-cprog
    tables
      value_tab        = it_matnr
      return_tab       = it_return
    exceptions
      parameter_error  = 1
      no_values_found  = 2.
 
  if sy-subrc eq 0.
    loop at it_return.
      clear p_repnam.
      p_repnam = it_return-fieldval.
    endloop.
 
  endif.

i hope it will help u a lot

thaks and regards

rahul sharma

Edited by: RAHUL SHARMA on Nov 19, 2008 7:34 AM

Read only

Former Member
0 Likes
571

Hi Ramesh,

For your query you have to use two FM.

check below code


DATA : BEGIN OF t_sarea OCCURS 0,
         werks TYPE t001p-werks,
         btrtl TYPE t001p-btrtl,
         btext TYPE t001p-btext,
         END OF t_sarea.
  DATA:
    lt_fields TYPE TABLE OF dynpread WITH HEADER LINE,
    l_pwerks  TYPE t5b1p-werks,
    t_return LIKE ddshretval OCCURS 0 WITH HEADER LINE.

  REFRESH lt_fields.
  CLEAR lt_fields.

  lt_fields-fieldname = 'SCREEN FIELD'.
  APPEND  lt_fields.
  CLEAR lt_fields.

  CALL FUNCTION 'DYNP_VALUES_READ'
    EXPORTING
      dyname               = sy-repid
      dynumb               = '2000'
    TABLES
      dynpfields           = lt_fields
    EXCEPTIONS
      invalid_abapworkarea = 1
      invalid_dynprofield  = 2
      invalid_dynproname   = 3
      invalid_dynpronummer = 4
      invalid_request      = 5
      no_fielddescription  = 6
      invalid_parameter    = 7
      undefind_error       = 8
      double_conversion    = 9
      stepl_not_found      = 10
      OTHERS               = 11.


  READ TABLE lt_fields WITH KEY fieldname = SCREEN FIELD.
  l_pwerks = lt_fields-fieldvalue.

  SELECT werks btrtl btext FROM t001p INTO TABLE t_sarea
                          WHERE werks = l_pwerks AND
                                molga = '40'.

  CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
    EXPORTING
      retfield        = 'BTRTL'
      dynpprog        = sy-repid
      dynpnr          = sy-dynnr
      dynprofield     = SCREEN FIELD
      value_org       = 'S'
    TABLES
      value_tab       = t_sarea
      return_tab      = t_return[]
    EXCEPTIONS
      parameter_error = 1
      no_values_found = 2
      OTHERS          = 3.
  READ TABLE t_return INDEX 1.
  MOVE t_return-fieldval TO SCREEN FIELD.