‎2007 Jan 23 10:49 AM
Hi ,
We use the GOS in material transaction....(mm01, mm01,mm03 )
(material number have a photo ).
Is there any FM or other way to display the photo...or get list of all the attachments of requested material .
We want to display the photos in the our portal.
I found the name of the file in table SOOD ...where we have the connection between material number and the file...
Thanks ,
Faniel.
‎2007 Jan 23 8:13 PM
use FM BDS_ALL_CONNECTIONS_GET to get list of all attachments for a particular object (material)
Regards
Raja
‎2007 Jan 24 7:31 AM
Thanks Raja ,
But...If i get into mm02 to material num i can see the attachment list...
If i go to OAOR with bus1001 and OT ...I don't see the attachments ,
But if i create new one in oaor i see it in mm02...
and when i use the FM i see only the new one.
How can i see the old attachments that i create from the MM02 transaction directly ???
Thanks, Faniel
‎2007 Jan 24 7:56 AM
‎2007 Jan 24 8:32 AM
My mistake....i used BO.
Why i cant see the attachments that i created directly in the transactions???
And another question....do you know FM to display the attachments ?
Thanks....
‎2007 Jan 24 8:45 AM
you can use class CL_GOS_ATTACHMENTS to get the list of attachments as well as displaying them
search this forum with cl_gos_ you should see some good sample codes
Regards
Raja
‎2007 Jan 23 9:27 PM
Hi Faniel,
Try this standard report.
&----
*& Report RSDEMO_CUSTOM_CONTROL *
*& *
&----
*& *
*& *
&----
REPORT rsdemo_custom_control .
DATA url(132).
TYPE-POOLS cndp.
custom container
DATA container TYPE REF TO cl_gui_custom_container.
picture Control.
DATA picture TYPE REF TO cl_gui_picture.
Definition of Control Framework
CLASS cl_gui_cfw DEFINITION LOAD.
DATA init.
DATA ok_code TYPE sy-ucomm.
CALL SCREEN 100.
&----
*& Module STATUS_0100 OUTPUT
&----
text
----
MODULE status_0100 OUTPUT.
SET PF-STATUS 'STATUS'.
SET TITLEBAR 'xxx'.
IF init is initial.
create the custom container
CREATE OBJECT container
EXPORTING container_name = 'CUSTOM'.
create the picture control
CREATE OBJECT picture
EXPORTING parent = container.
Request an URL from the data provider by exporting the pic_data.
CLEAR URL.
PERFORM LOAD_PIC_FROM_DB CHANGING URL.
load picture
CALL METHOD picture->load_picture_from_url
EXPORTING url = url.
init = 'X'.
CALL METHOD cl_gui_cfw=>flush
EXCEPTIONS cntl_system_error = 1
cntl_error = 2.
IF sy-subrc <> 0.
error handling
ENDIF.
ENDIF.
ENDMODULE. " STATUS_0100 OUTPUT
&----
*& Module EXIT INPUT
&----
text
----
MODULE exit INPUT.
CALL METHOD picture->free.
CALL METHOD container->free.
FREE picture.
FREE container.
LEAVE PROGRAM.
ENDMODULE. " EXIT INPUT
&----
*& Form LOAD_PIC_FROM_DB
&----
text
----
*
----
FORM LOAD_PIC_FROM_DB CHANGING URL.
DATA QUERY_TABLE LIKE W3QUERY OCCURS 1 WITH HEADER LINE.
DATA HTML_TABLE LIKE W3HTML OCCURS 1.
DATA RETURN_CODE LIKE W3PARAM-RET_CODE.
DATA CONTENT_TYPE LIKE W3PARAM-CONT_TYPE.
DATA CONTENT_LENGTH LIKE W3PARAM-CONT_LEN.
DATA PIC_DATA LIKE W3MIME OCCURS 0.
DATA PIC_SIZE TYPE I.
REFRESH QUERY_TABLE.
QUERY_TABLE-NAME = '_OBJECT_ID'.
QUERY_TABLE-VALUE = 'ENJOYSAP_LOGO'.
APPEND QUERY_TABLE.
CALL FUNCTION 'WWW_GET_MIME_OBJECT'
TABLES
QUERY_STRING = QUERY_TABLE
HTML = HTML_TABLE
MIME = PIC_DATA
CHANGING
RETURN_CODE = RETURN_CODE
CONTENT_TYPE = CONTENT_TYPE
CONTENT_LENGTH = CONTENT_LENGTH
EXCEPTIONS
OBJECT_NOT_FOUND = 1
PARAMETER_NOT_FOUND = 2
OTHERS = 3.
if sy-subrc = 0.
PIC_SIZE = CONTENT_LENGTH.
endif.
CALL FUNCTION 'DP_CREATE_URL'
EXPORTING
TYPE = 'image'
SUBTYPE = cndp_sap_tab_unknown
SIZE = PIC_SIZE
lifetime = cndp_lifetime_transaction
TABLES
DATA = PIC_DATA
CHANGING
URL = URL
EXCEPTIONS
others = 1.
ENDFORM. " LOAD_PIC_FROM_DB