cancel
Showing results for 
Search instead for 
Did you mean: 

Backend Search + attachment

Former Member
0 Kudos

Hi guys.

I try use backend search + attachment function in DOE+SUP. but the return object field in SUP for attachment every time return null.

I read the text DOEu2019s Attachment Capability - with a Sample Application but its explaind only about DOE.

I need help, please.

FUNCTION VERSION_ATTACH.

*"----


""Local Interface:

*" IMPORTING

*" VALUE(VERSION_ID) TYPE ZCONTROLVERSION-VERSION_ID

*" EXPORTING

*" VALUE(VERSION_ATTACH) TYPE ZCTRLVER_FILE-CONTENT

*" TABLES

*" RETURN STRUCTURE BAPIRET2

*"----


data: lpar1 like sy-msgv1,

lpar2 like sy-msgv2,

lpar3 like sy-msgv3,

lpar4 like sy-msgv4 ,

lcl like sy-msgid,

ltype like bapireturn-type,

lnumber like sy-msgno,

bapireturn type bapiret2.

data tmp type ZCTRLVER_FILE.

select single *

from ZCTRLVER_FILE

into tmp

where version_id = version_id.

VERSION_ATTACH = tmp-CONTENT.

call function 'BALW_BAPIRETURN_GET2'

exporting

type = 'S'

cl = lcl

number = lnumber

par1 = lpar1

par2 = lpar2

par3 = lpar3

par4 = lpar4

" LOG_NO =

" LOG_MSG_NO =

" PARAMETER =

" ROW = 0

" FIELD =

importing

return = bapireturn.

append bapireturn to return.

ENDFUNCTION.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

I think you are trying to mix backend search and attachment together which actually doesn't work as far as I know. Let me explain you the both Backend Search and how the attachment stuff works and then you will get a clear idea.

1. Backend Search -

You use this when you want more data to be seen on device a part from the data which actully flowed to device based on distribution rule. In this case, you model a Backend search function module which actually contains certain Import parameters which forms the search criteria in your device application and the return structure of this FM has to be exactly the root node/header structure of your Data object. This is a mandatory requirement as per Gateway functionality.

2. Attachment -

Coming to attachment, CRM Mobile Sales application from Sybase doesn't support attachment's as of now. But the actual Backend functionality supports enhancements and these attachments are downloaded to DOE as well, but not downloaded/used on the device.

Also with DOE gateway, the attachements are not downloaded to mobile device directly. There is a seperate DOE Gateway service which nees to be called by passing Attachement ID/Guid 's Sync key and then this service will return you the actual attachment which is either text/binary. The way it works is, as a part of normal data download if there are any attachement related fields and if that particular record actually contains attachement then that field is returned from DOE gateway as 'X'. Then once you know that there is an an attachment associated with that record, you need make a seperate call to DOE gateway very similar to that of Backend search to fetch the actual attachment.

Now if you are trying to mix both Backend search and Attachment together, like when you do a backend search you also want the attachment in that then it doesn't work. Attachments must be downloaded to DOE as a part of normal data download and then from the device all you can do is try to request the actual attachment from the device using a seperate call/service. Mix of both is actually not supported as far as I know.

Thanks & Best Regards,

Siva.

Answers (0)