Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

function modules

we created a function module and we are using this function module with in the loop. now i want to remove the loop condition with in the function module. i am giving sample code also. it is taking long time because it is with in the loop. how reduce the time

FUNCTION zspanish_char_conv_new.

*"----


""Local interface:

*" IMPORTING

*" VALUE(I_TEXT)

*" EXPORTING

*" VALUE(E_TEXT)

*"----


DATA : len TYPE i.

DATA: str(99) TYPE c.

DATA: cntr TYPE i.

DATA: val TYPE int1.

DATA:BEGIN OF x,

y TYPE int1,

END OF x.

cntr = 0.

len = strlen( i_text ).

WHILE cntr NE len.

x = i_text+cntr(1).

val = x-y.

IF val >= 128 .

x = ' '.

ENDIF.

i_text+cntr(1) = x.

cntr = cntr + 1.

ENDWHILE.

CONDENSE i_text.

e_text = i_text.

ENDFUNCTION.

Tags:
Former Member
Not what you were looking for? View more on this topic or Ask a question