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

Generic Object Services

former_member413959
Participant
0 Likes
974

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.

6 REPLIES 6
Read only

athavanraja
Active Contributor
0 Likes
833

use FM BDS_ALL_CONNECTIONS_GET to get list of all attachments for a particular object (material)

Regards

Raja

Read only

0 Likes
833

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

Read only

0 Likes
833

in OAOR use

BUS1001 and BO (not ot)

Read only

0 Likes
833

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....

Read only

0 Likes
833

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

Read only

Former Member
0 Likes
833

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