Skip to Content
avatar image
Former Member

how to remove space while giving the output in abap???

WRITE:/ sy-vline, 'At the end of:' , ITAB-ERNAM , 'Total count is:' ,I.

the above thing i m mentioning in my prg and in output there is space between 'total count is:' and the variable I,

there is also space between the value of itab-ernam and the msg 'total count is'....

pls help me to remove the space...

i tried with condense and replace command but it's not working...

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

8 Answers

  • Best Answer
    avatar image
    Former Member
    Oct 14, 2013 at 09:30 AM

    hi,

    create a char field and then condense the count field with no gaps to this char field. And then display this char field. This should work for you.

    Regards,

    Anil

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 14, 2013 at 09:58 AM

    Try writing to a variable of type char, condense the variable an write it to screen

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 12, 2013 at 02:27 PM

    Hi

    The Numeric values are always right justified.  So there you see the space between the label and the value.

    If you do not want space, you can use the justification option in the Write Statement.

    Regards,

    Venkat

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 12, 2013 at 08:36 PM

    This can be the reason because for Integer value. Integer, float and Packed data type are right Justified.

    You had tried with condense statement, Right, Condense statement removes more then one space but one space will be there .

    So try with CONDENSE <c> [NO-GAPS]. This will remove all space.

    data lv_string type string.

    concatenate Total count is:' ,I into lv_string.

    condense lv_string no-gaps.

    WRITE:/ sy-vline, 'At the end of:' , ITAB-ERNAM , lv_string.

    And if you want to remove leading zero form I for this you can use 'CONVERSION_EXIT_ALPHA_OUTPUT' function module.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 12, 2013 at 07:59 PM

    Hi,

    Try with left justified or no-gap.

    it will work.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 13, 2013 at 05:50 AM

    It would work fine with NO-GAP addition.

    WRITE:/ sy-vline, 'At the end of:' , ITAB-ERNAM , 'Total count is:' NO-GAP , I.


    http://help.sap.com/saphelp_470/helpdata/en/9f/db9e3d35c111d1829f0000e829fbfe/content.htm

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 14, 2013 at 09:05 AM

    Hello,

    In addition of using the NO-GAP and CONDENSE abap statements, you must also ensure that the datatype you using is appropriate.

    For example:

    data g_type_i type i.

    g_type_i = 01.

    WRITE:/ sy-vline, 'At the end of:' , sy-uname , 'Total count is:' , g_type_i.

    WRITE:/ sy-vline, 'At the end of:' , sy-uname , 'Total count is:' NO-GAP , g_type_i.

    data g_type_n type n.

    g_type_n = 01.

    WRITE:/ sy-vline, 'At the end of:' , sy-uname , 'Total count is:' , g_type_n.

    WRITE:/ sy-vline, 'At the end of:' , sy-uname , 'Total count is:' NO-GAP , g_type_n.


    In this example the type i contains space compared to the type n.

    Thanks and Kind Regards,

    Yovish.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 14, 2013 at 12:04 PM

    thanks all for replying your help really helped me to solve my prob....😊

    Add comment
    10|10000 characters needed characters exceeded