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

former_member182371
Active Contributor
0 Likes
1,175

Hi,

i´ve been using FM '

F4IF_INT_TABLE_VALUE_REQUEST

' in order to get the value of an input field in a dynpro of a modulpool.
is it possible to retrieve

two fields

or even a

structure

the same way this FM does?
i´ve even tried with a matchcode but i´m not able to.

Any suggestions?

Best regards.

1 ACCEPTED SOLUTION
Read only

former_member182371
Active Contributor
0 Likes
926

Sorry (sleep seems to take it´s lot)

i repeat the former explanation but correctly

,

the question is that the ztable i´m working with has two key fields:

ZTABLE-NUMDE ZTABLE-KUNNR

the values i´d get would be:

JOHN05001 1 (*)

PETE05001 1

JOHN05001 2 (*)

PETE05001 2

where ZTABLE-NUMDE = SY-UNAME + GJAHR + SEQUENTIAL NUMBER

So i can have several entries with the same value but for different customers (see *).

As you see the disctinction makes sense only if i consider the two fields altogether.

Best regards.

6 REPLIES 6
Read only

Former Member
0 Likes
926

You can only get one field value using this function module but what you can do is to read your input internal table with the value obtained after the call and get the other value.

As an example, let us say you pass an internal table with two fields 'Country code' and 'Country Name" for the call to this function module. User selects, let us say, 'US' and you get that value returned to you after the call to the function module. Then you will do a simple read of your internal table with key country equal to US and get the description.

Hope this makes sense.

Srinivas

Read only

former_member182371
Active Contributor
0 Likes
926

hi Srinivas,

the question is that the ztable i´m working with has two key fields:

ZTABLE-NUMDE ZTABLE-KUNNR

the values i´d get would be:

JOHN05001 1 (*)

PETE05001 2 (*)

JOHN05002 1

PETE05002 2

where ZTABLE-NUMDE = SY-UNAME + GJAHR + SEQUENTIAL NUMBER

So i can have several entries with the same value but for different customers (see *).

As you see the disctinction makes sense only if i consider the two fields altogether.

Best regards.

Read only

0 Likes
926

Hi Calsadillo,

There is another option to achieve what you want to do. Here is the sample code.


TYPES: BEGIN OF ztable,
         numde(20),
         kunnr(10).
TYPES: END OF ztable.

DATA: i_ztable TYPE ztable OCCURS 0 WITH HEADER LINE.

DATA: v_choice TYPE i.

PARAMETERS: p_kunnr LIKE kna1-kunnr DEFAULT '4290'.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_kunnr.

  i_ztable-numde = 'JOHN05001'.
  i_ztable-kunnr = '1'.
  APPEND i_ztable.
  CLEAR i_ztable.
  i_ztable-numde = 'PETE05001'.
  i_ztable-kunnr = '2'.
  APPEND i_ztable.
  CLEAR i_ztable.
  i_ztable-numde = 'JOHN05002'.
  i_ztable-kunnr = '1'.
  APPEND i_ztable.
  CLEAR i_ztable.
  i_ztable-numde = 'PETE05002'.
  i_ztable-kunnr = '2'.
  APPEND i_ztable.
  CLEAR i_ztable.

  CALL FUNCTION 'POPUP_WITH_TABLE_DISPLAY'
       EXPORTING
            endpos_col   = 50
            endpos_row   = 20
            startpos_col = 1
            startpos_row = 1
            titletext    = 'Test'
       IMPORTING
            choise       = v_choice
       TABLES
            valuetab     = i_ztable
       EXCEPTIONS
            break_off    = 1
            OTHERS       = 2.
  IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
            WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  ELSE.
    CLEAR i_ztable.
    READ TABLE i_ztable INDEX v_choice.
    MOVE i_ztable-kunnr TO p_kunnr.
  ENDIF.

Hope this helps,

Srinivas

Read only

former_member182371
Active Contributor
0 Likes
927

Sorry (sleep seems to take it´s lot)

i repeat the former explanation but correctly

,

the question is that the ztable i´m working with has two key fields:

ZTABLE-NUMDE ZTABLE-KUNNR

the values i´d get would be:

JOHN05001 1 (*)

PETE05001 1

JOHN05001 2 (*)

PETE05001 2

where ZTABLE-NUMDE = SY-UNAME + GJAHR + SEQUENTIAL NUMBER

So i can have several entries with the same value but for different customers (see *).

As you see the disctinction makes sense only if i consider the two fields altogether.

Best regards.

Read only

0 Likes
926

Then in that case the only thing that comes to my mind immediately is to have an internal table just for the F4 which has just one field that can accommodate the concatenated value of both NUMDE and KUNNR. Then you can use it as you wish by the offset.

Data: begin of itab occurs 0,

f4_values(50).

data: end of itab.

loop at ztable.

concatenate ztable-numde ztable-kunnr into itab-f4values.

append itab.

clear itab.

endloop.

call the function module.

read table ztable with key numde = returnvalue+0(40)

kunnr = returnvalue+40(10).

50 is just an arbitrary number I came up with, but it should be the total combined field length of all the fields of ztable.

Hope this helps,

Srinivas

Read only

jayanthi_jayaraman
Active Contributor
0 Likes
926

Hi,

The following code illustrates the use of the function module.

F4IF_INT_TABLE_VALUE_REQUEST F4 help that returns the values selected in an internal table. Very handy when programming your very own F4 help for a field.

Example:

data:

begin of t_values occurs 2,

value like kna1-begru,

end of t_values,

t_return like ddshretval occurs 0 with header line.

t_values = 'PAR*'.

append t_values.

t_values = 'UGG'.

append t_values.

call function 'F4IF_INT_TABLE_VALUE_REQUEST'

exporting

retfield = 'BEGRU'

value_org = 'S'

tables

value_tab = t_values

return_tab = t_return

exceptions

parameter_error = 1

no_values_found = 2

others = 3.

if sy-subrc = 0.

read table t_return index 1.

o_begru-low = t_return-fieldval.

if o_begru-low = 'PAR*'.

o_begru-option = 'CP'.

else.

o_begru-option = 'EQ'.

endif.

o_begru-sign = 'I'.

append o_begru to s_begru.

else.

o_begru = i_begru.

endif.

Regards,

J.Jayanthi