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: 

Convert SY-SUBRC to a String (character type).

Former Member
0 Kudos

Hello

Im just starting with ABAP and I've come to a silly problem. I want to use the SY-SUBRC into a log line and I don't know how to use it in a CONCATENATE sentece.

Im trying this:

IF SY-SUBRC <> 0.

CONCATENATE 'Error(' SY-SUBRC ')creating HTTP CLIENT for URL' LW_URI INTO LW_AuxStr.

me->log->logerror_string( LW_AuxStr ).

RAISE EXCEPTION TYPE ZCX_HTTP_ERROR.

ENDIF.

But it wont work because of this error: SY-SUBRC must be a character-type data object....

How can I convert an Integer type into a String type?

Thanks!

1 ACCEPTED SOLUTION

Former Member
0 Kudos

You could declare a character or string variable and just do

var = sy-subrc.

3 REPLIES 3

Former Member
0 Kudos

You could declare a character or string variable and just do

var = sy-subrc.

Former Member
0 Kudos

Hi,

data: temp type c.

temp = sy-subrc.

IF SY-SUBRC 0.

CONCATENATE 'Error' temp 'creating HTTP CLIENT for URL' LW_URI INTO LW_AuxStr.

me->log->logerror_string( LW_AuxStr ).

RAISE EXCEPTION TYPE ZCX_HTTP_ERROR.

ENDIF.

I hope it will help.

regards

Natasha Garg

0 Kudos

Thanks!

That was easy enought!