cancel
Showing results for 
Search instead for 
Did you mean: 

Regarding Spaces

Former Member
0 Kudos

Hi All

i'm modifying standard salesorder form and printing Material description from vbdpa-arktx but its lenght is 40character, due to space probelm for line items i declared description field as 20 and printing the value from vbdpa-arktx but in line items its taking all 40 char lenght and pushing remaining line item values. so pleas can any oen let me know how to delete spaces after text. ie in my case text is only "samsung SGH F007" its only 16 char lenght but while printing remaining 24 spaces also prining . plz its urgent .

Regards

Munna

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

HI,

Specifying an offset has the effect that a certain number of bytes of the symbol value, starting with the first byte on the left, will not be displayed. If the offset specified is greater than the length of the value, nothing is printed.

Syntax

<b>&symbol+offset&</b>

If < symbol> has the value 123456789, the following will be displayed:

&symbol& -> 123456789

&symbol+3& -> 456789

&symbol+7& -> 89

&symbol+12& ->

&symbol+0& -> 123456789

<b>Space Compression</b>

The symbol value is viewed as a sequence of ‘words’, each separated from the next by either one or a string of space characters. The C option has the effect of replacing each string of space characters with a single space and shifting the ‘words’ to the left as necessary to close up the gaps. Leading spaces are completely removed. The results are the same as those of the ABAP command CONDENSE.

Syntax:

<b>&symbol(C)&</b>

Assuming ' Albert Einstein ' is the symbol value,

&symbol& -> 'Albert Einstein '

&symbol(C)& -> Albert Einstein

Regards

Sudheer

Former Member
0 Kudos

If you have the description in a variable like

data: description type c.

then I think you can do the following:

condense description.

Davis

Former Member
0 Kudos

hi,

i'm not declaring description field its just heading, below that i'm priing &vbdpa-arktx& which is 40 char length. but value in that is only 18chars but its pringint spaces also. i want to remove spaces after that.

suppose text is nokia then remaining 34 spaces should remove

Thanks & Regards

Munna

Former Member
0 Kudos

In that case I would create a character variable, move the description into the variable, and condense it.

data description type c.

description = vbdpa-arktx.

condense description.

Davis

Former Member
0 Kudos

Hi,

i think condence removes only leading spaces.

but my requirement is to remove spaces after the word

vbdpa-arktx is 40 char lenght

but the value might be less that 40 char for ex in my cafe

"Samsung" but while printg vbdpa-arktx its printing like

"Samsung "

i want only samsung, no spaces after that.

Regards

Munna

Former Member
0 Kudos

Here is the documentation for condense. I know that it will remove trailing spaces; I use it in SmartForms. Did you try what Sudheer suggested? I believe what he posted will work as well.

CONDENSE

Syntax

CONDENSE text [NO-GAPS].

Effect

In the variable text, leading and closing blanks are completely removed and any other directly consecutive blanks are all replaced by exactly one space character or - if NO-GAPS is specified - are also removed completely.

The data object text must be character-type. If the data object has a fixed length, any space created by the condense operation is filled with blanks on the right. If the data object is of the type string, its length is adapted to the result of the condense operation.

Example

The flat structure sentence contains only character-type components and can therefore be assigned to the string text. After the execution of the CONDENSE statement, text contains "She feeds you tea and oranges". Before the condense operation, the words in text are 30 characters apart from one another.

DATA: BEGIN OF sentence,

word1(30) TYPE c VALUE 'She',

word2(30) TYPE c VALUE 'feeds',

word3(30) TYPE c VALUE 'you',

word4(30) TYPE c VALUE 'tea',

word5(30) TYPE c VALUE 'and',

word6(30) TYPE c VALUE 'oranges',

END OF sentence,

text TYPE string.

text = sentence.

CONDENSE text.