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

parameter with f4 help

Former Member
0 Likes
836

Hi all,

I have created ztable with search help, in my programe i was declared like,

PARAMETERS : field1 like ztable-field1 MATCHCODE OBJECT ' '.

in o/p : ' field1 f4 help' shows all the values in ztable.

i want only field1 values in corresponding f4help.other fields in ztable i no need.so how to extract it.kindly help me.

thanks advance.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
795

Check below code in which F4 functionality for second comes as per first select option.

Selection screen:-

SELECT-OPTIONS: s_bukrs FOR gs_bseg-bukrs OBLIGATORY NO-EXTENSION, " Company code

SELECT-OPTIONS: s_sbgrp FOR gs_knkk-sbgrp NO-EXTENSION, " Credit Rep. Group

Main program

  • Value request on Credit Rep. Group.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_sbgrp-low.

PERFORM sub_search_help_sbgrp.

  • Value request on Credit Rep. Group.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_sbgrp-high.

PERFORM sub_search_help_sbgrp.

Actual Code:-

&----


*& Form sub_search_help_sbgrp

&----


  • Search Help for Credit Rep. Group based on company code value

----


FORM sub_search_help_sbgrp .

DATA: lv_bukrs LIKE LINE OF s_bukrs.

CLEAR gs_dynfields.

  • Assigning the company code value to the table (DYNPREAD) Fields of the current screen (with values)

gs_dynfields-fieldname = 'S_BUKRS-LOW'.

APPEND gs_dynfields TO gt_dynfields.

gs_dynfields-fieldname = 'S_BUKRS-HIGH'.

APPEND gs_dynfields TO gt_dynfields.

  • Call this function module to get the values of selection screen for company code

CALL FUNCTION 'DYNP_VALUES_READ'

EXPORTING

dyname = sy-cprog

dynumb = sy-dynnr

translate_to_upper = 'X'

TABLES

dynpfields = gt_dynfields

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.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

  • Get the values obtained for company code into select options s_bukrs

CLEAR gs_dynfields.

FREE: lv_bukrs, s_bukrs.

READ TABLE gt_dynfields INTO gs_dynfields WITH KEY fieldname = 'S_BUKRS-LOW'.

IF sy-subrc = 0.

s_bukrs-low = gs_dynfields-fieldvalue.

ENDIF.

CLEAR gs_dynfields.

READ TABLE gt_dynfields INTO gs_dynfields WITH KEY fieldname = 'S_BUKRS-HIGH'.

IF sy-subrc = 0.

s_bukrs-high = gs_dynfields-fieldvalue.

ENDIF.

lv_bukrs-low = s_bukrs-low.

lv_bukrs-high = s_bukrs-high.

IF lv_bukrs-high IS NOT INITIAL.

lv_bukrs-option = 'BT'.

ELSE.

lv_bukrs-option = 'EQ'.

ENDIF.

lv_bukrs-sign = 'I'.

APPEND lv_bukrs TO s_bukrs .

IF s_bukrs IS NOT INITIAL.

  • Get the data from Credit management: Credit representative groups (t024b) into internal table

SELECT kkber sbgrp stext

FROM t024b

INTO CORRESPONDING FIELDS OF TABLE gt_t024b

WHERE kkber IN s_bukrs.

IF sy-subrc EQ 0.

SORT gt_t024b BY kkber sbgrp.

ENDIF.

  • Passing the data of internal table gt_t691b to get the search help for credit group

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

retfield = 'sbgrp'

dynpprog = sy-cprog

dynpnr = sy-dynnr

dynprofield = 's_bukrs-low'

value_org = 'S'

TABLES

value_tab = gt_t024b

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.

ENDIF.

ENDFORM. " sub_search_help_sbgrp

NOTE:

gt_dynfields TYPE TABLE OF dynpread, " Fields of the current screen (with values)

gs_dynfields TYPE dynpread, " Fields of the current screen (with values)

Rewards if useful....

Minal

5 REPLIES 5
Read only

seshatalpasai_madala
Product and Topic Expert
Product and Topic Expert
0 Likes
795

Hi,

For the search help that you created, check the Parameter of the search help.

From there remove the parameters that you dont want in the search help.

But still when you have created a search help and assigned it at the table level to the field, why are you still using MATCH CODE?.

Regards,

Sesh

Read only

Former Member
0 Likes
795

HI,

In the Search help, you need to mention the export and import parametres, there mention only the fields which you wanted when you press the F4

Regards

Sudheer

Read only

Former Member
0 Likes
796

Check below code in which F4 functionality for second comes as per first select option.

Selection screen:-

SELECT-OPTIONS: s_bukrs FOR gs_bseg-bukrs OBLIGATORY NO-EXTENSION, " Company code

SELECT-OPTIONS: s_sbgrp FOR gs_knkk-sbgrp NO-EXTENSION, " Credit Rep. Group

Main program

  • Value request on Credit Rep. Group.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_sbgrp-low.

PERFORM sub_search_help_sbgrp.

  • Value request on Credit Rep. Group.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_sbgrp-high.

PERFORM sub_search_help_sbgrp.

Actual Code:-

&----


*& Form sub_search_help_sbgrp

&----


  • Search Help for Credit Rep. Group based on company code value

----


FORM sub_search_help_sbgrp .

DATA: lv_bukrs LIKE LINE OF s_bukrs.

CLEAR gs_dynfields.

  • Assigning the company code value to the table (DYNPREAD) Fields of the current screen (with values)

gs_dynfields-fieldname = 'S_BUKRS-LOW'.

APPEND gs_dynfields TO gt_dynfields.

gs_dynfields-fieldname = 'S_BUKRS-HIGH'.

APPEND gs_dynfields TO gt_dynfields.

  • Call this function module to get the values of selection screen for company code

CALL FUNCTION 'DYNP_VALUES_READ'

EXPORTING

dyname = sy-cprog

dynumb = sy-dynnr

translate_to_upper = 'X'

TABLES

dynpfields = gt_dynfields

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.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

  • Get the values obtained for company code into select options s_bukrs

CLEAR gs_dynfields.

FREE: lv_bukrs, s_bukrs.

READ TABLE gt_dynfields INTO gs_dynfields WITH KEY fieldname = 'S_BUKRS-LOW'.

IF sy-subrc = 0.

s_bukrs-low = gs_dynfields-fieldvalue.

ENDIF.

CLEAR gs_dynfields.

READ TABLE gt_dynfields INTO gs_dynfields WITH KEY fieldname = 'S_BUKRS-HIGH'.

IF sy-subrc = 0.

s_bukrs-high = gs_dynfields-fieldvalue.

ENDIF.

lv_bukrs-low = s_bukrs-low.

lv_bukrs-high = s_bukrs-high.

IF lv_bukrs-high IS NOT INITIAL.

lv_bukrs-option = 'BT'.

ELSE.

lv_bukrs-option = 'EQ'.

ENDIF.

lv_bukrs-sign = 'I'.

APPEND lv_bukrs TO s_bukrs .

IF s_bukrs IS NOT INITIAL.

  • Get the data from Credit management: Credit representative groups (t024b) into internal table

SELECT kkber sbgrp stext

FROM t024b

INTO CORRESPONDING FIELDS OF TABLE gt_t024b

WHERE kkber IN s_bukrs.

IF sy-subrc EQ 0.

SORT gt_t024b BY kkber sbgrp.

ENDIF.

  • Passing the data of internal table gt_t691b to get the search help for credit group

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

retfield = 'sbgrp'

dynpprog = sy-cprog

dynpnr = sy-dynnr

dynprofield = 's_bukrs-low'

value_org = 'S'

TABLES

value_tab = gt_t024b

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.

ENDIF.

ENDFORM. " sub_search_help_sbgrp

NOTE:

gt_dynfields TYPE TABLE OF dynpread, " Fields of the current screen (with values)

gs_dynfields TYPE dynpread, " Fields of the current screen (with values)

Rewards if useful....

Minal

Read only

Former Member
0 Likes
795

Hi,

refer to the following code:

AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_WERK.

REFRESH ITEMP.

CLEAR ITEMP.

SELECT WERKS

NAME1

FROM T001W

INTO TABLE ITEMP

WHERE IWERK = 'M011'.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

  • DDIC_STRUCTURE = ' '

RETFIELD = 'WERKS'

  • PVALKEY = ' '

  • DYNPPROG = ' '

  • DYNPNR = ' '

  • DYNPROFIELD = ' '

  • STEPL = 0

  • WINDOW_TITLE =

  • VALUE = ' '

VALUE_ORG = 'S'

  • MULTIPLE_CHOICE = ' '

  • DISPLAY = ' '

  • CALLBACK_PROGRAM = ' '

  • CALLBACK_FORM = ' '

TABLES

VALUE_TAB = ITEMP

  • FIELD_TAB =

RETURN_TAB = T_RETURN

  • 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.

P_WERK = T_RETURN-FIELDVAL.

Hope this helps.

Reward if helpful.

Regards,

Sipra

Read only

Former Member
0 Likes
795

thankx for all.