‎2014 Jul 09 10:48 AM
Hi,
There is one query which is using logical database PNM. I have got one requirement to add one field in selection screen to filter the output. The field which is required to be displayed in selection screen to filter the data is from table mkal which is not present in logical database. Hence my question is, is it possible to add field from table which is not present in logical database? IF yes, please specify the procedure.
‎2014 Jul 09 11:12 AM
Hi Imran,
You can add your field using code in the SAP Query Infoset Tcode SQ02. In the below screen you can see selections option is there when you add your field and used in free code area as a selection otherwise you can copy LDB in custom LDB and add your field in the custom LDB after that use your LDB in the SAP Query.
Regards,
Prasenjit
‎2014 Jul 09 11:12 AM
Hi Imran,
You can add your field using code in the SAP Query Infoset Tcode SQ02. In the below screen you can see selections option is there when you add your field and used in free code area as a selection otherwise you can copy LDB in custom LDB and add your field in the custom LDB after that use your LDB in the SAP Query.
Regards,
Prasenjit
‎2014 Jul 09 11:18 AM
Hi Prasenjit,
It is giving me error as the table is not present in logical database. Your second option I will try.
‎2014 Jul 09 11:44 AM
‎2014 Jul 09 11:52 AM
Hi Jogeswara,
Here it is not mentioned what method is used to fetch data. I want to dispay field in selection screen of a query which is using LDB. Also the field is from a table which is not present in LDB? Can we do that?
‎2014 Jul 09 11:59 AM
I'm hinting at that only. You may need to add a Z field (like the field you desired) and write your logic to meet your requirements.
Anyways, Best of luck
Jogeswara Rao K
‎2014 Jul 09 1:10 PM
Hi Jogeswara,
I went to that thread. I could not understand steps mentioned in sq01. Can you please elaborate here. Thanks in advance.
‎2014 Jul 09 1:43 PM
Hi Jogeswara,
I understood your reference. But I have to restrict the data based on the values of fields of table which is not present in LDB. How will we do that ? I mean how to join tables present in LDB with a table which is not present in LDB? Any inputs will be of great help.
Many thanks in advance.
Regards,
Imran Kundan.
‎2014 Jul 09 1:48 PM
You need to use Coding in Extras.
Like
Check <fieldname> NE '<value>' in Record Processing section.
OR
Selecting the value from the table into a local variable equating to the LDB field name. and then writing your logic based on this value.
‎2014 Jul 14 10:39 AM
Hi Jogeswara,
Thanks for your inputs.
But my question is, how can I filter the data which is being fetched by standard logical database. I cannot go inside the std. LDB and change internal tables of it. I tried coding in extras, but I think it works only if we want to add additional fields in output.
At present, we are considering the option of creating a z LDB where we copy. std. LDB and also add the reqd. table which is not present in LDB.
Is there any other option?
Please provide your valuable inputs.
Regards,
Imran Kundan.
‎2014 Jul 14 10:46 AM
Hello Imran,
Prima facie, it seems to me you have a genuine reason to got ZLDB. The point where you reached I am yet to experience. I always avoided LDB the primary reason being the Selection screen is totally out of control.
However, if something strikes I'd tell.
‎2014 Jul 14 10:47 AM
But filtering a data does not seem to be a complex problem, with the Check syntax I already referred.
Example:(with LDB Notifications, code in Free Coding)
CHECK RQMQMEL-QMART <> 'M2'.
‎2014 Jul 14 11:07 AM
Hi Jogeswara,
Many thanks for quick reply.
But the prblem is, I have to add a field on selection screen from a table which is not present in LDB and then filter the values coming from LDB? That is where, I am stuck.
Can we do that?
Regards,
Imran Kundan.
‎2014 Jul 14 11:24 AM
Follow steps like this
Create an Additional field.(say Zfield)
Give a code to this field (like Zfield = viqmel-ausbs - viqmel-ausvn)
Now give the check syntax in the END-OF-SELECTION (before list) section or (other suitable section) like: CHECK ZFIELD > '2'.