cancel
Showing results for 
Search instead for 
Did you mean: 

how can i get data in the iterator

Former Member
0 Kudos

Hello, i´ve got an iterator.

To fill a dropdown box i have to select data from a db.

so far...

i use cookies to get the select-parameters in the iterator but, it says "unknown field: runtime->"

does anybody know a solution ?

Accepted Solutions (0)

Answers (3)

Answers (3)

rainer_liebisch
Contributor
0 Kudos

Hi Benjamin,

you can use a constructor method where you read your values from DB and finally use them for your dropdown listbox. Here an example:


  method constructor.
    DATA: m_row_ref        TYPE REF TO SFLIGHT,
          m_color_ref      TYPE REF TO DATA,
          entry            TYPE        IHTTPNVP,
          entrytab         TYPE        TIHTTPNVP.

    entry-name = 'key_red'.
    entry-value = 'Red'.
    append entry to entrytab.

    entry-name = 'key_green'.
    entry-value = 'Green'.
    append entry to entrytab.

    entry-name = 'key_blue'.
    entry-value = 'Blue'.
    append entry to entrytab.

    entry-name = 'key_black'.
    entry-value = 'Black'.
    append entry to entrytab.

    get reference of entrytab into m_color_ref.

  endmethod.                    "CONSTRUCTOR

You can also read values from db into your internal table instead.

In your iterator you use:


        p_replacement_bee = cl_htmlb_dropdownlistbox=>factory(
                              id  = p_cell_id
                              selection = 'key_green'
                              table = me->m_color_ref
                              nameofkeycolumn   = 'NAME'
                              nameofvaluecolumn = 'VALUE' ).

Regards,

Rainer

Former Member
0 Kudos

Hello, thanks for your answers. I did it like Rainer has explained.

Can i use a dropdownbox to show 2 columns ?

For an example: Key Column is "CarNumber"

and an other olumn with "Model of the car"

I didn´t find any example.

THX

athavanraja
Active Contributor
0 Kudos

concatenate the Car Number and Model of the car into the value field (may be with a separator or space)

Regards

Raja

Former Member
0 Kudos

Hi,

can you tellme if i can use concatenante ?

Because i have to use 2 columns

(each with about 400 entries)

which are part of the same table ?

I thought concatenante can only characterband and no columns ?

athavanraja
Active Contributor
0 Kudos

let me explain by slightly modifying Rainer's code sample.

method constructor.  
  DATA: m_row_ref        TYPE REF TO SFLIGHT,    
      m_color_ref      TYPE REF TO DATA,  
        entry            TYPE        IHTTPNVP, 
         entrytab         TYPE        TIHTTPNVP. 
   entry-name = 'key_red'.   
concatenate 'Red' '1998' into  entry-value separated by '|' .    
append entry to entrytab.  
  entry-name = 'key_green'.  
concatenate 'Green' '2000' into  entry-value separated by '|' .     
append entry to entrytab.  
  entry-name = 'key_blue'.  
concatenate 'Blue' '2003' into  entry-value separated by '|' .    
 append entry to entrytab.   
 entry-name = 'key_black'.   
concatenate 'Black' '2005' into  entry-value separated by '|' .    
append entry to entrytab.    
get reference of entrytab into m_color_ref. 
 endmethod.                    "CONSTRUCTOR

Regards

Raja

Former Member
0 Kudos

Hi,

for tableview the sample code is as follows...

<htmlb:tableView id="net200_tv" table="<%= it_flight%>" iterator="<%=iterator%>" selectionMode="LINEEDIT" onRowSelection="my_select" footerVisible="FALSE"/>

Regards,

Azaz Ali.

Former Member
0 Kudos

hi i know the tv code.

My Problem is:

i have to make a select in the iterator. Here i need some select-parameters, which are hold in the BSP page.

Former Member
0 Kudos

Hi Benjamin,

Declare the seleciton parameter say G1, G2 as global parameters of the iterator class, create the constructor of your class with two importing variables say ig1 and ig2. Then while creating iterator pass your selct opitons.

Create object iterator exporting ig1 = s1 ig2 = s2.

In the constructor of iterator give g1 = ig1 g2 = ig2.

Regards,

Arun.

Former Member
0 Kudos

Hi,

Populate the data from database into an internal table and declare that internal table as page attribute and then give that table as attrbite to that dropdownlistbox as shown below....

<htmlb:dropdownListBox id="Matnr"

table="<%= it_mara1%>"

nameOfKeyColumn="Matnr"

nameOfValueColumn="Matnr">

</htmlb:dropdownListBox>

Regards,

Azaz Ali.

Former Member
0 Kudos

Hello,

i cannot use your solution because i use a tableview.

Thanks

Regards