Problem in Logical Databse Call via Function Module - Urgent
Hi Experts,
To use the Logical Database(LDB) in the function module(Custom) I am using the function module - LDB_PROCESS. But I didn't get any output. I am attaching the code. Please Help me in this.
DATA : W_LDBNAME LIKE TRDIR-LDBNAME.
DATA : IT_CALLBACK LIKE TABLE OF LDBCB WITH HEADER LINE,
IT_SELECTIONS LIKE TABLE OF RSPARAMS WITH HEADER LINE,
IT_PERNR TYPE TABLE OF PERNR WITH HEADER LINE.
MOVE 'PNP' TO W_LDBNAME.
IT_CALLBACK-LDBNODE = 'PERNR'.
IT_CALLBACK-GET = 'X'.
IT_CALLBACK-CB_PROG = SY-CPROG.
IT_CALLBACK-CB_FORM = 'CALLBACK_PERNR'.
APPEND IT_CALLBACK.
CLEAR IT_CALLBACK.
IT_SELECTIONS-KIND = 'S'.
IT_SELECTIONS-SELNAME = 'PNPPERNR'.
IT_SELECTIONS-SIGN = 'I'.
IT_SELECTIONS-OPTION = 'EQ'.
IT_SELECTIONS-LOW = '100178'.
APPEND IT_SELECTIONS.
CLEAR IT_SELECTIONS.
CALL FUNCTION 'LDB_PROCESS'
EXPORTING
LDBNAME = W_LDBNAME
VARIANT =
EXPRESSIONS =
FIELD_SELECTION =
DYN_NODE_TYPES =
TABLES
CALLBACK = IT_CALLBACK
SELECTIONS = IT_SELECTIONS
EXCEPTIONS
LDB_NOT_REENTRANT = 1
LDB_INCORRECT = 2
LDB_ALREADY_RUNNING = 3
LDB_ERROR = 4
LDB_SELECTIONS_ERROR = 5
LDB_SELECTIONS_NOT_ACCEPTED = 6
VARIANT_NOT_EXISTENT = 7
VARIANT_OBSOLETE = 8
VARIANT_ERROR = 9
FREE_SELECTIONS_ERROR = 10
CALLBACK_NO_EVENT = 11
CALLBACK_NODE_DUPLICATE = 12
CALLBACK_NO_PROGRAM = 13
CALLBACK_NO_CBFORM = 14
DYN_NODE_NO_TYPE = 15
DYN_NODE_INVALID_TYPE = 16
OTHERS = 17.
IF SY-SUBRC <> 0.
MESSAGE I039(ZABA) WITH SY-SUBRC.
ENDIF.
LOOP AT IT_PERNR.
message i039(zaba) with 'Inside loop'.
WRITE : / IT_PERNR-PERNR, IT_PERNR-BUKRS.
ENDLOOP.
*& Form CALLBACK_PERNR
text
-->L_LDBNAME text
-->L_IT_PAYROLL text
-->TYPE text
-->PAY99_REULT text
-->L_EVT text
-->L_CHK text
FORM CALLBACK_PERNR USING L_LDBNAME LIKE TRDIR-LDBNAME
L_IT_PERNR LIKE PERNR
L_EVT type C
L_CHK type C.
message i039(zaba) with 'Inside Callback'.
WRITE : / L_IT_PERNR-PERNR,
L_IT_PERNR-BUKRS.
MOVE-CORRESPONDING L_IT_PERNR TO IT_PERNR.
APPEND IT_PERNR.
CLEAR IT_PERNR.
ENDFORM. "CALLBACK_PERNR
Thanks in advance
Arul Jothi.
Hi,
I think Arul commented the 'it_selections' while trying out.. I couldn't get the fm work for PNP.. it worked fine with the FI LDBs.. just didn't seem to like the PNP..
Regards,
Suresh Datti
Similar Messages
-
Problem in transfer rules-- Calling the function module.
Hi All,
when we r extracting the data from r3, the infoobject 0wbs_elem the data pulled is in internal format in which wbs element is stored.
wbs element gets stored in a different way compared to front end.
Eg. The external format is /abc/123 the internal format is 00012300.
I have written a transfer routine using the function module CONVERSION_EXIT_ABPSP_OUTPUT.
the code goes like this
data ifield(30) type c.
call function CONVERSION_EXIT_ABPSP_OUTPUT
Exporting
input = tran_structure-wbselem (Field in transfer structure---name of the field in source system) .
Importing
output = ifield.
result = ifield.
End of code.
Problem
When I am Scheduling the package the job doesnt get completed for a long time and fails.Is there a problem with the code. When trying for the Simulation of the datapackets, the system says no data package number could be determined.
Please help me out...
Thank You
MaheshHi Mahesh,
Could you please check ST22 and see if there is any short dumps ?
try to do test run for the FMs using SE37 and see what is the output for your input.
Do you have PSA for the load ? It may also have been deleted. You get this message when there is no PSA available.
hope it helps
Thanks
Soumya -
Call a function module from CRM 5.0 via ITS to FICA
Hi
I want to call a function module in FICA (FICA is using sapgui) from CRM (IC-web) via ITS (Not integrated in FICA)
Is it possible and how should this be done???
If someone know how, please help
BR//JLgenerally RFCs should not have user dialogs.
any how to handle your case, you need ITS and since FICA is a WAS 6.20 system, you need to have a ITS installed for FICA system, without which you cannot do that.
alternatively you can mimic the functionality of the RFC by programming the same in a BSP and call this from CRM system
Regards
Raja -
Call RFC Function Module in R/3 via XI during Mapping
Hi,
I have an XI scenario where I have to fill the IDoc ADRMAS03 in XI and send it to R/3. Unfortunately the sender system does not provide the required address number (ADRNR) for the Business Partner, only the Business Partner number. Therefore I want to call a Function Module in R/3 during the mapping in order to get the ADRNR.
Does anybody know which RFC-Function Module I can call in R/3 4.6c providing the Busness Partner number in order to get the ADRNR?
Thanks.
AlexHi,
no need for RFC lookup it's better to do as he wants
(inside an exit in R3) - just my point of view
BTW
don't use a FM just find a table with both values
and create a select statement youself
Regards,
michal
<a href="/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions"><b>XI / PI FAQ - Frequently Asked Questions</b></a> -
ERROR: -Type conflict when calling a function module
hi to all,
when iam executing the program in browser Type conflict when calling a function module error is showing, i have bind all the attribute correctly still iam getting error, WHEN I CLICK ON THE SEARCH BUTTON DATA IS NOT COMING TO MY TABLE ITAB1 plz help me....
DATA:
NODE_IP_SELECTION TYPE REF TO IF_WD_CONTEXT_NODE,
ELEM_IP_SELECTION TYPE REF TO IF_WD_CONTEXT_ELEMENT,
STRU_IP_SELECTION TYPE IF_PLANNING_HISTORY=>ELEMENT_IP_SELECTION ,
ITAB TYPE TABLE OF ZSL_PL_UPDATE1,
WA TYPE ZSL_PL_UPDATE1.
navigate from <CONTEXT> to <IP_SELECTION> via lead selection
NODE_IP_SELECTION = WD_CONTEXT->GET_CHILD_NODE( NAME = `IP_SELECTION` ).
get element via lead selection
ELEM_IP_SELECTION = NODE_IP_SELECTION->GET_ELEMENT( ).
get all declared attributes
ELEM_IP_SELECTION->GET_STATIC_ATTRIBUTES(
IMPORTING
STATIC_ATTRIBUTES = STRU_IP_SELECTION ).
CALL FUNCTION 'ZBAPI_PL_UPDATE'
EXPORTING
GV_LIFNR = STRU_IP_SELECTION-LIFNR
GV_MATNR = STRU_IP_SELECTION-LIFNR
GV_GJAHR = ' '
GV_WEEK_LOW = STRU_IP_SELECTION-FROM_WEEK
GV_WEEK_HIGH = STRU_IP_SELECTION-TO_WEEK
IMPORTING
RETURN =
TABLES
GT_PL_UPDATE = ITAB
DATA:
NODE_PLANN_NODE TYPE REF TO IF_WD_CONTEXT_NODE,
ELEM_PLANN_NODE TYPE REF TO IF_WD_CONTEXT_ELEMENT,
STRU_PLANN_NODE TYPE IF_PLANNING_HISTORY=>ELEMENT_PLANN_NODE,
WA1 TYPE IF_PLANNING_HISTORY=>ELEMENT_PLANN_NODE,
ITAB1 TYPE TABLE OF IF_PLANNING_HISTORY=>ELEMENT_PLANN_NODE.
LOOP AT ITAB INTO WA.
MOVE-CORRESPONDING WA TO WA1.
APPEND WA1 TO ITAB1.
ENDLOOP.
navigate from <CONTEXT> to <PLANN_NODE> via lead selection
NODE_PLANN_NODE = WD_CONTEXT->GET_CHILD_NODE( NAME = `PLANN_NODE` ).
CALL METHOD NODE_PLANN_NODE->BIND_TABLE
EXPORTING
NEW_ITEMS = ITAB1
SET_INITIAL_ELEMENTS = ABAP_TRUE
INDEX =
ENDMETHOD.CALL FUNCTION 'ZBAPI_PL_UPDATE'
EXPORTING
GV_LIFNR = STRU_IP_SELECTION-LIFNR
GV_MATNR = STRU_IP_SELECTION-LIFNR
GV_GJAHR = ' '
GV_WEEK_LOW = STRU_IP_SELECTION-FROM_WEEK
GV_WEEK_HIGH = STRU_IP_SELECTION-TO_WEEK
IMPORTING
RETURN =
TABLES
GT_PL_UPDATE = ITAB
Problem is here
check out the type GV_GJAHR whether it accepts string type.
thanks
sarbjeet singh -
Errors occurred during call of function module BUPR_EMPLO_DELETE
when distributing employee data from (HCM) to (CRM) there is an error that appears in relation with the settings for the Business Parner:
"Errors occurred during call of function module BUPR_EMPLO_DELETE
Message no. R11335
Diagnosis
The business partner BAPIs were called up incorrectly. The indicator IV_X_SAVE was given differing settings when the modules were called.
Within a LUW, the indicator must be consistently set or not set.
System Response
The indicator IV_X_SAVE should be set or not set once off. Up to COMMIT WORK the content of the field may not be changed, as problems will otherwise occur with the internal memory, thus leading to runtime errors."
This prevents CRM to be updated with the changes. Kindly help me on the same.Hi Sai,
This is too late to reply this post, but to let everyone know about the issue I am posting here.
Start new UI session and put breakpoint at BUPR_EMPLO_DELETE and check parameter IV_X_SAVE everytime, till you get the error message. The parameter IV_X_SAVE should be same/consistent (either ' ' or 'X') in whole Logical Unit of Work. It should not change in between.
I faced the same kind of problem and found that standard was passing IV_X_SAVE = ' ' and in our custom code we were passing IV_X_SAVE = 'X'. I changed it to IV_X_SAVE = ' ' and my problem got resolved.
You can try the same. Please post the alternate solution if you find it.
Best Regards,
Rahul Koshti -
How to call Z-Function module from BAPI_IDOC_INPUT1.
Hi All,
Process code is :BAPI and standard function module is BAPI_IDOC_INPUT1.
I am coding all the logic for the INBOUND IDOC in the Z-Function module ZIDOC_INPUT_ZGOODSMOVEMENTOIL.
My requirement is:
Process code fires the inbound function module BAPI_IDOC_INPUT1, this in turn call the function module ZIDOC_INPUT_ZGOODSMOVEMENTOIL.
How can i call ZIDOC_INPUT_ZGOODSMOVEMENTOIL from BAPI_IDOC_INPUT1 to process the idoc.
Thanks in Advance.
Regards,
UmeshHi Krush,
Thanks for your reply,
Now i can trigger the idoc.
I have one more problem that if i want to add another z-segment to the attached idoc type its not allowing me its saying that it is already generated and cannot be changed.
if i am generating the BDBG transaction its not asking for specific segment and it automatically takes the segment and generates the function module.
How i can add an additinal z-segment to the idoc type and it generate through BDBG transaction to include in inbound function module?
Thanks in Advance.
Regards,
Umesh -
How to create RFC function module and how to call this function module
Hi,
i want to know step for creating RFC function module and then How to use this function module from some other sap system.
Thnaks,
jigarJigar,
To implement a remote function module in ABAP, perform the following steps:
Register the module as remotely callable in the RFC server system.
In the function module Administration screen (transaction code SE37), set the field Can be called via REMOTE CALL. Registering a module as remote causes an RFC stub to be generated for it.
Write the code for the function module.
Create the destinations.....................
Displaying, Maintaining and Testing Destinations
To display, create or modify destinations, choose Tools ® Administration ® Administration ® Network ® RFC destinations or enter transaction code SM59.
Remote Destinations are stored in table RFCDES. The RFCDES table describes logical destinations for remote function calls.
It is not possible to maintain the RFCDES table directly.
You can also access logical destinations via the Implementation Guide (IMG) by choosing Tools ® AcceleratedSAP ® Customizing ® Execute Project ® SAP Reference IMG.
In the Implementation Guide, expand the following hierarchy structure:
Basis
Application Link Enabling (ALE)
Sending and Receiving Systems
Systems in Network
Define Target Systems for RFC Calls
Displaying Destinations
The initial screen for this transaction displays a tree:
Different connection types (i.e. partner systems or programs) are possible. For further information, see Types of Destinations.
To display all information for a given destination, double-click it, or place the cursor on it and press F2 .
To search for a destination, press the Find button and specify your selection. You get a list of all entries matching your selection. Place the cursor on the one you want, and press F2 or simply double-click the destination. All information for the given entry appears.
Creating Destinations
On the destinations overview screen (transaction code SM59), the connection types and all existing destinations are displayed in a tree structure.
All available connection types are explained in Types of Destinations.
To create a new RFC destination, press the Create button. A new screen is displayed with empty fields for you to fill in.
If you want to create a new destination
As you create a remote destination, you can specify a particular application server or a group of servers for a balanced distribution of system load.
For details of the destination parameters, see Entering Destination Parameters.
Changing Existing Destinations
On the destinations overview screen (transaction code SM59), the connection types and all existing destinations are displayed in a tree structure.
You can display all information for a given destination by double-clicking it or pressing F2 on it.
To change an existing destination, double-click it, or place the cursor on it and press the Change button.
For details of the destination parameters, see Entering Destination Parameters.
Testing Destinations
To test a destination, choose the appropriate function from the Test menu.
Connection (also available via the Test connection pushbutton)
Authorization (checks logon data)
Local network (provides a list of application servers)
You can use the CALL FUNCTION statement to call remote functions, just as you would call local function modules. However, you must include an additional DESTINATION clause to define where the function should run:
CALL FUNCTION RemoteFunction
DESTINATION Dest
EXPORTING
f1 =...
f2 =...
IMPORTING
f3 =...
TABLES
t1 =...
EXCEPTIONS......
The field Dest can be either a literal or a variable: its value is a logical destination (for example, "hw1071_53") known to the local SAP System. Logical destinations are defined in the RFCDES table (or the TRFCD table in R/2 Systems) via transaction sm59 or the following menu path: Tools ® Administration, Administration ® Network ® RFC destinations. You can also access logical destinations via the Implementation Guide (IMG) by choosing Tools ® Customizing ® Enterprise IMG. In the Implementation Guide, you can then choose Cross-application components ® ALE ® Communication ® Define RFC destination.
The remote function call concept, for example, allows you to access a function module in an R/2 System from an ABAP program in an R/3 System. If you want to read a customer record from your R/2 Systems database, create a remotely callable function module in the R/2 environment which retrieves customer records. Call this function from your R/3 System using a remote function call and listing the destination for the target R/2 System:
Pls. reward if useful -
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 -
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 -
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.
-
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. -
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 -
Hi Experts,
When I run my Application in Portal, i am getting the following error.
Type conflict when calling a function module., error key: RFC_ERROR_SYSTEM_FAILURE
When I execute the BAPI, it is getting executed.
My Bapi Strucute:
Import Parameters
IM_MAT_Search --> ZPTIP_MAT --> Import Parameters
Tables
IT_INFO_REC --> ZMM_GET_ITEM --> Output Parameters
When I import the model, i am getting the structure like this
BAPI_Name > ZMM_BAPI_Input> IM_MAT_Search(respective Parameters) , Output (respective Tables and their parameters)
> ZMM_Input1> Parameters
This is the way, how i am executing in webdynpro java
Zmm_Bapi_Ptip_Search_Input eleInput = new Zmm_Bapi_Ptip_Search_Input();
wdContext.nodeZmm_Bapi_Ptip_Search_Input().bind(eleInput);
Zptip_Asset eleInputAsset = new Zptip_Asset();
eleInputAsset.setSearch("ACRS");
wdContext.nodeZptip_Asset().bind(eleInputAsset);
eleInput.setIm_Ast_Search(eleInputAsset);
wdContext.nodeZmm_Bapi_Ptip_Search_Input().bind(eleInput);
wdContext.nodeZmm_Bapi_Ptip_Search_Input().currentZmm_Bapi_Ptip_Search_InputElement().modelObject().execute();
wdContext.nodeOutput().invalidate();
Please let me know, how to do the same.
Thanks in advance.
Regards,
PalaniHi David,
I checked for the Parameter of setIm_Ast_Search, it is of Zptip_Asset.
Hi Saleem,
When I changed the same, i am getting the Type conflict error,
Type conflict when calling a function module., error key: RFC_ERROR_SYSTEM_FAILURE
Please let me know,what can be done in this regard to solve the problem.
My BAPI Structure when imported as model
SearchBAPI
--> ZMM_BAPI_SEARCH_INPUT
> IM_AST_SEARCH(zPTIP_ASSET)
>Zptip_Asset
>Search (Parameter)
> OutPut(ZMM_BAPI_Search_Output)
>IT_Asser_Rec(ZMM_Asset)
>ZMM_Asset
>TXT100 (output Parameter)
--> ZMM_BAPI_SEARACH_OUTPUT
--> ZPTIP_ASSET
>Search (Parameter)
Thanks & Regards,
Palani
Edited by: Palani Appan on Nov 11, 2009 5:31 PM
Maybe you are looking for
-
Help me in finding the right JRE for encryption
HI , I have developed and tested Encryption using Ciphers and SecretKey , i used the JRE1.4 .But other components are being developed using JRE1.3.If i try to run my code in JRE1.3 i get many errors. Is there anything i need to do before i integrate
-
"An Error Occurred During Import"
I am importing video from a Canon Vixia HF10 HD CMOS camcorder into iMovie 08. After the thumbnails are created, I select the clips I want and click on Import. I tried in a a Large (960x540) and Full (1920x1080) format and receive the same error mess
-
Can I get the app store for my macbook?
-
Question about HTMLB:tableView with nested tag
Dear experts. 1. I have one question that can I code like below. 2. And what is the mean of "$something$". when I run the page I met the error $TVCID$ is no more supported from design2003. <htmlb:tableViewColumn columnName = "myicon"
-
Dear All, I'm searching for answer concerning this: Using SE16 + DD03L and using selection criterium table LBBIL_INVOICE I can see fields (e.g. LBBIL_INVOICE-ALAND, LBBIL_INVOICE-BIL_CAT, etc.) in the report that are not displayed when I'm using SE11