Calling URL when click on buttons using web dynpro - ABAP
Hi All,
I am new to web dynpro application development and i am facing issue when i try to test my application.
simple require when i click on button i should direct the to one of url say 'http://www.google.co.in/' my application is activate with no error but when i test the application i am getting below error , can someone please provide me the solution or way out.
The URL http://ides47:8062/sap/bc/webdynpro/sap/zwa_calling_url/ was not called due to an error.
Note
The following error text was processed in the system N6Q : Access via 'NULL' object reference not possible.
The error occurred on the application server IDES47_N6Q_62 and in the work process 0 .
The termination type was: RABAX_STATE
The ABAP call stack was:
Method: IF_WDR_CONTEXT_MENU_HANDLER~CONTEXT_MENU_CALLED of program CL_WDR_INTERNAL_WINDOW_ADAPTERCP
Method: IF_WDR_CONTEXT_MENU_HANDLER~CONTEXT_MENU_CALLED of program CL_WDR_INTERNAL_WINDOW_ADAPTERCP
Method: IF_WDR_ADAPTER_EVENT_HANDLER~HANDLE_EVENT of program CL_WDR_CONTEXT_MENU_HANDLER===CP
Method: IF_WDR_CLIENT~GET_CLIENT_UPDATES of program CL_WDR_CLIENT_SSR=============CP
Method: EXECUTE of program CL_WDR_MAIN_TASK==============CP
Method: IF_HTTP_EXTENSION~HANDLE_REQUEST of program CL_WDR_MAIN_TASK==============CP
Method: EXECUTE_REQUEST_FROM_MEMORY of program CL_HTTP_SERVER================CP
Function: HTTP_DISPATCH_REQUEST of program SAPLHTTP_RUNTIME
Module: %_HTTP_START of program SAPMHTTP
HTTP 500 - Internal Server Error
Thanks,
Parab
Hi ,
It seesms something you are missing. It would be easy for us if you could paste your code which you have written in the Action of Button.
Sample code for your reference :
METHOD onactionget_url .
data lo_window_manager type ref to if_wd_window_manager.
data lo_api_component type ref to if_wd_component.
data lo_window type ref to if_wd_window.
lo_api_component = wd_comp_controller->wd_get_api( ).
lo_window_manager = lo_api_component->get_window_manager( ).
CALL METHOD lo_window_manager->CREATE_EXTERNAL_WINDOW
EXPORTING
URL = 'http://www.google.co.in/'
MODAL = ABAP_FALSE
HAS_MENUBAR = ABAP_TRUE
IS_RESIZABLE = ABAP_TRUE
HAS_SCROLLBARS = ABAP_TRUE
HAS_STATUSBAR = ABAP_TRUE
HAS_TOOLBAR = ABAP_TRUE
HAS_LOCATION = ABAP_TRUE
RECEIVING
WINDOW = lo_window.lo_window->open( ).
ENDMETHOD.
Similar Messages
-
Adobe form to save data using Web Dynpro ABAP
Hi. I am pretty new to SAP world and trying to learn and work on a task given to me relate to
creating Adobe offline form using Web Dynpro ABAP same time.
I have several questions and hopefully, many gurus like you will provide answers.
I noticed there are many examples creating and using Adobe interactive forms (though not many newer version),
but I didn't see (at least I didn't find any) any detail example on saving data to an internal table (such as fixed assets, vendor master, etc)
using interactive form. Is there any detail explanation/example on this?
I have ask this question in another forum (before I found this forum) but didnu2019t get the answer yet.
2. When I tried to see graphic layout and modify the layout from Web Dynpro, I can't see the graphic layout.
All I see is text list of fields/buttons that I created, but can't see section for graphic layout where I can modify layout.
I am sure I didn't install/configure something correctly.
Anyone has any idea what I didn't do?
I have another question, but I will wait till later after I figure out above ones first.
Thanks for all your help in advance.
JohnHi John,
In the WD4A view, there is a button "Show/Hide Layout Preview".
Click on that button to be able to see the Layout.
Note that this button is next to the Pretty Print button.
regards,
Reema. -
How to save file in km using web dynpro abap
Hi Experts,
We have a requirement that file should be saved in a folder in km, the name of the folder should be the employee number.
Could you please tell me how to create folder with employee number in KM and store file in it using web dynpro abap.
Thanks and Regards,
Santhoshi.Thanks Naga Raju Meesala.
How come all these methods are deprecated...getEP5User
Also, since I am building a weddynpro DC, what is the proper way to include these jar files as Used DCs?
Now proceed in the same way with the variable PORTAL_HOME and add the following .jar files:
u2022 \lib\prtapi.jar The portal runtime APIs
u2022 \portalapps\com.sap.portal.usermanagement\lib\com.sap.security.api.ep5.jar The user management APIs of the Enterprise Portal 5.0 are deprecated, but still in use in SAP NetWeaver 04
u2022 \portalapps\com.sap.netweaver.bc.rf\lib\bc.rf.framework_api.jar KM Repository Framework APIs
u2022 \portalapps\com.sap.netweaver.bc.rf.service\lib\bc.rf.global.service.urlgenerator_api.jar Repository Framework Utility: URL Generator
u2022 \portalapps\com.sap.netweaver.bc.sf\lib\bc.sf.framework_api.jar Repository Framework: Repository Services
u2022 \portalapps\com.sap.netweaver.bc.util\lib\bc.util.public_api.jar Repository Framework Utilities -
Reading HTML Content using Web Dynpro ABAP
Hello,
I was wondering if it is possible to read the content (HTML) behind a given URL using Web Dynpro ABAP. If so, are there any functions available to parse the HTML ? I have been asked to develop an application that requires going to a URL, reading the content, and formatting a table from that content for presentaion within Web Dynpro ABAP. The HTML of the URL is nothing more than a "Table of Contents" to existing documentation ( Word Documents )
Thank you for any help / advice you can provide
LarryYou can get the HTML returned in a table using fm RSFO_HTML_REQUEST2.
Once you have that, you can convert it to a string using any number of methods. CL_RSR_WWW_RENDERER=>TABLE_TO_STRING should work fine.
One option for parsing it would be to get it converted into an iXML object, but you might have to do quite a bit of manipulation first depending on what the html looks like. You can see more info here on iXML classes: [http://help.sap.com/saphelp_nw04/helpdata/de/86/8280ba12d511d5991b00508b6b8b11/frameset.htm|http://help.sap.com/saphelp_nw04/helpdata/de/86/8280ba12d511d5991b00508b6b8b11/frameset.htm]
Otherwise I would just make use of find statements with regex patterns to sort through the html. -
Create portal user using web dynpro abap application
Dear All,
I would like to know is it possible to create portal user-id through web dynpro abap application.
My requirement is
> I have to create a web dynpro abap application. In the web dynpro abap application I have name email-id and phone number as entry fields.
> I will click on submit, one unique id will get created. This unique id will be the login id for portal.
I found how to create portal user using web dynpro java, but i could not find regarding web dynpro abap.
If it is possible to create the portal users using web dynpro abap pls share the code as well.
Regards,
Swapnil IndulkarHi swapnil,
I think by using BAPi.. BAPI_USER_CREATE1 you can create.
Please check this...
Create portal user from webdynpro abap
Creating user and assigning a group through code
user administration su01
How can i get the portal user id from logon ticket in the webdyn 4 ABAP
Cheers,
Kris.
Edited by: kissnas on May 21, 2011 8:47 AM -
How to display the data of CJ2C(T-CODE) using web dynpro abap
Hi all:
How to display the data of CJ2C(T-CODE) using web dynpro abap.
CJ2C used to display a Gantt Chart.
Thanks.Hi,
Create a Value attribute (resource) of type Resource, bind it with the property of File Upload UI element.
On action place the code and Deploy the application
byte[] bytes = new byte[ 1024];
FileOutputStream out = new FileOutputStream( new File( <path in server>));
InputStream in = resource.read( true);
int len;
while( ( len = in.read( bytes)) > 0)
out.write( bytes, 0, len);
in.close();
out.close();
Regards
Vinod V -
Calling a smart form on click of a button in web dynpro abap
Hi experts,
I have a requirement like if I click a button in a view i need ti generate a PDF through smart form.
Is this possible. If so please tell me the way..
Thanks & RegardsHi Sharma,
Create Interactive form in your view, create one node say PDF_SOURCE under this one attribute PDF_SOURCE of type XSTRING.
Bind this to IF form Datasource and pdfsource.
in your button action write code to call your smartform
using SSF_FUNCTION_MODULE_NAME
using FM CONVERT_OTF and attach_file_to_response
*convert to pdf
call function 'CONVERT_OTF'
EXPORTING
format = 'PDF'
IMPORTING
bin_filesize = lv_bytecount
TABLES
otf = ls_job_output_info-otfdata
lines = lt_lines
EXCEPTIONS
err_conv_not_possible = 1
err_bad_otf = 2.
loop at lt_lines into ls_line.
lv_string = ls_line.
export mydata = lv_string to data buffer lv_buffer.
import mydata to l_xline from data buffer lv_buffer in char-to-hex
mode.
concatenate l_pdfstring l_xline into l_pdfstring in byte mode.
endloop.
call method cl_wd_runtime_services=>attach_file_to_response
EXPORTING
i_filename = 'ZWTY_PACKINGSLIP'
i_content = l_pdfstring
i_mime_type = 'BIN'
i_in_new_window = abap_false
i_inplace = abap_false.
also check this..
http://abapcodexperiments.wordpress.com/2011/03/20/smartform-pdf-webdynpro-abap/
Call smartform in web dynpro abap
Cheers,
Kris. -
When to use 'Web dynpro ABAP' and when to go for 'Web Dynpro Java'
Hi,
I am trying to learn 'Web dynpro ABAP' from tutorials available on SDN as i am presently working in ABAP. I am also Java learned.
Please tell me the selection criteria for using Web Dynpro component / application using ABAP or JAVA.
Regards,
TanayaHi,
Go through this
Web Dynpro: ABAP or Java?
WebDynpro for ABAP Vs Java
Re: Javascript future in Webdynpro (JAVA and ABAP)
Javascript future in Webdynpro (JAVA and ABAP)
PradeeP -
File Upload In DMS Using Web Dynpro ABAP
Hi,
I have a requirement to upload files in DMS using Web Dynpro. I have written the code by the hint of the following thread:-
scn.sap.com/thread/1865934
My code is uploading all files but when I try to view them from CV03N only txt files are displaying , Images and PDF files are not
showing there.
Please help me. It's urgent requuirement.
Thanks
AmitTYPES : BEGIN OF zst_ts_raw_line,
line TYPE orblk,
END OF zst_ts_raw_line.
DATA : ls_draw TYPE draw ,
ls_api_ctrl TYPE cvapi_api_control,
ls_message TYPE messages,
lv_documentnumber TYPE draw-doknr,
it_objectlinks TYPE STANDARD TABLE OF dms_db_drad,
ig_objectlinks TYPE dms_db_drad ,
it_documentdescriptions TYPE STANDARD TABLE OF bapi_doc_drat,
ig_documentdescriptions TYPE bapi_doc_drat ,
it_originals_of_doc TYPE STANDARD TABLE OF cvapi_doc_file,
ig_originals_of_doc TYPE cvapi_doc_file ,
lv_storage_cat TYPE cv_storage_cat,
lv_size TYPE i ,
lt_bindata TYPE STANDARD TABLE OF zst_ts_raw_line," STANDARD TABLE OF zst_ts_raw_line,
ls_bindata TYPE zst_ts_raw_line ,"SOLISTI1,"sdokcntbin ,
ls_drao TYPE drao,
lt_drao TYPE TABLE OF drao,
lt_DRAT TYPE TABLE OF DMS_DB_DRAT,
ls_DRAT TYPE DMS_DB_DRAT,
lt_files TYPE cvapi_tbl_doc_files,
ls_files TYPE cvapi_doc_file,
l_string TYPE string.
DATA : ex_pf_ftp_dest TYPE rfcdes-rfcdest.
DATA : ex_pf_http_dest TYPE rfcdes-rfcdest.
DATA lo_nd_upload TYPE REF TO if_wd_context_node.
DATA lo_el_upload TYPE REF TO if_wd_context_element.
DATA ls_upload TYPE wd_this->element_upload.
DATA lo_nd_upload1 TYPE REF TO if_wd_context_node.
DATA lo_el_upload1 TYPE REF TO if_wd_context_element.
DATA ls_upload1 TYPE wd_this->element_upload1.
DATA lo_nd_upload2 TYPE REF TO if_wd_context_node.
DATA lo_el_upload2 TYPE REF TO if_wd_context_element.
DATA ls_upload2 TYPE wd_this->element_upload2.
* navigate from <CONTEXT> to <UPLOAD> via lead selection
lo_nd_upload = wd_context->get_child_node( name = wd_this->wdctx_upload ).
lo_el_upload = lo_nd_upload->get_element( ).
lo_el_upload->get_static_attributes( IMPORTING static_attributes = ls_upload ).
* navigate from <CONTEXT> to <UPLOAD1> via lead selection
lo_nd_upload1 = wd_context->get_child_node( name = wd_this->wdctx_upload1 ).
lo_el_upload1 = lo_nd_upload1->get_element( ).
lo_el_upload1->get_static_attributes( IMPORTING static_attributes = ls_upload1 ).
* navigate from <CONTEXT> to <UPLOAD2> via lead selection
lo_nd_upload2 = wd_context->get_child_node( name = wd_this->wdctx_upload2 ).
lo_el_upload2 = lo_nd_upload2->get_element( ).
lo_el_upload2->get_static_attributes( IMPORTING static_attributes = ls_upload2 ).
DATA : lv_file_name TYPE filep.
ls_draw-dokar = 'Document Type'.
ls_draw-dokvr = '00'.
ls_draw-doktl = '000'.
ls_draw-dwnam = sy-uname.
lv_storage_cat = 'Storage space'.
ls_DRAT-doknr = 'Document Type'.
ls_DRAT-dokvr = '00'.
ls_DRAT-doktl = '000'.
ls_DRAT-dktxt = 'Test Document'.
ls_drat-dktxt_uc = 'Test Document'.
append ls_drat to lt_drat.
ls_api_ctrl-tcode = 'CV01N'.
ls_api_ctrl-commit_flag = 'X'.
ls_api_ctrl-save_flag = 'X'.
ls_api_ctrl-api_mode = 'X'.
ls_api_ctrl-no_update_task = 'X'.
ls_draw-filep = ls_upload-filename. "l_string. *
ig_objectlinks-dokar = doc type
ig_objectlinks-dokvr = '00'.
ig_objectlinks-doktl = '000'.
ig_objectlinks-dokob = 'LFA1'.
ig_objectlinks-objky = lifnr.
APPEND ig_objectlinks TO it_objectlinks.
CALL FUNCTION 'CVAPI_DOC_CREATE'
EXPORTING
ps_draw = ls_draw
*• PF_STATUSLOG = ' '
*• PF_REVLEVEL =
ps_api_control = ls_api_ctrl
*• PF_FTP_DEST = ' '
*• PF_HTTP_DEST = ' '
*• PF_HOSTNAME = ' '
*• PF_CONTENT_PROVIDE = ' '
IMPORTING
psx_message = ls_message
*• PFX_DOKAR =
pfx_doknr = lv_documentnumber
TABLES
pt_drad_x = it_objectlinks
pt_drat_x = lt_drat
* pt_files_x = lt_files.
* documentdescriptions = it_documentdescriptions.
IF sy-subrc NE 0.
WRITE: 'no number'.
ENDIF.
IF ls_message-msg_type CA 'EA'.
ELSE.
ls_draw-doknr = lv_documentnumber.
COMMIT WORK.
ENDIF.
DATA lv_count TYPE i.
DO 3 TIMES.
REFRESH : lt_files,lt_bindata,lt_drao.
lv_count = lv_count + 1.
ls_files-appnr = lv_count."'1'.
CASE lv_count.
WHEN '1'.
ls_files-filename = ls_upload-filename. "wa_general-REF_FILE_NAME1. "
ls_upload-filecontent = ls_upload-filecontent.
WHEN '2'.
ls_files-filename = ls_upload1-filename. "wa_general-REF_FILE_NAME1. "
ls_upload-filecontent = ls_upload1-filecontent.
WHEN '3'.
ls_files-filename = ls_upload2-filename. "wa_general-REF_FILE_NAME1. "
ls_upload-filecontent = ls_upload2-filecontent.
ENDCASE.
MOVE ls_files-filename TO lv_file_name.
CALL FUNCTION 'CV120_DOC_GET_APPL'
EXPORTING
*•PF_DIALOG =
*•PF_DISPLAY =
* PF_FILE = 'DO.TXT'
pf_file = lv_file_name "wa_general-REF_FILE_NAME1 "
*•PF_TYPDT =
IMPORTING
pfx_dappl = ls_files-dappl.
ls_files-updateflag = 'I'.
ls_files-langu = sy-langu.
ls_files-storage_cat = 'Srotage ID'.
ls_files-description = 'DMS'.
APPEND ls_files TO lt_files.
CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
EXPORTING
buffer = ls_upload-filecontent "wa_general-ref_doc1 "
*• APPEND_TO_TABLE = ' '
IMPORTING
output_length = lv_size
TABLES
binary_tab = lt_bindata.
DATA : lv_zaehl TYPE obzae.
CLEAR lv_zaehl.
LOOP AT lt_bindata INTO ls_bindata.
CLEAR ls_drao.
lv_zaehl = lv_zaehl + 1.
ls_drao-orblk = ls_bindata-line.
ls_drao-orln = lv_size.
* ls_drao-dokar = ls_draw-dokar.
* ls_drao-doknr = lv_documentnumber.
* ls_drao-dokvr = ls_draw-dokvr.
* ls_drao-doktl = ls_draw-doktl.
ls_drao-zaehl = lv_zaehl.
* ls_drao-appnr = lv_count."'1'.
APPEND ls_drao TO lt_drao.
ENDLOOP.
CALL FUNCTION 'CVAPI_DOC_CHECKIN'
EXPORTING
pf_dokar = ls_draw-dokar
pf_doknr = lv_documentnumber
pf_dokvr = ls_draw-dokvr
pf_doktl = ls_draw-doktl
ps_api_control = ls_api_ctrl
pf_content_provide = 'TBL'
IMPORTING
psx_message = ls_message
TABLES
pt_files_x = lt_files
pt_content = lt_drao.
COMMIT WORK.
ENDDO. -
Shooping cart creation in SRM 7.0 using web dynpro ABAP classes.
Hi,
We have recently upgraded to SRM 7.0 from SRM 4.0. We are using customized portal application for the creation of the shopping cart.I am planning to create custom FM which will use the standard Web dynpro ABAP classes to create the shopping cart.
Could you please guide with the classes that are need to be implemented and the sequence of the classes used in the shopping cart creation.
I think these are the classes that are used in the standard web dynpro ABAP component.
CL_FPM_EVENT -> Creates an instance of this class based on an event ID.
CL_BADI_FLT_DATA_TRANS_AND_DB -> Data Handling: Transport and Database.
CL_EXITHANDLER -> Class for Ext. Services Within Framework of Exit Technique.
CL_EX_BBP_DOC_CHANGE_BADI -> BAdI Class CL_EX_BBP_DOC_CHANGE_BADI.
CL_BBP_OBJECTS_ACCESS -> Access Functions for Object Types.
/SAPSRM/CL_PDO_BO_SC -> Shopping Cart BO.
Your expert comments will be appreciated...
Regards,
NareshDear Poster,
As no response has been provided to the thread in some time I must assume the issue is resolved, if the question is still valid please create a new thread rephrasing the query and providing as much data as possible to promote response from the community.
Best Regards,
SDN SRM Moderation Team -
Rules Engine using Web Dynpro ABAP
Hi,
Can we build a Rules Engine which works with Web Dynpro-ABAP? Something similar to BRM in CE-7.2.
Thanks,
PrasannaDo you mean BRM or BRF. BRF is the name of the business rules framework that is integrated in the ABAP engine. BRM is Business Rules Management and a part of NetWeaver CE - running on the Java Stack and a part of SAP NetWeaver BPM (Business Process Management).
Generally if your work is all ABAP based you would use BRF. Here is a small eLearning that shows the usage of BRF within Web Dynpro ABAP.
http://www.sdn.sap.com/irj/scn/elearn?rid=/library/uuid/c0181bb1-28e7-2c10-538c-a093c616310e -
Upload file into KM using Web Dynpro ABAP
Hi, I'm looking at converting an existing Web Dynpro Java application to a Web Dynpro ABAP application. However, I cannot find how to upload a file and store it in the Portal KM repository using WDA. I have been able to do it successfully using WDJ. Any help on how to do this would be very much appreciated. Thanks.
Hi, I'm looking at converting an existing Web Dynpro Java application to a Web Dynpro ABAP application. However, I cannot find how to upload a file and store it in the Portal KM repository using WDA. I have been able to do it successfully using WDJ. Any help on how to do this would be very much appreciated. Thanks.
-
E-recruiting using web dynpro ABAP
Hi experts,
I am new to HR E-recruiting. I understand the concepts through SDN and [help.sap.com]. But I want to know how to develop E-Recruiting in Web dynpro ABAP. Is there any tutorial or document for this....
I cant get a clear idea till now. Please provide me with some steps,documents and procedures .
Thanks&Regards,
vinoVino,
check these links
http://help.sap.com/saphelp_erp60_sp/helpdata/en/72/c9b54015c4752ae10000000a155106/frameset.htm
EREC 600-http://help.sap.com/saphelp_erp60_sp/helpdata/en/72/c9b54015c4752ae10000000a155106/frameset.htm
http://help.sap.com/saphelp_erp2005/helpdata/en/45/8150635e9c40c1e10000000a1553f7/frameset.htm
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/30adcac6-7a55-2a10-9fa9-a61d947f6ec9
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/a07122ae-8216-2a10-c9a5-996717a0648b
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/24396589-0a01-0010-3c8c-ab2e3acf6fe2
https://www.sdn.sap.com/irj/sdn/wiki?path=/display/erphcm/sap%2be-recruiting
E-Recruitment-SAP E-Recruiting
Thanks
Bala Duvvuri -
Print Button in Web Dynpro ABAP
Hi Everybody,
i hope that someone know or have a code sample how i can set a print button to the Web Dynpro for ABAP. On click on this it should open the print window from the Internet Explorer.
Please let me know if there is any information about this.
Thanks
Best regards
MarkusHi,
If you are using the Internet Explorer 7, you can use CTRL + P to invoke print directly on any WebDynpro ABAP view. This is IE 7.0 browser featute & always has print preview & print options available from File Menu's. So you dont require any additional buttons on view :).
For table data if you use ALV you get options to export data to excel or fire print directly
Greetings
Prashant -
Not able to upload file in DMS(Document Mang. system) using Web dynpro ABAP
Hi All,
I am facing a problem while uploading the file into the DMS ( Document Management System ) from Webdnrpo .
I am using the BAPI - BAPI_DOCUMENT_CREATE2 to create the document .
CASE - 1
when i am providing the storage category mention below and no data carrier1
ls_documentfiles-storagecategory = 'ZHMEL_CS'. it is not able to upload the document in the DMS system and when i check
in the debugg mode it giving error as ""Error while checking in and storing: C:\TEST.TXT "" .
CASE - 2
When i am not using the storage category and providing the the data carrier as default
ls_documentdata-DATACARRIER1 = 'DEFAULT'. It is able to create the document in the DMS but i am not able to read that document .
I checked with DMS Consultant that DMS is configured for ZOL ( documenttype) with a storage category as 'ZHMEL_CS'.
The code which i have used is below :
ls_documentdata-documenttype = 'ZOL'.
ls_documentdata-documentversion = '00'.
ls_documentdata-documentpart = '000'.
ls_documentdata-description = 'Test Document'.
ls_documentdata-laboratory = '001'.
ls_documentdata-WSAPPLICATION1 = 'TXT'.
ls_documentdata-DOCFILE1 = 'C:\TEST.TXT'.
ls_documentdata-SAVEDOCFILE1 = 'C:\TEST.TXT'.
*ls_documentdata-FILESIZE1 = 000000000000.
*ls_documentdata-FILESIZE2 = 000000000000.
ls_documentdata-WSAPPLICATION1 = 'TXT'.
ls_documentfiles-DOCUMENTTYPE = 'ZOL'.
ls_documentfiles-DOCUMENTPART = '000'.
ls_documentfiles-DOCUMENTVERSION = '00'.
ls_documentfiles-storagecategory = 'ZHMEL_CS'.
ls_documentfiles-WSAPPLICATION = 'TXT'.
ls_documentfiles-DOCPATH = 'C:\'.""lv_filename.
ls_documentfiles-DOCFILE = 'TEST.TXT'."lv_filename.
ls_documentfiles-description = 'Test Document'.
ls_documentfiles-language = 'EN'.
ls_documentfiles-CHECKEDIN = 'X'.
APPEND ls_documentfiles to lt_documentfiles .
*&----Fill Descriptions
w_descr-language = 'EN'.
w_descr-language_iso = 'EN'.
w_descr-description = 'Test'.
append w_descr to lt_descr.
clear w_descr.
**w_hostname = 'HMEL-DV1R3_DR3_00'.
CALL FUNCTION 'BAPI_DOCUMENT_CREATE2'
EXPORTING
documentdata = ls_documentdata
*hostname = 'content-srv'
*pf_http_dest = 'SAPHTTPA'
*pf_ftp_dest = 'SAPFTPA'
IMPORTING
DOCUMENTNUMBER = lv_DOCUMENTNUMBER
return = gv_return
TABLES
documentdescriptions = lt_descr
documentfiles = lt_documentfiles.
Please let me know your valuable inputs on the same ..
Edited by: Omm Awasthi on Dec 30, 2010 12:22 AM
Edited by: Omm Awasthi on Dec 30, 2010 12:25 AMHi omm , from functional side your require a document type and content repository
I have used below code in a function module to create document , we have create object link as PO to the doc.
FUNCTION ZFM_SR_CREATE_FROM_EXTERNAL .
""Local Interface:
*" IMPORTING
*" VALUE(IV_DOCUMENTNUMBER) TYPE DOKNR OPTIONAL
*" VALUE(IV_DOCUMENTTYPE) TYPE DOKAR OPTIONAL
*" VALUE(IV_DOCUMENTVERSION) TYPE DOKVR OPTIONAL
*" VALUE(IV_DOCUMENTPART) TYPE DOKTL_D OPTIONAL
*" VALUE(IV_STORAGE_CAT) TYPE CV_STORAGE_CAT OPTIONAL
*" VALUE(IV_DOKST) TYPE DOKST OPTIONAL
*" VALUE(IT_DM_FILES) TYPE ZDM_TT_FILES OPTIONAL
*" VALUE(IV_EBELN) TYPE EBELN
*" EXPORTING
*" VALUE(EV_DOCUMENTNUMBER) TYPE DOKNR
*" VALUE(ES_RETURN) TYPE BAPIRET2
V00.00 DD.MM.YYYY *
*********************New Method of Uploading File*********************************
CONSTANTS path_name TYPE dms_path
VALUE '/tmp/'.
CONSTANTS log TYPE dms_path VALUE '/tmp/logFO.txt'.
DATA: ls_draw TYPE bapi_doc_draw2,
lt_documentfiles TYPE TABLE OF bapi_doc_files2,
ls_documentfiles TYPE bapi_doc_files2,
ls_dm_files TYPE zdm_files,
lv_filename TYPE string,
lv_ext TYPE string,
lv_file_type TYPE draw-dappl,
lv_file_name TYPE dms_path,
lv_msg(80) TYPE c,
lt_objectlinks TYPE TABLE OF bapi_doc_drad,
ls_objectlinks TYPE bapi_doc_drad,
lv_ebelp TYPE ebelp
Prepare Data
MOVE iv_documentnumber TO ls_draw-documentnumber.
MOVE iv_documenttype TO ls_draw-documenttype.
MOVE iv_documentversion TO ls_draw-documentversion.
MOVE iv_documentpart TO ls_draw-documentpart.
ls_draw-statusextern = iv_dokst.
ls_draw-statusintern = iv_dokst.
ls_draw-username = sy-uname.
LOOP AT it_dm_files INTO ls_dm_files.
SPLIT ls_dm_files-filepath AT '.' INTO lv_filename lv_ext.
CALL FUNCTION 'CV120_DOC_GET_APPL'
EXPORTING
pf_file = ls_dm_files-filepath
IMPORTING
pfx_dappl = lv_file_type.
TRANSLATE lv_file_type TO UPPER CASE.
OPEN DATASET log FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
TRANSFER lv_ext TO log.
ls_documentfiles-wsapplication = lv_file_type.
TRANSLATE ls_documentfiles-wsapplication TO UPPER CASE.
CONCATENATE path_name
lv_filename
lv_ext
INTO lv_file_name.
CONDENSE lv_file_name NO-GAPS.
TRANSFER lv_file_name TO log.
OPEN DATASET lv_file_name FOR OUTPUT IN BINARY MODE MESSAGE lv_msg.
*Transfer Attachment Content to Application Server
TRANSFER ls_dm_files-content TO lv_file_name.
CLOSE DATASET lv_file_name.
TRANSFER 'move data to lt_files' TO log.
ls_documentfiles-storagecategory = iv_storage_cat.
ls_documentfiles-docfile = lv_file_name.
ls_documentfiles-DOCUMENTVERSION = IV_DOCUMENTVERSION.
APPEND ls_documentfiles TO lt_documentfiles.
CLEAR lv_file_name.
CLOSE DATASET log.
ENDLOOP.
IF iv_ebeln IS NOT INITIAL.
ls_objectlinks-objecttype = 'EKPO'.
SELECT SINGLE ebelp INTO lv_ebelp FROM ekpo WHERE
ebeln = iv_ebeln
AND loekz eq space.
CONCATENATE iv_ebeln lv_ebelp INTO ls_objectlinks-objectkey.
APPEND ls_objectlinks TO lt_objectlinks.
ENDIF.
CALL FUNCTION 'BAPI_DOCUMENT_CREATE2'
EXPORTING
documentdata = ls_draw
pf_ftp_dest = 'SAPFTPA'
pf_http_dest = 'SAPHTTPA'
IMPORTING
documentnumber = ev_documentnumber
return = es_return
TABLES
objectlinks = lt_objectlinks
documentfiles = lt_documentfiles.
DATA: ls_doc_data type bapi_doc_draw2,
ls_doc_datax type bapi_doc_drawx2,
ls_return type bapiret2.
Set value for document data
ls_doc_data-statusextern = 'IW'.
ls_doc_data-statusintern = 'IW'.
Set value for document data check
ls_doc_datax-statusextern = 'X'.
ls_doc_datax-statusintern = 'X'.
CALL FUNCTION 'BAPI_DOCUMENT_CHANGE2'
EXPORTING
DOCUMENTTYPE = 'ROS'
DOCUMENTNUMBER = IV_DOCUMENTNUMBER
DOCUMENTPART = IV_DOCUMENTPART
DOCUMENTVERSION = IV_DOCUMENTVERSION
DOCUMENTDATA = ls_doc_data
DOCUMENTDATAX = ls_doc_datax
HOSTNAME =
DOCBOMCHANGENUMBER =
DOCBOMVALIDFROM =
DOCBOMREVISIONLEVEL =
SENDCOMPLETEBOM = ' '
pf_ftp_dest = 'SAPFTPA'
pf_http_dest = 'SAPHTTPA'
CAD_MODE = ' '
ACCEPT_EMPTY_BOM = ' '
IMPORTING
RETURN = ls_return
TABLES
CHARACTERISTICVALUES =
CLASSALLOCATIONS =
DOCUMENTDESCRIPTIONS =
OBJECTLINKS =
DOCUMENTSTRUCTURE =
DOCUMENTFILES = lt_documentfiles.
LONGTEXTS =
COMPONENTS =
move es_return to ES_RETURN.
IF es_return-type CA 'EA' ."NE 'E' AND es_return-type NE 'A'.
"do nothing
ELSE.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
wait = 'X'.
ENDIF.
LOOP AT lt_documentfiles INTO ls_documentfiles.
DELETE DATASET ls_documentfiles-docfile.
ENDLOOP.
ENDFUNCTION.
Maybe you are looking for
-
How do I recover the music on my nano back to a new drive
All data om my Western Digital external hard drive has been lost as the drive has failed completely with all data unrecoverable. How do I sync the music on my nano to the new hard drive - am worried that i will lose all this music - over 2.5k songs,
-
I have a Lacie External Drive connected to my AEBS. All the time while it's connected the drive wines. So much in fact, that I've turned it off. I know the drive is 'permanently' connected to the network but should it be causing it to wine like this?
-
VMware - I cannot logon to Windows 7 after upgrade to Yosemite
After upgrading to Yosemite, I cannot logon to Windows under VMware Fusion 7.0. It was working fine prior to the upgrade. The message I get when logging onto Window is, "The User Profile Service service failed the logon. The User profile cannot be l
-
I know I can associate a certain type of file extension to a program by going to Finder, Get Info and apply to all. But I wanted to know what's behind that feature? Are there any way to do that in the Terminal? The closest I got was SetFile from Deve
-
Reportin on Smart Lists in FR Studio
Hi there- I need to add some smart lists in a report and have no idea how to do it. I cant use planning as a data source because is all jacked! In the planning form the smart list have 6 different labels (product codes) that I need to pull into my re