Function modules calling Application server
I am working on a SAP Migration for windows to unix. Right now I am patching up all custom programs which call the Application server using physical filenames and paths (platform specific) and replacing them with logical paths and names (platform independent). I need help from you guys to identify more function modules which uses file names that are platform specific. I have taken care of open dataset and FTP commands. Any help pointing out function modules is highly appreciated. Points will be rewarded. Thanks in advance.
Rohit
Hi ,
Check the following function groups for file related operations.
GRAP - Frontend related.
SVRZ - System related.
SFTP - FTP related.
SFIL - Logical file name related.
As per my understanding, we are not using any function modules to read data from application server.
Best of luck.
Thanks
Viswa
(Assign points for helpful answers)
Similar Messages
-
Equalent of F4_filename function module for application server file path
hi experts,
i am using cl_gui_frontend_services=>file_open_dialog
for bring file path dynamically for user, in front end.
same feature i want to give when i am trying upload file from application server.
kindly provide me function module or class method, which will do it.
thanks in advance
regards,
pavanHi,
Use FM F4_DXFILENAME_TOPRECURSION
Sample code here
report ztest.
data : filename like DXFIELDS-LONGPATH.
data : begin of itab occurs 0,
a(200) type c,
end of itab.
CALL FUNCTION 'F4_DXFILENAME_TOPRECURSION'
EXPORTING
I_LOCATION_FLAG = 'A'
*I_SERVER = '?'
*I_PATH =
FILEMASK = '.*'
*FILEOPERATION = 'R'
IMPORTING
*O_LOCATION_FLAG =
*O_SERVER =
O_PATH = filename
*ABEND_FLAG =
EXCEPTIONS
RFC_ERROR = 1
ERROR_WITH_GUI = 2
OTHERS = 3
break-point.
open dataset filename for input in binary mode.
while sy-subrc = 0.
clear itab .
read dataset filename into itab.
append itab.
endwhile.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
BIN_FILESIZE =
FILENAME = 'd:\abc.txt'
FILETYPE = 'BIN'
TABLES
DATA_TAB = itab
Regards,
Satish -
Function module call with destination
Hi,
how can check if a function module call with destination works or not ?
How can I debug.
What can be the reason if it is not calles
regards
ertas* to chcek the rfc Destination By pass RFC destination name and Connection Type..
RFC_CHECK_DESTINATION
or
RFC_CHECK_DESTINATION_ID
or
You can use this FM RFC_VERIFY_DESTINATION if your release is greater than 4.6C.
Check this sample code from Craig Cmehil's weblog.
CALL FUNCTION 'RFC_VERIFY_DESTINATION'
EXPORTING
DESTINATION = TMP
TIMEOUT = 10
EXCEPTIONS
INTERNAL_FAILURE = 1
TIMEOUT = 2
DEST_COMMUNICATION_FAILURE = 3
DEST_SYSTEM_FAILURE = 4
UPDATE_FAILURE = 5
NO_UPDATE_AUTHORITY = 6
OTHERS = 7.
IF SY-SUBRC EQ '0'.
"* Do code here
ENDIF.
Prabhu -
Rfc function module call error
Hi Abaper,
I'm doing upgrade from 4.7 to ecc 6.0 currently and encounter problem in one of the rfc function module that we used. I've tested the connection to destination using sm59 and the connection is successful.
As an information, in the rfc setting, the target system is not Unicode system.
When I test using se37 and put the rfc destination in my function module call, I always encountered system_error exception. There's no issue with this rfc call before in 4.7 system.
Please help me on this. Thank you.
Edited by: Abraham Bukit on Sep 3, 2008 2:36 AMHi,
I had the same issue in the past and solved it in the following way.
If the destination system is not Unicode please try to set the password for the communication user set in SM59 using only upper-case characters and taking into account that the password shouldn't be longer than 8 characters.
Hope this will help. -
Problem with function module calling
Hi,
I have two questions here
i have a function moduel 'Z_GET_MATL_BALANCE'
in my code it called in the below said way
CALL FUNCTION 'Z_GET_MATL_BALANCE'
DESTINATION 'NONE'
STARTING NEW TASK 'A'
PERFORMING f_back ON END OF TASK
EXPORTING
ref_dte = s_datum-low
str_dte = s_datum-high
end_dte = s_datum-high
i_werks = p_werks
i_past = 'X'
i_future = 'X'
verselem = p_mrpver
plscn = p_scenar
r_outrec = r_outrec
supstk = p_supstk
days_ahead = w_days_ahead
shipnt = p_shipnt
TABLES
mat_bals = w_zmat_bals_a
i_zdatum = i_datum
mat_movmts = w_mat_movmts_a
mat_ship = i_mat_ship_a.
IF sy-subrc NE 0.
MESSAGE e005(ZMIM) WITH
text-009 text-166 text-054 sy-subrc.
ENDIF.
FORM f_back USING task.
CASE task.
WHEN 'A' .
RECEIVE RESULTS FROM FUNCTION 'Z_GET_MATL_BALANCE'
TABLES
mat_bals = w_zmat_bals_a
mat_movmts = w_mat_movmts_a
mat_ship = i_mat_ship_a
EXCEPTIONS
call_material_lesen_fail = 1
call_t450n_fail = 2
call_t399d_fail = 3
call_aufbauen_mdpsx_fail = 4
call_mdezx_aufbauen_fail = 5
call_t001w_fail = 6
call_zmrpelem_failed = 7
call_aufbauen_mdpsx_sim_fail = 8
OTHERS = 9.
IF SY-SUBRC NE 0.
RET_CODE1 = SY-SUBRC.
ENDIF.
now my first question is what is the difference between function modules calling normally and in the above said way
and the second question is
under tables parameter i have four internal tables defined where as while calling the same function module using recive results i have three internal tables. is this correct?
i am asking this because i am getting an error message while using this funciton module
please do not give generic answers, all the helpful answers will get a def rewardCall function starting new task is used to make Asynchronus RFC Call. In this case your function module will be called in a NEW SESSION and it will exceute independently from the Main program which is calling the FM. Also, the main program will continue its own processing and it will not wait for the RFC FM to complete.
Its not mandatory to have all the TABLES parameters in the RETURN Perform (..Receive results from ...) -
Need to track Function modules called when executing a transaction
Hi All,
Is there a way through which i can track function modules called, while executing a Transaction. Kindly provide pointers to it.
Thanks in advance.
Regards,
Navin.Goto SE80 Transaction and use Program name for corresponding Transaction Use Find operation like Call Function .. then you will get list of FM ..
There is no other option .
reward Points if it is helpful
Thanks
Seshu -
Can a function module call another function module
Can a function module call another function module:-
within the same function group
(ii) within different function groupsHi,
We can call function from another function. If there is a function which is like a calculator and all the operations are from different functions then we have to call the functions from the calculator function for different functions.
If all the function are from same function group, Then the data is globally available to all the functions with in the group.
Otherwise we have to declare the data definitions for each of the functions if they are in different function groups.
Yes it is possible to call a function module from another function module:-
within the same function group
(ii) within different function groups
Reward. -
Hi,
I need to call few function modules dynamically.The exporting and importing parameters are also known only at run time.
Can somebody help me out in this regard,
Thanks and regards,
Archnahi ,
Create Function module according to your requirment and call the same
such as
Create functi0n module where you are passing PLant runtime and get data related to Plant
write code in function according to requirment .
FUNCTION zrfc_test.
""Local interface:
*" IMPORTING
*" VALUE(ZWERKS) TYPE MARC-WERKS OPTIONAL
*" EXPORTING
*" VALUE(RETURN) LIKE BAPIRET2 STRUCTURE BAPIRET2
*" TABLES
*" ZIT_DATA STRUCTURE MARC
IF zwerks IS NOT INITIAL.
SELECT *
FROM marc
INTO CORRESPONDING FIELDS OF TABLE zit_data
WHERE werks = zwerks .
ELSE.
SELECT *
FROM marc
INTO CORRESPONDING FIELDS OF TABLE zit_data.
ENDIF.
IF sy-subrc = 0 .
MESSAGE ' Selected ' TYPE 'I' .
ENDIF.
ENDFUNCTION.
Suppose at runtime you get Plant 7100
types : begin of w_marc .
include structure marc .
types : end of w_marc .
data : it_data type standard table of w_marc with header line .
p_plant = 7100 .
Call to function module
CALL FUNCTION 'ZRFC_TEST'
EXPORTING
ZWERKS = 'p_plant
IMPORTING
RETURN =
TABLES
zit_data = it_data .
You will get result in it_data .
Note : if you don't know how to create Function Module then search on SDN you will get lots of Forum .
Regards
Deepak. -
Idoc - Error Status 51: Incorrect function module called up
Hi,
In the receiver system for the custom message type, I got this error.
Incorrect function module called up
Can any one pls help me to solve this one.
Regards,
Bala RajaHi Bala,
Check the inbound function module attached to process code in receiving system. Generally in every inbound function module first check is coded for checking message type or for checking funciton module like below.In the receiving system go to WE20 and then select the partner and select inbound message type. in that double click on assigned process code.then you have to double click on displayed FM. In that fm check first few lines. You will find this error message.
LOOP AT IDOC_CONTRL.
IF IDOC_CONTRL-IDOCTP(6) <> 'DESADV'.
MESSAGE ID 'E0' TYPE 'E' NUMBER '029'
WITH IDOC_CONTRL-IDOCTP ' ' 'IDOC_INPUT_DESADV'
RAISING WF_ERROR_PROCESS.
ENDIF.
ENDLOOP.
Thanks & Regards,
Kalyan. -
Calling a function module on another server
Dear all,
I have a function module on a test server which accesses a database table on it. I need to call that function module from a development server. Both servers are AS ABAP. I believe I need RFC, but how do I specify the test server address from the development server function call?
Thanks for your help,
PhilonYou need to call the Function module as a RFC FM.
The function module needs to be set as such.
In its atributes, it needs to be Remote-enabled function module.
To call it, proceed as follows:
CALL FUNCTION <FUNCTION MODULE> ON <DESTINATION>.
<DESTINATION> needs to be a predefined RFC destination. (See transaction SM59)
CALL FUNCTION func DESTINATION dest parameter_list.
Effect
Synchronous call of a remote-enabled function module specified in func using the RFC interface. Use addition DESTINATION to specify the destination in dest. For func and dest, character-type data objects are expected. After terminating the remotely called function, the calling program is continued after CALL FUNCTION.
Note
If the content of dest is equal to the constant space, then the addition DESTINATION is ignored and a normal call CALL FUNCTION func is executed.
Leonardo De Araujo -
ABAP Dump due to RFC Function module call in another thread
Hi,
I am facing some problem since yesterday. In one of my executable program I am calling a RFC fm as below mentioned
REPORT ZREPORT.
CALL FUNCTION 'Z_XXXXXXXXX'
STARTING NEW TASK L_NAME
DESTINATION IN GROUP 'TASK'
PERFORMING RETURN_INFO ON END OF TASK
EXPORTING
P_exp1 = l_emp
TABLES
R_VBELN = r_it_vbeln
EXCEPTIONS
NO_DATA_TO_PROCESS = 1
OTHERS = 2.
wait until v_task = 1.
update ztable.
Due to some data inconsistence one of the SAP function
module which I am calling in my function module Z_XXXXXXXXX
is generating dump with message type X. Since there is data inconsistence it is generating dump that's OK.
But the problem i am getting is, report ZREPORT is generating dump at WAIT statement saying illegal statement even though I am calling that function module
Z_XXXXXXXXX as a separate new task.
Can somebody help me.
Thanks,
Amara.hi, Amara
I agree with Rich said, and do a simulate test in my server, here is the analysis.
Assume we have a RFC, like this:
FUNCTION ZGZL_DUMPTEST.
*"*"Local interface:
*" EXPORTING
*" VALUE(OUT) TYPE I
*" EXCEPTIONS
*" CONVERT_FAIL
data:a type i.
a = 'A'.
ENDFUNCTION.
And call this RFC like you way:
REPORT ZGZL_DUMPTEST .
DATA:
SEMAPHORE(1) VALUE SPACE,
LC_OUT TYPE I.
CALL FUNCTION 'ZGZL_DUMPTEST'
STARTING NEW TASK 'DUMP'
PERFORMING RETURN_INFO ON END OF TASK.
WAIT UNTIL SEMAPHORE = 'X'.
WRITE: 'OVER'.
FORM RETURN_INFO USING TASKNAME.
RECEIVE RESULTS FROM FUNCTION 'ZGZL_DUMPTEST'
IMPORTING OUT = LC_OUT.
SEMAPHORE = 'X'.
ENDFORM. " RETURN_INFO
if we run the RFC in se37 directly, obviously it will occur a rumtime error CONVT_NO_NUMBER, and dump.
But if we run the above application to call the RFC, we will get a different runtime error CALL_FUNCTION_REMOTE_ERROR.
Error Analysis in ST22 like this:
An error occurred when executing a REMOTE FUNCTION CALL.
It was logged under the name "CONVT_NO_NUMBER"
on the called page.
I think that means the application receive the runtime error from RFC when call <b>RECEIVE RESULTS</b>.
In normal CALL FUNCTION, the external application will accept the rumetime error throw from FM, that's correct, because it let the caller can handle these runtime errors.
In you case, you said RFC run in a new task, yes, that's true, so you can call the RFC like this:
CALL FUNCTION 'ZGZL_DUMPTEST'
STARTING NEW TASK 'DUMP'
PERFORMING RETURN_INFO ON END OF TASK.
WAIT UNTIL SEMAPHORE = 'X'.
WRITE: 'OVER'.
FORM RETURN_INFO USING TASKNAME.
SEMAPHORE = 'X'.
ENDFORM. " RETURN_INFO
It will goes well, no dump. Why? because we don't use RECEIVE RESULT. RECEIVE RESULT will bring the result from FM, also bring the runtime error from FM.
So if you want to call the FM and receive the result, handle the runtime error in FM inside at first.
like this:
CATCH SYSTEM-EXCEPTIONS CONVT_NO_NUMBER = 1.
a = 'A'.
ENDCATCH.
IF SY-SUBRC = 1.
RAISE CONVERT_FAIL.
ENDIF.
And then you call FM like this:
CALL FUNCTION 'ZGZL_DUMPTEST'
STARTING NEW TASK 'DUMP'
PERFORMING RETURN_INFO ON END OF TASK.
WAIT UNTIL SEMAPHORE = 'X'.
WRITE: 'OVER'.
FORM RETURN_INFO USING TASKNAME.
RECEIVE RESULTS FROM FUNCTION 'ZGZL_DUMPTEST'
IMPORTING OUT = LC_OUT
EXCEPTIONS CONVERT_FAIL = 1.
SEMAPHORE = 'X'.
ENDFORM. " RETURN_INFO
That's will be ok for your scenario.
Hope my reply is useful.
thanks -
Update sap table using a function module call by php code
Hello,
I m trying to update the table VBAP using a function module ZZ_SET_DISTANCE call by a php code.
But I have this problem:
the saprfc seems to work well but when I look to the table VBAP the fields have not been update.
I tried the function module in debug mode and it work good. The fields are update.
I also handle the saprfc call function and the return SAPRFC_OK
This are the function module ZZ_SET_DISTANCE, and the php code
//PHP CODE
$fce = saprfc_function_discover($sap,"ZZ_SET_DISTANCE");
if (! $fce ) {echo "Echec d'ouverture du module fonction "; exit;}
saprfc_import ($fce,"COMMANDE", '0000001998');
saprfc_table_init($fce,"TBLE_CMDE");
$val=array();
$val['NUM_POST']='000030';
$val['HN_EXP']='';
$val['ST_EXP']='';
$val['PC_EXP']='';
$val['CI_EXP']='';
$val['CO_EXP']='';
$val['HN_REC']='';
$val['ST_REC']='';
$val['PC_REC']='';
$val['CI_REC']='';
$val['CO_REC']='';
$val['DIST']='popo';
saprfc_table_append ($fce,"TBLE_CMDE", $val);
$rfc_rc = saprfc_call_and_receive ($fce);
echo "\n".$rfc_rc;
if ($rfc_rc != SAPRFC_OK) { if ($sap == SAPRFC_EXCEPTION ) echo ("Exception raised: ".saprfc_exception($fce)); else echo (saprfc_error($fce)); }else{echo '/execution de la function ;}
saprfc_function_free($fce);
//FUNCTION MODULE ZZ_SET_DISTANCE
FUNCTION ZZ_SET_DISTANCE.
""Local Interface:
*" IMPORTING
*" VALUE(COMMANDE) TYPE VBELN
*" TABLES
*" TBLE_CMDE STRUCTURE ZADD_COM_LOXAN
DATA : NUMC TYPE VBELN.
NUMC = COMMANDE .
WHILE STRLEN( NUMC ) < 10 .
CONCATENATE '0' NUMC INTO NUMC .
ENDWHILE .
DATA tble_addrcomm LIKE LINE OF TBLE_CMDE .
LOOP AT TBLE_CMDE INTO tble_addrcomm.
DATA : NUMP TYPE POSNR.
NUMP = tble_addrcomm-NUM_POST.
WHILE STRLEN( NUMP ) < 6 .
CONCATENATE '0' NUMP INTO NUMP .
ENDWHILE .
UPDATE VBAP SET ARKTX = tble_addrcomm-DIST
WHERE VBELN EQ COMMANDE
AND POSNR EQ NUMP.
ENDLOOP.
ENDFUNCTION.
Is anybody can help me?
thank.Marie, create a Blog please, about more details for dummies....
1) how to connect to sap system?
2) you run the php code where? in a webserver or where?
3) wich is the url for run the FM: ZZ_SET_DISTANCE
4) you placed some dlls files on the web server?
please is interesting this...
Thanks -
Getting values from a function module called in a WDA method
Friends,
I am trying to execute a function module from WDA.
I have created a service call for the function module. The function module takes values from the user, looks up the corresponding values of another field and returns the values in an internal table.
I am using the "Method Call in Used Controller" of WD Code wizard to call the function module.
When the event handler method containing the call to the function module is executed, nothing happens.
I am not sure how to pass values to the function module and to get the return values from the function module.
I am new to using function modules from WDA. Please help me out.
Thanks and Regards.Rashmi,
Is the function module intended to collect input data from the UI and process it? - Yes
If yes, then the input (importing parameter) to the Function Module is a table of values (which should be ideally from the context mapped to the Table UI Element). - The importing parameter is a single value NOT a table and is mapped to the view context.
Now this table UI Element is bound to the view controller context , which in turn is mapped to the component controller context. And you are indeed being able to read the value of this internal table in the component controller method where the function module is being called by means of get_static_attributes_table (Is this right? - Yes, I am able to read the table of values that is passed from the component controller view to form view context by using get_static_attributes_table.
Or are you being able to read it in the event handler method of the view controller and not being able to read it in the component controller method) -
The function module takes a single value as import parameter and returns a table of values as return value.
It works fine when no importing parameter is being used and returns the table of values that is getting passed from component controller context to form view context when i am able to read it using get_static_attributes_table.
Now the question is: how to pass the import parameter value to the function module. I assumed since the importing parameter is a context node (like the return values are), i should set the value ( captured when the user enters the value in the form) to the importing parameter context attribute using set_attribute method. Since it is mapped to the component controller context, i assumed it will get passed and the method will take it as input parameter.
Let me know if my assumptions are correct regarding passing the import parameters and what is missing here.
Thanks and Regards. -
Function module called within a loop seems to carry over global data
Hello all,
I am calling FM "RS_COVERPAGE_SELECTIONS" inside of a loop of all variants for a program and then writing the variant values to spool. If only one variant is entered on the selection screen, all the values are correct. If nothing is entered, some of the variant values are carried over from a previous variant. I am emptying the internal table returned by the FM every time before the FM executes.
Would some one be willing to run the following code for a program with many screen fields and many variants and tell me if they get the same behavior?
Thanks
Bruce
REPORT zzzz.
tables: varid, varit.
parameters: p_pgm type progname obligatory default 'ZFAPI004'.
select-options: s_var for varid-variant.
parameters: p_varval as checkbox default 'X'.
data: begin of reptab occurs 0,
report like varid-report,
variant like varid-variant,
ename like varid-ename,
edat like varid-edat,
etime like varid-etime,
aename like varid-aename,
aedat like varid-aedat,
aetime like varid-aetime,
vtext like varit-vtext,
end of reptab.
data: begin of tab_sel_options occurs 0,
flag(1) type c,
olength type x,
line like rsvar-infoline,
end of tab_sel_options.
*>> At Selection-Screen data items <<
data: w_pgm like sy-repid.
data: itab like rseui_f4 occurs 0 with header line.
data: dyname like d020s-prog value sy-repid,
dynumb like d020s-dnum value '1000'.
data: begin of dynpfields occurs 3.
include structure dynpread.
data: end of dynpfields.
data: w_tabix like sy-tabix.
data: begin of i_var occurs 0,
variant like varit-variant,
vtext like varit-vtext.
data: end of i_var.
start-of-selection.
format intensified on.
write: / p_pgm.
select * from varid
where report = p_pgm
and variant in s_var.
select single * from varit
where langu = 'E' and report = p_pgm
and variant = varid-variant.
move-corresponding varid to reptab.
move-corresponding varit to reptab.
append reptab.
endselect.
sort reptab by variant.
skip 1.
format color col_heading.
write: /03 'Variant',
18 'Create',
47 'Modify',
76 'Description'.
format color off.
skip 2.
loop at reptab.
format color col_total.
write: /3 reptab-variant,
reptab-ename(8),
reptab-edat,
reptab-etime,
reptab-aename(8),
reptab-aedat,
reptab-aetime,
reptab-vtext.
format color off.
skip 1.
if p_varval = 'X'.
clear tab_sel_options. " header
refresh tab_sel_options. " lines
call function 'RS_COVERPAGE_SELECTIONS'
exporting
report = reptab-report
variant = reptab-variant
no_import = ' '
tables
infotab = tab_sel_options
exceptions
error_message = 1
variant_not_found = 2
others = 3.
loop at tab_sel_options.
if sy-tabix < 7.
continue.
endif.
write: / tab_sel_options-line.
endloop.
skip 1.
endif. " p_varval = 'X'.
endloop.Hi
Try using the function module PRINT_SELECTIONS, within this FM, the FM RS_COVERPAGE_SELECTIONS is being called. So it will not copy the previous values.
Pass Mode as 'A' , report name and variant name, then it will display the same output.
Please try it
Shiva -
RFC remote function module call from XI
hi
I am trying to call a remote function module directly from XI which is not a bespoke module.
And i am getting the following error:
com.sap.aii.af.ra.ms.api.DeliveryException: error while processing message to remote system:com.sap.aii.af.rfc.core.client.RfcClientException: failed to parse BAPI response due to: com.sap.aii.af.rfc.util.bapi.BapiException: Parameter with name RETURN not found.
Please help me in this.
Thanks in advance.Hi Naina,
Normally RFC are synchronous, they do have return parameter as export parameter.
If return parameter is missing then , you can create Wrapper RFC.
Wrapper RFC:
It is nothing but you just create BAPI in SE37 transaction with Return parameter as export parameter and make it remote enabled by clicking on Radio button.
Under source code, CALL BAPI which XI has to call.
Thats it!
I hope this helps.
Let me know if any help required.
Maybe you are looking for
-
Follow up to arcsines and J2ME(saving the table)
ok, I've got a table I can only generate on my PC, but I need to somehow package it with a midlet, and have the midlet open it. Midlet's don't support serialization, only persistance(which can only be saved and read on the phone), or any direct file
-
How to submit the values in the ztable to the line items
Hi everybody Please give me the code to my task I am having a Z Table with one field and with some certain records and i am having an unique value . This unique value should be submitted in all the line items which are having the Z table records
-
Why has drag and drop in mail stopped working
Drag and drop has only stopped working in Mail, it is still functioning in other programs.
-
Popup window height and width is not as expected
Hi I am using this peace of code to create a popup. But this popup is not created with the specified height and width. It is created with a default size. Please tell me how to rectify the problem? data: l_api_main type ref to if_wd_vie
-
Not getting enough performance out of Msi GT60 0NC
Hello there guys! Since I've got my laptop I have been getting the feeling that I am not getting enough power out of my toy. I dont know if its me who have too big expectations about this laptop or it really should be performing better?:( I have done