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

F4IF_INT_TABLE_VALUE_REQUEST Problem

Former Member
0 Likes
1,450

Hi Folks,

I have problem with FM F4IF_INT_TABLE_VALUE_REQUEST

Here is the scenario.

i have interbnal table tbwerks[] that contains plant and description(two fields).

DATA: BEGIN OF tbwerks OCCURS 10,

werks LIKE t001w-werks,

name1 like t001w-name1,

END OF tbwerks .

then i am populating values to internal table.

now i want to display all the plants in listbox.

for that i am using the following FM

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

retfield = 'TBWERKS-WERKS'

value_org = 'S'

TABLES

value_tab = tbwerks[]

EXCEPTIONS

parameter_error = 1

no_values_found = 2

OTHERS = 3.

IF sy-subrc <> 0.

ENDIF.

But, here i am getting all descriptions insted of plants.

can't we use internal table with two fields here..?

what could be the problem..

sara

8 REPLIES 8
Read only

Former Member
0 Likes
1,174

hi

try this...

TABLES

value_tab = tbwerks-werks

Read only

Former Member
0 Likes
1,174

Hi Sara,

This function module initially returns only single value.

In order to get two values, you have to write a simple code for that.

pass these two parameters in FM

CALLBACK_PROGRAM

CALLBACK_FORM

and you have to write code to assign the other value also.

regards

shylesh

Read only

0 Likes
1,174

hi sailesh

i just want to display plants.i don't want to be displayed two columns in listbox.

the thing is, listbox is showing all plant descriptions insted of displaying plants.

though my internal table has plant and description values

i would like to see only plants not descriptions.

sara

Read only

0 Likes
1,174

Hi Sara,

Then i am really not sure. Coz, I worked on this FM to return two fields. But try passing the parameter DDIC_STRUCTURE = 'your internal table name'.

Read only

Former Member
0 Likes
1,174

Hi Sara,

In your code you are passing retfield wrongly in the function module..Correct it as follows and it should work

DATA: BEGIN OF tbwerks OCCURS 10,

werks LIKE t001w-werks,

name1 like t001w-name1,

END OF tbwerks .

then i am populating values to internal table.

now i want to display all the plants in listbox.

for that i am using the following FM

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

retfield = TBWERKS-WERKS

value_org = 'S'

TABLES

value_tab = tbwerks[]

EXCEPTIONS

parameter_error = 1

no_values_found = 2

OTHERS = 3.

IF sy-subrc 0.

ENDIF.

Reward points if it helps!!!

Anthony.

Read only

Former Member
0 Likes
1,174

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

retfield = 'TBWERKS-WERKS'

value_org = 'S'

TABLES

value_tab = tbwerks " check this here v use internal table without [].

EXCEPTIONS

parameter_error = 1

no_values_found = 2

OTHERS = 3.

IF sy-subrc 0.

ENDIF.

Read only

Former Member
0 Likes
1,174

Hei Sara,

I've the similar requirement as yours. In my case, the two columns are Administrator and Administrator name ( instead of plant and plant description ) and I've solved the problem this way :

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_sachx.

PERFORM build_dropdown.

FORM build_dropdown.

TYPES:BEGIN OF ty_admin,

sachx LIKE t526-sachx,

sachn LIKE t526-sachn,

END OF ty_admin.

DATA:it_admin TYPE TABLE OF ty_admin,

it_return TYPE STANDARD TABLE OF ddshretval.

DATA:wa_admin LIKE LINE OF it_admin,

wa_return LIKE LINE OF it_return.

DATA:l_retfield TYPE dfies-fieldname.

  • Get HR administrators

SELECT sachx sachn FROM t526 INTO CORRESPONDING FIELDS OF TABLE it_admin

WHERE sachx LIKE 'H%'.

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

retfield = l_retfield

value_org = 'S'

TABLES

value_tab = it_admin

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 wa_return INDEX 1.

READ TABLE it_admin INTO wa_admin WITH KEY

sachn = wa_return-fieldval.

WRITE wa_admin-sachx TO p_sachx.

  • Refresh it_admin, otherwise valuse in the drop-down will keep on

  • adding up each time

REFRESH:it_admin.

ENDFORM. " build_dropdown

It's working fine...

Regards,

Rudresh

Read only

Former Member
0 Likes
1,174

go through this once

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST‘

EXPORTING

retfield = 'MATNR'

DYNPPROG = progname

DYNPNR = sy-dynnr

DYNPROFIELD = 'MARA-MATNR '

WINDOW_TITLE = ' Select Materials From the List‘ VALUE_ORG = 'S‘

tables value_tab = itab

EXCEPTIONS

PARAMETER_ERROR = 1

NO_VALUES_FOUND = 2

OTHERS = 3 .

retfield : Name of the column whose value is to be

returned .

dynpprog : Name of the program .

dynpnr : value of sy-dynnr

dynprofield : name of the field where value is to be returned

value-org = 'S'

( the internal table to be passed has a flat structure.Every line in VALUE_TAB then corresponds to one line in the list of values)

value_tab : internal table to be passed with values

plz reward if useful

keep rockin

vivek