cancel
Showing results for 
Search instead for 
Did you mean: 

Copy Sales OrderTexts tab into a Custom Screen in my Module Pool Program

Hello Experts!

I hope you're doing good fine.

I have a requirement that consists on copying the Text tab in the Sales Order Header tab into my own Z Module Pool Program, in this case whenever i change texts in my program it should also change in the Sales Order.

test.png

Sandra_Rossi
Active Contributor
0 Kudos

Please embed your screenshot instead of link. Like that:

Please clarify your request:

  • "to have the whole layout of the Tab, i mean the way the test is managed in the Sales Order tcode (with all the buttons..etc)."

What I understand so far of your request:

  • You don't care about having a tab strip in your custom program, you just want to mimic what is inside Texts tab.
  • You want to mimic left and right sides: it's control CL_GUI_SPLITTER_CONTAINER inside dynpro "custom control".
  • You want to mimic the left side: it's CL_GUI_COLUMN_TREE
  • You wan to know how to get the list of possible text types: I don't know
  • You want to mimic the right side: it's CL_GUI_TEXTEDIT
  • You want to read and save texts: it's function modules READ_TEXT and SAVE_TEXT
  • "with all the buttons": at the top, it's part of CL_GUI_TEXTEDIT, at the bottom it's part of the dynpro

For more information:

  • Use the SAP GUI trace tool
  • Use the backend debugger tool "Screen analysis"

Accepted Solutions (0)

Answers (3)

Answers (3)

raymond_giuseppi
Active Contributor
0 Kudos

What did you already try

  • Including some standard code into your program
  • Handling it yourself with FM READ_TEXT/SAVE_TEXT (*), a class such as CL_GUI_TEXTEDIT, an ALV or table control for the list of texts (you first MUST analyze the text Customizing of copy text rules and profiles)

(*) or better, BAPI_SALESORDER_CHANGE (table parameter ORDER_TEXT)

noumantahir
Explorer
0 Kudos

1. create custom container in the screen (name = 'TEXTEDIT') then set custom container as a text editor in PBO Module. create internal table for reading and puting text in the screen. Try to check the code in below.

  • Variable

DATA: container TYPE REF TO cl_gui_custom_container,

editor TYPE REF TO cl_gui_textedit,

text_tab LIKE STANDARD TABLE OF line.

*PBO

MODULE set_text_editor OUTPUT.

CREATE OBJECT: container EXPORTING container_name = 'TEXTEDIT',

editor EXPORTING parent = container. ",

CALL METHOD editor->set_text_as_stream

EXPORTING

text = text_tab.

ENDMODULE. " set_text_editor OUTPUT

*PAI

MODULE user_command_0100 INPUT.

CASE ok-code.

WHEN 'SAVE'.

CALL METHOD editor->get_text_as_stream

IMPORTING

text = text_tab.

WHEN 'BACK'.

LEAVE PROGRAM.

WHEN 'EXIT'.

LEAVE PROGRAM.

ENDCASE.

ENDMODULE. " set_text_editor

noumantahir
Explorer
0 Kudos

Above requirement consist on steps.

1-double click on long text and get text header.

2- Pass Header details to below program to read text. i.e Text name, language, text id, text object

3- it will return you long text of subjected header in ITAB tline2

4-populate tline2 in you Zmodule screen

5- make you required changes in screen and save the using function module SAVE_TEXT .

REPORT ZMNT_DOCUMENT_LONG_TEXT.
TABLES:TLINE,THEAD.
PARAMETERS:ID LIKE THEAD-TDID DEFAULT 'ZTX1',
LANGUAGE LIKE THEAD-TDSPRAS DEFAULT 'EN',
NAME LIKE THEAD-TDNAME NO-DISPLAY,
OBJECT LIKE THEAD-TDOBJECT DEFAULT 'VBBK'.
data: tline2 like TABLE OF tline WITH HEADER LINE.
SELECT-OPTIONS: name1 for THEAD-tdname no INTERVALS.
LANGUAGE = 'EN'.
OBJECT = 'VBBK'.
ID = 'ZTX1'.
WRITE:/(105) sy-ULINE.
WRITE:/(30)'Document Number' , '|' ,(70)'Long Text','|'.
WRITE:/(105) sy-ULINE.
loop at name1.
* WRITE:/ name1-low.
name = name1-low.
CALL FUNCTION 'READ_TEXT'
EXPORTING
* CLIENT = SY-MANDT
id = id
language = language
NAME = name
OBJECT = OBJECT
* ARCHIVE_HANDLE = 0
* LOCAL_CAT = ' '
* IMPORTING
* HEADER =
* OLD_LINE_COUNTER =
TABLES
lines = TLINE2
* EXCEPTIONS
* ID = 1
* LANGUAGE = 2
* NAME = 3
* NOT_FOUND = 4
* OBJECT = 5
* REFERENCE_CHECK = 6
* WRONG_ACCESS_TO_ARCHIVE = 7
* OTHERS = 8
.
LOOP AT tline2.
IF TLINE2-tdline IS NOT INITIAL.
WRITE:/(30) name , '|' ,(70)TLINE2-tdline,'|'.
WRITE:/(105) sy-ULINE.
ENDIF.
ENDLOOP.
ENDLOOP.

0 Kudos

Hello noumantahir,

Thank you so much for your answer, but i think i wasn't clear with my problem :), actually, what i need is to have the whole layout of the Tab, i mean the way the test is managed in the Sales Order tcode (with all the buttons..etc). Do you please have any idea about that ?

Thanks,

Hamza