Types Of Texts in Smartforms
- Texts are used to display data on the smartform layout.
Types of Texts in Smartforms :-
1. Text Element :-
- These are not reusable texts.
- They are dedicated to one smartform only.
- That means, once we use them in one smartform, we cannot reuse them again.
2. Text Module :-
- It is a reusable text.
- It is a reusable text for smartforms.
3. Include Text :-
-
It is also a reusable text.
-
But comparing it with Text module, we can reuse it in smartforms, programs etc.
Transaction code for Include Text :-
- SO10.
Function Module to display Include Text :-
- READ_TEXT
4. Dynamic Texts :-
-
This text is used to display the text at run time in smartform.
( Pre - defined table type - TSFTEXT )
1. Practical Implementation for Text Elements :-
-
We have already implemented text elements in the smartform which we have created.
2. Practical Implementation for Text Module :-
-
We can create text module in smartform though SMARTFORMS transaction code only.
-
We can use the text, module in the same way as we create text elements.
3. Practical Implementation for Include Text :-
-
Go to SO10 transaction code.
-
Click on create button.
-
Write the text.
-
In the header, section you can see its details
-
Use it in your smartform
Using Include text in Program :-
*&---------------------------------------------------------------------*
*& Report ZAR_INC_TEXT
*&---------------------------------------------------------------------*
*&
*&---------------------------------------------------------------------*
REPORT ZAR_INC_TEXT.
DATA : lt_line type table of TLINE.
CALL FUNCTION 'READ_TEXT'
EXPORTING
* CLIENT = SY-MANDT
id = 'ST'
language = 'E'
NAME = 'ZAR_INC_TEXT'
OBJECT = 'TEXT'
* ARCHIVE_HANDLE = 0
* LOCAL_CAT = ' '
* IMPORTING
* HEADER =
* OLD_LINE_COUNTER =
TABLES
lines = lt_line
EXCEPTIONS
ID = 1
LANGUAGE = 2
NAME = 3
NOT_FOUND = 4
OBJECT = 5
REFERENCE_CHECK = 6
WRONG_ACCESS_TO_ARCHIVE = 7
OTHERS = 8
.
TRY.
CALL METHOD cl_salv_table=>factory
EXPORTING
list_display = IF_SALV_C_BOOL_SAP=>FALSE
* r_container =
* container_name =
IMPORTING
r_salv_table = data(lo_alv)
CHANGING
t_table = lt_line
.
CATCH cx_salv_msg.
ENDTRY.
lo_alv->display( ).
Execute the Code :-
4. Dynamic Texts Implementation :-
-
We can use this text, for passing text to smartform at the runtime.
-
We have a built in table type ( TSFTEXT ) which we can use for the same purpose.
Comments
Post a Comment