Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

u0130mport Datas Soc3 Database Table Problem?

Former Member
0 Likes
1,416

hi friends , I wrote this code but data didnt come in Soc3 database table. What is problem?

thank for all answers.

REPORT Z_Download_Document.

Parameters:
Classn Like Bapibds01-Classname Obligatory ,
Classtyp Like Bapibds01-Classtype Obligatory ,
Objkey Like Swotobjid-Objkey Obligatory .

Data : Gt_Objcont_tab Like Soli Occurs 0 With Header Line .
Data : Srtfd Like Soc3-Srtfd.
Data : Connections Like Bdn_con Occurs 0 With Header Line .

Start-Of-Selection.
Perform Get_Data.
Perform Download_Gos_Documents.

    * Perform Download_Documents.

&---------------------------------------------------------------------
*& Form Get_Data
&---------------------------------------------------------------------
FORM Get_Data .
CALL FUNCTION 'BDS_GOS_CONNECTIONS_GET'
EXPORTING
CLASSNAME = Classn
OBJKEY = Objkey
TABLES
GOS_CONNECTIONS = Connections.
ENDFORM. " Get_Data
&---------------------------------------------------------------------
*& Form Download_Documents
&---------------------------------------------------------------------
FORM Download_Documents .
Data : Attachments Type Standard Table Of Sood4.

Loop At Connections.
Append Connections-loio_id To Attachments.
Endloop.

CALL FUNCTION 'SO_DOCUMENTS_MANAGER'
EXPORTING
ACTIVITY = 'EXPO'
TABLES
DOCUMENTS = Attachments.
ENDFORM. " Download_Documents
&---------------------------------------------------------------------
*& Form Download_Gos_Documents
&---------------------------------------------------------------------
FORM Download_Gos_Documents .
Data: Lv_Filename Like Rlgrap-Filename.
Loop At Connections.
Srtfd = Connections-Loio_id+17(17).

Import Gt_Objcont_tab
From Database Soc3(dt) Id Srtfd.

Concatenate 'D:\' Connections-Objkey '\' Connections-Descript
'.' Connections-Docuclass Into Lv_Filename.

CALL FUNCTION 'SO_OBJECT_DOWNLOAD'
EXPORTING
FILETYPE = 'BIN'
PATH_AND_FILE = Lv_Filename
NO_DIALOG = 'X'
TABLES
OBJCONT = Gt_Objcont_tab.
Endloop.
ENDFORM. " Download_Gos_Documents

Added code tags

Edited by: Rob Burbank on Feb 27, 2009 4:02 PM

hi friends , I wrote this code but data didnt come in Soc3 database table. What is problem?

thank for all answers.

REPORT Z_Download_Document.

Parameters:
Classn Like Bapibds01-Classname Obligatory ,
Classtyp Like Bapibds01-Classtype Obligatory ,
Objkey Like Swotobjid-Objkey Obligatory .

Data : Gt_Objcont_tab Like Soli Occurs 0 With Header Line .
Data : Srtfd Like Soc3-Srtfd.
Data : Connections Like Bdn_con Occurs 0 With Header Line .

Start-Of-Selection.
Perform Get_Data.
Perform Download_Gos_Documents.

    * Perform Download_Documents.

&---------------------------------------------------------------------
*& Form Get_Data
&---------------------------------------------------------------------
FORM Get_Data .
CALL FUNCTION 'BDS_GOS_CONNECTIONS_GET'
EXPORTING
CLASSNAME = Classn
OBJKEY = Objkey
TABLES
GOS_CONNECTIONS = Connections.
ENDFORM. " Get_Data
&---------------------------------------------------------------------
*& Form Download_Documents
&---------------------------------------------------------------------
FORM Download_Documents .
Data : Attachments Type Standard Table Of Sood4.

Loop At Connections.
Append Connections-loio_id To Attachments.
Endloop.

CALL FUNCTION 'SO_DOCUMENTS_MANAGER'
EXPORTING
ACTIVITY = 'EXPO'
TABLES
DOCUMENTS = Attachments.
ENDFORM. " Download_Documents
&---------------------------------------------------------------------
*& Form Download_Gos_Documents
&---------------------------------------------------------------------
FORM Download_Gos_Documents .
Data: Lv_Filename Like Rlgrap-Filename.
Loop At Connections.
Srtfd = Connections-Loio_id+17(17).

Import Gt_Objcont_tab
From Database Soc3(dt) Id Srtfd.

Concatenate 'D:\' Connections-Objkey '\' Connections-Descript
'.' Connections-Docuclass Into Lv_Filename.

CALL FUNCTION 'SO_OBJECT_DOWNLOAD'
EXPORTING
FILETYPE = 'BIN'
PATH_AND_FILE = Lv_Filename
NO_DIALOG = 'X'
TABLES
OBJCONT = Gt_Objcont_tab.
Endloop.
ENDFORM. " Download_Gos_Documents

Added code tags

Edited by: Rob Burbank on Feb 27, 2009 4:02 PM

3 REPLIES 3
Read only

former_member194669
Active Contributor
0 Likes
952

Have you checked the possibility to use fm SO_DOCUMENT_READ_API1 to retrieve attachments?

Read only

Former Member
0 Likes
952

hi friends.I wrote this code .Where is problem? thansk for all replies.

REPORT Z_CREATE_DOCUMENT.

Parameters:

Classn Like Bapibds01-Classname Obligatory ,

Classtyp Like Bapibds01-Classtype Obligatory ,

Objkey Like Swotobjid-Objkey Obligatory .

Data : Gt_Objcont_tab LIKE SOLISTI1 OCCURS 0

WITH HEADER LINE.

Data : Gv_Srtfd Like Soc3-Srtfd.

Data : Connections Like Bdn_con Occurs 0 With Header Line .

Start-Of-Selection.

Perform Get_Data.

Perform Download_Gos_Documents.

  • Perform Download_Documents.

&----


*& Form Get_Data

&----


FORM Get_Data .

CALL FUNCTION 'BDS_GOS_CONNECTIONS_GET'

EXPORTING

CLASSNAME = Classn

OBJKEY = Objkey

TABLES

GOS_CONNECTIONS = Connections.

ENDFORM. " Get_Data

&----


*& Form Download_Documents

&----


FORM Download_Documents .

Data : Attachments Type Standard Table Of Sood4.

Loop At Connections.

Append Connections-loio_id To Attachments.

Endloop.

CALL FUNCTION 'SO_DOCUMENTS_MANAGER'

EXPORTING

ACTIVITY = 'EXPO'

TABLES

DOCUMENTS = Attachments.

ENDFORM. " Download_Documents

&----


*& Form Download_Gos_Documents

&----


FORM Download_Gos_Documents .

Data: Lv_Filename Like Rlgrap-Filename .

data: document_id LIKE SOFOLENTI1-DOC_ID ,

document_data LIKE SOFOLENTI1 OCCURS 0 WITH HEADER LINE.

DATA : Lt_CONTENTS_CON LIKE SOLISTI1 OCCURS 0

WITH HEADER LINE,

l_t_objheader TYPE STANDARD TABLE OF solisti1.

Data : LT_OBJECT_PARA LIKE SOPARAI1 Occurs 0 With Header Line,

LT_OBJECT_PARB LIKE SOPARBI1 Occurs 0 With Header Line,

LT_ATTACHMENT_LIST LIKE SOATTLSTI1 Occurs 0 With Header Line,

LT_RECEIVER_LIST LIKE SORECLSTI1 Occurs 0 With Header Line,

LT_CONTENTS_HEX LIKE SOLIX Occurs 0 With Header Line.

Loop At Connections.

Gv_Srtfd = Connections-Loio_id+17(17).

document_id = Connections-Loio_id.

  • Import Gt_Objcont_tab From Database Soc3(Dt) Id Gv_Srtfd.

Concatenate 'D:\' Connections-Objkey '\' Connections-Descript

'.' Connections-Docuclass Into Lv_Filename.

  • CALL FUNCTION 'BDS_DOCUMENT_GET_TABLE'

  • EXPORTING

  • DOC_ID = Connections-Loio_id

  • TABLES

  • CONTENT = Gt_Objcont_tab.

CALL FUNCTION 'SO_DOCUMENT_READ_API1'

EXPORTING

DOCUMENT_ID = document_id

  • FILTER = 'X'

IMPORTING

DOCUMENT_DATA = document_data

TABLES

OBJECT_HEADER = l_t_objheader

OBJECT_CONTENT = Lt_CONTENTS_CON

OBJECT_PARA = LT_OBJECT_PARA

OBJECT_PARB = LT_OBJECT_PARB

ATTACHMENT_LIST = LT_ATTACHMENT_LIST

RECEIVER_LIST = LT_RECEIVER_LIST

CONTENTS_HEX = LT_CONTENTS_HEX

EXCEPTIONS

DOCUMENT_ID_NOT_EXIST = 1

OPERATION_NO_AUTHORIZATION = 2

X_ERROR = 3

OTHERS = 4

.

IF SY-SUBRC 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

APPEND : Lt_CONTENTS_CON To Gt_Objcont_tab.

CALL FUNCTION 'SO_OBJECT_DOWNLOAD'

EXPORTING

FILETYPE = 'BIN'

PATH_AND_FILE = Lv_Filename

NO_DIALOG = 'X'

TABLES

OBJCONT = Gt_Objcont_tab.

Endloop.

ENDFORM. " Download_Gos_Documents

Read only

0 Likes
952

Hi Serkan,

Did you managed to fix the error in your program? I also need to read the encrypted data in SOC3 table. Thanks.

Regards,

Ryan