Skip to Content
author's profile photo Former Member
Former Member

Concatenate Long Text Into String for smart form Printing.

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

Capture.PNG (33.5 kB)
Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

8 Answers

  • Best Answer
    Posted on Apr 24, 2014 at 08: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...

    Add a comment
    10|10000 characters needed characters exceeded

    • 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

      Texts1.jpg (98.8 kB)
  • Posted on Apr 24, 2014 at 07: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.


    Untitled.png (23.5 kB)
    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Apr 24, 2014 at 07: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

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Apr 24, 2014 at 08: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

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Apr 24, 2014 at 07: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

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Apr 24, 2014 at 07: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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Apr 24, 2014 at 08:07 AM

    Thank you for all your replies 😊 😊

    Regards

    Vishnu Ravi

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Apr 26, 2014 at 04:50 AM

    Thank you for all your replies 😊 😊

    Problem Solved .

    Regards

    Vishnu Ravi

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.