Application Development 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: 

Listbox does not populate what I want

Former Member
0 Kudos

I am trying to retrieve my program_ID that are distinct and here are the codes:

-


TYPE-POOLS : vrm.

DATA:wa_itab TYPE vrm_value,

it_itab TYPE vrm_values.

select distinct PROGRAM_ID into wa_itab from ZPROGRAM_TABLE.

endselect.

APPEND wa_itab TO it_itab.

START-OF-SELECTION.

CALL SCREEN 1000.

MODULE STATUS_1000 OUTPUT.

SET PF-STATUS 'SCREEN_1000'.

SET TITLEBAR 'TITLE_1000'.

CALL FUNCTION 'VRM_SET_VALUES'

EXPORTING

ID = 'ZDROPDOWNLIST'

VALUES = it_itab.

ENDMODULE. "STATUS_1000 OUTPUT

-


It populated what is in the column called PROGRAM_ID. However, it only retrieve the latest ID and not the other's ID.

For eg, I have these values at my PROGRAM_ID value.

1

1

1

1

1

2

2

2

As mentioned, I have tried using distinct for my SQL statement and it only retrieve the integer 2. What am I suppose to do to retrieve integer 1 too?

10 REPLIES 10

former_member188829
Active Contributor
0 Kudos

Sorry..Wrong Post.

Edited by: VISHNU on Jan 28, 2008 1:42 PM

Former Member
0 Kudos

Juzme,

See the below code you have to apppend in between select and endselect statement.

select distinct PROGRAM_ID into wa_itab from

ZPROGRAM_TABLE.

APPEND wa_itab TO it_itab.

endselect.

Now it will work.

Don't forget to reward if useful...

0 Kudos

That works and I have already awarded points to you. Now I got a new problem.

My listbox is able to retrieve the value but it appeared like this as this link showed.

http://img301.imageshack.us/img301/8139/screenrs6.png

When I put a break point at this line of code's it_itab you give me:

APPEND wa_itab TO it_itab.

I got this values as shown as this link http://img301.imageshack.us/img301/8175/screen2ju2.png

There is extra row added with a space in front of my value 1. How am I suppose to get rid of the spacing?

0 Kudos

can not open ur liks ..please paste the o/p

0 Kudos

What is o/p?

0 Kudos

What is o/p?

0 Kudos

output

0 Kudos

0 Kudos

iam not able to open ur link please paste the output instead of links.

0 Kudos

Juzme,

Reduce your checkbox visible length to required.See the below syntax.

PARAMETERS :

p_qmart LIKE viqmel-qmart AS LISTBOX VISIBLE

LENGTH 3 ,

Don't forget to reward if useful......