Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8573

Re: Bapi to post two FI documents in MB1B.

$
0
0

Hi,

 

It seems you are trying to put commit work statement inside Update task. System throws a dump when you put commit work statement inside update function module. 

 

Remove the statement

 

   CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

            EXPORTING

              WAIT          = 'X'.

         IMPORTING

          RETURN        = return

                 .

       WRITE: /'BAPI cal worked'.



You can separately add the FI document after the material document is created. By calling :


1) BAPI   CALL FUNCTION 'BAPI_ACC_GL_POSTING_POST'  in background task  in the exit.


2)  Or create a wrapper FM . Call that FM in starting new task. Use  while and wait statement to check whether document exists in the database (MKPF). If yes, call the BAPI 'BAPI_ACC_GL_POSTING_POST'. Disadvantage of this process is that , it  opens a new session. If number of open session is more than 6-7( maintained in profile parameter) update fails.



Regards,

DPM


Viewing all articles
Browse latest Browse all 8573

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>