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

multiple select-option

Former Member
0 Kudos
207

Hi gurus,

I would just like to ask for your ideas on how can I output in ALV the multiple entries in your select-options. Here's the scenario, I have a select-option which is unit of measurement and it can have a multiple entries. The requirement is that I should output in ALV the conversion based on how many are the entries. If there are two entries, I should have 2 conversion and both of them should be in ALV.

I hope you can help me gurus.thanks in advance.

regards,

gizelle

5 REPLIES 5
Read only

rainer_hbenthal
Active Contributor
0 Kudos
191

Just to make it clear: when you enter km and miles in your select-option, you would like to have two columns in your alv showing a distance in km and in miles? And if you select additionally lightyears to your options, you would like to have three columns showng the distance in three units?

Read only

0 Kudos
191

Hi rainer,

Yes your correct. That's how my output should be.

Do you have any ideas on how can I make it?

Thanks in advance.

Read only

0 Kudos
191

Yes, you have to build your fieldcatalog dynamically, the select options are nothing else but a table of type ranges, so just loop over the table like this:

loop at s_measure.

if s_mesure-low = 'km'.

CLEAR wa_fcat.

wa_fcat-fieldname = 'KM'.

wa_fcat-seltext_l = 'Kilometers'.

wa_fcat-seltext_m = 'Kilometers'.

wa_fcat-seltext_s = 'Kilometers'.

APPEND wa_fcat TO it_fcat.

endif.

if s_mesure-low = 'miles'.

CLEAR wa_fcat.

wa_fcat-fieldname = 'MILES'.

wa_fcat-seltext_l = 'Miles'.

wa_fcat-seltext_m = 'Miles'.

wa_fcat-seltext_s = 'Miles'.

APPEND wa_fcat TO it_fcat.

endif.

if s_mesure-low = 'LY'.

CLEAR wa_fcat.

wa_fcat-fieldname = 'LY'.

wa_fcat-seltext_l = 'lightyeras'.

wa_fcat-seltext_m = lightyeras'.

wa_fcat-seltext_s = 'lightyeras'.

APPEND wa_fcat TO it_fcat.

endif.

endloop.

Of course theres a lot more to do but i hope you get the point. You have to foresee every possible measurment and react on this.

Read only

0 Kudos
191

can i create dynamic tables for this? but I dont know how to create a dynamic table. I hope you could help me gurus.thanks.

Read only

0 Kudos
191

Even if you are creating a dynamic table you have to fill the fieldcatalog like i showed you.

I really suggest that you limit down your measures to a fix amount of them and let the user choose via radiobuttons.

Your problem isnt solvable in this forum, its too complex using dynamic tables if you havent a glue of them.