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

Query using logical database

Former Member
0 Likes
5,815

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.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
3,688


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

13 REPLIES 13
Read only

Former Member
0 Likes
3,689


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

Read only

0 Likes
3,688

Hi Prasenjit,

It is giving me  error as the table is not present in logical database. Your second option I will try.

Read only

0 Likes
3,688

Hi IMRAN,

You may go through the conversation between Se-Uk Moon and the author in the comments section of document   This seems relevant to your requirement.


Jogeswara Rao K

Read only

0 Likes
3,688

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?


Read only

0 Likes
3,688

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

Read only

0 Likes
3,688

Hi Jogeswara,

I went to that thread. I could not understand steps mentioned in sq01. Can you please elaborate here. Thanks in advance.

Read only

0 Likes
3,688

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.

Read only

0 Likes
3,688

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.

Read only

0 Likes
3,688

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.

Read only

0 Likes
3,688

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.

Read only

0 Likes
3,688

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'.

Read only

0 Likes
3,688

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.

Read only

jogeswararao_kavala
Active Contributor
0 Likes
3,688

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'.