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: 

regarding Transfer statement

Former Member
0 Kudos

Hi All...

Iam transfering the data string to the application server by using the TRANSFER statement.

How can i disply the scusses or failure message after transfering the data string.

for example Due to some network problems the string was not transfered..in this case how can i popup the message?

Regards,

Mahesh

7 REPLIES 7

Former Member
0 Kudos

Hi Mahesh,

check sy-subrc = 0 after the transfer statement, if <> 0 exit from the loop and give error message..

Thanks.

Regards,

Jey

0 Kudos

If not equalto 0 then exit from the loop.

Former Member
0 Kudos

Hi Mahesh,

Check the SY-SUBRC condition after the TRANSFER Statement. If it is not successful then give an error message.

Check this:

TRANSFER w_data TO f_name.

  if sy-subrc ne 0.
  message 'transfer failure' type 'I'.
  endif.

Regards,

Chandra Sekhar

0 Kudos

Hi Chandra ..

Thanks for reply.

But in the ABAP TRANSFER is the only statement that not return the subrc value.

0 Kudos

Hi Mahesh

Transfer doesnt have sy-subrc

U can use Autnority_check_dataset function module

Or U can use the table SPTH

here is the sample code

TYPE-POOLS SABC.

.....

CALL FUNCTION 'AUTHORITY_CHECK_DATASET'

EXPORTING PROGRAM = SY-REPID

ACTIVITY = SABC_ACT_READ

FILENAME = '/tmp/sapv01'

EXCEPTIONS NO_AUTHORITY = 1

ACTIVITY_UNKNOWN = 2.

Regards

Devanand

0 Kudos

checking the authority check is the only alternative...

after open dataset if you can check the sy-subrc its assured that transfer statement that follows it.. is done.. unfortunately transfer is the only statement which doesnot return subrc.

0 Kudos

Hi Jay.

Thanks for your reply.

Can you plz send me the sample.

But imagine one situation..

for example iam transfering 400 records to the file...

Error occured in the network after transfering 200 records at that time how to raise the error message .