04-24-2014 8:15 AM
Hi ,
I want to move the data of long text into the string in the exporting and importing process i the module pool , i have the defined the
DATA NEC TYPE TABLE OF char255. for exporting and importing the text in which i could able to concatenate the line item of the text in the NEC ,please suggest me the solution for this .
Regards
Vishnu Ravi
04-24-2014 9:49 PM
A bit confused by the choice of a helpful reply here... Instead of "wrapping" and "unwrapping" text why not just let the Smartform refer to the include text (as Mehwish suggested)? Or why not just pass a table to the Smartform (doesn't have to be a string)? Or even using the FM mentioned by Rajkumar would still be better than counting characters...
04-24-2014 8:33 AM
Hi Vishnu,
As per my understanding you want to print this long text table in smart by sending it in string from driver program if it is the case i would suggest you to export the NEC table to smart form and there use the Program lines code and separate as per your requirement.
Please let me know if i am wrong.
Regards,
Pavan
04-24-2014 8:37 AM
Hello Vishnu,
You can transfer the content of the NEC table to some string variable by LOOPing. Import that string to smartform. Print the string as follow:
v_length = 255.
&v_ltext(v_length)&&v_ltext+255(v_length)&&v_ltext+510(v_length)& and so on.
Hope this helps.
Regards,
Anubhab
04-24-2014 8:39 AM
Instead of concatenating the text in string, use "include text" option of text node. fill the text object, ID and name and long text would be displayed accordingly.
04-24-2014 8:45 AM
Dear Ravi,
I I have faced the similar issue and found there is single way to print line item in smartform.
you have to get each line of the table in variable and Concatenate them in a single variable(you can loop on itab and concatenate the work area) and then split them on "." or some special character to store in different variable.
Print these variable to the smartform text.
In case of PO header text, you have the similar solution in smartform.
Regards,
Chandan
04-24-2014 9:07 AM
04-24-2014 9:12 AM
Dear Vishnu,
To convert the Internal Table into String, use the following Function module 'IDMX_DI_TLINE_INTO_STRING'.
"Function to convert the Internal Table to String
CALL FUNCTION 'IDMX_DI_TLINE_INTO_STRING'
EXPORTING
it_tline = nec
IMPORTING
EV_TEXT_STRING = l_mat_desc.
Regards
Rajkumar Narasimman
06-11-2014 4:11 AM
04-24-2014 9:49 PM
A bit confused by the choice of a helpful reply here... Instead of "wrapping" and "unwrapping" text why not just let the Smartform refer to the include text (as Mehwish suggested)? Or why not just pass a table to the Smartform (doesn't have to be a string)? Or even using the FM mentioned by Rajkumar would still be better than counting characters...
04-25-2014 5:45 AM
Hi Jelena,
As per you and Mehwish suggestion that of adding the Include text into the smart forms is quite fine but is that possible to fetch the data from INDX table.
Regards
Vishnu Ravi
04-25-2014 6:01 AM
Please share your requirement in detail. Are you using FM "READ_TEXT" to read text in your NEC internal table? How is your NEC internal table being populated?
Regards
04-25-2014 6:17 AM
Hi Mehwish,
The exporting code :
DATA NEC TYPE TABLE OF char255.
FORM SAVE_NECDATA .
CLEAR NEC[].
CALL METHOD EDIT_QRY->GET_TEXT_AS_R3TABLE
* EXPORTING
* only_when_modified = FALSE
IMPORTING
TABLE = NEC.
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = IT_VAT-SANCTION_NO
IMPORTING
OUTPUT = V_CAPN1.
MOVE V_CAPN1 TO V_NCTP1.
INDX-AEDAT = SY-DATUM.
INDX-USERA = SY-UNAME.
INDX-PGMID = SY-REPID.
SELECT *
FROM INDX
WHERE RELID = 'CP'
AND SRTFD = V_NCTP1.
ENDSELECT.
IF SY-SUBRC <> 0.
CLEAR WA_REF.
WA_REF-RELID = 'SANCT_ENT'.
WA_REF-KEYNO = IT_VAT-SANCTION_NO.
WA_REF-PGMID = INDX-PGMID.
WA_REF-REF1 = V_NCTP1.
INSERT YEXREF FROM WA_REF .
IF SY-SUBRC = 0.
EXPORT NEC TO DATABASE INDX(CP) ID V_NCTP2.
ENDIF.
ENDIF.
FREE : V_CAPN1, V_NCTP1.
ENDFORM. " SAVE_NECDATA
THE IMPORTING CODE:
SELECT SRTFD
INTO V_ITKTX1
FROM INDX AS A INNER JOIN YEXREF AS B
ON B~REF1 = A~SRTFD
WHERE A~RELID = 'CP'
AND SRTFD = V_SAN.
ENDSELECT.
IF SY-SUBRC = 0.
IMPORT NEC FROM DATABASE INDX(CP) ID V_SAN.
ENDIF.
IF SY-SUBRC NE 0.
MESSAGE 'Data not Found' TYPE 'E'.
ENDIF.
04-25-2014 4:15 PM
Plot thickens... I'm honestly having trouble understanding this setup. What is it that you're trying to achieve exactly and why do you have to use INDX table and IMPORT/EXPORT? Surely there must be a simpler solution for a simple text...
04-25-2014 5:43 PM
You won't believe what kind of solutions for text output and persistence a highly qualified and capable programmers can come up with, given a cl_gui_textedit and a lowly smartform to work with, and enough freedom and time on their hands to get exactly where they think they will need to be after couple of years of changing requirements. Real ABAP programmers, having not found the requisite stuff in their /namespace/, start implementing their first "I want to have a note on that order form" requirement by coming up with cutting edge /namespace/cl_longtext and /namespace/cl_gui_control_editor. Learning along the way that maximum output length of string in SAP Smarform is 255 only doubles their determination to "do it right"
cheers
Janis
04-25-2014 6:36 PM
EDIT_QRY->get_textstream should return the text as string (it's cl_gui_textedit class, right?). String can be converted to "SapScript" or so called ITF Text using FM CONVERT_STREAM_TO_ITF_TEXT, which takes string table as input when LF = 'X'. The text in this format can then be relatively conveniently output in Smartform using Dynamic Text node:
where IT_TEXT is of type TLINE_T. I'm not sure if character formatting is preserved during conversion, but the Smartform would bind the values to variables (something like &sy-uname&) if those are found somewhere in the text.
Would something like this suit your requirement?
cheers
Janis
04-26-2014 5:50 AM
Thank you for all your replies
Problem Solved .
Regards
Vishnu Ravi