cancel
Showing results for 
Search instead for 
Did you mean: 

Problem in DropDownBykey UI element

Former Member
0 Kudos

Hi,

i am using DropDownByKey UI element. I am using the following code for displaying tha data in DropDown.

LOOP AT i_org_type  INTO w_org_type.

    value1-key   = sy-tabix.
    value1-value = w_org_type-org_type.
    APPEND value1 TO set.
     ENDLOOP.

value1 is of type wdy_key_value,

set is of type wdy_key_value_table.

This is running fine if sy-tabix is less then 10. But for sy-tabix >= 10, then APPEND statement is giving run time error.

Error analysis is as follow:

The following error text was processed in the system S92 : Error when inserting or changing in a sorted table 
The error occurred on the application server pep74_S92_00 and in the work process 3 . 
The termination type was: RABAX_STATE 
The ABAP call stack was: 
Method: WDDOINIT of program /1BCWDY/E8YS2GY3H6R11XV29QIQ==CP
Method: IF_WDR_VIEW_DELEGATE~WD_DO_INIT of program /1BCWDY/E8YS2GY3H6R11XV29QIQ==CP
Method: DO_INIT of program CL_WDR_DELEGATING_VIEW========CP
Method: INIT_CONTROLLER of program CL_WDR_CONTROLLER=============CP
Method: INIT_CONTROLLER of program CL_WDR_VIEW===================CP
Method: INIT of program CL_WDR_CONTROLLER=============CP
Method: GET_VIEW of program CL_WDR_VIEW_MANAGER===========CP
Method: BIND_ROOT of program CL_WDR_VIEW_MANAGER===========CP
Method: INIT of program CL_WDR_VIEW_MANAGER===========CP
Method: INIT_CONTROLLER of program CL_WDR_INTERFACE_VIEW=========CP

Please suggest.

Regards,

Amit

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Do not access the sy-tabix value directly inside your loop. First declare a variable of type char, then put the

sy-tabix value in the variable and use this for value1-key.

DATA a TYPE char20.

LOOP AT i_org_type  INTO w_org_type.
 a = sy-tabix
    value1-key   = a.
    value1-value = w_org_type-org_type.
    APPEND value1 TO set.
     ENDLOOP.

Regards

Pankaj Aggarwal

Former Member
0 Kudos

Hi,

Since you are using APPEND statement inside loop,

sy-tabix value will change.So,instead use another variable

of type int and assign the sy-tabix value at the first line

of the loop.It lll wrk fine.

Thanks,

Divya.S

Answers (1)

Answers (1)

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

For future postings, please note that this content is not sutiable for the Web Dynpro ABAP forum. This forum is for only Web Dynpro ABAP specific questions - not for all ABAP syntax that might happen to be within a WDA application. For such general questions like looping through an internal table, please use the ABAP General Forum.