Quantcast
Channel: SCN : Blog List - ABAP Development
Viewing all articles
Browse latest Browse all 943

Display BDCMSGCOLL Log ( BDCMSGCOLL / BAPIRET2 )

$
0
0

As a developer, we frequently come across BDC / BAPI developments. When we have BDC and BAPI, Error Handling plays a crucial rule.

 

Recently, I was engaged in a development of BDC. And when it comes to BDC. BDCMSGCOLL plays a crucial role when opting for 'CALL TRANSACTION' method.

 

Here, in my case, I need to simply display a meaning full messages that are returned after 'Call Transaction' into BDCMSGCOLL.

 

Instead going pillar to post, a simple combination of function modules does the entire job required. The output and sample coding as in below.

 

Function Modules Used :

  • CONVERT_BDCMSGCOLL_TO_BAPIRET2
  • RSCRMBW_DISPLAY_BAPIRET2

*  messages of call transaction
DATA:   messtabTYPESTANDARDTABLEOFbdcmsgcoll,
            
bapiret2TYPESTANDARDTABLEOFbapiret2.

****************************SOME BDC Here************

   PERFORMbdc_field   USING'BDC_CURSOR'   'DF05B-PSBET(01)'.
  
PERFORMbdc_field   USING'RF05A-ABPOS'   '1'.
*
  
ct_params-defsize = 'X'.
  
ct_params-updmode = 'L'.
  
ct_params-dismode = p_mode.


  
CALLTRANSACTION'FB05'USINGbdcdata
  
OPTIONSFROMct_params
  
MESSAGESINTOmesstab.

*Convert BDCMSGCOLL to BAPIRET2
CALLFUNCTION'CONVERT_BDCMSGCOLL_TO_BAPIRET2'
  
TABLES
  
imt_bdcmsgcoll = messtab[]
  
ext_return  = bapiret2.
*

*Display messages from BAPIRET2
  
CALLFUNCTION'RSCRMBW_DISPLAY_BAPIRET2'
  
TABLES
  
it_return = bapiret2.

 

With Combination of above two function modules, following desired out put obtained with out any custom code.

 

Output:

BAPIRET2 msg.png

 

Always giving a simple search into utility function modules from the standard SAP Repository is quite a rewarding. you will come out clean with no bug-fixing and formatting almost every time.

 

*with SAP_ABA 731


Viewing all articles
Browse latest Browse all 943

Trending Articles



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