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

Problem in f4 help with the function module F4IF_INT_TABLE_VALUE_REQUEST

Former Member
0 Likes
630

Hi to all experts,

I need get f4 help for a field in a table control in a screen which depends on the other screen,This my code dont why but getting sy-subrc Eq 2 no values found.in the internal table in the select there are values after the select statement. im passing the values to the function module

TYPES: BEGIN OF ty_segm,
          segmt TYPE t71adm22t-segmt,
          ltext TYPE t71adm22t-ltext,
       END OF ty_segm.

  DATA: lt_segm TYPE STANDARD TABLE OF ty_segm,
        ls_segm LIKE LINE OF lt_segm.


  DATA: field_tab TYPE TABLE OF dfies WITH HEADER LINE,
        return_tab TYPE TABLE OF ddshretval WITH HEADER LINE.

  SELECT segmt ltext FROM t71adm22t INTO TABLE lt_segm
     WHERE carea = zhrv0007-carea AND
           dimsn = zhrv0007-dims1 AND
           langu = 'E'.

  field_tab-fieldname = 'SEGMT'.
  field_tab-tabname   = 'LT_SEGMT'.
  APPEND field_tab.
   field_tab-fieldname = 'LTEXT'.
  field_tab-tabname   = 'LT_SEGMT'.
  APPEND field_tab.

  CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
    EXPORTING
*   DDIC_STRUCTURE         = ' '
      retfield               = 'SEGMT' *"return field in the internal table* 
*   PVALKEY                = ' '
   DYNPPROG               = SY-REPID
   DYNPNR                 = SY-DYNNR
   DYNPROFIELD            = 'ZHRV0007-SEGM1'  *"screen fields*
*   STEPL                  = 0
*   WINDOW_TITLE           =
*   VALUE                  = ' '
   VALUE_ORG              = 'S'
*   MULTIPLE_CHOICE        = ' '
*   DISPLAY                = ' '
*   CALLBACK_PROGRAM       = ' '
*   CALLBACK_FORM          = ' '
*   MARK_TAB               =
* IMPORTING
*   USER_RESET             =
    TABLES
     value_tab              = lt_segm "containing values 
*     field_tab              = field_tab " 
     return_tab             = return_Tab "return table 
*   DYNPFLD_MAPPING        =
 EXCEPTIONS
   PARAMETER_ERROR        = 1
   NO_VALUES_FOUND        = 2
   OTHERS                 = 3
            .
  IF sy-subrc = 0.
    READ TABLE return_Tab INDEX 1.
    zhrv0007-SEGM1 = return_tab-fieldval.

  ENDIF.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
557

Hi,

Please check exporting parameters that are passed to function module.

Please see below program for your reference.

REPORT ztest_f4help.

TABLES:sscrfields.

DATA: t_return LIKE ddshretval OCCURS 0 WITH HEADER LINE.

DATA: BEGIN OF t_f4 OCCURS 0,

connid TYPE spfli-connid,

END OF t_f4.

SELECTION-SCREEN: BEGIN OF BLOCK b1.

PARAMETERS: p_carrid TYPE s_carr_id,

p_connid TYPE s_conn_id.

SELECTION-SCREEN : END OF BLOCK b1.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_connid.

DATA: t_scrval TYPE STANDARD TABLE OF dynpread WITH HEADER LINE.

t_scrval-fieldname = 'P_CARRID'.

APPEND t_scrval.

CALL FUNCTION 'DYNP_VALUES_READ'

EXPORTING

dyname = 'ZTEST_F4HELP'

dynumb = '1000'

TABLES

dynpfields = t_scrval

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.

DATA: w_fld TYPE help_info-dynprofld VALUE 'P_CONNID',

w_scr TYPE sy-dynnr ,

w_prog TYPE sy-repid VALUE sy-repid,

w_ret TYPE dfies-fieldname VALUE 'CONNID'.

w_scr = sy-dynnr.

READ TABLE t_scrval INDEX 1.

IF sy-subrc EQ 0.

TRANSLATE t_scrval-fieldvalue TO UPPER CASE.

SELECT connid

FROM spfli

INTO TABLE t_f4

WHERE carrid = t_scrval-fieldvalue.

ENDIF.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

retfield = w_ret

dynpprog = w_prog

dynpnr = w_scr

dynprofield = w_fld

value_org = 'S'

TABLES

value_tab = t_f4

return_tab = t_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.

Thanks & Regards,

Rajni MV.

Hi to all experts,

I need get f4 help for a field in a table control in a screen which depends on the other screen,This my code dont why but getting sy-subrc Eq 2 no values found.in the internal table in the select there are values after the select statement. im passing the values to the function module

TYPES: BEGIN OF ty_segm,
          segmt TYPE t71adm22t-segmt,
          ltext TYPE t71adm22t-ltext,
       END OF ty_segm.

  DATA: lt_segm TYPE STANDARD TABLE OF ty_segm,
        ls_segm LIKE LINE OF lt_segm.


  DATA: field_tab TYPE TABLE OF dfies WITH HEADER LINE,
        return_tab TYPE TABLE OF ddshretval WITH HEADER LINE.

  SELECT segmt ltext FROM t71adm22t INTO TABLE lt_segm
     WHERE carea = zhrv0007-carea AND
           dimsn = zhrv0007-dims1 AND
           langu = 'E'.

  field_tab-fieldname = 'SEGMT'.
  field_tab-tabname   = 'LT_SEGMT'.
  APPEND field_tab.
   field_tab-fieldname = 'LTEXT'.
  field_tab-tabname   = 'LT_SEGMT'.
  APPEND field_tab.

  CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
    EXPORTING
*   DDIC_STRUCTURE         = ' '
      retfield               = 'SEGMT' *"return field in the internal table* 
*   PVALKEY                = ' '
   DYNPPROG               = SY-REPID
   DYNPNR                 = SY-DYNNR
   DYNPROFIELD            = 'ZHRV0007-SEGM1'  *"screen fields*
*   STEPL                  = 0
*   WINDOW_TITLE           =
*   VALUE                  = ' '
   VALUE_ORG              = 'S'
*   MULTIPLE_CHOICE        = ' '
*   DISPLAY                = ' '
*   CALLBACK_PROGRAM       = ' '
*   CALLBACK_FORM          = ' '
*   MARK_TAB               =
* IMPORTING
*   USER_RESET             =
    TABLES
     value_tab              = lt_segm "containing values 
*     field_tab              = field_tab " 
     return_tab             = return_Tab "return table 
*   DYNPFLD_MAPPING        =
 EXCEPTIONS
   PARAMETER_ERROR        = 1
   NO_VALUES_FOUND        = 2
   OTHERS                 = 3
            .
  IF sy-subrc = 0.
    READ TABLE return_Tab INDEX 1.
    zhrv0007-SEGM1 = return_tab-fieldval.

  ENDIF.

4 REPLIES 4
Read only

Former Member
0 Likes
557

Hi,

Please comment below two 'Exporting' parameters and try.

DYNPPROG = SY-REPID

DYNPNR = SY-DYNNR

Thanks,

Renjith.

Read only

Former Member
0 Likes
558

Hi,

Please check exporting parameters that are passed to function module.

Please see below program for your reference.

REPORT ztest_f4help.

TABLES:sscrfields.

DATA: t_return LIKE ddshretval OCCURS 0 WITH HEADER LINE.

DATA: BEGIN OF t_f4 OCCURS 0,

connid TYPE spfli-connid,

END OF t_f4.

SELECTION-SCREEN: BEGIN OF BLOCK b1.

PARAMETERS: p_carrid TYPE s_carr_id,

p_connid TYPE s_conn_id.

SELECTION-SCREEN : END OF BLOCK b1.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_connid.

DATA: t_scrval TYPE STANDARD TABLE OF dynpread WITH HEADER LINE.

t_scrval-fieldname = 'P_CARRID'.

APPEND t_scrval.

CALL FUNCTION 'DYNP_VALUES_READ'

EXPORTING

dyname = 'ZTEST_F4HELP'

dynumb = '1000'

TABLES

dynpfields = t_scrval

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.

DATA: w_fld TYPE help_info-dynprofld VALUE 'P_CONNID',

w_scr TYPE sy-dynnr ,

w_prog TYPE sy-repid VALUE sy-repid,

w_ret TYPE dfies-fieldname VALUE 'CONNID'.

w_scr = sy-dynnr.

READ TABLE t_scrval INDEX 1.

IF sy-subrc EQ 0.

TRANSLATE t_scrval-fieldvalue TO UPPER CASE.

SELECT connid

FROM spfli

INTO TABLE t_f4

WHERE carrid = t_scrval-fieldvalue.

ENDIF.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

retfield = w_ret

dynpprog = w_prog

dynpnr = w_scr

dynprofield = w_fld

value_org = 'S'

TABLES

value_tab = t_f4

return_tab = t_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.

Thanks & Regards,

Rajni MV.

Read only

Former Member
0 Likes
557

Hi Mohammed,

I copied the code that you have pasted in to a test program and executed it. It does return the value that i select from the F4 help that pops up. So, try to debug the program again and check the values in the internal table after the select statement.

The code looks ok to me.

Best Regards,

Ram.

Read only

Former Member
0 Likes
557

write your select query after

AT SELECTION-SCREEN on VALUE-REQUEST FOR segmt-low.

and call the fm 'F4IF_INT_TABLE_VALUE_REQUEST'