<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Catching Errors in Call Transaction in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/catching-errors-in-call-transaction/m-p/6083076#M1357278</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;  You can use it like below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
CALL TRANSACTION 'ME21' USING bdcdata MODE 'N' UPDATE 'S' MESSAGES INTO it_message.
LOOP AT it_message.
CALL FUNCTION 'FORMAT_MESSAGE'
EXPORTING
id = it_message-msgid      
lang = it_message-msgspra
no = it_message-msgnr
v1 = it_message-msgv1
v2 = it_message-msgv2
IMPORTING
msg = v_msg
EXCEPTIONS
not_found = 1
OTHERS = 2.
ENDLOOP.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Himanshu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 30 Aug 2009 09:09:41 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-08-30T09:09:41Z</dc:date>
    <item>
      <title>Catching Errors in Call Transaction</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/catching-errors-in-call-transaction/m-p/6083069#M1357271</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have develop the BDC using call transaction for MM01 transaction but i need to catch the success messages as well as errors in a log file that i wanna download. below is the code for the same and is it mandatory to give the update mode.please let me know.&lt;/P&gt;&lt;P&gt;DATA: i_bdcdata TYPE bdcdata OCCURS 0 WITH HEADER LINE,&lt;/P&gt;&lt;P&gt;      i_error TYPE bdcmsgcoll OCCURS 0 WITH HEADER LINE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PARAMETERS: p_file TYPE rlgrap-filename OBLIGATORY,&lt;/P&gt;&lt;P&gt;            p_mode(1) DEFAULT 'A'.&lt;/P&gt;&lt;P&gt;           p_erfile TYPE rlgrap-filename.&lt;/P&gt;&lt;P&gt;SELECTION-SCREEN : BEGIN OF BLOCK BLK1 WITH FRAME TITLE TEXT-001.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PARAMETER: PBROW_HD TYPE I, PEROW_HD TYPE I, PBCOL_HD TYPE I, PECOL_HD TYPE I.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECTION-SCREEN : END OF BLOCK BLK1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: T_EXCEL LIKE ALSMEX_TABLINE OCCURS 0 WITH HEADER LINE.&lt;/P&gt;&lt;P&gt;Data: begin of record occurs 0,&lt;/P&gt;&lt;P&gt;      MATNR(40),&lt;/P&gt;&lt;P&gt;      MBRSH(01),&lt;/P&gt;&lt;P&gt;      MTART(04),&lt;/P&gt;&lt;P&gt;      MAKTX(40),&lt;/P&gt;&lt;P&gt;      MEINS(03),&lt;/P&gt;&lt;P&gt;      MATKL(09),&lt;/P&gt;&lt;P&gt;      BISMT(18),&lt;/P&gt;&lt;P&gt;      UMREN_02(05),&lt;/P&gt;&lt;P&gt;      UMREN_03(05),&lt;/P&gt;&lt;P&gt;      MEINH_02(03),&lt;/P&gt;&lt;P&gt;      MEINH_03(03),&lt;/P&gt;&lt;P&gt;      UMREZ_02(05),&lt;/P&gt;&lt;P&gt;      UMREZ_03(05),&lt;/P&gt;&lt;P&gt;      WERKS(04),&lt;/P&gt;&lt;P&gt;      EKGRP(3) ,&lt;/P&gt;&lt;P&gt;      LGORT(04),&lt;/P&gt;&lt;P&gt;      DISMM(02),&lt;/P&gt;&lt;P&gt;      DISPO(03),   "Cash Discount Indicator&lt;/P&gt;&lt;P&gt;      DISLS(02),&lt;/P&gt;&lt;P&gt;      BESKZ(1),&lt;/P&gt;&lt;P&gt;      DZEIT(3),&lt;/P&gt;&lt;P&gt;      FHORI(3),&lt;/P&gt;&lt;P&gt;      PERKZ(1),&lt;/P&gt;&lt;P&gt;      MTVFP(02),&lt;/P&gt;&lt;P&gt;      IPRKZ(01),&lt;/P&gt;&lt;P&gt;      END OF RECORD.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      DATA: v_filename LIKE RLGRAP-FILENAME.&lt;/P&gt;&lt;P&gt;AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; PERFORM read_file CHANGING p_file.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;CALL FUNCTION 'F4_FILENAME'&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;* EXPORTING&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;* PROGRAM_NAME = SYST-CPROG&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;* DYNPRO_NUMBER = SYST-DYNNR&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;* FIELD_NAME = ' '&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt; IMPORTING&lt;/P&gt;&lt;P&gt; FILE_NAME = P_FILE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;start-of-selection.&lt;/P&gt;&lt;P&gt;  PERFORM upload_file.&lt;/P&gt;&lt;P&gt;  PERFORM bdc&lt;/P&gt;&lt;P&gt; PERFORM error_download&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM UPLOAD_FILE .&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'&lt;/P&gt;&lt;P&gt;EXPORTING&lt;/P&gt;&lt;P&gt;filename = p_file&lt;/P&gt;&lt;P&gt;i_begin_col = PBCOL_HD&lt;/P&gt;&lt;P&gt;i_begin_row = PBROW_HD&lt;/P&gt;&lt;P&gt;i_end_col =  PECOL_HD&lt;/P&gt;&lt;P&gt;i_end_row = PEROW_HD&lt;/P&gt;&lt;P&gt;TABLES&lt;/P&gt;&lt;P&gt;intern = T_EXCEL&lt;/P&gt;&lt;P&gt;EXCEPTIONS&lt;/P&gt;&lt;P&gt;inconsistent_parameters = 1&lt;/P&gt;&lt;P&gt;upload_ole = 2&lt;/P&gt;&lt;P&gt;OTHERS = 3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT T_EXCEL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; CASE T_EXCEL-COL.&lt;/P&gt;&lt;P&gt; WHEN 1.  MOVE T_EXCEL-VALUE TO record-MATNR.&lt;/P&gt;&lt;P&gt; WHEN 2.  MOVE T_EXCEL-VALUE TO record-MBRSH.&lt;/P&gt;&lt;P&gt; WHEN 3.  MOVE T_EXCEL-VALUE TO RECORD-MTART.&lt;/P&gt;&lt;P&gt; WHEN 4.  MOVE T_EXCEL-VALUE TO RECORD-MAKTX.&lt;/P&gt;&lt;P&gt; WHEN 5.  MOVE T_EXCEL-VALUE TO RECORD-MEINS.&lt;/P&gt;&lt;P&gt; WHEN 6.  MOVE T_EXCEL-VALUE TO RECORD-MATKL.&lt;/P&gt;&lt;P&gt; WHEN 7.  MOVE T_EXCEL-VALUE TO RECORD-BISMT.&lt;/P&gt;&lt;P&gt; WHEN 8.  MOVE T_EXCEL-VALUE TO RECORD-UMREN_02.&lt;/P&gt;&lt;P&gt; WHEN 9.  MOVE T_EXCEL-VALUE TO RECORD-UMREN_03.&lt;/P&gt;&lt;P&gt; WHEN 10. MOVE T_EXCEL-VALUE TO RECORD-MEINH_02.&lt;/P&gt;&lt;P&gt; WHEN 11. MOVE T_EXCEL-VALUE TO RECORD-MEINH_03.&lt;/P&gt;&lt;P&gt; WHEN 12. MOVE T_EXCEL-VALUE TO RECORD-UMREZ_02.&lt;/P&gt;&lt;P&gt; WHEN 13. MOVE T_EXCEL-VALUE TO RECORD-UMREZ_03.&lt;/P&gt;&lt;P&gt; WHEN 14. MOVE T_EXCEL-VALUE TO RECORD-WERKS.&lt;/P&gt;&lt;P&gt; WHEN 15. MOVE T_EXCEL-VALUE TO RECORD-EKGRP.&lt;/P&gt;&lt;P&gt; WHEN 16. MOVE T_EXCEL-VALUE TO RECORD-LGORT.&lt;/P&gt;&lt;P&gt; WHEN 17. MOVE T_EXCEL-VALUE TO RECORD-DISMM.&lt;/P&gt;&lt;P&gt; WHEN 18. MOVE T_EXCEL-VALUE TO RECORD-DISPO.&lt;/P&gt;&lt;P&gt; WHEN 19. MOVE T_EXCEL-VALUE TO RECORD-DISLS.&lt;/P&gt;&lt;P&gt; WHEN 20. MOVE T_EXCEL-VALUE TO RECORD-BESKZ.&lt;/P&gt;&lt;P&gt; WHEN 21. MOVE T_EXCEL-VALUE TO RECORD-DZEIT.&lt;/P&gt;&lt;P&gt; WHEN 22. MOVE T_EXCEL-VALUE TO RECORD-FHORI.&lt;/P&gt;&lt;P&gt; WHEN 23. MOVE T_EXCEL-VALUE TO RECORD-PERKZ.&lt;/P&gt;&lt;P&gt; WHEN 24. MOVE T_EXCEL-VALUE TO RECORD-MTVFP.&lt;/P&gt;&lt;P&gt; WHEN 25. MOVE T_EXCEL-VALUE TO RECORD-IPRKZ.&lt;/P&gt;&lt;P&gt; ENDCASE.&lt;/P&gt;&lt;P&gt;  AT END OF ROW.&lt;/P&gt;&lt;P&gt; APPEND record.&lt;/P&gt;&lt;P&gt; CLEAR  record.&lt;/P&gt;&lt;P&gt; ENDAT.&lt;/P&gt;&lt;P&gt; ENDLOOP.&lt;/P&gt;&lt;P&gt;ENDFORM.                    " UPLOAD_FILE&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp;      Form  BDC&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;      text&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; --&amp;gt;  p1        text&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt; &amp;lt;--  p2        text&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FORM BDC .&lt;/P&gt;&lt;P&gt;loop at record.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;perform bdc_dynpro      using 'SAPLMGMM' '0060'.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'BDC_CURSOR'&lt;/P&gt;&lt;P&gt;                              'RMMG1-MATNR'.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'BDC_OKCODE'&lt;/P&gt;&lt;P&gt;                              '=AUSW'.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'RMMG1-MATNR'&lt;/P&gt;&lt;P&gt;                               record-matnr.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'RMMG1-MBRSH'&lt;/P&gt;&lt;P&gt;                               record-mbrsh.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'RMMG1-MTART'&lt;/P&gt;&lt;P&gt;                               record-mtart.&lt;/P&gt;&lt;P&gt;perform bdc_dynpro      using 'SAPLMGMM' '0070'.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'BDC_CURSOR'&lt;/P&gt;&lt;P&gt;                              'MSICHTAUSW-DYTXT(01)'.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'BDC_OKCODE'&lt;/P&gt;&lt;P&gt;                              '=ENTR'.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'MSICHTAUSW-KZSEL(01)'&lt;/P&gt;&lt;P&gt;                              'X'.&lt;/P&gt;&lt;P&gt;perform bdc_dynpro      using 'SAPLMGMM' '4004'.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'BDC_OKCODE'&lt;/P&gt;&lt;P&gt;                              '=ZU01'.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'MAKT-MAKTX'&lt;/P&gt;&lt;P&gt;                              record-maktx.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'BDC_CURSOR'&lt;/P&gt;&lt;P&gt;                              'MARA-BISMT'.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'MARA-MEINS'&lt;/P&gt;&lt;P&gt;                               record-meins.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'MARA-MATKL'&lt;/P&gt;&lt;P&gt;                               record-matkl.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'MARA-BISMT'&lt;/P&gt;&lt;P&gt;                               record-bismt.&lt;/P&gt;&lt;P&gt;perform bdc_dynpro      using 'SAPLMGMM' '4300'.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'BDC_OKCODE'&lt;/P&gt;&lt;P&gt;                              '=ZU02'.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'BDC_CURSOR'&lt;/P&gt;&lt;P&gt;                              'RMMG1-MATNR'.&lt;/P&gt;&lt;P&gt;perform bdc_dynpro      using 'SAPLMGMM' '4300'.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'BDC_OKCODE'&lt;/P&gt;&lt;P&gt;                              '=MAIN'.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'MAKT-MAKTX'&lt;/P&gt;&lt;P&gt;                              record-maktx.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'BDC_CURSOR'&lt;/P&gt;&lt;P&gt;                              'SMEINH-UMREZ(03)'.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'SMEINH-UMREN(02)'&lt;/P&gt;&lt;P&gt;                              record-umren_02.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'SMEINH-UMREN(03)'&lt;/P&gt;&lt;P&gt;                               record-umren_03.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'SMEINH-MEINH(02)'&lt;/P&gt;&lt;P&gt;                               record-meinh_02.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'SMEINH-MEINH(03)'&lt;/P&gt;&lt;P&gt;                               record-meinh_03.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'SMEINH-UMREZ(02)'&lt;/P&gt;&lt;P&gt;                               record-umrez_02.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'SMEINH-UMREZ(03)'&lt;/P&gt;&lt;P&gt;                               record-umrez_03.&lt;/P&gt;&lt;P&gt;*perform bdc_dynpro      using 'SAPLMGMM' '4300'.&lt;/P&gt;&lt;P&gt;*perform bdc_field       using 'BDC_OKCODE'&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;                             '=MAIN'.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*perform bdc_field       using 'BDC_CURSOR'&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;                             'MAKT-MAKTX'.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*perform bdc_field       using 'MAKT-MAKTX'&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;                             record-maktx.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*perform bdc_dynpro      using 'SAPLMGMM' '4004'.&lt;/P&gt;&lt;P&gt;*perform bdc_field       using 'BDC_OKCODE'&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;                             '=SP02'.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*perform bdc_field       using 'BDC_CURSOR'&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;                             'MAKT-MAKTX'.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*perform bdc_field       using 'MAKT-MAKTX'&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;                             record-maktx.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*perform bdc_field       using 'MARA-MEINS'&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;                             record-meins.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*perform bdc_field       using 'MARA-MATKL'&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;                              record-matkl.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;*perform bdc_field       using 'MARA-BISMT'&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;                             record-bismt.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;perform bdc_dynpro      using 'SAPLMGMM' '4004'.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'BDC_OKCODE'&lt;/P&gt;&lt;P&gt;                              '=SP09'.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'BDC_CURSOR'&lt;/P&gt;&lt;P&gt;                              'MAKT-MAKTX'.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'MAKT-MAKTX'&lt;/P&gt;&lt;P&gt;                              record-maktx.&lt;/P&gt;&lt;P&gt;perform bdc_dynpro      using 'SAPLMGMM' '0081'.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'BDC_CURSOR'&lt;/P&gt;&lt;P&gt;                              'RMMG1-WERKS'.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'BDC_OKCODE'&lt;/P&gt;&lt;P&gt;                              '=ENTR'.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'RMMG1-WERKS'&lt;/P&gt;&lt;P&gt;                              record-werks.&lt;/P&gt;&lt;P&gt;perform bdc_dynpro      using 'SAPLMGMM' '4000'.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'BDC_OKCODE'&lt;/P&gt;&lt;P&gt;                              '=SP10'.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'MAKT-MAKTX'&lt;/P&gt;&lt;P&gt;                              record-maktx.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'BDC_CURSOR'&lt;/P&gt;&lt;P&gt;                              'MARC-EKGRP'.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'MARA-MEINS'&lt;/P&gt;&lt;P&gt;                              record-meins.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'MARC-EKGRP'&lt;/P&gt;&lt;P&gt;                              record-ekgrp.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'MARA-MATKL'&lt;/P&gt;&lt;P&gt;                              record-matkl.&lt;/P&gt;&lt;P&gt;perform bdc_dynpro      using 'SAPLMGMM' '4000'.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'BDC_OKCODE'&lt;/P&gt;&lt;P&gt;                              '=SP11'.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'BDC_CURSOR'&lt;/P&gt;&lt;P&gt;                              'MAKT-MAKTX'.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'MAKT-MAKTX'&lt;/P&gt;&lt;P&gt;                              record-maktx.&lt;/P&gt;&lt;P&gt;perform bdc_dynpro      using 'SAPLMGMM' '4040'.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'BDC_OKCODE'&lt;/P&gt;&lt;P&gt;                              '=SP12'.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'MAKT-MAKTX'&lt;/P&gt;&lt;P&gt;                              record-maktx.&lt;/P&gt;&lt;P&gt;perform bdc_dynpro      using 'SAPLMGMM' '0081'.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'BDC_CURSOR'&lt;/P&gt;&lt;P&gt;                              'RMMG1-LGORT'.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'BDC_OKCODE'&lt;/P&gt;&lt;P&gt;                              '=ENTR'.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'RMMG1-LGORT'&lt;/P&gt;&lt;P&gt;                              record-lgort.&lt;/P&gt;&lt;P&gt;perform bdc_dynpro      using 'SAPLMGMM' '4000'.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'BDC_OKCODE'&lt;/P&gt;&lt;P&gt;                              '=SP13'.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'MAKT-MAKTX'&lt;/P&gt;&lt;P&gt;                              record-maktx.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'MARA-MEINS'&lt;/P&gt;&lt;P&gt;                               record-meins.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'MARC-EKGRP'&lt;/P&gt;&lt;P&gt;                              record-ekgrp.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'MARC-DISMM'&lt;/P&gt;&lt;P&gt;                               record-dismm.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'MARC-DISPO'&lt;/P&gt;&lt;P&gt;                              record-dispo.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'BDC_CURSOR'&lt;/P&gt;&lt;P&gt;                              'MARC-DISLS'.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'MARC-DISLS'&lt;/P&gt;&lt;P&gt;                              record-disls.&lt;/P&gt;&lt;P&gt;perform bdc_dynpro      using 'SAPLMGMM' '4000'.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'BDC_OKCODE'&lt;/P&gt;&lt;P&gt;                              'SP14'.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'MAKT-MAKTX'&lt;/P&gt;&lt;P&gt;                              record-maktx.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'MARC-BESKZ'&lt;/P&gt;&lt;P&gt;                              record-beskz.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'BDC_CURSOR'&lt;/P&gt;&lt;P&gt;                              'MARC-FHORI'.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'MARC-FHORI'&lt;/P&gt;&lt;P&gt;                               record-fhori.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'MARC-DZEIT'&lt;/P&gt;&lt;P&gt;                              record-dzeit.&lt;/P&gt;&lt;P&gt;perform bdc_dynpro      using 'SAPLMGMM' '4000'.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'BDC_OKCODE'&lt;/P&gt;&lt;P&gt;                              '=SP15'.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'MAKT-MAKTX'&lt;/P&gt;&lt;P&gt;                              record-maktx.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'MARC-PERKZ'&lt;/P&gt;&lt;P&gt;                               record-perkz.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'BDC_CURSOR'&lt;/P&gt;&lt;P&gt;                              'MARC-MTVFP'.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'MARC-MTVFP'&lt;/P&gt;&lt;P&gt;                              record-mtvfp.&lt;/P&gt;&lt;P&gt;perform bdc_dynpro      using 'SAPLMGMM' '4000'.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'BDC_OKCODE'&lt;/P&gt;&lt;P&gt;                              '=SP19'.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'BDC_CURSOR'&lt;/P&gt;&lt;P&gt;                              'MAKT-MAKTX'.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'MAKT-MAKTX'&lt;/P&gt;&lt;P&gt;                              record-maktx.&lt;/P&gt;&lt;P&gt;perform bdc_dynpro      using 'SAPLMGMM' '4000'.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'BDC_OKCODE'&lt;/P&gt;&lt;P&gt;                              '=SP20'.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'BDC_CURSOR'&lt;/P&gt;&lt;P&gt;                              'MAKT-MAKTX'.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'MAKT-MAKTX'&lt;/P&gt;&lt;P&gt;                              record-maktx.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'MARA-MEINS'&lt;/P&gt;&lt;P&gt;                              record-meins.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'MARA-IPRKZ'&lt;/P&gt;&lt;P&gt;                               record-iprkz.&lt;/P&gt;&lt;P&gt;perform bdc_dynpro      using 'SAPLMGMM' '4000'.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'BDC_OKCODE'&lt;/P&gt;&lt;P&gt;                              '=SP23'.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'BDC_CURSOR'&lt;/P&gt;&lt;P&gt;                              'MAKT-MAKTX'.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'MAKT-MAKTX'&lt;/P&gt;&lt;P&gt;                              record-maktx.&lt;/P&gt;&lt;P&gt;perform bdc_dynpro      using 'SAPLMGMM' '4000'.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'BDC_OKCODE'&lt;/P&gt;&lt;P&gt;                              '=BU'.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'BDC_CURSOR'&lt;/P&gt;&lt;P&gt;                              'MAKT-MAKTX'.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'MAKT-MAKTX'&lt;/P&gt;&lt;P&gt;                               record-maktx.&lt;/P&gt;&lt;P&gt;perform bdc_field       using 'MARA-MEINS'&lt;/P&gt;&lt;P&gt;                               record-meins.&lt;/P&gt;&lt;P&gt;CALL TRANSACTION  'MM01' USING i_bdcdata MODE p_mode.&lt;/P&gt;&lt;P&gt;CLEAR I_BDCDATA[].&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;ENDFORM.                    " BDC&lt;/P&gt;&lt;P&gt;FORM bdc_dynpro USING program dynpro.&lt;/P&gt;&lt;P&gt;  CLEAR i_bdcdata.&lt;/P&gt;&lt;P&gt;  i_bdcdata-program  = program.&lt;/P&gt;&lt;P&gt;  i_bdcdata-dynpro   = dynpro.&lt;/P&gt;&lt;P&gt;  i_bdcdata-dynbegin = 'X'.&lt;/P&gt;&lt;P&gt;  APPEND i_bdcdata.&lt;/P&gt;&lt;P&gt;ENDFORM.&lt;/P&gt;&lt;P&gt;FORM bdc_field USING fnam fval.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CLEAR i_bdcdata.&lt;/P&gt;&lt;P&gt;  i_bdcdata-fnam = fnam.&lt;/P&gt;&lt;P&gt;  i_bdcdata-fval = fval.&lt;/P&gt;&lt;P&gt;  APPEND i_bdcdata.&lt;/P&gt;&lt;P&gt;ENDFORM.&lt;/P&gt;&lt;P&gt;FORM ERROR_DOWNLOAD .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; DATA: v_errorpath TYPE string.&lt;/P&gt;&lt;P&gt;  v_errorpath = p_erfile.&lt;/P&gt;&lt;P&gt;  CALL FUNCTION 'GUI_DOWNLOAD'&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;   BIN_FILESIZE                  =&lt;/P&gt;&lt;P&gt;      filename                      = v_errorpath&lt;/P&gt;&lt;P&gt;     filetype                      = 'ASC'&lt;/P&gt;&lt;P&gt;   APPEND                        = ' '&lt;/P&gt;&lt;P&gt;   WRITE_FIELD_SEPARATOR         = ' '&lt;/P&gt;&lt;P&gt;   HEADER                        = '00'&lt;/P&gt;&lt;P&gt;   TRUNC_TRAILING_BLANKS         = ' '&lt;/P&gt;&lt;P&gt;   WRITE_LF                      = 'X'&lt;/P&gt;&lt;P&gt;   COL_SELECT                    = ' '&lt;/P&gt;&lt;P&gt;   COL_SELECT_MASK               = ' '&lt;/P&gt;&lt;P&gt;   DAT_MODE                      = ' '&lt;/P&gt;&lt;P&gt; IMPORTING&lt;/P&gt;&lt;P&gt;   FILELENGTH                    =&lt;/P&gt;&lt;P&gt;    TABLES&lt;/P&gt;&lt;P&gt;      data_tab                      = i_error&lt;/P&gt;&lt;P&gt; EXCEPTIONS&lt;/P&gt;&lt;P&gt;   FILE_WRITE_ERROR              = 1&lt;/P&gt;&lt;P&gt;   NO_BATCH                      = 2&lt;/P&gt;&lt;P&gt;   GUI_REFUSE_FILETRANSFER       = 3&lt;/P&gt;&lt;P&gt;   INVALID_TYPE                  = 4&lt;/P&gt;&lt;P&gt;   NO_AUTHORITY                  = 5&lt;/P&gt;&lt;P&gt;   UNKNOWN_ERROR                 = 6&lt;/P&gt;&lt;P&gt;   HEADER_NOT_ALLOWED            = 7&lt;/P&gt;&lt;P&gt;   SEPARATOR_NOT_ALLOWED         = 8&lt;/P&gt;&lt;P&gt;   FILESIZE_NOT_ALLOWED          = 9&lt;/P&gt;&lt;P&gt;   HEADER_TOO_LONG               = 10&lt;/P&gt;&lt;P&gt;   DP_ERROR_CREATE               = 11&lt;/P&gt;&lt;P&gt;   DP_ERROR_SEND                 = 12&lt;/P&gt;&lt;P&gt;   DP_ERROR_WRITE                = 13&lt;/P&gt;&lt;P&gt;   UNKNOWN_DP_ERROR              = 14&lt;/P&gt;&lt;P&gt;   ACCESS_DENIED                 = 15&lt;/P&gt;&lt;P&gt;   DP_OUT_OF_MEMORY              = 16&lt;/P&gt;&lt;P&gt;   DISK_FULL                     = 17&lt;/P&gt;&lt;P&gt;   DP_TIMEOUT                    = 18&lt;/P&gt;&lt;P&gt;   FILE_NOT_FOUND                = 19&lt;/P&gt;&lt;P&gt;   DATAPROVIDER_EXCEPTION        = 20&lt;/P&gt;&lt;P&gt;   CONTROL_FLUSH_ERROR           = 21&lt;/P&gt;&lt;P&gt;   OTHERS                        = 22&lt;/P&gt;&lt;P&gt;            .&lt;/P&gt;&lt;P&gt;  IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt; MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO&lt;/P&gt;&lt;P&gt;         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDFORM.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Aug 2009 21:07:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/catching-errors-in-call-transaction/m-p/6083069#M1357271</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-26T21:07:12Z</dc:date>
    </item>
    <item>
      <title>Re: Catching Errors in Call Transaction</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/catching-errors-in-call-transaction/m-p/6083070#M1357272</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mustafa Shareef,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  Can you post Your code in two separate, please check preview before post for better repsone.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Suneel G&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Aug 2009 03:23:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/catching-errors-in-call-transaction/m-p/6083070#M1357272</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-27T03:23:00Z</dc:date>
    </item>
    <item>
      <title>Re: Catching Errors in Call Transaction</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/catching-errors-in-call-transaction/m-p/6083071#M1357273</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Mustafa Shareef,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  Can you post Your code in two separate, please check preview before post for better repsone.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Suneel G&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Aug 2009 03:28:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/catching-errors-in-call-transaction/m-p/6083071#M1357273</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-27T03:28:45Z</dc:date>
    </item>
    <item>
      <title>Re: Catching Errors in Call Transaction</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/catching-errors-in-call-transaction/m-p/6083072#M1357274</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    Please search SCN before posing on the forum. In order to capture error while call transaction you can do like below:&lt;/P&gt;&lt;P&gt;data: it_bdcmsgcoll like bdcmsgcoll occurs 0 with header line.&lt;/P&gt;&lt;P&gt;CALL TRANSACTION 'MM01' USING i_bdcdata MODE p_mode messages in it_bdcmsgcoll.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Internal table it_bdcmsgcoll will have all the messages errors would be with message type 'E'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Himanshu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Aug 2009 03:53:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/catching-errors-in-call-transaction/m-p/6083072#M1357274</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-27T03:53:57Z</dc:date>
    </item>
    <item>
      <title>Re: Catching Errors in Call Transaction</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/catching-errors-in-call-transaction/m-p/6083073#M1357275</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Himanshu,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have done the same by taking an internal table of type bdcmsgcol.but when i display the log file it is showing me only the Screen name, Screen No.s, Field names but it is not showing me the messages like the material created or not created etc...&lt;/P&gt;&lt;P&gt;i have taken the msgid fields also but it is displaying the text messages.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any Idea y it is not showing me the text messages.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;Mustafa.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 29 Aug 2009 23:29:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/catching-errors-in-call-transaction/m-p/6083073#M1357275</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-29T23:29:48Z</dc:date>
    </item>
    <item>
      <title>Re: Catching Errors in Call Transaction</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/catching-errors-in-call-transaction/m-p/6083074#M1357276</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;  After you get the error message codes in table use function module 'FORMAT_MESSAGE'  get the corresponding text message for the error message codes that you are getting in the errors table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Himanshu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 30 Aug 2009 05:31:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/catching-errors-in-call-transaction/m-p/6083074#M1357276</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-30T05:31:36Z</dc:date>
    </item>
    <item>
      <title>Re: Catching Errors in Call Transaction</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/catching-errors-in-call-transaction/m-p/6083075#M1357277</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Himanshu ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can i use that format _message FM ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mustafa.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 30 Aug 2009 08:43:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/catching-errors-in-call-transaction/m-p/6083075#M1357277</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-30T08:43:04Z</dc:date>
    </item>
    <item>
      <title>Re: Catching Errors in Call Transaction</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/catching-errors-in-call-transaction/m-p/6083076#M1357278</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;  You can use it like below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
CALL TRANSACTION 'ME21' USING bdcdata MODE 'N' UPDATE 'S' MESSAGES INTO it_message.
LOOP AT it_message.
CALL FUNCTION 'FORMAT_MESSAGE'
EXPORTING
id = it_message-msgid      
lang = it_message-msgspra
no = it_message-msgnr
v1 = it_message-msgv1
v2 = it_message-msgv2
IMPORTING
msg = v_msg
EXCEPTIONS
not_found = 1
OTHERS = 2.
ENDLOOP.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Himanshu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 30 Aug 2009 09:09:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/catching-errors-in-call-transaction/m-p/6083076#M1357278</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-30T09:09:41Z</dc:date>
    </item>
    <item>
      <title>Re: Catching Errors in Call Transaction</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/catching-errors-in-call-transaction/m-p/6083077#M1357279</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Solved&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Feb 2011 13:01:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/catching-errors-in-call-transaction/m-p/6083077#M1357279</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-02-24T13:01:55Z</dc:date>
    </item>
  </channel>
</rss>

