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

Issue with function module F4IF_INT_TABLE_VALUE_REQUEST

Former Member
0 Likes
698

Hi,

I wrote the logic as follows.

Select-options: s_lgart FOR pa0015-lgart.

SELECT lgart FROM t512z INTO TABLE it_temp WHERE infty = '0015' AND lgart IN rlgart.

IF NOT it_temp[] IS INITIAL.

SORT it_temp BY lgart.

DELETE ADJACENT DUPLICATES FROM it_temp COMPARING lgart.

LOOP AT it_temp.

SELECT SINGLE lgtxt FROM t512t INTO it_temp-description

WHERE lgart = it_temp-lgart AND

sprsl = 'EN'.

IF sy-subrc = 0.

MODIFY it_temp INDEX sy-tabix.

ENDIF.

ENDLOOP.

at present in internal table it_temp having following fields.

5100 Relolump sum

5111 SIP

my requirement is : when i press F4 help on wage type in selection screen i am able to see two fields.

i used above function as follows.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

retfield = 'LGART'

dynpprog = sy-repid

dynpnr = sy-dynnr

dynprofield = 'LGART'

value_org = 'S'

TABLES

value_tab = it_temp[]

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.

but it is shwoing first field i.e. wage type but it is not showing wage type description.

anybody can suggest me how to fix this issue.

thanks,

maheedhar

1 ACCEPTED SOLUTION
Read only

MarcinPciak
Active Contributor
0 Likes
660

Ensure you are typing both fields in IT_TEMP as reference to Dictionary type (i.e data element, table field)


data: begin of it_temp occurs 0,
           field1 type char20,                  "no direct type here, only DDIC type 
           field2 type db_table-field,         "same here i.e type as table field
        end of it_temp.

Regards

Marcin

5 REPLIES 5
Read only

Former Member
0 Likes
660

@maheedhar

hi!

write this after select-options

at selection-screen on value-request for <tabname-field name>

also,

Try commenting-

*dynpprog = sy-repid

*dynpnr = sy-dynnr

*dynprofield = 'LGART'

in FM.

Regards,

Sumit

Edited by: Sumit Nene on Aug 10, 2009 9:09 AM

Read only

Former Member
0 Likes
660

Hi,

Try this, it works...

write this after select-options

at selection-screen on value-request for <the field name in select options>

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

RETFIELD = field from int table whose value will be returned

DYNPPROG = SY-CPROG

DYNPNR = SY-DYNNR

DYNPROFIELD = 'screen field'

VALUE_ORG = 'S'

TABLES

VALUE_TAB = internal table whose values will be shown.

EXCEPTIONS

parameter_error = 1

no_values_found = 2

others = 3.

Thanks,

Read only

MarcinPciak
Active Contributor
0 Likes
661

Ensure you are typing both fields in IT_TEMP as reference to Dictionary type (i.e data element, table field)


data: begin of it_temp occurs 0,
           field1 type char20,                  "no direct type here, only DDIC type 
           field2 type db_table-field,         "same here i.e type as table field
        end of it_temp.

Regards

Marcin

Read only

Mohamed_Mukhtar
Active Contributor
0 Likes
660

hi,


TABLES pa0015.
SELECT-OPTIONS: s_lgart FOR pa0015-lgart.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_lgart-low.
  PERFORM f_f4help.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_lgart-high.
  PERFORM f_f4help.

*&---------------------------------------------------------------------*
*&      Form  f_f4help
*&---------------------------------------------------------------------*
FORM f_f4help .
  DATA : BEGIN OF it_temp OCCURS 0,
         lgart TYPE t512z-lgart,
         description TYPE t512t-lgtxt,
         END OF it_temp.
  SELECT lgart FROM t512z INTO CORRESPONDING FIELDS OF  TABLE it_temp WHERE infty = '0015' AND lgart IN s_lgart.

  IF NOT it_temp[] IS INITIAL.
    SORT it_temp BY lgart.
    DELETE ADJACENT DUPLICATES FROM it_temp COMPARING lgart.

    LOOP AT it_temp.
      SELECT SINGLE lgtxt FROM t512t INTO it_temp-description
      WHERE lgart = it_temp-lgart AND
      sprsl = 'EN'.
      IF sy-subrc = 0.
        MODIFY it_temp INDEX sy-tabix.
      ENDIF.
    ENDLOOP.
  ENDIF.
  CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
    EXPORTING
      retfield        = 'LGART'
      dynpprog        = sy-repid
      dynpnr          = sy-dynnr
      dynprofield     = 'LGART'
      value_org       = 'S'
    TABLES
      value_tab       = it_temp[]
    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.
ENDFORM.                                                    " f_f4help

Read only

Mohamed_Mukhtar
Active Contributor
0 Likes
660

hi,


TABLES pa0015.
SELECT-OPTIONS: s_lgart FOR pa0015-lgart.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_lgart-low.
  PERFORM f_f4help.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_lgart-high.
  PERFORM f_f4help.

*&---------------------------------------------------------------------*
*&      Form  f_f4help
*&---------------------------------------------------------------------*
FORM f_f4help .
  DATA : BEGIN OF it_temp OCCURS 0,
         lgart TYPE t512z-lgart,
         description TYPE t512t-lgtxt,
         END OF it_temp.
  SELECT lgart FROM t512z INTO CORRESPONDING FIELDS OF  TABLE it_temp WHERE infty = '0015' AND lgart IN s_lgart.

  IF NOT it_temp[] IS INITIAL.
    SORT it_temp BY lgart.
    DELETE ADJACENT DUPLICATES FROM it_temp COMPARING lgart.

    LOOP AT it_temp.
      SELECT SINGLE lgtxt FROM t512t INTO it_temp-description
      WHERE lgart = it_temp-lgart AND
      sprsl = 'EN'.
      IF sy-subrc = 0.
        MODIFY it_temp INDEX sy-tabix.
      ENDIF.
    ENDLOOP.
  ENDIF.
  CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
    EXPORTING
      retfield        = 'LGART'
      dynpprog        = sy-repid
      dynpnr          = sy-dynnr
      dynprofield     = 'LGART'
      value_org       = 'S'
    TABLES
      value_tab       = it_temp[]
    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.
ENDFORM.                                                    " f_f4help