Skip to Content
0
Former Member
Feb 09, 2011 at 11:38 AM

F4IF_INT_TABLE_VALUE_REQUEST value_tab cleared

183 Views

Hi all,

i'm using the bapi in object.

I use it in a table control.

It runs well when i start it for the first time.

If i open the match code for the second field the value_tab is displayed with initial values:

1st time: SRVPOS KTEXT1

1 descr1

2 descr2... ecc

2nd time KTEXT1 KTEXT1

0000000 descr1

0000000 descr2... ecc

The header too is not correct.

Anybody can help me?

Thanks.

-


MY CODE----

DATA: field_tab LIKE dfies OCCURS 0 WITH HEADER LINE.

DATA: return_tab TYPE ddshretval OCCURS 0 WITH HEADER LINE.

* DATA: BEGIN OF value_tab OCCURS 0,

* srvpos like esll-srvpos,

* ktext1 like esll-ktext1,

* END OF value_tab.

DATA: value_tab LIKE esll OCCURS 0 WITH HEADER LINE.

CLEAR: value_tab, return_tab.

REFRESH value_tab[].

REFRESH field_tab[].

REFRESH return_tab[].

field_tab-fieldname = 'SRVPOS'.

field_tab-tabname = 'ESLL'.

field_tab-offset = '18'.

field_tab-position = '1'.

field_tab-keyflag = 'X'.

field_tab-intlen = 15.

field_tab-leng = 15.

field_tab-outputlen = 15.

field_tab-scrtext_m = 'Prestazione'.

APPEND field_tab.

CLEAR field_tab.

field_tab-fieldname = 'KTEXT1'.

field_tab-tabname = 'ESLL'.

field_tab-position = '2'.

field_tab-offset = '40'.

field_tab-intlen = 15.

field_tab-leng = 15.

field_tab-outputlen = 15.

field_tab-scrtext_m = 'Descrizione'.

APPEND field_tab.

CLEAR field_tab.

DATA: check_fieldval LIKE return_tab-fieldval.

LOOP AT tadd.

MOVE-CORRESPONDING tadd TO value_tab.

APPEND value_tab.

CLEAR value_tab.

ENDLOOP.

CLEAR tadd.

SORT value_tab.

DELETE ADJACENT DUPLICATES FROM value_tab.

*****

CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'

EXPORTING

retfield = 'SRVPOS'

value_org = 'S'

dynpprog = sy-repid

dynpnr = sy-dynnr

TABLES

value_tab = value_tab

field_tab = field_tab

return_tab = return_tab

EXCEPTIONS

parameter_error = 1

no_values_found = 2

OTHERS = 3.

IF sy-subrc = 0.

wins-srvpos = return_tab-fieldval.

ENDIF.

Edited by: SAPDUMMY on Feb 9, 2011 12:38 PM