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

GOS: How to attach url using object services

Former Member
0 Likes
12,406

Hi ,

I want to attach URL using object services in tcode FB02.I am creating invoice using custom IDOC.I want to attach URL after the invoice is posted . As soon as invoice is posted I want to attach URL to that invoice.

Is it possible to attach URL to invoice from the custom function module(Custom IDOC F.M).Is there any BAPI or F.M to do this.

We have Sap 4.6C.

Thanks,

Rekha.

1 ACCEPTED SOLUTION
Read only

former_member194669
Active Contributor
0 Likes
7,504

Hi,

You can do it thru using class CL_GOS*

SE24--> type CL_GOS*

you can find appropriate class

aRs

14 REPLIES 14
Read only

former_member194669
Active Contributor
0 Likes
7,505

Hi,

You can do it thru using class CL_GOS*

SE24--> type CL_GOS*

you can find appropriate class

aRs

Read only

0 Likes
7,504

I found one FM BDS_BUSINESSDOCUMENT_CREA_URL.

But how to find out what need to be passed in parameters CLASSNAME and

CLASSTYPE.

Any one has used this F.M before.

Thanks,

Rekha.

Read only

0 Likes
7,504

call function 'BDS_BUSINESSDOCUMENT_CREA_URL'

exporting

logical_system = logical_system

classname = classname_select

classtype = classtype_select

client = sy-mandt

object_key = objkey_select

tables

uris = i_uris

exceptions

error_kpro = 1

internal_error = 2

others = 3.

if sy-subrc <> 0.

message id sy-msgid type sy-msgty number sy-msgno

with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

endif.

for logical_system use FM OWN_LOGICAL_SYSTEM_GET to get your logical system name.

class name= BKPF

classtype = BO

object_key = <companycode><doc number><year> e.g 011000001234562007

in uris talbe pass the urls to be created.

Raja

Read only

0 Likes
7,504

Hi Durairaj ,

Thanks for your reply.I passed the data in bapi as specified by you and it worked.But when I checked it in FB03 I can see one attachment but when I double click it it gives me an error "Errors occurred when executing the service 'Attachment list' ". Do I need to do something else also ?

Thanks,

Rekha.

Read only

0 Likes
7,504

Hi Durairaj,

I used this FM. It ran successfully for 26 micro secs.

But unable to find the link in FB03--> Services for object --> Attachments list.

It is blank. What might be wrong.

Read only

0 Likes
4,721

Hi,

I found one class for attach URL using object services, 

PARAMETERS: P_migo TYPE mblnr,
P_year TYPE Mjahr,
P_doc TYPE bitm_descr,
P_con TYPE string.


CLASS lcl_url DEFINITION.
PUBLIC SECTION.
METHODS: update_data EXPORTING ex_gos_commit_flag TYPE flag,
message.

PRIVATE SECTION.
CONSTANTS : c_typeid TYPE bitm_type VALUE 'BUS2017',
c_catid TYPE sibfcatid VALUE 'BO',
c_techtype TYPE bitm_type VALUE 'URL'.

DATA: ls_object TYPE gos_s_obj,
ls_atta_key TYPE gos_s_attcont,
ls_get TYPE gos_s_attkey,
lv_instid TYPE sibfboriid.

ENDCLASS.

CLASS lcl_url IMPLEMENTATION.
METHOD update_data.

ls_object-typeid = c_typeid.
ls_object-instid = |{ p_migo }{ p_year } |.
ls_object-catid = c_catid.

DATA(lo_ins) = cl_gos_api=>create_instance( ls_object ).

ls_atta_key-atta_cat = cl_gos_api=>c_msg.
ls_atta_key-cr_user = sy-uname.
ls_atta_key-cr_name = sy-uname.
ls_atta_key-cr_date = sy-datum.
ls_atta_key-cr_time = sy-uzeit.
ls_atta_key-tech_type = c_techtype.
ls_atta_key-descr = p_doc .
ls_atta_key-lang = sy-langu.
ls_atta_key-content = p_con.

TRY.
ex_gos_commit_flag = lo_ins->insert_al_item(
EXPORTING
is_attcont = ls_atta_key " GOS API: Strucure for Attachment
iv_roltype = cl_gos_api=>c_website ).

CATCH cx_gos_api.
ENDTRY.

IF ex_gos_commit_flag IS NOT INITIAL.
COMMIT WORK.
ENDIF.

ENDMETHOD.
METHOD message.
MESSAGE 'Uploaded Sucessfully' TYPE 'S'.
ENDMETHOD.

ENDCLASS.

 


<<<<<<<<<<<<<<<<<<<<<<<<<

DATA(obj) = NEW lcl_url( ).

CALL METHOD obj->update_data
IMPORTING
ex_gos_commit_flag = DATA(lv_check).

IF lv_check IS NOT INITIAL.
CALL METHOD obj->message.
ELSE.
MESSAGE 'failed to upload' TYPE 'E'.
ENDIF.

 

 

Regards,

Kasireddy M.

 

 

Read only

Former Member
0 Likes
7,504

Hi Rekha,

I have the same problem. Have you solved it?

Many thanks.

Luca

Read only

0 Likes
7,504

Hi Luca,

No I couldn't resolve this error.But I created URL through custom code which will create URL in the background.

Thanks,

Rekha.

Read only

0 Likes
7,504

Hi Rekha ,

Can you please send me custom code for reference , I am having some problem with this function module

Thanks

Read only

0 Likes
7,504

Hi,

Please check for class cl_bds_document_set, its have method create_with_url

and also please check example program

1. BDSTESTOO

2. SAPRDEMO_DOI_BDS

Note: You still in Unilever UK?

a®

Read only

0 Likes
7,504

Thanks for your reply , Sorry I didn't recognise you . Send me your email id

My requirement is to attach URL to document ...I am using function module BDS_BUSINESSDOCUMENT_CREA_URL, it doesnot give me any error but after excecution if I try to see attached URL on document there is nothing ...

No , I am not with Unilever any more

Regards

Read only

0 Likes
7,504

Hi aRs,

am able to attach the URL to Invoice but the title is coming as my logon ID.

How can I change the decription.

Regards,

Saurabh

Read only

Former Member
0 Likes
7,504

Hi Rekha,

Can you send me your custom code please?

But I have also another problem. My user mustn't delete the URL created in the document. How can I solve this problem? Could I use the profiles in your opinion?

Many thanks.

Luca

Read only

Former Member
0 Likes
7,504

I never got BDS_BUSINESSDOCUMENT_CREA_URL to work properly.  I now use BDS_BUSINESSDOCUMENT_CRE_O_URL instead and have not had a problem with it.  It is much easier to use.