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

regarding Transfer statement

Former Member
0 Likes
986

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
Read only

Former Member
0 Likes
897

Hi Mahesh,

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

Thanks.

Regards,

Jey

Read only

0 Likes
897

If not equalto 0 then exit from the loop.

Read only

Former Member
0 Likes
897

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

Read only

0 Likes
897

Hi Chandra ..

Thanks for reply.

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

Read only

0 Likes
897

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

Read only

0 Likes
897

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.

Read only

0 Likes
897

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 .