Application Development 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: 

list display - formating

former_member202957
Contributor
0 Kudos

hi all,

i am facing problem in formating in list. i have a table Zstock1 i hv taken the values from zstock1 to it_stock and priting. The problem here is there are certain fields such as it_stock-pmenge, it_stock-sfkimg. there fields taken from zstock1 -pmenge which is quantity field length 13 decimal 3. and it_stock-sfkimg is taken from zstock1-sfkimg which is also quntity field lenth 13 dec 3.

In these fields i am getting only values of size 7 in length so i want to print only 7 length only rather printing total 13 length.

if i try to do write : it_stock-pmenge+8(7) it is giving error :Type 'P' dosent support .

ex: it_stock1-pmenge value is 7854.251 and

it_stock1-sfkimg values is 123.412 so i am trying to print these values it showing like this

write: it_stock1-pmenge , it_stock1-sfkimg.

output is: 7854.251 123.412

rather i want to print like this.

o/p: 7854.251 123.412.

i want to curb the unnessary gap b/w the fields.

in debug i hv seen that before the value(7854.251 ) there is 7 digit space in the filed. so thats why i am taking <b>it_stock1-pmenge+7(7)</b> but is not supporitng for quantity field. plese give me any other options to print like that.

<b>useful answers will be rewarded.</b>

Regards,

Sunil kumar.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi

Declare a 2 varables of CHAR of length 7 and move these qty fields into them.

But do you think that always the Qty fields values will be always of length 7 Char only

otherwise it will be a problem.

Since QTY fields are right justified it may come like that.

data: v_qty1(7), v_qty2(7).

v_qty1 = it_stock1-pmenge .

v_qty2 = it_stock1-sfkimg.

or you can do like this

data: v_qty1(13), v_qty2(13).

v_qty1 = it_stock1-pmenge .

v_qty2 = it_stock1-sfkimg.

condence v_qty1.

condence v_qty2.

write the v_qty1 and v_qty2 fields and see

Regards

Anji

Message was edited by:

Anji Reddy Vangala

3 REPLIES 3

naimesh_patel
Active Contributor
0 Kudos

Try to print like:


Write: /1(7) it_stock-pmenge,
       10(7) it_stock-sfkimg .

Regards,

Naimesh Patel

Former Member
0 Kudos

Hi

Declare a 2 varables of CHAR of length 7 and move these qty fields into them.

But do you think that always the Qty fields values will be always of length 7 Char only

otherwise it will be a problem.

Since QTY fields are right justified it may come like that.

data: v_qty1(7), v_qty2(7).

v_qty1 = it_stock1-pmenge .

v_qty2 = it_stock1-sfkimg.

or you can do like this

data: v_qty1(13), v_qty2(13).

v_qty1 = it_stock1-pmenge .

v_qty2 = it_stock1-sfkimg.

condence v_qty1.

condence v_qty2.

write the v_qty1 and v_qty2 fields and see

Regards

Anji

Message was edited by:

Anji Reddy Vangala

Former Member
0 Kudos

use some string operations before displaying that fields like CONDENSE or something like this.

you can refer to the following sample code:

DATA: STRING(25) VALUE ' one two three four',

LEN TYPE I.

LEN = STRLEN( STRING ).

WRITE: STRING, '!'.

WRITE: / 'Length: ', LEN.

CONDENSE STRING.

LEN = STRLEN( STRING ).

WRITE: STRING, '!'.

WRITE: / 'Length: ', LEN.

CONDENSE STRING NO-GAPS.

LEN = STRLEN( STRING ).

WRITE: STRING, '!'.

WRITE: / 'Length: ', LEN.

i think it will solve the problem.

reward points if you find it useful.