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

handling errors

Former Member
0 Likes
437

hi experts,

how to handle errore while file transfer in outbound interface.

regards,

siri.

1 ACCEPTED SOLUTION
Read only

uwe_schieferstein
Active Contributor
0 Likes
410

Hello Sireesha

If the assumption of Appana about your requirement is correct then you could also use a TRY/CATCH/ENTRY block to handle errors.

TRY.
  OPEN DATASET ...

CATCH cx_root INTO lo_error.
" ... do error handling
ENDTRY.

Regards

Uwe

2 REPLIES 2
Read only

Laxmana_Appana_
Active Contributor
0 Likes
410

Hi,

I am not clear on your doubt , do you want to capture errors while creating the file. check below code for this :

data : begin of i_errmsg occurs 0,
        x_msg(100) type c,
       end of i_errmsg.

OPEN DATASET x_file FOR output 
                            MESSAGE l_msg
                       IN text MODE ENCODING DEFAULT.
  x_RCODE = sy-subrc. 
  IF x_RCODE <> 0.
    <b>i_errmsg-x_msg = l_msg.
    append i_errmsg.</b>  
  endif.

internal table i_errmsg will contain the error message details.

Regards

Appana

Read only

uwe_schieferstein
Active Contributor
0 Likes
411

Hello Sireesha

If the assumption of Appana about your requirement is correct then you could also use a TRY/CATCH/ENTRY block to handle errors.

TRY.
  OPEN DATASET ...

CATCH cx_root INTO lo_error.
" ... do error handling
ENDTRY.

Regards

Uwe