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

Using long text in Mobile 7.1

Hello,

We are using Mobile 7.1. We want to display a long text of the notification object in the Mobile Client. We defined this field as STRING data type in the DOE and set TEXT MEMO flag for it. Unfortunately we have a problem with its definition in the backend. This field is included in the header structure for the noitification obect so when we define it as STRING (DSTRING data element), we get compilation error that STRINGS cannot be defined in the flat structure.

So how can we define this field in the backend in order to transfer more than 256 characters?

Thanks in advance,

Sergey

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Dec 23, 2008 at 12:44 PM

    Hello Narayani,

    First of all, thanks a lot. The solution that you provided solved the problem.

    Before I'm closing the thread and giving you all the points 😉, I want to ask you about the opposite direction - how to download the long text to the backend from DOE? In the attachments we can choose "Upload" direction and to create another function module.

    But how should this function module to be defined (import, export and so on)?

    How does DOE know to call it in CREATE, MODIFY or DELETE?

    Thanks in advance,

    Sergey

    Add a comment
    10|10000 characters needed characters exceeded

    • Hi,

      You are most welcome. I am glad the problem is solved.

      For long text fortunately(for BLOB you need to write code) you dont have to write any upload program. It works the same way as you create, modify or delete any other data/row e.g. Notification type, details etc. Reason its just text no change has to be made when data is sent from the client. It goes the same way as the other rows.

      Just you need to provide a text view with some rows which is large enough to hold data for the long text.

      Bind the field as you have done for other fields(you would have done all this).

      When you create a particular row the data that there / will be entered in the text view for this will get updated automatically.

      Thanks and Regards,

      Narayani

  • Posted on Dec 23, 2008 at 10:39 AM

    Hi,

    You need to have a separate table to store attachments in the backend.

    In the DOE define the attribute as STRING(tick the text memo) [This you have already done] .

    In the backend you will need another table where you will be storing the attachments.

    Lets assume you have a notification table : In this define the field for headertext with the data type as CHAR and length 1

    Create another table where you want to store the attachments:

    You can have the fields as NOTIFICATION and HEADERTEXT. This headertext should have a datatype STRING. You can also have a field called attachment type to store whether it is HeaderText or Binary Memo.

    Create a BAPI wrapper for getting the HEADERTEXT with importing parameter as NOTIFICATION and exporting HeaderText and a return parameter:

    Here the source code:

    SELECT SINGLE b~headertext INTO e_headertext

    FROM <notification table> AS a

    INNER JOIN <attachment table> AS b ON

    borderid = aorderid

    WHERE a~orderid = orderid AND

    a~headertext = 'X' and

    b~ATTCHTYP = 'HEDTXT'.

    Now in the DOE : give this function module name in the attachment Function module. SAVE (very important)

    After doing the mapping go to the attachment tab and do the mapping with the attachment function module.

    save and activate the backend adapter.

    execute SDOE_LOAD.

    Go to SE11: there should be a table starting <cds table name>ending with _TM.

    Create an application in the similar way. No extra code required.

    Thanks and Regards,

    Narayani

    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.