2014 Nov 20 10:13 AM
Hi all,
i am using READ_TEXT function module to read long text for line items, i have used these code lines
which is giving whole text in debugging but it is in splitted lines, so if i have lets say three line items
and my first line items contains a very long text then it splits into three lines, and unfortunately when i'm
using these long text to get printed in my smartforms ,it only printing some text from last.
My code is written below, please anybody tell me the required changes i have to perform
here to get whole long text (i am using command &WA_FINAL-TXZ05& to print the long text and TXZ05 is of type
tline-tdline).I know tline-tdline can hold only 132 char length, so not getting how could i achieve this.
DATA:BEGIN OF DT_LINES OCCURS 0,
TDFORMAT LIKE TLINE-TDFORMAT,
TDLINE LIKE TLINE-TDLINE.
DATA:END OF DT_LINES.
LOOP AT it_final INTO wa_final.
CONCATENATE WA_FINAL-EBELN WA_FINAL-EBELP INTO V_NAM.
CALL FUNCTION 'READ_TEXT'
EXPORTING
* CLIENT = SY-MANDT
ID = 'A01'
LANGUAGE = SY-LANGU
NAME = V_NAM
OBJECT = 'EKPO'
* ARCHIVE_HANDLE = 0
* LOCAL_CAT = ' '
* IMPORTING
* HEADER =
TABLES
LINES = DT_LINES
EXCEPTIONS
ID = 1
LANGUAGE = 2
NAME = 3
NOT_FOUND = 4
OBJECT = 5
REFERENCE_CHECK = 6
WRONG_ACCESS_TO_ARCHIVE = 7
OTHERS = 8
.
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CLEAR DS_LINES.
LOOP AT DT_LINES INTO DS_LINES.
WA_FINAL-TXZ05 = DS_LINES-TDLINE.
MODIFY IT_FINAL FROM WA_FINAL TRANSPORTING TXZ05 .
ENDLOOP.
ENDLOOP.
2014 Nov 20 10:27 AM
Hi
Go to your smartform inside main loop. Create a text element & Pass your read text values here as variable.
Regards:
Sumit
2014 Nov 20 10:27 AM
Hi
Go to your smartform inside main loop. Create a text element & Pass your read text values here as variable.
Regards:
Sumit
2014 Nov 20 10:36 AM
2014 Nov 20 10:40 AM
Hi
Include a field tdname in your it_sdesc table, which holds line item specific texts.
Modify your as per loop with modification.
2014 Nov 20 10:42 AM
i have written like this, and inside smartforms i have loop through IT_REQ INTO IT_REQ
and put the conditions as shown in screenshot, and i put it_req-text in the command
inside text, but nothing changes, please tell me what should i do.
While debugging i gets text according to v_nam, but i am unable to print the same.
2014 Nov 20 10:44 AM
Hi Ashish,
In below code, you are overwriting all the previous lines .
Please try changing the code as below and see if it helps.
DATA:BEGIN OF DT_LINES OCCURS 0,
TDFORMAT LIKE TLINE-TDFORMAT,
TDLINE LIKE TLINE-TDLINE.
DATA:END OF DT_LINES.
LOOP AT it_final INTO wa_final.
CONCATENATE WA_FINAL-EBELN WA_FINAL-EBELP INTO V_NAM.
CALL FUNCTION 'READ_TEXT'
EXPORTING
* CLIENT = SY-MANDT
ID = 'A01'
LANGUAGE = SY-LANGU
NAME = V_NAM
OBJECT = 'EKPO'
* ARCHIVE_HANDLE = 0
* LOCAL_CAT = ' '
* IMPORTING
* HEADER =
TABLES
LINES = DT_LINES
EXCEPTIONS
ID = 1
LANGUAGE = 2
NAME = 3
NOT_FOUND = 4
OBJECT = 5
REFERENCE_CHECK = 6
WRONG_ACCESS_TO_ARCHIVE = 7
OTHERS = 8
.
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CLEAR DS_LINES.
LOOP AT DT_LINES INTO DS_LINES.
concatenate WA_FINAL-TXZ05 DS_LINES-TDLINE. into WA_FINAL-TXZ05. ( Please make sure that WA_FINAL-TXZ05. is long enough to hold all the lines)
ENDLOOP.
MODIFY IT_FINAL FROM WA_FINAL TRANSPORTING TXZ05 .
ENDLOOP.
Thanks
Sri
2014 Nov 20 10:44 AM
-> Make sure to create a text inside the loop not under the loop. In your text -> select editor -> Goto Change editor -> &wa_req-text&.
2014 Nov 20 10:47 AM
i'm getting my text in smartform itself for each vname1 (it contains ebeln+ebelp).
And to print text values i am using the command &IT_REQ-TEXT& or &wa_req-text&.
But now the text field is coming to be blank,
please tell me where i am wrong.
2014 Nov 20 10:51 AM
For testing purpose in your include text replace &v_nam& with the combination of order and item. And check in your output whether you are able to display the complete text. Note: Here text for line item 1 will be displayed for the other line items too.
2014 Nov 20 10:54 AM
yes when i have kept text name as , it prints the long text in each row,
please tell me how could i achieve it, if i write a code to concatenate the ebeln and ebelp
before include text
2014 Nov 20 10:57 AM
Hi
you have created text cell under the loop for it_req it should be inside the loop and not under the loop.
What you need to do is create inside the loop, right click on loop -> Create -> Text. This will insert text cell inside the loop and here try to pass text details.
This change needs to be done only if you are using it_req to display text. No changes required if you are using include text.
2014 Nov 20 10:45 AM
Hi,
Loop internal table which you from FM read_text.
Copy the lines into another internal table.
Pass this internal table to smartforms through the TABLES parameter.
Try using INCLUDE_TEXT.
Thanks
Vijay
2014 Nov 20 10:49 AM
HI Ashish,
No need to use read_text to display text in smartform.
Create a Include text element in smartform to do this.
*Ensure that text element is not placed inside a template. In such case full text will not get printed.
Regards
Sreekanth