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

help on value request

Former Member
0 Likes
555

Hi all,

can anyone help me out with the following code in finding F4 help for the fiscal year .

while executing it is going to dump. The problem I fing is with the value_org = 'S'.

thanks....

AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_GJAHR.

SELECT DISTINCT GJAHR FROM COSS

INTO CORRESPONDING FIELDS OF TABLE LT_GJAHR

UP TO 10 ROWS.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

RETFIELD = 'GJAHR'

DYNPPROG = SY-REPID

DYNPNR = SY-DYNNR

DYNPROFIELD = 'P_GJAHR'

VALUE_ORG = 'S'

TABLES

VALUE_TAB = LT_GJAHR

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.

1 ACCEPTED SOLUTION
Read only

former_member156446
Active Contributor
0 Likes
476

Check the decleration of LT_GJAHR.

Update: This works fine in my system... except its taking time to get the help..

REPORT  zj_test LINE-SIZE 162.

PARAMETER: p_gjahr TYPE vbrk-gjahr.

DATA: BEGIN OF lt_gjahr OCCURS 0,
        gjahr TYPE vbrk-gjahr,
      END OF lt_gjahr.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_gjahr.

  SELECT DISTINCT gjahr FROM coss
  INTO TABLE lt_gjahr
  UP TO 10 ROWS.

  CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
    EXPORTING
      retfield        = 'GJAHR'
      dynpprog        = sy-repid
      dynpnr          = sy-dynnr
      dynprofield     = 'P_GJAHR'
      value_org       = 'S'
    TABLES
      value_tab       = lt_gjahr
    EXCEPTIONS
      parameter_error = 1
      no_values_found = 2
      OTHERS          = 3.
  IF sy-subrc <> 0.

  ENDIF.

3 REPLIES 3
Read only

former_member156446
Active Contributor
0 Likes
477

Check the decleration of LT_GJAHR.

Update: This works fine in my system... except its taking time to get the help..

REPORT  zj_test LINE-SIZE 162.

PARAMETER: p_gjahr TYPE vbrk-gjahr.

DATA: BEGIN OF lt_gjahr OCCURS 0,
        gjahr TYPE vbrk-gjahr,
      END OF lt_gjahr.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_gjahr.

  SELECT DISTINCT gjahr FROM coss
  INTO TABLE lt_gjahr
  UP TO 10 ROWS.

  CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
    EXPORTING
      retfield        = 'GJAHR'
      dynpprog        = sy-repid
      dynpnr          = sy-dynnr
      dynprofield     = 'P_GJAHR'
      value_org       = 'S'
    TABLES
      value_tab       = lt_gjahr
    EXCEPTIONS
      parameter_error = 1
      no_values_found = 2
      OTHERS          = 3.
  IF sy-subrc <> 0.

  ENDIF.

Read only

0 Likes
476

thanks jay

there is a problem with int table declaration.

Read only

amit_khare
Active Contributor
0 Likes
476

You can refer to Function Module documentation in SE37. The usage is explained there.