Application Development and Automation 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: 
Read only

Problem while displaying the data

Former Member
0 Likes
675

<b>Item

{

Item2000249CYANINE BLUE 3011 ~ ~;

} </b>

The above output is a downloaded report.

You should remove the empty spaces when the actual field value is less than the max filed size eg if a field size is defined as 20 and field value is Mumbai than you are sending some 16 empty spaces after that and then placing a delimiter ‘~’.

and also if database is not having any value for particular selection then there should be only one gap between two '~'.

--->Any Solution

6 REPLIES 6
Read only

Former Member
0 Likes
642

Hi,

Try using SHIFT statement.

SHIFT <FIELD NAME> LEFT DELETING LEADING ' '.

Hope this would help out.

Cheers,

Prashanth

Read only

Former Member
0 Likes
642

Hi,

use describe field length f.

condense field no-gaps

strlen functions for your requirement.

Regards

amole

Read only

Former Member
0 Likes
642

U can use the DESCRIBE statement to get the field length.

DESCRIBE FIELD item-field length lfldlen.

llen = strlen ( item-field ).

if llen <> lfldlen and item-field is not initial.

loutput = item-field.

write ldel to loutput+lfldlen(1). "ldel is ~

endif.

Read only

Former Member
0 Likes
642

Hi ,

Use statement 'condense' For removing additional spaces.

and to check weather there is value check is initial.

ex :

if field is initial put only '~'

else.

condese field.

endif.

Read only

Former Member
0 Likes
642

Hi,

Item2000249CYANINE BLUE 3011 ~ ~;

data lv_test(20) type c value 'test'.

describe lv_test length lv_len

lv_len1 = strlen(lv_test)

if lv_len1 < lv_len .

condense lv_test.

endif.

if database has no value

concatenate lv_test '~ ~' into lv_test.

Regards

Amole

Read only

Former Member
0 Likes
642

Hi satyanarayana,

I guess you can do this in 2 steps.

1. concatenate field1 field2 filed3 ... into wa_string seperated by '~'.

2. condense wa_string no-gaps.

Regards'

Srikanth M