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

Problem with Query and ENM Logical DDBB

Former Member
0 Likes
766

   Hi,

I have a problem with one query that uses ENM Logical Data Base.

I Set as filter criteria one field from ekkn Table (WEMPF), it has another filters as (EKKO-EBELN, EKKO-EKORG...)

If i run the query without filtering by EKKN-WEMPF the query returns the correct rows. But if i run the query filtering by that field, it returns the same rows as if it haven´t filtered. The difference is that if one row contains the value of the filter, it appears on its column. Otherwise, the column appears with no value.

Example.

Without filtering by ekkn-wempf (sin Filtro.JPG)

Filtering by ekkn-wempf value 154322 (Con Filtro.JPG)

Thanks,

Regards,

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
668

Hi,

I have found the solution, following the instructions of this post.

Regards,

http://stackoverflow.com/questions/3765373/how-do-i-do-a-select-distinct-using-a-sap-infoset-query

How to access the data set & limit the records after the selection:

Disclaimer: This feels very much like a hack, it does not work for all the output types, but it does show how you could access the data set.

In code block INITIALIZATION add the following statement:

* Dummy comment to force generation 
* of END-OF-SELECTION Block

Any comment will do - all this does is force the program generator to generate the END-OF-SELECTION block which we need to access the data set.

In code block END-OF-SELECTION add the following:

data: lv_table type char100 value '%G00[]'.
field-symbols: <table> type any table.
assign (lv_table) to <table>.
if <table> is assigned.
  sort <table>.
  delete adjacent duplicates from <table>.
endif.

%G00 is the variable name of the resultset in the generated program (use [] to access the table, not just the header line). As the generated program variables are not available in the Infoset, you have to use field-symbols to access any variables. If the variable does not exist, the check for assignment will avoid any run-time errors.

Limitation: When executing the query in "ABAP List mode" this code has no effect, this is because in this case the list is written as the data is being selected, therefore any manipulation after the fact is too late.

   Hi,

I have a problem with one query that uses ENM Logical Data Base.

I Set as filter criteria one field from ekkn Table (WEMPF), it has another filters as (EKKO-EBELN, EKKO-EKORG...)

If i run the query without filtering by EKKN-WEMPF the query returns the correct rows. But if i run the query filtering by that field, it returns the same rows as if it haven´t filtered. The difference is that if one row contains the value of the filter, it appears on its column. Otherwise, the column appears with no value.

Example.

Without filtering by ekkn-wempf (sin Filtro.JPG)

Filtering by ekkn-wempf value 154322 (Con Filtro.JPG)

Thanks,

Regards,

1 REPLY 1
Read only

Former Member
0 Likes
669

Hi,

I have found the solution, following the instructions of this post.

Regards,

http://stackoverflow.com/questions/3765373/how-do-i-do-a-select-distinct-using-a-sap-infoset-query

How to access the data set & limit the records after the selection:

Disclaimer: This feels very much like a hack, it does not work for all the output types, but it does show how you could access the data set.

In code block INITIALIZATION add the following statement:

* Dummy comment to force generation 
* of END-OF-SELECTION Block

Any comment will do - all this does is force the program generator to generate the END-OF-SELECTION block which we need to access the data set.

In code block END-OF-SELECTION add the following:

data: lv_table type char100 value '%G00[]'.
field-symbols: <table> type any table.
assign (lv_table) to <table>.
if <table> is assigned.
  sort <table>.
  delete adjacent duplicates from <table>.
endif.

%G00 is the variable name of the resultset in the generated program (use [] to access the table, not just the header line). As the generated program variables are not available in the Infoset, you have to use field-symbols to access any variables. If the variable does not exist, the check for assignment will avoid any run-time errors.

Limitation: When executing the query in "ABAP List mode" this code has no effect, this is because in this case the list is written as the data is being selected, therefore any manipulation after the fact is too late.