Application Development 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: 

Error log in background processing

Former Member
0 Kudos
208

Hi all,

I need to print an ALV report.The report will be run in background and foreground based on some conditions..

My requirement is that when the program is running in background mode then the user wants an error log if the updation of some fields has not taken place..

Can u suggest how that error log can be created?..and where the user can see the log..

<REMOVED BY MODERATOR - REQUEST OR OFFER POINTS ARE FORBIDDEN>

Thanks & Regards,

Arun Chaudhary

Edited by: Alvaro Tejada Galindo on Jan 8, 2009 4:30 PM

4 REPLIES 4

Former Member
0 Kudos
90

Hi Arun,

Pass the error records into a separate internal table and append them. once the Background processing was completed then loop on that error internal table and list them in the Basiclist for the identification.

Regards,

Narendra.

Former Member
0 Kudos
90

Arun,

Declare internal table for errors.

Ex :


DATA : BEGIN OF i_errors OCCURS 0,
            
           Your reuire firlds to display in error log  and
            desc(150), "error description  field
       END OF i_errors.

After processed all the code wirte

v_filepath ---This is file path where you want to store your error log

EX :


DATA :v_filepath(80)       VALUE '/data/sapdata/inc/error_log/pme_br/' ,
  v_string  TYPE string. 

*****Clolumn Names for error log

   i_errors-equnr = 'ASSET' .
    i_errors-tplnr = 'MPRN'.
    i_errors-desc  = 'Description'.

    INSERT i_errors INDEX 1.


OPEN DATASET v_filepath FOR OUTPUT IN TEXT MODE.

    IF sy-subrc EQ 0.

 LOOP AT i_errors.

***These are fields of error table 
 CONCATENATE i_errors_-plant c_coma i_errors-zzvendor
                          c_coma  i_errors-post_code1 c_coma 
                          i_errors-outcode c_coma i_errors-district 
    INTO v_string.

        TRANSFER v_string TO v_filepath.


  ENDLOOP.

to see error log

Go to tcode AL11 and go to according to your path.

Path what ever you are ging sholud exist.

<REMOVED BY MODERATOR - REQUEST OR OFFER POINTS ARE FORBIDDEN>

Edited by: Alvaro Tejada Galindo on Jan 8, 2009 4:30 PM

former_member404244
Active Contributor
0 Kudos
90

Hi,

if u r using session method..then automatically u will get the log in SM35,if u r using call transaction then u will get it in BDCMSGCOLL table....Now what u do is create one internal table with error..and fill the values from BDCMSGCOLL and finally use REUSE_ALV_GRID_DISPLAY,and pass the error internal table ,now u will get the error records in the output...

syntax for call transaction is


CALL TRANSACTION <tcode> USING i_bdcdata
                   mode 'N' update 'S'
                   MESSAGES INTO BDCMSGCOLL.

Regards,

Nagaraj

Code Formatted by: Alvaro Tejada Galindo on Jan 8, 2009 4:30 PM

Former Member
0 Kudos
90

thanks..