cancel
Showing results for 
Search instead for 
Did you mean: 

FM to fix text length

Former Member
0 Kudos

Hi....

I've got a problem in Smartform where in if the firs column fields lenght(character type) is less it printing the second column in the space and the order of column entry is shuffling.....

My text length is 30 character long i've fixed it like &itab-text(30)& in text element........but when the text character is less that 20 chars i'm having the shuffling problem and the second column get fixed up the space and the order gets misplace.....i'm using tab stop for giving space between two columns and its fixed for every columns......i tried this my concatenating space when the text lenght is less than 20 chars....but still the same problem........and tried every thing now i just wonder do we have any FM to fix the lenght of text to achieve the result.......

Points wud be surely awarded.....Thxxxxxxxxxxxxx

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

I've resolved it by myself

Former Member
0 Kudos

Moderator message: When closing threads, there is no need to add a comment. If you do add a comment, please make sure it adds something and is not just a meaningless comment like "I've resolved it by myself". This just brings old posts to the top of the list and pushes current ones down. Rob

Former Member
0 Kudos

Hi,

You have this function module to get the exact no of letters you need in one word.

CALL FUNCTION 'IQAPI_WORD_WRAP'

EXPORTING

textline = ekpo-matnr

outputlen = 10

IMPORTING

out_line1 = l_COMMTd1

out_line2 = l_COMMTd2

out_line3 = l_COMMTd3

TABLES

OUT_LINES = T_OUTLINES.

IF SY-SUBRC EQ 0.

ENDIF.

Thanks,

NN.

Former Member
0 Kudos

Thx for the quick reply......

I still have the problem persisting in my smartform.........i've restricted the length of my text to 20 chars but when the text length is less than 10 char then other column entries get shuffels up and everything is turing out to be a mess....

The probelm we have this while displaying it in the print.....

Former Member
0 Kudos

Hi,

i think you are using tab spaces to print the data .

If you need to display data as a table format use the table specified above in previoous reply.

Data in the table will never get messed up instead it extends the column hight and prints down .

Thanks,

NN.

Former Member
0 Kudos

hi,

may be this function module will helpful for u for fomating the text.

CALL FUNCTION 'FORMAT_TEXTLINES'

EXPORTING

cursor_column = 1

cursor_line = 1

endline = 99999

formatwidth = 45

linewidth = 45

startline = 1

language = sy-langu

*IMPORTING

*NEW_CURSOR_COLUMN =

*NEW_CURSOR_LINE =

TABLES

lines = g_tline

EXCEPTIONS

BOUND_ERROR = 1

OTHERS = 2

.

IF sy-subrc eq 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

Former Member
0 Kudos

Hi,

1.Take the value into the variable.

2.Print that variable as v_var(C).

Regards,

SHiva.