3

Is there a function Module to call a logical Database via function module or classes?

In my case I would need PNPCE, so it is the HCM Module.

Sandra Rossi
  • 11,934
  • 5
  • 22
  • 48
Sasku
  • 517
  • 7
  • 23
  • 4
    Personally I avoid dealing with LDBs whenever possible. They were declared obsolete decades ago, and for good reason. Most of the time it's pretty simple to build a view to replace them with. Especially now with the more powerful CDS views. Could you elaborate on why exactly you need this? Perhaps there is a better way to achieve that goal. – Philipp Sep 10 '20 at 11:22
  • I do too. But sometimes I've got requirements from customers to use them and I can't get around this. Once I've been in a company and I developed a custom report and didn't use the LDB ( even though it was a requirement ). Authorization-Checks and data selection was all fine, but they wanted that I use the LDB because their developers only work with them. So I needed to change my report. Since then it happend quite a lot. This is why I am working with it, at least when needed... – Sasku Sep 11 '20 at 08:35

1 Answers1

7

You can use the function module LDB_PROCESS.

Here the SAP documentation.

But remember, LDB are obsolete.

Philipp
  • 67,764
  • 9
  • 118
  • 153
I.B.N.
  • 992
  • 4
  • 15
  • Thanks! I think it is not really possible to call the selection screen via FM, is it? I know they are obsolete, but sometimes I must use them, because of customer wants / requires them, just one of a few disadvantages of the HCM-module. Most of the developers are old fashioned and don't want to use new and "fancy" techniques like CDS.. at least those who I know. – Sasku Sep 11 '20 at 08:39
  • @Sasku If you want the selection screen, then why don't you create an executable program which is based on this logical database and you call this program instead of `LDB_PROCESS`? – Sandra Rossi Sep 11 '20 at 09:27
  • @Sandra: some ldbs offer good selection screens, but as it is said in the answer they are obsolete. But if I don't need to use the selection but want the screen I would be able to have the best of 2 worlds (selection screen of ldb and my selection). It's just that I am lazy and don't want to build the screen over and over again or if I want to build a transaction only with the use of classes. Then I call a function module ( yeah I know I could just build one) which has the dynpro included. So there are use cases. But my original question is solved with the fm ldb_process – Sasku Sep 12 '20 at 16:18