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

Function Module error handling

priya_ramani
Participant
0 Likes
523

Hello Techies,

we use a Standard FM 'RSNDI_MD_ATTRIBUTES_UPDATE' for updating infoobject .

So sometimes it fails to update and giving error .

so we use solution like , we are keeping that FM in a DOLOOP for 3 times and making wait for sometime.

So am expecting an alternative solution for avoiding this error and i want to avoid that DOLOOP also .

Thanks in advance .

2 REPLIES 2
Read only

RaymondGiuseppi
Active Contributor
0 Likes
489

Analyze the cause of error, maybe some lock is not immediately released, so an ENQUEUE call on some lock object with _WAIT option, or a select from database for update, could trigger the required wait time?

Regards,
Raymond

Read only

Former Member
0 Likes
489

If it`s ENQUEUE problem, i just a piece of code. 

    DO.

* To check whether there already are a 'E' lock on this object.

     CALL FUNCTION 'ENQUEUE_READ'

       EXPORTING

         gclient               = sy-mandt

       TABLES

         enq                   = lt_enq

       EXCEPTIONS

         communication_failure = 3

         system_failure        = 4.

     IF sy-subrc EQ 0.

       SORT lt_enq BY gname gmode.

       READ TABLE lt_enq INTO ls_enq WITH KEY gname = 'E070' gmode = 'E' BINARY SEARCH.

       IF sy-subrc EQ 0.

         WAIT UP TO 1 SECONDS.

       ELSE.

         EXIT.

       ENDIF.

     ENDIF.

   ENDDO.

  

  CALL FM.



regards,

Archer