cancel
Showing results for 
Search instead for 
Did you mean: 

SQL on HelpTable ?

Former Member
0 Kudos

Hello Friends,

Is it possible to search a feild ( LastName or FirstName) form a helpTable (which I probablly get while calling the BAPI 'BAPI_HELPVALUES_GET') using SQL.

Marek

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

After you get your data into help_table then you can do a search on that table as an internal table and move the contents (results) to a new table.

Former Member
0 Kudos

Hi Craig,

Actually help_table has only one field (values), and this value contains the complete row (firstName, lastName, ..) and If I want to search the table with only ( lastName ), I dont have any picture how to do that !

I guess I need iterator to go through the whole table? is it possible to apply iterator over the table without tableView ? because if I put the iterator and use the following code.

method IF_HTMLB_TABLEVIEW_ITERATOR~RENDER_CELL_START .

DATA: dataValue TYPE STRING,

f1 TYPE STRING,

f2 TYPE STRING,

f3 TYPE STRING,

result TYPE STRING,

LastName TYPE String.

.

MOVE 'MARKUS' TO LastName.

dataValue = m_row_ref->VALUES.

CONDENSE dataValue.

SPLIT dataValue AT SPACE INTO f1 f2 f3 .

IF LastName = f1.

result = dataValue.

EndIF.

endmethod.

Then I am only intrested in the 'result' and want to display only this row! and not the whole table.

And if I use the following code.

method IF_HTMLB_TABLEVIEW_ITERATOR~RENDER_CELL_START .

DATA: dataValue TYPE STRING,

f1 TYPE STRING,

f2 TYPE STRING,

f3 TYPE STRING,

result TYPE STRING,

LastName TYPE String.

.

MOVE 'MARKUS' TO LastName.

dataValue = m_row_ref->VALUES.

CONDENSE dataValue.

SPLIT dataValue AT SPACE INTO f1 f2 f3 .

IF LastName = f1.

result = dataValue.

CASE p_column_key.

WHEN 'LASTNAME'.

p_replacement_bee = cl_htmlb_textview=>factory(

text = f1 ).

WHEN 'FIRSTNAME'.

p_replacement_bee = cl_htmlb_textview=>factory(

text = f2 ).

WHEN 'BUSINESSPARTNERID'.

p_replacement_bee = cl_htmlb_textview=>factory(

text = f3 ).

ENDCASE.

ELSE.

SKIP.

EndIF.

endmethod.

then It shows me the correct row in the table, but other table cells are shown as NULL, ( which is obvious ), is there any way, that I just display one row ( result ) and other cells would not populate as NULL ?

like now I have my VIEW which has search Mask for searching the helptable via LastName ? am I able to use iterator Interface in the Controller class (it would not be any problem ) or ??

Summrize the question?

Is it possible to use iterator over the table without using the tableView, because I dont want to show the complete table rather use iterator to iterate the table inorder to search a particular row ?

Former Member
0 Kudos

Once you have your help_table, then in your code you can seperate help_table (like in the iterator) into a internal table (define the types like I did in the other post) then just loop through or work with the internal table to get the single row and pass that to the tableView.

What I normally do for things like this is create a TABLE TYPE and TABLE/STRUCTURE in my Dictionary Objects then in a METHOD I get the data from the table I want and do all of my manipulating of the data then pass the manipulated table as a returing parameter from the method back to my event handler then to my tableView. I have FILTER in my columndefintions set to = 'X' then in my tableView I have the parameter filter = "server" set then I let the users filter the data themselves.

You can do something similar by only passing a single row of a table back from the METHOD. There's many many ways of doing it.