Application Development 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: 

Problem with LDB_PROCESS .. Not working in Loop

Former Member
0 Kudos
749

Hi Experts,

I am using FM LDB_PROCESS for calling PNM LDB iteratively for some data in internal table.

For the first record it works well and give me corresponding node values.

But for other line items/records of internal table, it does n't give me any output , although some of these line items contain exactly the same data as contained in first record.

Kindly help.

Regards,

Vikas

1 ACCEPTED SOLUTION

raymond_giuseppi
Active Contributor
0 Kudos
394

There was a problem with repeated call of the function module for some LDB some years ago, but most were solved via OSS notes from 2003 (like [Note 648739 - Call of IOC logical database with LDB_PROCESS|https://service.sap.com/sap/support/notes/648739]) look at OSS for your system version., or put a BREAK-POINT at "PERFORM LDB_PROCESS_INIT" in FM LDB_PROCESS. (Also do you check exception LDB_NOT_REENTRANT Logical database not intended for multiple calls ?)

Else you may try [CALL FUNCTION LDB_CALL_LDB_PROCESS STARTING NEW TASK|http://help.sap.com/abapdocu_70/en/ABAPCALL_FUNCTION_STARTING.htm#!ABAP_ADDITION_2@2@], receiving the result in a form, so 1-bypass the initialization problems, 2-parallelization of your process...

Regards,

Raymond

5 REPLIES 5

raymond_giuseppi
Active Contributor
0 Kudos
395

There was a problem with repeated call of the function module for some LDB some years ago, but most were solved via OSS notes from 2003 (like [Note 648739 - Call of IOC logical database with LDB_PROCESS|https://service.sap.com/sap/support/notes/648739]) look at OSS for your system version., or put a BREAK-POINT at "PERFORM LDB_PROCESS_INIT" in FM LDB_PROCESS. (Also do you check exception LDB_NOT_REENTRANT Logical database not intended for multiple calls ?)

Else you may try [CALL FUNCTION LDB_CALL_LDB_PROCESS STARTING NEW TASK|http://help.sap.com/abapdocu_70/en/ABAPCALL_FUNCTION_STARTING.htm#!ABAP_ADDITION_2@2@], receiving the result in a form, so 1-bypass the initialization problems, 2-parallelization of your process...

Regards,

Raymond

0 Kudos
394

Dear Raymond,

I tried debugging the FM but it is not stopping at the perform you mentioned.

Then I opted for CALL FUNCTION 'LDB_CALL_LDB_PROCESS' starting new task v_task_id.

If I don't use "starting new task v_task_id" it gives dump at the following part of 'LDB_CALL_LDB_PROCESS' , stating Result table incompatible.

CALL FUNCTION 'LDB_CALLBACK'

DESTINATION 'BACK'

TABLES

CALLBACK_TAB = G_CALLBACK

RESULTS = RESULTS

LDBNODES = I_LDBS.

But if I use CALL FUNCTION 'LDB_CALL_LDB_PROCESS' starting new task v_task_id then it does n't give me any results.

Kindly help.

Regards,

Vikas

0 Kudos
394

Two remarks

- [RFC Destination|http://help.sap.com/abapdocu_70/en/ABENRFC_DESTINATION.htm] : use Destination "NONE", "BACK" is used by a called function to call back to its caller

- Receive results : add a [PERFORMING <subroutine> ON END OF TASK|http://help.sap.com/abapdocu_70/en/ABAPCALL_FUNCTION_STARTING.htm#!ABAP_ADDITION_2@2@], in this task a [RECEIVE RESULTS FROM FUNCTION|http://help.sap.com/abapdocu_70/en/ABAPRECEIVE.htm] statement will get the result back.

Regards,

Raymond

Former Member
0 Kudos
394

LDB was not meant to be processed in loop.

0 Kudos
394

Hi,

You can add this code after calling LDB_PROCESS

DATA: L_FIELD(40). 
FIELD-SYMBOLS: <FS>.
L_FIELD = '(SAPLSLDBFREE)BAD_LDBS[]'. 
ASSIGN (L_FIELD) TO <FS>.
CLEAR <FS>.