Generic BAPI to create attachment to document?
Hello,
I'm trying to locate an existing BAPI to attach a file (i.e. pdf) to an expense report. There's nothing in the travel section, but I'm hoping there might be a generic BAPI to attach files to SAP document #'s. Any help is appreciated.
- Jonathan
This question really doesn't belong in the Web Dypro ABAP forum. It should be in one of the general ABAP forums.
However what you want sounds like the generic object attachement - provided by the Generic Object Services framework. There are a series of classes for this functionality. You can read some documentation about it here:
[http://help.sap.com/saphelp_nw70/helpdata/EN/be/3fe63659241157e10000009b38f889/frameset.htm|http://help.sap.com/saphelp_nw70/helpdata/EN/be/3fe63659241157e10000009b38f889/frameset.htm]
I don't know if there is a BAPI for this functionality since it is a class based API, but it wouldn't be difficult to wrap the classes in an RFC if you need they remotely. Otherwise just work with the classes directly.
Similar Messages
-
Generic Object Services - Create Attachment
Hi SDN experts
In the trip details page of the travel expense manager, may i know what Function Module does the "Create Attachment" functionality in the Generic Object Services trigger? Appreciate if anyone is able to provide me with an answer. Thank you
Regards
LVYou are in great trouble. Repeated posting of a single thread will really make you a Guest.
You have replicated this post in SEVEN forums.
Generic Object Services - Create Attachment in
Generic Object Services - Create Attachment in
Generic Object Services - Create Attachment in
Generic Object Services - Create Attachment in
Generic Object Services - Create Attachment in
Generic Object Services - Create Attachment in
Generic Object Services - Create Attachment in
As you are new to the forum please Read the [Forum Rules|http://wiki.sdn.sap.com/wiki/x/FgQ] before posting more.
Regards
Karthik D -
BAPI to create a billing document with reference to delivery or sales order
Hi,
Does anyone know any BAPI or function module that allows the creation of a billing document with reference to a sales order or to a delivery.
Maybe the BAPI_BILLINGDOC_CREATEFROMDATA may be used to create a billing document with reference to a sales document, but i'm looking for a solution where I only need to indicate the number of the reference sales order or the reference delivery and maybe some few data more without the need of transfer all the items and conditions information.
Thanks.
Kind regards,
Paulo SousaHello Paulo,
To create a billing document based on a delivery use BAPI_BILLINGDOC_CREATEMULTIPLE. In table BILLINGDATAIN insert one line with the following data:
REF_DOC = Delivery number
REF_DOC_CA = 'J'
If it runs fine, table SUCCESS will bring back useful data, like BILL_DOC (Billing document number).
Regards,
Joã -
Generic Object Services ; create attachment function grey out in Tcode KA03
Hi all,
I would like to know how can I enable create attachment function in GOS toolbar in Tcode KA03.
Currently it was grey out.
However, was tried to use the same function in KS03 and it works.Please help. Thanks!I just found the solution...
SAP note : 961572
Symptom</u>
In the transactions for displaying cost elements (KA03) and changing cost elements (KA02), the 'Services for Object' function does not work correctly, as most Generic Object Services are unavailable.
Other terms
KA03, KA02, SWO1, K_OBJECT_SERVICES_INITIALIZE, BUS1059, BUS1030
Reason and Prerequisites
The problem is caused by a program error.
Solution
Implement the attached program corrections
Then go to Transaction SW01 (Business Object Builder), enter BUS1059 as the object type, click Change, and make the following changes:
Navigate to Methods -> RevenueType.Display, press F2 to select it, and go to the 'ABAP' tab page: Select the 'Transaction' radio button, enter the name as KA03, and click 'Save'
Navigate to Attributes -> Attribute properties, select the 'Mandatory' checkbox, and click 'Save'
Then change the release status by navigating as follows:
Edit -> Change Release Status -> Object Type -> To implemented
Edit -> Change Release Status -> Object Type -> To released
Then double-click BUS1059 (or select using F2) in SWO1 to reach the 'General' tab page, which should appear as follows:
ObjectType BUS1059 Revenue element
Object Name RevenueType
Program RBUS1059
Objtype status generated Saved released -
FM/BAPI to create a accrual document in FBS1 ?
Hi,
Id any one aware of any BAPI or FM that can be used to create and accrual document through FBS1.
Thanks,How about BAPI_USER_ACTGROUPS_ASSIGN ...?
(Found searching SE37 with pattern "BAPIUSER" ...)
<u>Take care</u>: when using an CUA you might need to use BAPI_USER_LOCACTGROUPS_ASSIGN (to assign roles in the CUA master system). -
Error while using BAPI to create Goods Receipt Document
Hello All,
While using the bapi BAPI_GOODSMVT_CREATE to create Goods receipt document ,the following error is encountered:-
Error Message:FOR OBJECT XABBELEGNR,NUMBER RANGE INTERVAL DOES NOT EXIST OM36.
Do we need to create a number range object ??If yes,how and where to create ?
Thanks,
Deepti.Hi Deepti!
There is only a valid interval missing, not the whole object.
Maintenance can be done via transaction SNRO, enter your object XABBELEGNR in entry screen. (Alternatively use transaction OMJ6).
Push button 'Number Ranges' and 'Change Intervals'. Here you can define an interval.
Regards,
Christian -
How to create an Accounting Document by calling BAPI
Hai friends ,
please tell me how to call this BAPI and fulfill all the parameters .. Please help me , I dont know the head and tail of it ...
create an Accounting Document by calling BAPI BAPI_ACC_DOCUMENT_POST
Below is the step to fill the parameters for BAPI:
Enter company code, invoice no, invoice date, document type, header text into DOCUMENTHEADER
Enter customer, item text, company code, payment term into ACCOUNTRECEIVABLE
Enter offset account, company code, document type, item text into ACCOUNTGL
Enter currency type u201800u2019, currency, exchange rate, amount into CURRENCYAMOUNT. Please note there will be two rows in this table, one positive amount and one negative amount
Call the BAPI to create the AR document. If p_check is checked, call the BAPI only without COMMIT and then do the message processing
If p_check is initial, COMMIT the data to the database tables.
Check the RETURN table after each BAPI, if no u2018Eu2019 message type found, output the document no. Otherwise, output the error messge to the screen with the message type u2018Eu2019.
thanks in advance ...Hi,
Check the link
http://www.sapbrainsonline.com/sapinfo/tutorial.php?artid=617
http://sap.ittoolbox.com/groups/technical-functional/sap-dev/bapi_acc_document_post-error-1973720
http://delaynomore.spaces.live.com/blog/cns!D2BFFB84EDFE4189!528.entry
http://sap4.com/wiki/index.php?title=BAPI_ACC_DOCUMENT_POST
http://www.sapfans.com
Anurodh -
How to create shipment cost document through BAPI?
Hi SAP Guru,
My requirement is to create shipment cost document through BAPI.
Is there any standard BAPI to create Shipment cost documents? If any buddy no please help me out.I am in client place i have find out the solution..
Thanks & Regards,
Pankaj SinhaHi Pankaj,
See the following link for more help.
IDOC/BAPI for changing Shipment cost number/document
Regards -
GOS - Create attachment - how to rmove those documents and link the to BDS
Hi all
When using GOS - create attachment, the documents gets saved to the database. How can i extract or move those documents over to BDS and store it in KPRO.
Any ideas will be great.
PierreHello! I need same. Specially, to use methods form CL_BDS_DOCUMENT_SET class with GOS documents.
Some help?
Thanks on advance.
Emanuel -
BAPI to create Billing DOC for deliveries
Hi All,
I am looking for a BAPI to create a billing document based on the Shipment number.
I found Bapi_BILLINGDOC_CREATEMULTIPLE, but not working as expected.
If anyone has used above or another bapi, please inform.
Thx-PraveenHi Praveen,
i'm using same bapi and i'm able to create the invoice for the del.doc.
for your ref. , here i'm attaching the code , please go through once.
LS_BAPIVBRK-REF_DOC = DELIVERY_NO.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = LS_BAPIVBRK-REF_DOC
IMPORTING
OUTPUT = LS_BAPIVBRK-REF_DOC.
LS_BAPIVBRK-REF_DOC_CA = '8'. Shipment
APPEND LS_BAPIVBRK TO LT_BAPIVBRK.
CALL FUNCTION 'BAPI_BILLINGDOC_CREATEMULTIPLE'
TABLES
BILLINGDATAIN = LT_BAPIVBRK
ERRORS = LT_BAPIVBRKERRORS
RETURN = LT_BAPIRET1
SUCCESS = LT_BAPIVBRKSUCCESS.
after this do commit.
you might miss the document category .
Regards,
Krishna -
Create Attachment through Generic Object Services (BC-SRV-GBT)
Hello experts,
I have one question about a storing of document in this functionality. As you know there are several ways of storing a document to some object.
1. Using the menu: "Create - Create Attachment"
2. Using the menu: "Create - Store Business Document"
In the first case the document will be saved in SAP Database (Please correct me if I mistake). In the second case an optical archive must be connected to the SAP System. Can I use an optical archive in the first case?
PS. When I use the second way I don't see the name of document in the Attachment List. If use "Create - Create Attachment" - it is OK.
Thanks advance for any help.
Your faithfully,
Alekseev Aleksandr
Edited by: Aleksandr Alekseev on May 5, 2008 6:05 AMHi Friend,
You have posted your query in wrong forum.
Pls post your query in BPM and Workflow Forum. -
Create a PDF document and attach it to a service order business transaction
Hi all,
I have following requirement. For a particular service order, i am reading the entire survey details and then my requirement is that i want to convert this details into a PDF document and then attach the document to the same service order.
Right now, i have created a SMARTFORM which prints the required details. I got the OTFDATA of the smartform and now my problem is to convert it into PDF and then attach it to the service order .
Kindly help.
Points will be rewarded.
Thanks in advance,
Karanbusiness object
business_object-instid = guid.
business_object-typeid = 'BUS2000116'.
business_object-catid = 'BO'.
PROPERTIES
ls_loio_properties-name = 'DESCRIPTION'.
APPEND ls_loio_properties TO l_loio_properties.
ls_loio_properties-name = 'KW_RELATIVE_URL'.
ls_loio_properties-value = 'Test'.
APPEND ls_loio_properties TO l_loio_properties.
CLEAR ls_loio_properties.
ls_loio_properties-name = 'DESCRIPTION'.
APPEND ls_loio_properties TO l_phio_properties.
ls_loio_properties-name = 'KW_RELATIVE_URL'.
ls_loio_properties-value = 'any name'.
APPEND ls_loio_properties TO l_phio_properties.
ls_loio_properties-name = 'LANGUAGE'.
ls_loio_properties-value = 'EN'.
APPEND ls_loio_properties TO l_phio_properties.
FILE_ACCESS_INFO
FILE_SIZE = l_filesize.
mimetype = 'application/pdf'.
file_name = 'any name'.
binary_flg = 'X'.
FILE_CONTENT_BINARY
pass the binary content
RAW_MODE
X
package_id -> to create package id
CONSTANTS: c_objtype TYPE skwf_ioty VALUE 'P',
c_sign TYPE sdok_qusgn VALUE 'I',
c_op TYPE sdok_cxop VALUE 'NX'.
c_class TYPE sdok_class VALUE 'BDS_POC1'.
DATA: appl TYPE skwf_appl.
DATA: cspc TYPE sdok_ent VALUE 'CRM'.
CALL FUNCTION 'CRM_KW_BOR_SET'
EXPORTING
iv_business_object = business_object.
ls_selectors-type = c_objtype.
ls_selectors-attribute = 'LANGUAGE'.
ls_selectors-sign = c_sign.
ls_selectors-op = c_op.
APPEND ls_selectors TO lt_selectors.
ls_selectors-type = c_objtype.
ls_selectors-attribute = 'BDS_DOCUMENTTYPE'.
ls_selectors-sign = c_sign.
ls_selectors-op = c_op.
APPEND ls_selectors TO lt_selectors.
KW Framework: Context Treatment
CALL FUNCTION 'SKWF_CTX_CREATE'
EXPORTING
context_class = 'CRM_CTXCL'
x_reduce_to_one = reduce_to_one
description = 'Default Context'
x_transient = 'X'
IMPORTING
context_id = lv_context_id
TABLES
instance_selectors = lt_selectors.
KW Framework: Package Handling
CALL FUNCTION 'SKWF_PKG_DYNAMIC_CREATE'
EXPORTING
package_desc = 'PAKET'
x_transient = 'X'
appl = appl
cspc = cspc
context_id = lv_context_id
IMPORTING
new_package_id = l_pkgid
error = l_error. -
Create Attachment issue in storing the document
We are facing an issue in tranaction PR05 (Travel Expense Manager) on services object for Create Attachment. We would like to know is there anyway/manage to find any setting so that the u201CCreate Attachmentu201D would result in storing the document on the content server like the u201CStore Business Documentu201D does.
Please advise and confirm.
Thanks & regards
AKI try to answer based on my understanding.
If you want to store the document in the server when attaching the document in Services for object, it can be done.
You have to define the directory in the server where the documents are to be stored. Also you need to define a naming convention for all the files which need to be stored in the directory.
Then you have to programatically enable the services for object to store the files in the directory created for that purpose. Also on clicking, you should programatically enable the document fetching from the directory by making use of the naming convention. -
Creating a sales document using BAPI in web dynpro by uploading a file
Hi ALL,
Can some one help me how to create a sales document using BAPI by uploading a file as input...Can someone provide me a sample program....
Thanks n Regards,
Praveenn.
Edited by: praveenn on Aug 23, 2011 12:42 PMHi Sri,
Thx for the response...
Here is the code that i followed for creating a BAPI_SALESORDER_CREATE1 by uploading a text file as input.
Just create a Attribute in the VIEW CONTEXT of type String.
method ONACTIONCREATE_SO .
types : Begin of ty_data,
sales_org type vkorg,
doc_type type AUART,
DISTR_CHAN type VTWEG,
DIVISION type spart,
material type matnr,
partn_role type PARVW,
PARTN_NUMB type kunnr,
end of ty_data.
DATA :it_table TYPE TABLE OF ty_data,
i_data TYPE TABLE OF string,
l_string TYPE string,
wa_table TYPE ty_Data,
l_xstring TYPE xstring,
fields TYPE string_table,
lv_field TYPE string.
DATA: wa_order_header_in TYPE BAPISDHD1,
it_order_items_in TYPE TABLE OF BAPISDITM,
wa_order_items_in TYPE BAPISDITM,
it_order_partners TYPE TABLE OF BAPIPARNR,
wa_order_partners TYPE BAPIPARNR,
it_return TYPE TABLE OF BAPIRET2,
wa_return TYPE BAPIRET2.
DATA : sales_doc type bapivbeln-vbeln.
DATA:
node_zfinal_node TYPE REF TO if_wd_context_node,
elem_zfinal_node TYPE REF TO if_wd_context_element,
stru_zfinal_node TYPE if_main_view=>element_zfinal_node .
get single attribute
wd_context->get_attribute(
EXPORTING
name = 'DATASOURCE'
IMPORTING
value = l_xstring ).
CALL FUNCTION 'HR_KR_XSTRING_TO_STRING'
EXPORTING
in_xstring = l_xstring
IMPORTING
out_string = l_string.
SPLIT l_string AT cl_abap_char_utilities=>newline INTO TABLE i_data.
LOOP AT i_data INTO l_string.
SPLIT l_string AT cl_abap_char_utilities=>horizontal_tab INTO TABLE fields.
READ TABLE fields INTO lv_field INDEX 1.
wa_table-sales_org = lv_field.
READ TABLE fields INTO lv_field INDEX 2.
wa_table-doc_type = lv_field.
READ TABLE fields INTO lv_field INDEX 3.
wa_table-DISTR_CHAN = lv_field.
READ TABLE fields INTO lv_field INDEX 4.
wa_table-DIVISION = lv_field.
READ TABLE fields INTO lv_field INDEX 5.
wa_table-material = lv_field.
READ TABLE fields INTO lv_field INDEX 6.
wa_table-partn_role = lv_field.
READ TABLE fields INTO lv_field INDEX 7.
wa_table-partn_numb = lv_field.
APPEND wa_table TO it_table.
ENDLOOP.
loop at it_table into wa_table.
clear : wa_order_header_in.
wa_order_header_in-sales_org = wa_table-sales_org.
wa_order_header_in-doc_type = wa_table-doc_type.
wa_order_header_in-distr_chan = wa_table-distr_chan.
wa_order_header_in-division = wa_table-division.
clear : wa_order_items_in.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = wa_table-material
IMPORTING
OUTPUT = wa_order_items_in-material.
*wa_order_items_in-req_qty = wa_table-req_qty.
append wa_order_items_in to it_order_items_in.
clear : wa_order_partners.
wa_order_partners-partn_role = wa_table-partn_role.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
input = wa_table-partn_numb
IMPORTING
OUTPUT = wa_order_partners-partn_numb
*wa_order_partners-partn_numb = wa_table-partn_numb.
append wa_order_partners to it_order_partners.
endloop.
CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'
EXPORTING
SALESDOCUMENTIN =
order_header_in = wa_order_header_in
ORDER_HEADER_INX =
SENDER =
BINARY_RELATIONSHIPTYPE =
INT_NUMBER_ASSIGNMENT =
BEHAVE_WHEN_ERROR =
LOGIC_SWITCH =
TESTRUN =
CONVERT = ' '
IMPORTING
SALESDOCUMENT = sales_doc
tables
RETURN = it_return
ORDER_ITEMS_IN = it_order_items_in
ORDER_ITEMS_INX =
order_partners = it_order_partners.
ORDER_SCHEDULES_IN =
get message manager
DATA: l_current_controller TYPE REF TO if_wd_controller,
l_message_manager TYPE REF TO if_wd_message_manager.
l_current_controller ?= wd_this->wd_get_api( ).
DATA: v_message_text TYPE string.
When Sales Order is created commit the data
IF NOT sales_doc IS INITIAL.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING wait = 'X'.
CONCATENATE 'Sales Document' sales_doc 'has been created.' INTO v_message_text SEPARATED BY space.
Report Success message
CALL METHOD l_message_manager->report_success
EXPORTING
message_text = v_message_text.
ELSE.
v_message_text = 'Error Creating Sales Order'.
Report Error message
CALL METHOD l_message_manager->report_error_message
EXPORTING
message_text = v_message_text.
ENDIF.
endmethod.
Edited by: praveenn on Aug 30, 2011 2:41 PM -
Creating PDF & Attaching a document to it
Hi All,
I want to create a pdf, attach a document (txt or another pdf) encrypt the file and password protect it.
I would like to know if there are any API for doing the same.
I am using Weblogic 6.1 will it be a constraint from using the pdf api's?
Pls Help!!!
Rgds,
SrihaSo here's what gooles says:
http://www.onjava.com/pub/a/onjava/2003/06/18/dynamic_files.html
Sounds pretty useful.
Maybe you are looking for
-
Fatal1ty Champion Front Panel I/O Issue
'Fatalty Champion Front Panel I/O Issue I just purchased a Creative PCI Express Sound Blaster X-Fi Titanium Fatalty Champion Series Sound Card. I have installed the card and front panel into my system with the latest drivers. I am unable to get the f
-
External hard drive gone!!
Don't know if it's the right forum to post, but anyway: I pluged in my external harddrive (Western Digital 2TB),but suddenly i could read the files, but i couldn't open them! So I tried to remove the disk usig disk utilities but it couldn't. And afte
-
Anyone have advice on Platform swap from windows to mac
I have been using lightroom since the begining and purchased the original download versions and upgraded to lr2 when in was released. Both downloads are available for me to download to the mac version, but my question is this....Do I need to down LR
-
Making my application icon/image
Okay, so I've finished making my program and want to give it it's own icon. I have the image I want to use, I know how to open the info and copy and paste into it but I cannot figure out how to make it transparent. Even if the image I'm copying and p
-
Restart of incorrect business-processes
Hi, I have the following situation: An Order-IDOC (ORDER02) comes from our SAP-System. This Order runs into a business-process. I this process the first step is to split the 1 order with x Positions into x Orders with one position. Then the business-