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 + module pool

Former Member
0 Likes
536

hai all

there is a problem am facing while doing module pool search help.

1)I have a screen 200, witrh fields wiwid, firstname, last name.

2)i have created elementary search help for the filed wiw id and added that search help to the screen field wiw id.

3)when am excuted the screen and press f4 on filed wiwid, am able find the all values there, but when am select any of the record, only wiwid value coming to screen fields

4) how to get screen values to other fields also.

5) pls suggest, if works reward points.

4 REPLIES 4
Read only

Former Member
0 Likes
511

Check the search help output parameters.System will fill in only those output parameters from search help

award if it helps

krishna

Read only

0 Likes
511

I think you should look at function module DYNP_VALUES_UPDATE (or CALL METHOD c_dynpro_handler=>set_dynp_values which calls this function). There are lots of examples in SAP's code but basically this allows you to push values back onto the screen from within an F4 request.

I've used it, for example, for filling in the name and address details on the screen after the user has selected a customer number from the searchhelp.

You will need to trigger the searchhelp yourself inside your screen e.g.

process on value-request. 
   field gs_9900-my_field
   module d9900_f4_my_field.

and then

module d9900_f4_my_field input.
  perform d9900_f4_my_field.
endmodule.                   

and then something along the lines of

form d9900_f4_my_field.

  data:
    l_dynpprog          like sy-repid,
    l_dynpnr            like sy-dynnr,
    lt_dynpfield        like dynpread,
    lt_dynpfield        like dynpread   occurs 10.

  l_dynpprog    = sy-repid.
  l_dynpnr      = sy-dynnr.

  call function 'F4IF_FIELD_VALUE_REQUEST'  "trigger your search help
     exporting
        ...
     importing
        ...
*
* use the results from 'return_tab-fieldval' to get the other data you want on the screen
* build up lt_dynpfield with the field names and values for the screen e.g.
* 
  clear: ls_dynpfield.
  concatenate 'GS_' l_dynpnr '-CUSTOMER_NAME'
    into ls_dynpfield-fieldname.
  ls_dynpfield-stepl      = 0.
  ls_dynpfield-fieldvalue = kna1-name1.
  ls_dynpfield-fieldinp   = space.
  append ls_dynpfield to lt_dynpfield.
* etc etc 
* then call the function that updates the screen
  call function 'DYNP_VALUES_UPDATE'  "update the screen fields
    exporting
      dyname     = l_dynpprog
      dynumb     = l_dynpnr
    tables
      dynpfields = lt_dynpfield
    exceptions
      others     = 0.

endform.

Let me know how it goes - and if you need any more specific sample code.

Note that there's also function DYNP_VALUES_READ which is handy for reading other screen field values from within a value request... so you can make your searchhelp limit the displayed values based on something else the user just keyed on the screen e.g. a company code.

cheers

jc

Read only

0 Likes
511

Hey just try this piece of code and incase u have any problem get back to me .

declare 3 internal tables as given below .

DATA: itab1 TYPE TABLE OF dfies WITH HEADER LINE,

itab2 TYPE TABLE OF ddshretval WITH HEADER LINE,

itab3 TYPE TABLE OF dselc WITH HEADER LINE,

itab type table of <dbtable> .

write the select query for which u want to retrievr data into another table type the database table .

call the function module

CLEAR i_dfies.

REFRESH i_dfies.

i_dfies-tabname = '<dbtable name>'.

i_dfies-fieldname = '<field name1>'.

APPEND i_dfies.

this is repeated to show the no of fields in the f4 help .

this is written as many times as the no of fields to be displayed .

i_dfies-tabname = '<dbtable name>'.

i_dfies-fieldname = '<field name2>'.

APPEND i_dfies.

this is for mapping the data if u have 2 fields ie the data in the second field should be retrieved according to the data in the first field

i_map-fldname = '<field name 1>'.

i_map-dyfldname = '<dbtablename-fieldname1>'.

APPEND i_map.

i_map-fldname = '<field name 2>'.

i_map-dyfldname = '<dbtablename-fieldname2>'.

APPEND i_map.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

retfield = '<fieldname1>'

dynpprog = sy-repid

dynpnr = sy-dynnr

dynprofield = '<dbtable-name-fieldname1>'

value_org = 'S'

TABLES

value_tab = itab

field_tab = itab1

return_tab = itab2

dynpfld_mapping = itab3.

hope this solves your problem ,

if anything more specific please get back to me .

warm regards.

Read only

Former Member
0 Likes
511

Hi Srikanth,

I think the problem is in creation of search help. While creating you have to specify

1. Out put fields in the search help and

2. You have to see the relation-ship between the fields if they are from different table, I.e you need to have foreign key relationship betn. them

Do write if problem is not solved.

Darshan.

<b><i>Reward Points if this solves your problem</i></b>