2012 May 21 8:30 AM
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,
2012 May 24 10:26 AM
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 BlockAny 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.
2012 May 24 10:26 AM
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 BlockAny 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.