cancel
Showing results for 
Search instead for 
Did you mean: 

Converting BW 3.X Code into BI 7.0

Former Member
0 Kudos

Hai

can anyone give the following code in BI7.0 and im planning to write this code in between the DSO and InfoCube for replacing the invalid characters(# , !) by space .

DATA: L_S_ERRORLOG TYPE RSSM_S_ERRORLOG_INT,

L_TEXT TYPE STRING,

G_ALLOWED_CHAR(200) TYPE C.

RESULT = TRAN_STRUCTURE-<b>MSEGNAME</b>.

while RESULT ca '#'.

RESULT+sy-fdpos(1) = ' '.

endwhile.

if RESULT (1) = '!'.

RESULT (1) = ' '.

endif.

TRANSLATE RESULT TO upper case.

IF G_ALLOWED_CHAR IS INITIAL.

CALL FUNCTION 'RSKC_ALLOWED_CHAR_GET'

IMPORTING

E_ALLOWED_CHAR = G_ALLOWED_CHAR.

ENDIF.

CHECK G_ALLOWED_CHAR NE 'ALL_CAPITAL'.

do.

if not RESULT co g_allowed_char.

shift RESULT+sy-fdpos left.

else.

exit.

endif.

enddo.

RETURNCODE = 0.

ABORT = 0.

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

It will be similar, except TRAN_STRUCTURE will be replaced by SOURCE_FIELDS.

so your code will look like:

DATA: L_S_ERRORLOG TYPE RSSM_S_ERRORLOG_INT,

L_TEXT TYPE STRING,

G_ALLOWED_CHAR(200) TYPE C.

RESULT = SOURCE_FIELDS-MSEGNAME.

while RESULT ca '#'.

RESULT+sy-fdpos(1) = ' '.

endwhile.

if RESULT (1) = '!'.

RESULT (1) = ' '.

endif.

TRANSLATE RESULT TO upper case.

IF G_ALLOWED_CHAR IS INITIAL.

CALL FUNCTION 'RSKC_ALLOWED_CHAR_GET'

IMPORTING

E_ALLOWED_CHAR = G_ALLOWED_CHAR.

ENDIF.

CHECK G_ALLOWED_CHAR NE 'ALL_CAPITAL'.

do.

if not RESULT co g_allowed_char.

shift RESULT+sy-fdpos left.

else.

exit.

endif.

enddo.

write this code inside CLASS * IMPLEMENTATION.

Hope this helps.

Best Regards,

Rajani