cancel
Showing results for 
Search instead for 
Did you mean: 

Using long text in Mobile 7.1

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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

0 Kudos

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

Answers (1)

Answers (1)

0 Kudos

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