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

F4 help is not working

Former Member
0 Likes
2,187

Hi,

For the below code I am not getting the F4 help.

SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-003.

PARAMETERS : p_type TYPE char1.

SELECTION-SCREEN END OF BLOCK b3.

TYPES: BEGIN OF ty_values,

desc TYPE char20,

num TYPE char1,

END OF ty_values.

DATA: lv_field TYPE dfies-fieldname,

wa_values TYPE ty_values,

it_values TYPE STANDARD TABLE OF ty_values,

ls_return TYPE ddshretval,

it_return TYPE STANDARD TABLE OF ddshretval,

wa_fields TYPE dfies,

it_fields TYPE STANDARD TABLE OF dfies.

wa_values-num = '1'.

wa_values-desc = 'Internal'.

APPEND wa_values TO it_values.

wa_values-num = '2'.

wa_values-desc = 'External Supplier'.

APPEND wa_values TO it_values.

wa_values-num = '3'.

wa_values-desc = 'Internal all Info'.

APPEND wa_values TO it_values.

wa_values-num = '4'.

wa_values-desc = 'External Specific Supplier'.

APPEND wa_values TO it_values.

wa_fields-fieldname = 'DESC'.

wa_fields-SCRTEXT_M = 'Description'.

wa_fields-intlen = '20'.

wa_fields-outputlen = '20'.

APPEND wa_fields TO it_fields.

wa_fields-fieldname = 'NUM'.

wa_fields-SCRTEXT_M = 'Number'.

wa_fields-intlen = '1'.

wa_fields-outputlen = '1'.

APPEND wa_fields TO it_fields.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

retfield = 'NUM'

dynprofield = 'P_TYPE'

value_org = 'S'

TABLES

value_tab = it_values

field_tab = it_fields

return_tab = it_return

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 it_return INTO ls_return

WITH KEY fieldname = 'NUM'.

IF sy-subrc EQ 0.

p_type = ls_return-fieldval.

ENDIF.

Thanks,

Srinivas.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,292

Use

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

After event AT SELECTION-SCREEN OUTPUT.

7 REPLIES 7
Read only

Former Member
0 Likes
1,293

Use

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

After event AT SELECTION-SCREEN OUTPUT.

Read only

0 Likes
1,292

Hi,

I am using after at selection screen event only. I am getting the output but i am not getting the values in the F4 help output for one field.

Thanks,

srinivas.

Read only

0 Likes
1,292

As metioned by Patric

Use FM after this event

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_pcgrp.

it will work fine

Read only

0 Likes
1,292

Hi,

Don't use below parameter in FM. And pass SY-REPID.You are doing in right way Other than these two.

field_tab = it_fields

return_tab = it_return

Read only

0 Likes
1,292

Hi,

I have done few modifications. I guess it ahs to work now. Please use the function module as metioned in the "AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_type."

And if you are using this coe in ECC 6.0, then you have to be careful with the lengths you are passing for the it_fields table. As in ECC 6.0, the internal length is double.You have to give offset for fields in the table. eg. if first field 20 lenght, then for the second field in the search help you have to give offset length as 20. An it is better to pass DYNPTYPE and INTTYPE for the it_fields table.

Changed code:-

SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-003.

PARAMETERS : p_type TYPE char1.

SELECTION-SCREEN END OF BLOCK b3.

TYPES: BEGIN OF ty_values,

desc TYPE char20,

num TYPE char1,

END OF ty_values.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_type.

DATA: lv_field TYPE dfies-fieldname,

wa_values TYPE ty_values,

it_values TYPE STANDARD TABLE OF ty_values,

ls_return TYPE ddshretval,

it_return TYPE STANDARD TABLE OF ddshretval,

wa_fields TYPE dfies,

it_fields TYPE STANDARD TABLE OF dfies.

wa_values-num = '1'.

wa_values-desc = 'Internal'.

APPEND wa_values TO it_values.

wa_values-num = '2'.

wa_values-desc = 'External Supplier'.

APPEND wa_values TO it_values.

wa_values-num = '3'.

wa_values-desc = 'Internal all Info'.

APPEND wa_values TO it_values.

wa_values-num = '4'.

wa_values-desc = 'External Specific Supplier'.

APPEND wa_values TO it_values.

wa_fields-fieldname = 'DESC'.

wa_fields-SCRTEXT_M = 'Description'.

wa_fields-intlen = '40'.

wa_fields-outputlen = '40'.

APPEND wa_fields TO it_fields.

wa_fields-fieldname = 'NUM'.

wa_fields-SCRTEXT_M = 'Number'.

wa_fields-offset = '40'.

wa_fields-intlen = '2'.

wa_fields-outputlen = '2'.

APPEND wa_fields TO it_fields.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

retfield = 'NUM'

dynprofield = 'P_TYPE'

value_org = 'S'

TABLES

value_tab = it_values

field_tab = it_fields

return_tab = it_return

EXCEPTIONS

parameter_error = 1

no_values_found = 2

OTHERS = 3.

IF sy-subrc ne 0.

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

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

ENDIF.

READ TABLE it_return INTO ls_return

WITH KEY fieldname = 'NUM'.

IF sy-subrc EQ 0.

p_type = ls_return-fieldval.

ENDIF.

Read only

0 Likes
1,292

Hi Krishna,

Really thanks, it worked.

Thanks,

srinvas.

Read only

Former Member
0 Likes
1,292

Hi,

Try to trigger the selection screen event using AT SELECTION-SCREEN, the following is the sample of retrieving relevant Profit Center:


*----------------------------------------------------------------------*
* AT SELECTION-SCREEN - P_PCGRP (Profit Center Group)                  *
*----------------------------------------------------------------------*
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_pcgrp.

  CLEAR: i_pcgrp[], i_pcgrp, v_report, v_dynpro.

  SELECT a~setname b~descript
    INTO TABLE i_pcgrp
    FROM setleaf AS a
    LEFT JOIN setheadert AS b
    ON  b~setname = a~setname
    AND b~langu = sy-langu
    WHERE a~setclass = '0106'.

* delete duplicated profit centre group in internal table.
  DELETE ADJACENT DUPLICATES FROM i_pcgrp
                COMPARING pcgrp.

  v_report = sy-repid.
  v_dynpro = sy-dynnr.

* Call F4 Help Sub-screen
  CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
    EXPORTING
      retfield    = 'PCGRP'
      dynpprog    = v_report
      dynpnr      = v_dynpro
      dynprofield = 'P_PCGRP'
      value_org   = 'S'
    TABLES
      value_tab   = i_pcgrp.

Hope the above helps.

Patrick