‎2007 Apr 11 3:20 PM
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.
‎2007 Apr 11 3:35 PM
Hi,
You can do it thru using class CL_GOS*
SE24--> type CL_GOS*
you can find appropriate class
aRs
‎2007 Apr 11 3:35 PM
Hi,
You can do it thru using class CL_GOS*
SE24--> type CL_GOS*
you can find appropriate class
aRs
‎2007 Apr 11 4:56 PM
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.
‎2007 Apr 12 10:17 AM
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
‎2007 Apr 12 8:43 PM
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.
‎2013 Jul 26 7:33 AM
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.
‎2025 Mar 17 12:22 PM
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.
‎2007 May 30 8:36 AM
Hi Rekha,
I have the same problem. Have you solved it?
Many thanks.
Luca
‎2007 May 30 4:45 PM
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.
‎2007 Dec 04 4:42 PM
Hi Rekha ,
Can you please send me custom code for reference , I am having some problem with this function module
Thanks
‎2007 Dec 04 5:11 PM
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®
‎2007 Dec 05 9:33 AM
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
‎2013 Oct 19 8:05 PM
Hi aRs,
I 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
‎2007 May 30 5:38 PM
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
‎2014 Apr 03 8:27 PM
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.