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: 

Dynamic search help.

Former Member
0 Kudos

Hi expert...
am facing a problem in my program.
am having 4 fields in my screen,

i want to have dynamic search help in the first field(process code,see image) only when i click 'flag' button (i.e display<>edit ) .

actually i have written a program,but my problem is when i select value from search help,i want the value to display on all fields,currently it displaying on the 1st field only.

Am giving my code here, please help me..

FLOW LOGIC:

PROCESS BEFORE OUTPUT.
MODULE status_0101.
PROCESS AFTER INPUT.
MODULE screen_0101.
PROCESS ON VALUE-REQUEST.
FIELD ZGEN_PRO_TAB-PRO_CODE MODULE MOD_POV.
MODULE mod_pov INPUT.
  IF flag = 'X' AND sy-ucomm = 'FLAG'.
    CALL FUNCTION 'F4IF_FIELD_VALUE_REQUEST'
      EXPORTING
        tabname    = 'ZGEN_PRO_TAB'
        fieldname  = 'PRO_DESCRIPTION'
        searchhelp = 'ZPROCESS'
      TABLES
        return_tab = t_return1.
    SELECT SINGLE * FROM zgen_pro_tab INTO i_dshlp1 WHERE pro_code = t_return1-fieldval.
   zgen_pro_tab-pro_code = i_dshlp1-pro_code.
    zgen_pro_tab-pro_description = i_dshlp1-pro_description.
    zgen_pro_tab-pro_class_descr = i_dshlp1-pro_class_descr.
    zgen_pro_tab-pro_doc_class = i_dshlp1-pro_doc_class.
  ENDIF.
ENDMODULE.                 " MOD_POV  INPUT
t_return1 contains only code value,please help.
1 ACCEPTED SOLUTION

raymond_giuseppi
Active Contributor
0 Kudos
  1. Execute the search help in POV, you get key field as return parameter
  2. Read from database/internal table values of other  fields
  3. Update other fields to screen with FM DYNP_VALUES_UPDATE

Regards,

Raymond

16 REPLIES 16

former_member195270
Active Participant
0 Kudos

Askar Imran,

  Attach function code to field of code and write following code inside MODULE status_0101.

IF flag = 'X' AND sy-ucomm = 'FLAG'.

  SELECT SINGLE * FROM zgen_pro_tab INTO i_dshlp1 WHERE pro_code = zgen_pro_tab-pro_code.
   zgen_pro_tab-pro_code = i_dshlp1-pro_code.
    zgen_pro_tab-pro_description = i_dshlp1-pro_description.
    zgen_pro_tab-pro_class_descr = i_dshlp1-pro_class_descr.
    zgen_pro_tab-pro_doc_class = i_dshlp1-pro_doc_class.

ENDIF.

0 Kudos

Actually Umar,
i want a dynamic search help,
as you are saying to assign Function code for field..
am not getting what you are saying..please read my thread.
thanks
Askar

Former Member
0 Kudos

Hi,

Just assign the selected values onto screen fields from work area..

0 Kudos

If screen fields are different than work area than assign work area fields to screen fields.

0 Kudos

Then convert the same as per the screen field data type and assign

try

condense workarea-field1. etc,.

Screen-field1     =     workarea-field1

screen-field2     =     workarea-field2

Regards,

Praveen

0 Kudos

Thanks for your replies..
actually,am mapping values from internal table to screen field...
am not gettin any other values in return_tab (from FM)

0 Kudos

Actually,i know how to map feilds,
thats not my problem..
am not getting all the values..
i.e the search help contains :

1) CODE  2) DESCRIPTION 3)CLASS 4) CLASS
now when i select value in search help,i want all these values to be displayed on the screen on their corresponding fields,
now,am getting only <1)code> in return_tab.
i want to get all values there,so that it can be mapped to screen fields.


Hope you got my question..
thanks.
Askar

0 Kudos

Hi Askar,

The Function Module will F4IF_FIELD_VALUE_REQUEST return only selected value.

Based on selected value you have use select single query to get the remanining data from table to your work area.

Currently u r using the i_dshlp1 workarea.

Do mention the same work area of type zgen_pro_tab,

Check the values in work area of type zgen_pro_tab in debug mode.

if values comes, Then u assign those to ur screen values.

Regards,

Praveen GVS


0 Kudos

yes,i have exactly done the way you are saying..

and the value comes in work area,and i have matched screen fields properly,

but its not displaying.

may be the problem is since am using

'POV'?

in debugging mode i checked first PAI loads,then PBO loads and finally POV loads.

so,the value, doesn't appear on the rest of field,
Thanks
ASKAR

0 Kudos

You have to work around for code field in a way that PAI should trigger after POV then you will be able to display other fields on screen.You can try by assigning funtion code to code field.

0 Kudos

Could you please tell me how to assign function code to field??
when i checked in screen painter it was not ready for input.

Thanks
ASKAR

Former Member
0 Kudos

Hi Askar Imran,

There should any event to capture it after dynamically generating the search help like enter or any button,then you can capture event in PAI and extract the data based on dynamic search help and map the data from work area to screen fields......It might work

Eg:- after getting the data into CODE field,after that there should be any event to capture that like enter or any button,write the event code in PAI.

0 Kudos

Thank you for ur reply...

as u said,when i press enter or or any button to trigger the PAI it would work,
but, i want it be displayed,when clicking the search help..

Thanks
ASKAR

raymond_giuseppi
Active Contributor
0 Kudos
  1. Execute the search help in POV, you get key field as return parameter
  2. Read from database/internal table values of other  fields
  3. Update other fields to screen with FM DYNP_VALUES_UPDATE

Regards,

Raymond

0 Kudos

Thank you..
i shall try this and tell.
Thanks

ASKAR

0 Kudos

It worked...
Thanks!!

Askar