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

Logical databse in repeat

Former Member
0 Likes
1,573

Hi

I call in loop logical database by FM LDB_PROCESS in different parameters but only first step is return ok

next return error subrc = 1 LDB_NOT_REENTRANT

How to init this calling in second step?

6 REPLIES 6
Read only

sreeramkumar_madisetty
Active Contributor
0 Likes
1,497

Hi

Firstly why you are calling the LDB using FM instead mentioned that in Program attributes and call that using GET statement ?

Regards,

Sreeram

Read only

0 Likes
1,497

It is my need to execute like this

Read only

0 Likes
1,497


then which LDB you are using?

Read only

0 Likes
1,497

ADA but I think it doeasn't matter

Read only

dream_woo2
Explorer
0 Likes
1,497

This message was moderated.

Read only

0 Likes
1,497

A necro post, but I've found a solution.

You need to initialize certain function group variables before next LDB_PROCESS call.

FORM ldb_init_ada.
 DATA:
 lt_fields TYPE STANDARD TABLE OF char40,
 ld_fname TYPE char20.

 FIELD-SYMBOLS:
 <ld_any> TYPE any,
 <ld_fld> LIKE LINE OF lt_fields.

 DEFINE mac_fld.
 concatenate '(SAPLABRA)' &1 into ld_fname.
 append ld_fname to lt_fields.
 END-OF-DEFINITION.

 mac_fld:
 'GD_INDEX',
 'GD_TFILL',
 'GD_ABRA',
 'GD_LAST_OBJ',
 'GD_ACT',
 'GD_SAV',
 'GD_OPEN_SUMANEP',
 'GD_NEW_TRIGGER',
 'GD_COMMIT',
 'GD_VORRAT',
 'GD_CURSOR',
 'GD_CURSOR_SUMANEP',
 'GD_SUMANEP_STOP',
 'GD_SUMANEP_STOP'.

 LOOP AT lt_fields ASSIGNING <ld_fld>.
 ASSIGN (<ld_fld>) TO <ld_any>.
 CHECK sy-subrc EQ 0.

 CLEAR <ld_any>.
 ENDLOOP.

 ASSIGN ('(SAPLSLDBFREE)BAD_LDBS[]') TO <ld_any>.
 CLEAR <ld_any>.
ENDFORM. "ldb_init_ada