on 03-12-2021 4:57 PM
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.
What did you already try
(*) or better, BAPI_SALESORDER_CHANGE (table parameter ORDER_TEXT)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
User | Count |
---|---|
85 | |
7 | |
6 | |
4 | |
3 | |
3 | |
3 | |
3 | |
3 | |
2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.