Skip to Content

list display - formating

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.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Nov 22, 2007 at 06:15 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 22, 2007 at 06:25 AM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Nov 22, 2007 at 06:15 AM

    Try to print like:

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

    Regards,

    Naimesh Patel

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.