Automate

 View Only
Expand all | Collapse all

Customer Texts format

  • 1.  Customer Texts format

    Posted 08-25-2025 03:49
    Edited by Nart Paksamut 08-25-2025 04:01

    Is there a way to upload Customer Texts in an exact format?

    I've tried using RFC but it doesn't work. It copies the whole text in a single row and if that row exceeds the characters, it will update the second row and so on.

    Example format:

    ORDER No. XXXXXXX
    IDF No. XXXXXXXX
    CONT No. XXXXXX
    SEAL No. XXXXXX

    The format and value is provided in a single cell in an Excel file.

    In BP Sales Area (SalesOrg, Distribution Channel level)

    Each wording is in a specific row.



    ------------------------------
    Best Regards,
    Nart
    ------------------------------



  • 2.  RE: Customer Texts format

    Posted 08-25-2025 11:52

    Nart,

    I've used the function module /WINSHTLQ/TRN_CREATE_TEXT and it works just fine how you described.  Below is a screenshot from my load file as well as the loaded data within SAP.




    ------------------------------
    Andrew Landry
    Leprino Foods Company
    CO
    ------------------------------



  • 3.  RE: Customer Texts format

    Posted 08-25-2025 23:01

    Hi Andrew,

    Are you saying that it will split the text line by line automatically to SAP?

    Could you please share the script, and an example load file?



    ------------------------------
    Best Regards,
    Nart
    ------------------------------



  • 4.  RE: Customer Texts format

    Employee
    Posted 08-25-2025 19:57
    Edited by Sigrid Kok 08-25-2025 19:57

    Hi Nart

    Try using carriage returns in Excel  - alt enter - if using the Function Module

    If using the line editor, check out the "LINE" opetion to insert a new line, which includes a carriage return.

    Hope that helps,

    Sigrid



    ------------------------------
    Sigrid Kok
    *Precisely Software Inc.
    ------------------------------



  • 5.  RE: Customer Texts format

    Posted 08-25-2025 23:05

    Hi Sigrid,

    I'm not sure I follow. Could you please provide some example screenshot or script/data file?



    ------------------------------
    Best Regards,
    Nart
    ------------------------------



  • 6.  RE: Customer Texts format

    Employee
    Posted 08-26-2025 09:36

    Hi Nart

    If I understand you correctly, you want the text you have on separate lines. 

    Please look at my recent post on adding long text without the function module here: https://community.precisely.com/discussion/tip-of-the-week-how-to-add-text-to-long-text-without-the-function-module?ReturnUrl=%2fcommunities%2fcommunity-home%2fdigestviewer%3fcommunitykey%3d4418e63a-9f6f-4468-b3f1-0186605ed001

    If you use the function module, you can just add carriage returns to the text, and it should upload in the proper format.

    Best Regards,

    Sigrid



    ------------------------------
    Sigrid Kok
    *Precisely Software Inc.
    ------------------------------



  • 7.  RE: Customer Texts format

    Posted 08-26-2025 22:17

    Hi Sigrid,

    Thank you, I saw your post. It might be a bit complicate for other users (I'm not the only one using it) if there is an error.

    We do have the FM installed but I couldn't get the /WINSHTLQ/TRN_CREATE_TEXT to work like what Andrew said. Is it possible for you to give an example Script and load file for reference?



    ------------------------------
    Best Regards,
    Nart
    ------------------------------



  • 8.  RE: Customer Texts format

    Employee
    Posted 08-27-2025 10:07

    Hi Nart

    That post has an example via the tcode and line editor with screen shots.

    Again, from what you posted, you want the text to be on specific lines, so use a carriage return for the input data or click LINE to add a row. 

    What specifically are you missing, please, and I/we can try to help?  

    Thanks

    Sigrid



    ------------------------------
    Sigrid Kok
    *Precisely Software Inc.
    ------------------------------



  • 9.  RE: Customer Texts format

    Posted 08-27-2025 22:12

    Hi Sigrid,

    I was referring the use of /WINSHTLQ/TRN_CREATE_TEXT function that Andrew mentioned in the screenshot. The issue is I don't have an example script/load file for this. Do you have an example script/load file for /WINSHTLQ/TRN_CREATE_TEXT function?



    ------------------------------
    Best Regards,
    Nart
    ------------------------------



  • 10.  RE: Customer Texts format

    Employee
    Posted 08-28-2025 17:34

    Hi Nart

    You can do this, but I am including an example on more time. If anyone else asks about long text, I will send them to this post and the tips of the week, and then maybe you :)

    Link to the documentation: https://help.precisely.com/r/n/Automate-Function-Module/pub/Latest/en-US/Automate-Function-Module/WINSHTLQ/TRN_CREATE_TEXT?tocId=h0Bw9XpdwC1gankkH3D_YA

    The key is open the text in the GUI and then click Goto - Header - and you'll see what you need to pass in

    That translate to this Direct script 

    note the Name which is the object id in this case is a mixture of bp # and sales area. KNVV for Sales and 0001 for text type - in this case sales text.

    I would likely hardcode the KNVV and 0001, and then I would use an Excel formula to concatenate bp number with sales area for the name (aka object id). The tag column defaults to "*" which is the equivalent of the insert button. If you swap it to "/", it does a carriage return aka Line button.

    Also be sure to set SAVE DIRECT to "X".

    There's a second approach - using the LINE in the WinOptions table. It will take up to 144 characters and split them for you, but based on your requirement, I don't think that's what you want.

    This will overwrite anything in the text that you had when you run it.

    Cheers,

    Sigrid



    ------------------------------
    Sigrid Kok
    *Precisely Software Inc.
    ------------------------------



  • 11.  RE: Customer Texts format

    Posted 08-29-2025 05:08

    Hi Sigrid,

    I appreciate it, it works :)

    Although it doesn't work on what I am trying to do.

    What I am trying to do is transfer below value from a cell in Excel

    To in SAP like below

    Is this possible to do?



    ------------------------------
    Best Regards,
    Nart
    ------------------------------



  • 12.  RE: Customer Texts format

    Employee
    Posted 08-29-2025 10:17

    That's exactly what the script did for me, Nart.

    What is it doing? 

    Can you use the tag column to include "/" per the documentation link or use another tag to have separate lines?

    Please advise with details,

    Sigrid



    ------------------------------
    Sigrid Kok
    *Precisely Software Inc.
    ------------------------------



  • 13.  RE: Customer Texts format

    Posted 08-31-2025 23:15

    Hi Sigrid,

    I tried putting "/" in the tag column but it doesn't work for me.

    I've attached the script and data file for your reference. Could you please advise what's did I miss?

    Script:

    Result:



    ------------------------------
    Best Regards,
    Nart
    ------------------------------

    Attachment(s)

    Txr
    BAPI Customer Text.Txr   41 KB 1 version
    xlsx
    BP Text.xlsx   9 KB 1 version


  • 14.  RE: Customer Texts format

    Employee
    Posted 09-02-2025 11:25

    Hi Nart

    Thanks for sharing your script.  Please review what I sent - as we are getting completely different results: 

    • my script uses a loop and uploads individual lines with a line number
    • your script is attempting to upload text in one chunk  

    Completely different results.

    Also for the key, you can use a formula like this: =CONCATENATE(TEXT(D2,"0000000000"),TEXT(E2,"0000"),TEXT(F2,"00"),"00")

    I'm assuming division is "00" - otherwise use another column for input and use a similar format.

    Best Regards,

    Sigrid 



    ------------------------------
    Sigrid Kok
    *Precisely Software Inc.
    ------------------------------



  • 15.  RE: Customer Texts format

    Posted 09-02-2025 22:25

    Hi Sigrid,

    Please bear with me. I understand that it's a different scenario. I've already reviewed your script.

    I am referring to the scenario for uploading a chunk text and it auto split into different rows in SAP. The same scenario that @Andrew Landry show, but he didn't provide the script and data file to view. Is it possible for you to provide an example in this scenario?



    ------------------------------
    Best Regards,
    Nart
    ------------------------------



  • 16.  RE: Customer Texts format

    Employee
    Posted 09-02-2025 22:36

    Hi Nart

    The Automate Function Module method to upload long text does that.

    @Andrew Landry would have to comment on his example.

    Best Regards,

    Sigrid



    ------------------------------
    Sigrid Kok
    *Precisely Software Inc.
    ------------------------------



  • 17.  RE: Customer Texts format

    Posted 09-03-2025 10:02

    Here is a copy of the load file and script I displayed in my earlier reply.



    ------------------------------
    Andrew Landry
    Leprino Foods Company
    CO
    ------------------------------

    Attachment(s)



  • 18.  RE: Customer Texts format

    Employee
    Posted 09-03-2025 19:13

    That works great, @Andrew Landry, thanks for sharing.

    I haven't used this BAPI before, so it's a great find to use this approach! 

    Please note for anyone finding this tip that the text line is limited to 140 characters and it is automatically split for you and loaded, plus it respects the carriage returns from Excel.. 

    Best Regards,

    Sigrid



    ------------------------------
    Sigrid Kok
    *Precisely Software Inc.
    ------------------------------



  • 19.  RE: Customer Texts format

    Posted 09-03-2025 22:40

    Works for me too. Thank you @Andrew Landry for sharing!

    It wasn't working for me when I created due to, I chose the FLINES under TABLES.

    For those that are looking to use this BAPI /WINSHTLQ/TRN_CREATE_TEXT • Automate Function Module • Reader • Welcome to the Precisely Help Center, make sure to only select ExportOthers fields under INPUT STRUCTURES.

    @Sigrid Kok Thank you for driving this.

    Noted on the 140 characters.



    ------------------------------
    Best Regards,
    Nart
    ------------------------------