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: 

F4 help needed in Process on value-request

Former Member
0 Kudos

Hi,

I have two fields on screen: region and its description in a dialog program. I want region description to be populated as soon as I select F4 help for region. Description field is output only . I want to do it using a module in Process On value-request. Field p_region MODULE GET_REGION_DESCRIPTION.

Using standard F4 help I can do it. If in my table I assign search help at field level for region. For example :

Search Help: ZREGION_SHLP. Selection method: ZREGION. Fields: Region and Description.

Table name : ZREGION.

i) 1st Fields: REGION , Data Element - ZREGN, Domain: ZZREGN ( CHAR2), Value table: ZREGN. Assign Search help at field level instead of data element level.

ii) 2nd Field: REGION_DESC, Data Element - BEZEI30.

in program: DATA: p_region like zregion-region. So if I press F4 help and select one region, description field gets populated.

I don't want to use standard functionality but want to write code in POV event. If I use F4IF_INT_TABLE_VLUE_REQUEST function module, I will get all the values associated with the field region. Since I don't know which region user has selected, i can't populate description. How to get the selected value in POV for that particular field. How can I get the value selected for region and then use DYNP_VALUES_UPDATE function module to update the description field. I tried search help exit event return to return the selected value. How to pass that value in POV module as you cannot use FORM ENDFORM . inside MODULE ENDMODULE.

Regards,

DPM

1 ACCEPTED SOLUTION

Clemenss
Active Contributor
0 Kudos

Hi DEBOPRIYO,

FM F4IF_INT_TABLE_VALUE_REQUEST provides TABLES parameter RETURN_TAB that will provide the value selected by user.

Regards,

Clemens

5 REPLIES 5

Clemenss
Active Contributor
0 Kudos

Hi DEBOPRIYO,

FM F4IF_INT_TABLE_VALUE_REQUEST provides TABLES parameter RETURN_TAB that will provide the value selected by user.

Regards,

Clemens

Former Member
0 Kudos

Thanks Clemens,

I know that RETURN_TAB holds the value selected in hitlist. One thing I haven't tested is for the same field on which you are doing F4 does the value RETURN_TAB contains anything. The thing I have done before is Suppose there are two fields on selection screen. One is filled, and on another field you want to do F4 whose value depends on the value put on the 1st field. One can use 'DYNP_VALUES_READ' to hold value for the first field and then using 'F4IF_INT_TABLE_VALUE_REQUEST' we can get return_tab. From that RETURN_TAB , we can get the value selected for first field and then using 'DYNP_VALUE_UPDATE' populate the second field.

Regards,

Debopriyo

GirieshM
Active Contributor
0 Kudos

1st step is:

choose screen 2000 for the program using t-code se80.

at the end of the coding enter the below code:

process ON VALUE-REQUEST.

FIELD screen field name module f4_zsearchhelp.

after typing the code double click on f4_zsearch help.

it ll ask for includes, Choose as main program.

then enter the below code after choosing:

DATA : t_dynpro_value TYPE TABLE OF dynpread,

v_field_value LIKE LINE OF t_dynpro_value,

lt_fields TYPE TABLE OF dfies,

t_return_str TYPE TABLE OF ddshretval,

w_return_str TYPE ddshretval,

v_text TYPE char25.

DATA: t_ty_prov_id TYPE STANDARD TABLE OF ty_prov_id,

w_ty_prov_id TYPE ty_prov_id.

CLEAR: t_ty_prov_id], w_ty_prov_id, t_return_str[, w_return_str.

enter the select query from the description table to get the description for the particular code.

in this i had mentioned with an example that i m getting description for massg :

p9001-massg ll have the value and v_text ll have the description.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

  • DDIC_STRUCTURE = 'TY_TAB'

retfield = 'MASSG'------>returning field

  • PVALKEY = ' '

dynpprog = sy-repid

dynpnr = sy-dynnr

dynprofield = 'P9001-ZMASSG'----


> pass the screen field name

  • STEPL = 0

  • WINDOW_TITLE =

  • VALUE = ' '

value_org = 'S'

  • MULTIPLE_CHOICE = ' '

  • DISPLAY = ''

  • CALLBACK_PROGRAM = ' '

  • CALLBACK_FORM = ' '

  • MARK_TAB =

  • IMPORTING

  • USER_RESET =

TABLES

value_tab = t_ty_prov_id

  • field_tab = lt_fields

return_tab = t_return_str

  • DYNPFLD_MAPPING =

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.

READ TABLE t_return_str INTO w_return_str WITH KEY retfield = 'P9001-ZMASSG'.

IF sy-subrc IS INITIAL.

READ TABLE t_ty_prov_id INTO w_ty_prov_id WITH KEY zmassg_desc = w_return_str-fieldval.

IF sy-subrc eq 0.

  • DATA: et_desc(20) TYPE c.

  • et_desc = w_ty_agrtx-v_gtext.

*

  • MODIFY SCREEN.

CLEAR : v_field_value,t_dynpro_value[].

v_field_value-fieldname = 'P9001-ZMASSG'.

v_field_value-fieldvalue = w_ty_prov_id-action_resn.

APPEND v_field_value TO t_dynpro_value .

CLEAR : v_field_value.

v_field_value-fieldname = 'V_TEXT'.

v_field_value-fieldvalue = w_ty_prov_id-zmassg_desc.

APPEND v_field_value TO t_dynpro_value .

CLEAR : v_field_value.

ENDIF .

ENDIF.

CALL FUNCTION 'DYNP_VALUES_UPDATE'

EXPORTING

dyname = sy-cprog

dynumb = sy-dynnr

TABLES

dynpfields = t_dynpro_value

EXCEPTIONS

invalid_abapworkarea = 1

invalid_dynprofield = 2

invalid_dynproname = 3

invalid_dynpronummer = 4

invalid_request = 5

no_fielddescription = 6

undefind_error = 7

OTHERS = 8.

IF sy-subrc 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

you can add the v_text in layput .

hope it ll satisfy your requirement.

Former Member
0 Kudos

Hi,

Follow the below steps.

1. Retrieve the regions and descriptions into one internal table.

2. Use the above internal table for F4 display.

3. Once region selected by using F4 help, then use the parameter RETURN_TAB and read the above internal table with that value and get the description and pass it to corresponding field.

4. Suppose instead F4, user can also type the value, in this case

5. Check entered value is correct or not in CHAIN - ENDCHAIN in PAI from the above internal table.

6. and fill the description field from the above internal table once satisfied the step 5.

Regards,

Chandu V

Former Member
0 Kudos

Thanks all of you for your support and cooperation. It is working now.