INTERNAL_SERVER_ERROR while Calling SCMS_HTTP_CREATE Function Module
Dear All,
We want to attach document (PDF, DOCX, TXT etc.) in DMS using WD application.
We converted data xstring to binary format. Now when we call Function Module SCMS_HTTP_CREATE, it gives SY-SUBRC = 5. INTERNAL_SERVER_ERROR.
Code:
*"*"Local Interface:
*" IMPORTING
*" VALUE(IV_ARCHIV_ID) TYPE TOAOM-ARCHIV_ID
*" VALUE(IV_AR_OBJECT) TYPE TOAOM-AR_OBJECT
*" VALUE(IV_OBJECT_ID) TYPE SAPB-SAPOBJID
*" VALUE(IV_SAP_OBJECT) TYPE TOAOM-SAP_OBJECT
*" VALUE(IV_LENGTH) TYPE I
*" VALUE(IV_MIMETYPE) TYPE STRING
*" VALUE(IT_DATA) TYPE ZTAB
*" EXPORTING
*" VALUE(EV_FLAG) TYPE CHAR1
*" VALUE(EV_DOC_ID) TYPE SAEARDOID
DATA : LV_ARC_DOC TYPE SYSUUID-C,
LV_MIMETYPE TYPE W3CONTTYPE,
LV_ARCDOC TYPE TOAV0-ARC_DOC_ID.
CALL FUNCTION 'SYSTEM_UUID_C_CREATE'
IMPORTING
UUID = LV_ARC_DOC.
CALL FUNCTION 'SCMS_FE_GROUP_OPEN'.
LV_MIMETYPE = IV_MIMETYPE.
CALL FUNCTION 'SCMS_HTTP_CREATE'
EXPORTING
MANDT = SY-MANDT
CREP_ID = IV_ARCHIV_ID
DOC_ID = LV_ARC_DOC
COMP_ID = 'data'
MIMETYPE = LV_MIMETYPE
LENGTH = IV_LENGTH
* SIGNATURE = 'X'
* DOC_PROT = 'rcud'
* TEXT_MODE = ' '
* ACCESSMODE = 'c'
* SECURITY = ' '
* OVERWRITE = '-'
* IMPORTING
* DOC_ID_OUT =
TABLES
DATA = IT_DATA
EXCEPTIONS
BAD_REQUEST = 1
UNAUTHORIZED = 2
FORBIDDEN = 3
CONFLICT = 4
INTERNAL_SERVER_ERROR = 5
ERROR_HTTP = 6
ERROR_URL = 7
ERROR_SIGNATURE = 8
ERROR_PARAMETER = 9
OTHERS = 10
IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL FUNCTION 'SCMS_FE_GROUP_CLOSE'
LV_ARCDOC = LV_ARC_DOC.
CALL FUNCTION 'ARCHIV_CONNECTION_INSERT'
EXPORTING
ARCHIV_ID = IV_ARCHIV_ID
ARC_DOC_ID = LV_ARCDOC
* AR_DATE = ' '
AR_OBJECT = IV_AR_OBJECT
* DEL_DATE = ' '
* MANDANT = ' '
OBJECT_ID = IV_OBJECT_ID
SAP_OBJECT = IV_SAP_OBJECT
* DOC_TYPE = ' '
* BARCODE = ' '
EXCEPTIONS
ERROR_CONNECTIONTABLE = 1
OTHERS = 2
IF SY-SUBRC <> 0.
** MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
While Calling FM 'SCMS_HTTP_CREATE' is Raise Exception 5 INTERNAL_SERVER_ERROR.
Thanks
Regards
Rohit
Hi,
Content-Type: application/xml
...check for the content type of the message that is sent ot the WS.....with the above mentioned content-type going to the WS currently...WS is not able to parse the req and hence the error....in other words wrong format being being passed.
Regards,
ABhishek.
Similar Messages
-
CNTL_ERROR while calling a function module from Java webdynpro
I am calling a RFC function module from javawebdynpro app
which inturn calls a function module performing BDC on CAPP transaction. When I run this from SE37 of the same system or a different system everything works fine. But when called from Java webdynpro app, it raises a CNTL_ERROR exception and creates a short dump.
Any help on this is highly appreciatedGood catch, BI Learner. This was exactly it: when assigning the values from SOURCEFIELDS directly to the import/export parameters, you have to make sure that the types are EXACTLY the same, otherwise it will not work (the routine stops with an error when calling the FM, but there is no dump).
Therefore, to solve my problem, I created the declarations precisely as expected by the FM and assigned the values to these fields:
DATA:
SOURCEVAL TYPE /BIC/OIINVQTY,
SOURCEUOM TYPE /BIC/OIUSUOM,
USITM TYPE /BIC/OIUSITM,
TARGETUOM TYPE /BIC/OIUSUOM,
CONVERTED_COST TYPE /BIC/OIINVQTY.
DATA PRODUCTION_UOM TYPE /BIC/OIUSUOM.
" get the Production UOM
SELECT SINGLE I~/BIC/USPRDUOM
FROM /BIC/PUSITM AS I
INTO PRODUCTION_UOM
WHERE I~/BIC/USITM = SOURCE_FIELDS-/BIC/USITM AND I~OBJVERS = 'A'.
IF ( SY-SUBRC = 4 ). " no records found
"RAISE PARTNO_NOT_FOUND.
RAISE EXCEPTION TYPE CX_RSROUT_SKIP_RECORD.
ENDIF.
" load the parameters
SOURCEVAL = SOURCE_FIELDS-/BIC/USFRZMFC.
SOURCEUOM = SOURCE_FIELDS-BASE_UOM.
USITM = SOURCE_FIELDS-/BIC/USITM.
" then you can call the FM
CALL FUNCTION 'Z_CA_CONVERT_US_COST'
EXPORTING
PSOURCEVAL = SOURCEVAL
PSOURCEUOM = SOURCEUOM
PUSITM = USITM
PTARGETUOM = PRODUCTION_UOM
IMPORTING
PTARGETVAL = CONVERTED_COST
EXCEPTIONS
CONVERSION_NOT_MAINTAINED = 1
PARTNO_NOT_FOUND = 2
OTHERS = 3.
" ... [do the rest]
Thanks for your help,
Dennis -
Problem while calling RFC function module in java
Hi all
com.sap.mw.jco.JCO$Exception: (102) RFC_ERROR_COMMUNICATION: Connect to SAP gateway failed
Connect_PM GWHOST=<system.ab.ydydy.yyyd.com>, GWSERV=sapgw00, ASHOST=<system.ab.ydydy.yyyd.com>, SYSNR=00
LOCATION CPIC (TCP/IP) on local host
ERROR hostname '<system.ab.ydydy.yyyd.com>' unknown
TIME Mon Jun 06 14:50:25 2005
RELEASE 640
COMPONENT NI (network interface)
VERSION 37
RC -2
MODULE ninti.c
LINE 332
DETAIL NiPGetHostByName2: hostname '<system.ab.ydydy.yyyd.com>' not found
SYSTEM CALL gethostbyname_r
COUNTER 1
at com.sap.mw.jco.rfc.MiddlewareRFC$Client.nativeConnect(Native Method)
at com.sap.mw.jco.rfc.MiddlewareRFC$Client.connect(MiddlewareRFC.java:1098)
at com.sap.mw.jco.JCO$Client.connect(JCO.java:2983)
at MyProject.Bapi2.<init>(Bapi2.java:43)
at MyProject.Bapi2.main(Bapi2.java:231)
Pl help me
pradeepHi
This is my code....
Created on Jun 2, 2005
To change the template for this generated file go to
Window>Preferences>Java>Code Generation>Code and Comments
package MyProject;
@author pradeep
To change the template for this generated type comment go to
Window>Preferences>Java>Code Generation>Code and Comments
import com.sap.mw.jco.*;
public class Bapi2 extends Object {
JCO.Client mConnection;
JCO.Repository mRepository;
public Bapi2() {
try {
// Change the logon information to your own system/user
mConnection =
JCO.createClient("122", // SAP client
"<pradeep>", // userid
"*****", // password
"EN", // language
"<abc11.aa.abc23.company.com>", // application server host name
"<00>");//system no
mConnection.connect();
mRepository = new JCO.Repository("HLL", mConnection);
catch (Exception ex) {
ex.printStackTrace();
System.exit(1);
JCO.Function function = null;
JCO.Table codes = null;
try {
function = this.createFunction("BAPI_COMPANYCODE_GETLIST");
if (function == null) {
System.out.println("BAPI_COMPANYCODE_GETLIST" +
" not found in SAP.");
System.exit(1);
mConnection.execute(function);
JCO.Structure returnStructure =
function.getExportParameterList().getStructure("RETURN");
if (! (returnStructure.getString("TYPE").equals("") ||
returnStructure.getString("TYPE").equals("S")) ) {
System.out.println(returnStructure.getString("MESSAGE"));
System.exit(1);
codes =
function.getTableParameterList().getTable("COMPANYCODE_LIST");
codes.setRow(2);
codes.deleteRow();
codes.deleteRow(5);
codes.appendRow();
codes.setValue("XXXX", "COMP_CODE");
codes.setValue("Does not exist", "COMP_NAME");
codes.appendRows(2);
codes.setValue("YYYY", "COMP_CODE");
codes.setValue("Does not exist either", "COMP_NAME");
codes.nextRow();
codes.setValue("ZZZZ", "COMP_CODE");
codes.setValue("Nor does this", "COMP_NAME");
for (int i = 0; i < codes.getNumRows(); i++) {
codes.setRow(i);
System.out.println(codes.getString("COMP_CODE") + '\t' +
codes.getString("COMP_NAME"));
catch (Exception ex) {
ex.printStackTrace();
System.exit(1);
try {
codes.firstRow();
for (int i = 0; i < codes.getNumRows(); i++, codes.nextRow()) {
function = this.createFunction("BAPI_COMPANYCODE_GETDETAIL");
if (function == null) {
System.out.println("BAPI_COMPANYCODE_GETDETAIL" +
" not found in SAP.");
System.exit(1);
function.getImportParameterList().
setValue(codes.getString("COMP_CODE"), "COMPANYCODEID");
mConnection.execute(function);
JCO.Structure returnStructure =
function.getExportParameterList().getStructure("RETURN");
if (! (returnStructure.getString("TYPE").equals("") ||
returnStructure.getString("TYPE").equals("S") ||
returnStructure.getString("TYPE").equals("W")) ) {
System.out.println(returnStructure.getString("MESSAGE"));
JCO.Structure detail =
function.getExportParameterList().
getStructure("COMPANYCODE_DETAIL");
System.out.println(detail.getString("COMP_CODE") + '\t' +
detail.getString("COUNTRY") + '\t' +
detail.getString("CITY"));
catch (Exception ex) {
ex.printStackTrace();
System.exit(1);
mConnection.disconnect();
public JCO.Function createFunction(String name) throws Exception {
try {
IFunctionTemplate ft =
mRepository.getFunctionTemplate(name.toUpperCase());
if (ft == null)
return null;
return ft.getFunction();
catch (Exception ex) {
throw new Exception("Problem retrieving JCO.Function object.");
public static void main (String args[]) {
Bapi2 app = new Bapi2();
This is the error i'm getting...
com.sap.mw.jco.JCO$Exception: (102) RFC_ERROR_COMMUNICATION: Connect to SAP gateway failed
Connect_PM GWHOST=<abc11.aa.abc23.company.com>, GWSERV=sapgw00, ASHOST=<abc11.aa.abc23.company.com>, SYSNR=00
LOCATION CPIC (TCP/IP) on local host
ERROR hostname '<abc11.aa.abc23.company.com>' unknown
TIME Mon Jun 06 17:15:12 2005
RELEASE 640
COMPONENT NI (network interface)
VERSION 37
RC -2
MODULE ninti.c
LINE 332
DETAIL NiPGetHostByName2: hostname
'<abc11.aa.abc23.company.com>' not
at com.sap.mw.jco.rfc.MiddlewareRFC$Client.nativeConnect(Native Method)
at com.sap.mw.jco.rfc.MiddlewareRFC$Client.connect(MiddlewareRFC.java:1098)
at com.sap.mw.jco.JCO$Client.connect(JCO.java:2983)
at MyProject.Bapi2.<init>(Bapi2.java:45)
at MyProject.Bapi2.main(Bapi2.java:233)
Thx
PRadeep -
Error when call RFC Function module in R/3
Dear All,
We are trying to call RFC function module CBIF_GLM1_PROCESS_ORDER_READ (This is not a BAPI and also not released ) in R/3 from XI system.
we are facing the error "Error while lookup Exception during processing the payload. Error when calling an adapter by using the communication channel CC_PPPI_MES_RFC_Rcvr (Party: , Service: WCD_320, Object ID: 16563889b449328eac76caa6a3bc592e) XI AF API call failed. Module exception: 'error while processing the request to rfc-client: com.sap.aii.adapter.rfc.afcommunication.RfcAFWException: error while processing message to remote system:com.sap.aii.adapter.rfc.core.client.RfcClientException: failed to parse BAPI response due to: com.sap.aii.adapter.rfc.util.bapi.BapiException: Parameter with name RETURN not found.'. Cause Exception: 'com.sap.aii.adapter.rfc.afcommunication.RfcAFWException: error while processing message to remote system:com.sap.aii.adapter.rfc.core.client.RfcClientException: failed to parse BAPI response due to: com.sap.aii.adapter.rfc.util.bapi.BapiException: Parameter with name RETURN not found.'."
This is the first time we are doing this configuration.
Could you please let me know what woulbe the reason.read the original message
We are trying to call RFC function module CBIF_GLM1_PROCESS_ORDER_READ (This is not a BAPI and also not released ) in R/3 from XI system.
I am talking about the above Receiver RFC channel which you guys are using to call R/3 from XI. That where you need to change the commit parameter -
Error while activating the function module
hi,
am getting error while activating the function module i.e. program or report statement is missing.
thank you in advance
karthikhii vinu,
hi there....
make sure that the Processing type in Attributes tab is 'Normal function module'. Also chk the general data, it must be having some name in the Program Name and include name column.try checking the program names in se38, if the program is of type include or not. you can also chk by writting a program call the function module and test it
I hope this will solve the query. in my case, SAPLZ123 is the program name and LZ123U28 is the include name.
or
Its common prob with Function module.
Goto SE80->Give Function group name->Right click on it->Activate.
regards,
Shweta -
Type conflict when calling a function module (field length)
Dear All,
I am getting this following error while executing: Type conflict when calling a function module (field length)
This is piece of coding i have writern in my action button.
method SEARCH_MATERIAL .
data:
node_mat_input TYPE REF TO if_wd_context_node,
node_mat_output TYPE REF TO if_wd_context_node,
material TYPE BAPIMATDET-MATERIAL,
itab TYPE TABLE OF BAPIMATDOA.
node_mat_input = wd_context->get_child_node( 'NODE_MAT_INPUT' ).
node_mat_output = wd_context->get_child_node( 'NODE_MAT_OUTPUT' ).
node_mat_input->get_attribute( EXPORTING name = 'MATERIAL'
IMPORTING value = material ).
CALL FUNCTION 'BAPI_MATERIAL_GET_DETAIL'
EXPORTING
material = material
PLANT = plant
VALUATIONAREA =
VALUATIONTYPE =
MATERIAL_EVG =
IMPORTING
MATERIAL_GENERAL_DATA = itab
RETURN =
MATERIALPLANTDATA =
MATERIALVALUATIONDATA =
node_mat_output->bind_table( itab ).
endmethod.
Attributes are:
Node name = INPUT its structure is BAPIMATDET
INPUT attributes = MATERIAL of type BAPIMATDET-MATERIAL
Thanks,
Gopi.Hi Amit,
I have used service call to fetch records from that bapi..
The following is the code generated by service call:-
METHOD execute_bapi_material_get_deta .
declarations for context navigation
DATA:
node_bapi_material_get_de TYPE REF TO if_wd_context_node,
node_exporting TYPE REF TO if_wd_context_node,
node_material_general_dat TYPE REF TO if_wd_context_node,
node_importing TYPE REF TO if_wd_context_node,
lri_element TYPE REF TO if_wd_context_element.
declarations for fuba parameters
data:
stru_c_material_general_dat TYPE if_componentcontroller=>element_material_general_dat.
DATA:
attr_material TYPE bapimatdet-material,
attr_plant TYPE bapimatall-plant.
get all involved child nodes
node_bapi_material_get_de = wd_context->get_child_node( `BAPI_MATERIAL_GET_DE` ).
node_exporting = node_bapi_material_get_de->get_child_node( `EXPORTING` ).
node_material_general_dat = node_exporting->get_child_node( `MATERIAL_GENERAL_DAT` ).
node_importing = node_bapi_material_get_de->get_child_node( `IMPORTING` ).
get input from context
node_importing->get_attribute( EXPORTING name = `MATERIAL`
IMPORTING value = attr_material ).
node_importing->get_attribute( EXPORTING name = `PLANT`
IMPORTING value = attr_plant ).
the invocation - errors are always fatal !!!
CALL FUNCTION 'BAPI_MATERIAL_GET_DETAIL'
EXPORTING
material = attr_material
plant = attr_plant
" valuationarea = wd_This->Valuationarea
" valuationtype = wd_This->Valuationtype
" material_Evg = wd_This->Material_Evg
IMPORTING
material_general_data = stru_c_material_general_dat
" return = wd_This->Return
" materialplantdata = wd_This->Materialplantdata
" materialvaluationdata = wd_This->Materialvaluationdat
node_material_general_dat->bind_structure( stru_c_material_general_dat[] ).
ENDMETHOD.
but the problem is I am getting the following error while compiling...
" stru_c_materialplantdata " is not an internal table - the " OCCOURS n" specification is missing.
Thanks,
Gopi.
Edited by: Yegalaivan on Nov 18, 2009 8:30 AM -
How to call a function module from debugger?
Hi all,
i just wanted to know whether we can call a function module from a debugger ,
if yes how ?Hi Laxmikanth,
How ur going to call a function module which is not present in program???
In debugging mode u can change the values of variables,put break points and watch points,but i thnk its not possible to call a function module(not present in program) while debugging .
Please share with us if u have any solution...
Regards,
lakshman. -
Calling a function module from a Web Template
Hi,
I need to call a function module from a web template. Any pointers on how i can do this ? Is this even possible ?
Thanks
ShaileshHi Rael,
We were finally able to call a FM module from the Web. The trick as Heike suggested was to create an ABAP class which inherits from CL_RSR_WWW_HELP_WINDOW. Then you should modify the process_cmd method of this new class in order to call the FM. Now use this class to create a help service. In case you need to pass any parameters to the FM, you will need to pass them as additional parameters while calling the help service.
An example is below.
CMD=PROCESS_HELP_WINDOW&HELP_SERVICE=ZBOOKMARKING&TEXT=mytext&URL=myurl
Where mytext and myurl were the parameters i pass to my FM and ZBOOKMARKING is my help service.
Thanks a Lot to Heike for his help on this !!
Shailesh -
Can we call a function module in ADHOC query
Hi
Can we call a function module in ADHOC query if yes how.
Also we ned to know how to call a function module in SAP query.
An early responce is appreciated.
Thanks and best regards
RajeevOkay as far as I understand your aim is:
To fill a field in the output list with a value that is based on the current line information and calculated by a function module
So go to SQ02 and create an additional field in the InfoSet.
You can refer in the coding to the technical names you can see in the left tree window like P0000-PERNR.
More information is avaiable in the Help part look for additional field in SQ02.
Regards,
Michael -
Upload data from excel with vba by calling a function module
Hello all,
i have a problem with the function module "ALSM_EXCEL_TO_INTERNAL_TABLE". I will call this function module with vba to load data from excel to sap with a Buttonclick. I have copied this function module and set it remotable. But i can´t call it from excel.
Can you give me some tips how can i
upload data from excel with vba by click a button.
The problem seems the function: call method cl_gui_frontend_services=>clipboard_import in the function module, because when i comment this function call the vba-call is true but no results.
How can I call the function module correct with vba?
Thanks a lot for your tips!!!!
Chris
Message was edited by:
Christoph KirschnerHI
Uploading data directly from Excel file format
* Upload data direct from excel.xls file to SAP
REPORT ZEXCELUPLOAD.
PARAMETERS: filename LIKE rlgrap-filename MEMORY ID M01,
begcol TYPE i DEFAULT 1 NO-DISPLAY,
begrow TYPE i DEFAULT 1 NO-DISPLAY,
endcol TYPE i DEFAULT 100 NO-DISPLAY,
endrow TYPE i DEFAULT 32000 NO-DISPLAY.
* Tick don't append header
PARAMETERS: kzheader AS CHECKBOX.
DATA: BEGIN OF intern OCCURS 0.
INCLUDE STRUCTURE alsmex_tabline.
DATA: END OF intern.
DATA: BEGIN OF intern1 OCCURS 0.
INCLUDE STRUCTURE alsmex_tabline.
DATA: END OF intern1.
DATA: BEGIN OF t_col OCCURS 0,
col LIKE alsmex_tabline-col,
size TYPE i.
DATA: END OF t_col.
DATA: zwlen TYPE i,
zwlines TYPE i.
DATA: BEGIN OF fieldnames OCCURS 3,
title(60),
table(6),
field(10),
kz(1),
END OF fieldnames.
* No of columns
DATA: BEGIN OF data_tab OCCURS 0,
value_0001(50),
value_0002(50),
value_0003(50),
value_0004(50),
value_0005(50),
value_0006(50),
value_0007(50),
value_0008(50),
value_0009(50),
value_0010(50),
value_0011(50),
value_0012(50),
value_0013(50),
value_0014(50),
value_0015(50),
value_0016(50),
value_0017(50),
value_0018(50),
value_0019(50),
value_0020(50),
value_0021(50),
value_0022(50),
value_0023(50),
value_0024(50),
value_0025(50),
value_0026(50),
value_0027(50),
value_0028(50),
value_0029(50),
value_0030(50),
value_0031(50),
value_0032(50),
value_0033(50),
value_0034(50),
value_0035(50),
value_0036(50),
value_0037(50),
value_0038(50),
value_0039(50),
value_0040(50),
value_0041(50),
value_0042(50),
value_0043(50),
value_0044(50),
value_0045(50),
value_0046(50),
value_0047(50),
value_0048(50),
value_0049(50),
value_0050(50),
value_0051(50),
value_0052(50),
value_0053(50),
value_0054(50),
value_0055(50),
value_0056(50),
value_0057(50),
value_0058(50),
value_0059(50),
value_0060(50),
value_0061(50),
value_0062(50),
value_0063(50),
value_0064(50),
value_0065(50),
value_0066(50),
value_0067(50),
value_0068(50),
value_0069(50),
value_0070(50),
value_0071(50),
value_0072(50),
value_0073(50),
value_0074(50),
value_0075(50),
value_0076(50),
value_0077(50),
value_0078(50),
value_0079(50),
value_0080(50),
value_0081(50),
value_0082(50),
value_0083(50),
value_0084(50),
value_0085(50),
value_0086(50),
value_0087(50),
value_0088(50),
value_0089(50),
value_0090(50),
value_0091(50),
value_0092(50),
value_0093(50),
value_0094(50),
value_0095(50),
value_0096(50),
value_0097(50),
value_0098(50),
value_0099(50),
value_0100(50).
DATA: END OF data_tab.
DATA: tind(4) TYPE n.
DATA: zwfeld(19).
FIELD-SYMBOLS: <fs1>.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR filename.
CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
EXPORTING
mask = '*.xls'
static = 'X'
CHANGING
file_name = filename.
START-OF-SELECTION.
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
filename = filename
i_begin_col = begcol
i_begin_row = begrow
i_end_col = endcol
i_end_row = endrow
TABLES
intern = intern
EXCEPTIONS
inconsistent_parameters = 1
upload_ole = 2
OTHERS = 3.
IF sy-subrc <> 0.
WRITE:/ 'Upload Error ', SY-SUBRC.
ENDIF.
END-OF-SELECTION.
LOOP AT intern.
intern1 = intern.
CLEAR intern1-row.
APPEND intern1.
ENDLOOP.
SORT intern1 BY col.
LOOP AT intern1.
AT NEW col.
t_col-col = intern1-col.
APPEND t_col.
ENDAT.
zwlen = strlen( intern1-value ).
READ TABLE t_col WITH KEY col = intern1-col.
IF sy-subrc EQ 0.
IF zwlen > t_col-size.
t_col-size = zwlen.
* Internal Table, Current Row Index
MODIFY t_col INDEX sy-tabix.
ENDIF.
ENDIF.
ENDLOOP.
DESCRIBE TABLE t_col LINES zwlines.
SORT intern BY row col.
IF kzheader = 'X'.
LOOP AT intern.
fieldnames-title = intern-value.
APPEND fieldnames.
AT END OF row.
EXIT.
ENDAT.
ENDLOOP.
ELSE.
DO zwlines TIMES.
WRITE sy-index TO fieldnames-title.
APPEND fieldnames.
ENDDO.
ENDIF.
SORT intern BY row col.
LOOP AT intern.
IF kzheader = 'X'
AND intern-row = 1.
CONTINUE.
ENDIF.
tind = intern-col.
CONCATENATE 'DATA_TAB-VALUE_' tind INTO zwfeld.
ASSIGN (zwfeld) TO <fs1>.
<fs1> = intern-value.
AT END OF row.
APPEND data_tab.
CLEAR data_tab.
ENDAT.
ENDLOOP.
CALL FUNCTION 'DISPLAY_BASIC_LIST'
EXPORTING
file_name = filename
TABLES
data_tab = data_tab
fieldname_tab = fieldnames.
*-- End of Program
<b>Excel Upload Alternative - KCD_EXCEL_OLE_TO_INT_CONVERT</b>
*Title : Excel Uploading
TYPES: BEGIN OF t_datatab,
col1(25) TYPE c,
col2(30) TYPE c,
col3(30) TYPE c,
col4(30) TYPE c,
col5(30) TYPE c,
col6(30) TYPE c,
col7(30) TYPE c,
col8(30) TYPE c,
col9(30) TYPE c,
col10(30) TYPE c,
col11(30) TYPE c,
END OF t_datatab.
DATA: it_datatab TYPE STANDARD TABLE OF t_datatab INITIAL SIZE 0,
wa_datatab TYPE t_datatab.
Data : p_table type t_datatab occurs 0 with header line.
DATA : gd_scol TYPE i VALUE '1',
gd_srow TYPE i VALUE '1',
gd_ecol TYPE i VALUE '256',
gd_erow TYPE i VALUE '65536'.
DATA: it_tab TYPE filetable,
gd_subrc TYPE i.
field-symbols : <fs>.
*Selection screen definition
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
PARAMETERS: p_file LIKE rlgrap-filename
DEFAULT 'c:test.xls' OBLIGATORY. " File Name
SELECTION-SCREEN END OF BLOCK b1.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
REFRESH: it_tab.
CALL METHOD cl_gui_frontend_services=>file_open_dialog
EXPORTING
window_title = 'Select File'
default_filename = '*.xls'
multiselection = ' '
CHANGING
file_table = it_tab
rc = gd_subrc.
LOOP AT it_tab INTO p_file.
* so_fpath-sign = 'I'.
* so_fpath-option = 'EQ'.
* append so_fpath.
ENDLOOP.
START-OF-SELECTION.
PERFORM upload_excel_file TABLES it_datatab
USING p_file
gd_scol
gd_srow
gd_ecol
gd_erow.
* END-OF-SELECTION.
END-OF-SELECTION.
LOOP AT it_datatab INTO wa_datatab.
WRITE:/ wa_datatab-col1,
wa_datatab-col2,
wa_datatab-col3,
wa_datatab-col4,
wa_datatab-col5,
wa_datatab-col6,
wa_datatab-col7,
wa_datatab-col8,
wa_datatab-col9,
wa_datatab-col10,
wa_datatab-col11.
ENDLOOP.
*& Form UPLOAD_EXCEL_FILE
* upload excel spreadsheet into internal table
* -->P_TABLE Table to return excel data into
* -->P_FILE file name and path
* -->P_SCOL start column
* -->P_SROW start row
* -->P_ECOL end column
* -->P_EROW end row
FORM upload_excel_file TABLES p_table
USING p_file
p_scol
p_srow
p_ecol
p_erow.
DATA : lt_intern TYPE kcde_cells OCCURS 0 WITH HEADER LINE.
* Has the following format:
* Row number | Colum Number | Value
* i.e. 1 1 Name1
* 2 1 Joe
DATA : ld_index TYPE i.
* Note: Alternative function module - 'ALSM_EXCEL_TO_INTERNAL_TABLE'
CALL FUNCTION 'KCD_EXCEL_OLE_TO_INT_CONVERT'
EXPORTING
filename = p_file
i_begin_col = p_scol
i_begin_row = p_srow
i_end_col = p_ecol
i_end_row = p_erow
TABLES
intern = LT_INTERN
EXCEPTIONS
inconsistent_parameters = 1
upload_ole = 2
OTHERS = 3.
IF sy-subrc <> 0.
FORMAT COLOR COL_BACKGROUND INTENSIFIED.
WRITE:/ 'Error Uploading file'.
EXIT.
ENDIF.
IF lt_intern[] IS INITIAL.
FORMAT COLOR COL_BACKGROUND INTENSIFIED.
WRITE:/ 'No Data Uploaded'.
EXIT.
ELSE.
SORT lt_intern BY row col.
LOOP AT lt_intern.
MOVE lt_intern-col TO ld_index.
assign component ld_index of structure
p_table to <fs>.
move : lt_intern-value to <fs>.
* MOVE lt_intern-value TO p_table.
AT END OF row.
APPEND p_table.
CLEAR p_table.
ENDAT.
ENDLOOP.
ENDIF.
ENDFORM. "UPLOAD_EXCEL_FILE
Regards
Pavan -
How to call a function module from the Web Template?
Hi all,
how can I call a function module from a BI 7.x web template and then show the result of the FM on the web template?
Many thanks for your hints.
Regards, NilsHi!
I am too working on a similar issue.
Probably this helps:
Re: Calling a function module from a Web Template
Regards,
Sri -
Program making a RFC call to Function Module not working in background
Hi All,
I have an ABAP Program which is used to do a reconciliation check between the R/3 and BI system for Invoice Data. Please find below the details of the program flow:
1. Program counts the number of records in the DSO table and aggregates the Net_Value based on the date range (passed as parameters)
2. Program calls a Function Module (RFC Call) which counts the number of records in the R/3 table and aggregates the Net_Value for the same date range
3. Function Module Passes back the count values and aggregated Net_Value to the program
4. Program compares the count and aggregated Net_Value from EDWH and MSP systems and sends an email mentioning whether the counts match or not
However we are facing an issue.
Whenever, we execute the program in dialog mode, it works fine and fetches results within 5-6 minutes. However if we schedule the program to run in background (parameters through a variant), it gives no results even after running for over 3-4 hours. We tried figuring it out yesterday but could not come to any conclusion. Since there is a RFC call being to the function module, we were wondering if we need to specify some other parameter as well.
Thanks & Regards
DharmendraRFC Call is a procedure for executing remote enables function modules. It is done via the 'Remote Enabled' radio button on the function module's attribute screen.
-
How to call a function module from a transformation
Hi,
Could somebody please let me know how I can call an abap function module from a transformation (abap xslt program). I know how to call the class methods from transformation, but how do i call a function module..?
Thanks,
Shashi.
Edited by: Shashi Kanth Kasam on Apr 8, 2010 12:45 PMYa. I can do that. But I don't want to use a class and a method to call that function module. Want to directly call function module from transformation. Is that possible..?
Thanks,
Shashi -
System failure, during call of function module RSWR_RFC_SERVICE_TEST
Hi Team,
I am working with BW and Portal Integration, with the Netweaver
2004s SP 11 version. I have a issue when i run the RSPOR_SETUP program
to test the configuration.
The error is on status 5 and 12, i get the following error:
System failure, during call of function module RSWR_RFC_SERVICE_TEST,
and when i enter at the dev_jrfc.trc log file, i have the following
error:
Exception thrown [Tue Jul 10 16:12:16,687]:Exception thrown by
application running in JCo Server
java.lang.RuntimeException: call FM RSWR_RFC_SERVICE_TEST to ProgId
smxpedvc_PORTAL_EPD on host smxpedvc.grupoempresarialangeles.com.mx
with SSO not authorized: No login module succeeded.
at
com.sap.engine.services.rfcengine.RFCDefaultRequestHandler.handleRequest
(RFCDefaultRequestHandler.java:79)
at com.sap.engine.services.rfcengine.RFCJCOServer.handleRequest
(RFCJCOServer.java:156)
at com.sap.mw.jco.JCO$Server.dispatchRequest(JCO.java:7785)
at com.sap.mw.jco.MiddlewareJRfc$Server.dispatchRequest
(MiddlewareJRfc.java:2405)
at com.sap.mw.jco.MiddlewareJRfc$Server.listen
(MiddlewareJRfc.java:1728)
at com.sap.mw.jco.JCO$Server.listen(JCO.java:8145)
at com.sap.mw.jco.JCO$Server.work(JCO.java:8265)
at com.sap.mw.jco.JCO$Server.loop(JCO.java:8212)
at com.sap.mw.jco.JCO$Server.run(JCO.java:8128)
at com.sap.engine.core.thread.impl3.ActionObject.run
(ActionObject.java:37)
at java.security.AccessController.doPrivileged(Native Method)
at com.sap.engine.core.thread.impl3.SingleThread.execute
(SingleThread.java:100)
at com.sap.engine.core.thread.impl3.SingleThread.run
(SingleThread.java:170)
Could you help me to solve this issue.
Thanks so much.Have you checked the user that is used to connect from J2EE back to ABAP?
I had a similar problem, went into the Visual Administrator and found the incorrect password (or possibly outdated password) was being used to communicate back to ABAP, and updating that sorted out my problem.
Hope this helps.
Cheers,
Andrew -
Call of function module "SUBST_START_BATCHJOB" by RFC failed
Hello Guru's,
We have the following Issue:
In Phase PREP_INIT/JOB_RSUPDTEC we get this error from EHPI (Version 710-1)
Checks after phase PREP_INIT/JOB_RSUPDTEC were negative!
Last error code set: BATCHJOB RSUPDTEC FAILED: Calling RSUPDTEC failed - repeat phase.
In the file PSUPDTEC.LOG are the following error:
4 ETQ260 Starting batchjob "RSUPDTEC"
4 ETQ230 Starting RFC Login to: System = "E11", GwHost = "sape11", GwService = "sapgw00"
4 ETQ359 RFC Login to: System="E11", Nr="00", GwHost="sape11", GwService="sapgw00"
4 ETQ232 RFC Login succeeded
4 ETQ233 Calling function module "SUBST_START_BATCHJOB" by RFC
4 ETQ399 JOBNAME='RSUPDTEC', REPNAME='RSUPDTEC', VARNAME='', BATCHHOST='sape11', IV_SCHEDEVER=' '
4 ETQ234 Call of function module "SUBST_START_BATCHJOB" by RFC succeeded
4 ETQ399 Returned JOBCOUNT='14230100'
2EETQ235 Call of function module "SUBST_START_BATCHJOB" by RFC failed (error-status "27")
2EETQ261 Start of batchjob "RSUPDTEC" failed
In the Sysem we can see, that the Job RSUPDTEC was created by DDIC but not started.
We can start (and finish) the job successfully as logged in DDIC.
We don't know whats the problem. The EHPI stopped every time at this point.
Need Help...
regards
ChrisIssue solved.
In /etc/hosts the first entry was SAPE11.
But it must be sape11, because the instance is sape11_E11_00.
In SM51 we could see that
sape11_E11_00 SAPE11 Dialog Batch Update Upd2 Spool Enqueue ICM active
We changed the entry and restarted SAP.
Then the job can be started.
Maybe you are looking for
-
Sender Mail Adapter - default interface name
Hi, I need to receive through one e-mail sender channel tree different kind of messages. In sender mail adapter I specify ecept other parameters "Default Interface Name". When I send a message with a same as defined in an interface the message is pro
-
When attempting to download the Firefox browser, I click on the big green button to download, then I am taken to the next page which says it should begin in a few seconds. Nothing happens. I click where it says to click if nothing happens and nothing
-
Anyone else having trouble with FCPX crashing after the OSX update?
Anyone else having trouble with FCPX crashing after the OSX update? It NEVER crashed until the update. The night before last it crashed 20 times in 45 minutes. I can't finish my project because of it. Retina, Mid 2012 Processor 2.3 GHz Intel Core i7
-
New ipad out of the box will not boot up?
I have a new iPad2 new out of the box and will not boot up. It is fully charged and when I touch the sleep/wake botton a usb cable appears with an itunes icon in the center. Nothing happens when I touch the screen. Any thoughts?
-
1st Gen, No sound?!?!
Hi guys, I just got my Itouch 1st Gen off ebay, plugged it into my computer, put my music onto it. Once id done all that I tried to play music. The ipod would say the music is playing, but no sound coming out, i tried multiple headphones and no sound