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

PO header text

Former Member
0 Likes
2,476

hi,

there is a function or method that give me the PO header text? I mean, exactly how we can see it in ME22n (same presentation with screens and editor...).

thank for you help,

joseph

PS: to retreive the text it's not a problem (FM READ_TEXT) i'm more interresting about how to retreive the "design"

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,181

Joseph,

READ_TEXT is the only way. In fact this function will also give the formatting that has been done if that is what you are interested in. The TLINE table has two fields.

TDFORMAT - Gives the format for that line

TDLINE - Gives the text.

Were you looking for something more?

Regards,

Ravi

Note : Please mark the helpful answers

Joseph,

READ_TEXT is the only way. In fact this function will also give the formatting that has been done if that is what you are interested in. The TLINE table has two fields.

TDFORMAT - Gives the format for that line

TDLINE - Gives the text.

Were you looking for something more?

Regards,

Ravi

Note : Please mark the helpful answers

13 REPLIES 13
Read only

Former Member
0 Likes
2,181

HI Joseph,

Do a partial BDC for navigating upto that screen and use the call transaction in 'E' mode.

If the number of values that are to be passed to the fields on the transaction is less, then you can use set parameter for all those fields and call the transaction.

Regards,

Ravi

Read only

Former Member
0 Likes
2,182

Joseph,

READ_TEXT is the only way. In fact this function will also give the formatting that has been done if that is what you are interested in. The TLINE table has two fields.

TDFORMAT - Gives the format for that line

TDLINE - Gives the text.

Were you looking for something more?

Regards,

Ravi

Note : Please mark the helpful answers

Read only

0 Likes
2,181

Hi everyone,

another solution could be performing a call transaction on tx ME22 (not ME22N).

Regards,

Alvaro

Read only

0 Likes
2,181

Hi,

BDC is not a solution: user doesn't have authorization to display/change PO.

ravi, as i said retrieve the data is not a problem. The problem is how can display them exactly the same way as ME22/23n does it.

thanks for your help

Read only

0 Likes
2,181

Hi Joseph,

check this sample module pool..

PROGRAM  z_test_text    .
DATA: txt     TYPE REF TO cl_gui_textedit,
      txt_con TYPE REF TO cl_gui_custom_container.
DATA: gt_text(100) OCCURS 10 WITH HEADER LINE.
DATA: BEGIN OF it_tab OCCURS 0,
      LINE(100),
      END OF it_tab.

start-of-selection.


*&---------------------------------------------------------------------*
*&      Module  STATUS_1000  OUTPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
MODULE status_1000 OUTPUT.
  SET PF-STATUS 'TEXT'.
  SET TITLEBAR 'TEXT AREA'.
it_tab-line = 'aaaaaa'.
append it_tab.
it_tab-line = 'bbb'.
append it_tab.
it_tab-line = 'ccc'.
append it_tab.
it_tab-line = 'ddd'.
append it_tab.

it_tab-line = 'aaa'.
append it_tab.
it_tab-line = 'bbb'.
append it_tab.
it_tab-line = 'ccc'.
append it_tab.
it_tab-line = 'ddd'.
append it_tab.

it_tab-line = 'aaa'.
append it_tab.
it_tab-line = 'bbb'.
append it_tab.
it_tab-line = 'ccc'.
append it_tab.
it_tab-line = 'ddd'.
append it_tab.

it_tab-line = 'aaa'.
append it_tab.
it_tab-line = 'bbb'.
append it_tab.
it_tab-line = 'ccc'.
append it_tab.
it_tab-line = 'ddd'.
append it_tab.

it_tab-line = 'aaa'.
append it_tab.
it_tab-line = 'bbb'.
append it_tab.
it_tab-line = 'ccc'.
append it_tab.
it_tab-line = 'ddd'.
append it_tab.

it_tab-line = 'aaa'.
append it_tab.
it_tab-line = 'bbb'.
append it_tab.
it_tab-line = 'ccc'.
append it_tab.
it_tab-line = 'ddd'.
append it_tab.
*-- test display in text area
*  gt_text = 'aaa'.
*  APPEND gt_text.
*-- populating gt_text from it_tab.
 loop at it_tab.
    gt_text = it_tab-line.
    append gt_text.
 endloop.

ENDMODULE.                 " STATUS_1000  OUTPUT
*&---------------------------------------------------------------------*
*&      Module  pbo_1000  OUTPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
MODULE pbo_1000 OUTPUT.
  DATA: container(30).

  container = 'TEXT'.

  IF txt IS INITIAL.
    CREATE OBJECT txt_con
     EXPORTING
       container_name = container
     EXCEPTIONS
       OTHERS = 1.

    CREATE OBJECT txt
      EXPORTING
       parent = txt_con
       wordwrap_mode  = cl_gui_textedit=>wordwrap_at_fixed_position
       wordwrap_to_linebreak_mode = cl_gui_textedit=>true.
  ENDIF.

  CALL METHOD txt_con->link
    EXPORTING
      repid     = sy-repid
      dynnr     = '1000'
      container = container.

  CALL METHOD txt->set_toolbar_mode
    EXPORTING
      toolbar_mode = txt->true.

  CALL METHOD txt->set_statusbar_mode
    EXPORTING
      statusbar_mode = txt->true.

  CALL METHOD txt->set_wordwrap_behavior
    EXPORTING
      wordwrap_mode = txt->true.

*-- set text -------------------------------------------
  IF gt_text[] IS INITIAL.

  ENDIF.

  CALL METHOD txt->set_text_as_r3table
    EXPORTING
      table = gt_text[].

  <b>CALL METHOD txt->set_readonly_mode.</b>

ENDMODULE.                 " pbo_1000  OUTPUT
*&---------------------------------------------------------------------*
*&      Module  USER_COMMAND_1000  INPUT
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
MODULE user_command_1000 INPUT.
  CASE sy-ucomm.
    WHEN  'BACK'.
      LEAVE TO SCREEN 0.
  ENDCASE.

ENDMODULE.                 " USER_COMMAND_1000  INPUT

this method is used to switch betwwen change and display mode

<b>CALL METHOD txt->set_readonly_mode.</b>

Regards

vijay

Read only

0 Likes
2,181

Joseph,

I understand the reading is not the issue, but the formatting is your concern. That is why I was talking about FORMAT also being returned in READ_TEXT.

Can you tell us, where are you trying to show the data and how to you plan to do it.

Regards,

Ravi

Read only

0 Likes
2,181

hi ravi,

I've got a ALV report where I show some PO informations. Header text in one of them. We decide to display only 30 characteres of the text in the report. if the user want to see more he just have to double click on the text.

And here is the issue. I can show him the text in POPUP or sapscript editor, but i want the display to be exactly as is it in ME22/23N.

Read only

0 Likes
2,181

Joseph,

Now I kind of understand why you are so concerned about the formats.

Well, unfortunately, the TEXT EDIT control doesn't take the formatting into consideration. So, I am not sure, if we are left with any options.

In fact it doesn't work with TRM_COMMENT_POPUP_EDIT either as the table expected will not have the format.

Regards,

Ravi

Read only

Former Member
0 Likes
2,181

Hi Joseph,

By design, do u mean the way the texts are entered?? eg,

<b> Engine Chassis

0000000001 000000002</b>

suppose this is entered as the text.. do u want to retreive it as entered or i ve misunderstood u??

if yes, then by using READ_TEXT and getting the text in a single internal table, u can get the text as it has been entered.

Hope it helps,

Regards,

Bikash

Read only

sergey_korolev
Active Contributor
0 Likes
2,181

In ME22N they obviously use CL_GUI_TEXTEDIT control.

Read only

Former Member
0 Likes
2,181

Hi,

internally it calls the same FM with all the attributes like textid , object id and shows the FM.

for PO header text you need to use READ_TEXT fm.

Text object               EKKO       
Text Name                 4700000006 
Text ID                   F05        
Language Key              E  

Text object is (TDOBJECT )is EKKO

Text name (TDNAME)isPO number 4700000006

Text id (TDID) F05/F07 varies check it once

language E

Regards

vijay

Read only

0 Likes
2,181

Hi,

design is based on Classes , the class is CL_GUI_TEXTEDIT,

for example check this FM <b>TRM_COMMENT_POPUP_EDIT</b>, run it and see how it is displaying.

it will be similar to the same one.

Regards

vijay

Read only

0 Likes
2,181

hi!

if you go to the text editor head of one text item in po you will see some paarmeters, with these parameters(i think that they are combinations of ebeln and posnr ) and fm read_text. you can obtein the long text.

Regards