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: 

PO Item Text - Display "0A" instead of new line

it_group_ihl
Explorer
0 Kudos

Hi,

I have enter "65-00A" in PO Item Text. But when it show on print preview it display as :

65-0
A

I search for the reason for what happened and found that 0A is the hex-representation for Line Feed. So how can I show string "0A" instead of Line Feed.

Thanks.

1 ACCEPTED SOLUTION

matt
Active Contributor
0 Kudos

Seems very unlikely to me - why should a character string suddenly be treated as a hexadecimal digit. In any case if 0A was being converted to a linefeed you'd see only

65-0

as the whole of 0A would become a linefeed. Try entering 65-00A0A0A0AX. See what you get.

No. You need to check the smartform. Perhaps the window displaying the item text is too small, so the text is wrapped.

10 REPLIES 10

matt
Active Contributor
0 Kudos

Seems very unlikely to me - why should a character string suddenly be treated as a hexadecimal digit. In any case if 0A was being converted to a linefeed you'd see only

65-0

as the whole of 0A would become a linefeed. Try entering 65-00A0A0A0AX. See what you get.

No. You need to check the smartform. Perhaps the window displaying the item text is too small, so the text is wrapped.

0 Kudos

When I enter 65-00A0A0A0AX I get.

65-0
A
A
A
AX

About display item text size I already check. It wider than the enter text.

This is my code. I query the text from Material PO Item Text and PO Item Text.


SPAN {
font-family: "Courier New";
font-size: 10pt;
color: #000000;
background: #FFFFFF;
}
.L0S31 {
font-style: italic;
color: #808080;
}
.L0S32 {
color: #3399FF;
}
.L0S33 {
color: #4DA619;
}
.L0S52 {
color: #0000FF;
}
.L0S55 {
color: #800080;
}
.L0S70 {
color: #808080;
}

  DATA: lv_id     LIKE thead-tdid,

        lv_name   LIKE thead-tdname,

        lv_obj    LIKE thead-tdobject,

        lt_line   LIKE TABLE OF tline WITH HEADER LINE,

        lt_tab    TYPE tdtab_c132,

        wa_temp   LIKE LINE OF lt_tab,

        str(1000) TYPE c.



*   Read Material PO Text

  CLEAR: lv_name.

  CLEAR: gt_line.

  lv_id = 'BEST'.

  lv_name = gwa_item-matnr.

  lv_obj = 'MATERIAL'.



  PERFORM read_desc TABLES lt_line

                     USING lv_id

                           sy-langu

                           lv_obj

                           lv_name.

  gt_line[] = lt_line[].

*   Read PO Item Text

  CLEAR: lv_name.

  CLEAR: lt_line.

  lv_id = 'F01'.

  CONCATENATE gwa_item-ebeln gwa_item-ebelp

  INTO lv_name.

  lv_obj = 'EKPO'.



  PERFORM read_desc TABLES lt_line

                     USING lv_id

                           sy-langu

                           lv_obj

                           lv_name.

  IF sy-subrc = 0.

*    APPEND LINES OF lt_line TO GT_LINE.

    CLEAR: lt_tab.

    CLEAR: wa_temp.

    CALL FUNCTION 'CONVERT_ITF_TO_ASCII'

      EXPORTING

        codepage          = '0000'

        formatwidth       = 128

        language          = sy-langu

        tabletype         = 'ASC'

      IMPORTING

        c_datatab         = lt_tab

      TABLES

        itf_lines         = lt_line

      EXCEPTIONS

        invalid_tabletype = 1

        OTHERS            = 2.



    LOOP AT lt_tab INTO wa_temp.

      str = wa_temp.

      CALL FUNCTION 'C14W_STRING_TO_TLINE'

        EXPORTING

          i_string    = str

        TABLES

          e_tline_tab = gt_line.

    ENDLOOP.

  ENDIF.

0 Kudos

OK. I found the reason why string turn into hexadecimal digit. Because I use function CONVERT_ITF_TO_ASCII before sending output. The reason why I use this function cause I have a problem with Ampersand (&).

Ex. Q & A.

When I print preview it display like Q <(>&<)> A. I found some thread in this community say that to resolve this problem I have to use this function.

Tomas_Buryanek
Active Contributor

No, it is because you are using C14W_STRING_TO_TLINE function !

EDIT: (Rant - this "new" forum replace of SCN s really bad, for some reason I can not use @ here to mention OP, also everyone mistakes answers for comments etc..)

-- Tomas --

matt
Active Contributor

@ tomas

@ works for some, not for others. Like just now!

We've been told that the reply, answer, comment is designed as intended. And won't be changed. Of course as experienced developers, we know that 'designed like that' does not mean the design is good.

0 Kudos

tomas.buryanek Then how can I put lt_tab data that come from function CONVERT_ITF_TO_ASCII to gt_line (TLINE table) without use C14W_STRING_TO_TLINE function.

Tomas_Buryanek
Active Contributor
0 Kudos

Interhides IHL Depends why you need it in TLINE table? Can you do it with just APPEND/INSERT into TLINE table (and maybe add * as standard paragraph format)?

-- Tomas --

0 Kudos

tomas.buryanek That's right! Now I cut C14W_STRING_TO_TLINE function off and just APPEND to GT_LINE directly.

But I have found another problem. When I print preview the first two character not shown. So I add two character before append to GT_LINE then it now show. I have no idea why this happening.

LOOP AT lt_tab INTO wa_temp.
      CONCATENATE 'AA' wa_temp INTO wa_temp.
      APPEND wa_temp TO GT_LINE.
ENDLOOP.

Tomas_Buryanek
Active Contributor
0 Kudos

Interhides IHL it is because you did not look into TLINE structure. It is a structure with two columns, first is for a paragraph format and second is for a text...

-- Tomas --

0 Kudos

tomas.buryanek matthew.billingham Thank you very much.