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 reward
Call 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 ...)
Similar Messages
-
Problem with Function module PTRA_WEB_ADVANCES_SAVE
Hi Friends,
We are posting advaces to this function module: PTRA_WEB_ADVANCES_SAVE thru ASP.Net developed application.
while calling this function module thru RFC saying error is ' RFC called failed. RFC error status19 '.
what might me the reason for this error. I am getting this error for this Function module only. i tried with other function module, then it is working fine. but i want to use function module to post advances..
Any suggestions please.
Thanks,
NaveenMust be an error in data submitted to the FM via the RFC...the FM is remote enabled, so check your data values AND FORMATS very carefully... are you getting the return table back? If so, what's in it?
-
Hi.
can anybody tell me how can i calculate
cost depreciation for an asset.
I have used one function module DEPR_RECALCULATE.
but it will allow only one date and it will calculate depreciation for total year .
As per my
I want to pass the two dates and need to calculate the depreciation between two periods.Hi Nitin.
Thank you for u r quick reply.
I have tried all these function modules but as per our requirement
They are not support.
Issue:
I need to calculate the cost depreciation between APRIL and MARCH
but DEPR_RECALCULATE Fm will calculate between JAN and the date which is specified in the parameter field on the selection screen .
so how can calculate the depreciation cost between two dates( I want to pass the select-options).
Thanking you,
Regards
sateesh -
Problem with function module RS_VARIANT_CONTENTS
Hi all,
i´ve a problem by calling the FM RS_VARIANT_CONTENTS. Everytime I try to get the content of a variant the module crashes with the following dump:
Call (PERFORM) to a non-existent routine.
025730 INSERT SCREEN_PROGS INDEX L_TABIX.
025740
025750 read table f3progs_old with key
025760 table_line = p_prog
025770 binary search
025780 transporting no fields.
025790 l_tabix = sy-tabix.
025800 if sy-subrc ne 0.
025810 PERFORM %_INIT-MOVE IN PROGRAM (P_PROG). " ????
025820 endif.
> IF P_NEW_CALL EQ 'S' or flag_query_active eq 'A'.
025840 PERFORM INIT IN PROGRAM (SY-LDBPG) IF FOUND.
025850 ENDIF.
025860
025870 ENDFORM. " INIT_1_PROG
Thats the coding how I create the variant:
i_jvari_desc-report = sy-repid.
i_jvari_desc-variant = 'TESTING4'.
i_jvari_desc-ename = sy-uname.
i_jvari_desc-environmnt = 'A'.
i_jvari_desc-mlangu = 'N'.
ls_jvt-mandt = sy-mandt.
ls_jvt-report = sy-repid.
ls_jvt-variant = 'TESTING4'.
ls_jvt-langu = sy-langu.
ls_jvt-vtext = 'FUNCTION EXAMPLES'.
APPEND ls_jvt TO i_jvt.
ls_selpa-sign = ''.
ls_selpa-option = ''.
ls_selpa-kind = 'P'.
ls_selpa-selname = 'BRAND'.
ls_selpa-low = 'SL'.
APPEND ls_selpa TO i_selpa.
CALL FUNCTION 'RS_CREATE_VARIANT'
EXPORTING
curr_report = i_jvari_desc-report
curr_variant = 'TESTING4'
vari_desc = i_jvari_desc
TABLES
vari_contents = i_selpa
vari_text = i_jvt.
IF sy-subrc EQ 0.
ENDIF.
Could it be a problem that the dynpro is not a generated selection screen instead it is a normal dynrpo created with the screen painter. The parameter BRAND isn´t the only parameter on this screen. Do I´ve to pass all Paramters on the screen while creating a new variant? SY-REPID includes the name of a Function Pool!
Did anybody had the same or similar problem and can give me some hints how to solve it?
Thanks in advance,
AndyHi,
thanks for your reply.
I´ve tried your suggestion, unfortunately without success.
I think the problem is, that the dynpro is not a generated selection screen instead it belongs to a function group.
It seams to me, that the FM unsuccessfully tries to check the dynpro fields....?
Nevertheless I´ve implemented my own variant maintenance environment.
Regards,
Andy -
Hi Friends,
im calling a fm(SD_DELIVERY_UPDATE_PICKING_1) to update the picking quantity during delivery creation wn ever sto is saved,inside a badi(LE_SHP_DELIVERY_PROC).Now the controll is not comming out of the code.
method IF_EX_LE_SHP_DELIVERY_PROC~SAVE_AND_PUBLISH_DOCUMENT.
data: wa_lips type lips,
it_lips TYPE TABLE OF lips,
wa_likp TYPE likp,
it_likp TYPE TABLE OF likp,
wa_komdlgn type komdlgn.
it_lips[] = it_xlips[].
it_likp[] = it_xlikp[].
read table it_lips into wa_lips index 1.
read table it_likp into wa_likp index 1.
data:wa_VBKOK type VBKOK.
data:wa_vbpok type vbpok,
it_VBPOK TYPE TABLE OF VBPOK.
wa_VBKOK-VBELN_VL = wa_likp-vbeln. " 0080001420
wa_VBKOK-VBTYP_VL = wa_likp-vbtyp. " J
wa_VBKOK-KODAT = wa_likp-kodat. " 01/09/2008
wa_VBPOK-VBELN_VL = wa_lips-vbeln. " 0080001420
wa_VBPOK-POSNR_VL = wa_lips-posnr. " 000010
wa_VBPOK-VBELN = wa_lips-vgbel. " 8200001248
wa_VBPOK-POSNN = wa_lips-vgpos. " 000010
wa_VBPOK-PIKMG = wa_lips-lfimg. " 1.000
wa_VBPOK-MATNR = wa_lips-matnr. " SC540206FUR2
wa_VBPOK-CHARG = wa_lips-charg. " 1000000009
wa_VBPOK-WERKS = wa_lips-werks. " 8380
append wa_vbpok to it_VBPOK.
*if wa_VBPOK-PIKMG is INITIAL.
*if sy-tcode ne 'VL02N'.
CALL FUNCTION 'SD_DELIVERY_UPDATE_PICKING_1'
EXPORTING
VBKOK_WA = wa_VBKOK
SYNCHRON = 'X'
NO_MESSAGES_UPDATE_1 = ' '
NICHT_SPERREN_1 = ' '
AUFRUFER_T_1 = ' '
IF_ERROR_MESSAGES_SEND_1 = 'X'
IF_LATE_DELIVERY_UPD = ' '
IT_SERNR_UPDATE =
TABLES
VBPOK_TAB = it_VBPOK.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
*commit WORK.
*endif.
endif.
endmethod.
plz help to solve the issue.
points wikll be awarded surelly.
after the end of execution of fm, the controll is coming back to
data: wa_lips type lips,
it_lips TYPE TABLE OF lips,
wa_likp TYPE likp,
it_likp TYPE TABLE OF likp,
wa_komdlgn type komdlgn. statemant.
and from there its not executing next time.i hv seen this in debug mode.
Edited by: SASIKANTH SM on Jan 9, 2008 8:32 PM
Edited by: SASIKANTH SM on Jan 9, 2008 8:33 PMdont writ bapi_transactin_commit inside the badi, we should not commit inside a user exit or badi.
-
Problem with function module RV_PRICE_PRINT_HEAD
Hello I was wondering if anyone could help me:
I'm using the fm RV_PRICE_PRINT_HEAD to retrieve the pricing conditions of a document, being used in a smartform. When I debug the the fm in the smartform to check if there are values returned, the tables TKOMV and TKOMVD do not contain anything, but when I test the fm using the function builder (se37), there are values in both tables.It may be that it works in SE37 becasue this is in foreground and the print parameters are visible. If this is the case you may end up using PRICING_GET_CONDITIONS in your Smartform instead.
Regards
Gareth
PS sorry for having three posts - just kept thinking:) -
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 -
VirtualProvider with Function module problem !
I implemented virtualprovider with function module. Unfortunately when I run query i get message error :
u201CFunction call of ZT0X failed; the obligatory parameter CHARACTERISTICS
An exception with the type CX_SY_DYN_CALL_PARAM_MISSING occurred, but was
I>> Row: 67 Inc: READ_DATA Prog: CL_RSDRV_VPROV_LOC_NOSIDu201D
Any suggestions ?
Below source code:
u201CFUNCTION ZT0X.
""Lokalny interfejs:
*" IMPORTING
*" VALUE(INFOCUBE) LIKE BAPI6200-INFOCUBE DEFAULT 'ZT03'
*" VALUE(KEYDATE) LIKE BAPI6200-KEYDATE OPTIONAL
*" EXPORTING
*" VALUE(RETURN) LIKE BAPIRET2 STRUCTURE BAPIRET2
*" TABLES
*" SELECTION STRUCTURE BAPI6200SL
*" CHARACTERISTICS STRUCTURE BAPI6200FD
*" KEYFIGURES STRUCTURE BAPI6200FD
*" DATA STRUCTURE BAPI6100DA
DATA:
l_r_srv TYPE ref to CL_RSDRV_REMOTE_IPROV_SRV,
l_th_mapping TYPE CL_RSDRV_REMOTE_IPROV_SRV=>TN_TH_IOBJ_FLD_MAPPING.
* break-point ID ZRSDRV_RC1.
* break DEVELOPER.
perform build_mapping_table
changing l_th_mapping.
create object l_r_srv
exporting
i_tablnm = '/BIC/PZPRD_ID'
i_th_iobj_fld_mapping = l_th_mapping.
l_r_srv->open_cursor(
i_t_characteristics = characteristics[]
i_t_keyfigures = keyfigures[]
i_t_selection = selection[] ).
l_r_srv->fetch_pack_data(
importing
e_t_data = data[] ).
return-type = 'S'.
ENDFUNCTION.
&---- <
*& Form build_mapping_table
&---- <
Form build_mapping_table
changing
c_th_mapping TYPE CL_RSDRV_EXTERNAL_IPROV_SRV=>TN_TH_IOBJ_FLD_MAPPING.
DATA:
l_s_map TYPE CL_RSDRV_EXTERNAL_IPROV_SRV=>TN_S_IOBJ_FLD_MAPPING.
l_s_map-iobjnm = 'ZPRD_ID'.
l_s_map-fldnm = '/BIC/ZPRD_ID'.
insert l_s_map into table c_th_mapping.
l_s_map-iobjnm = 'ZWARTOSC'.
l_s_map-fldnm = '/BIC/Z_CEN_W'.
insert l_s_map into table c_th_mapping.
+endform.u201DHello
I experienced the same issue. Were u able to solve it? If yes , kindly ask you to make posting here so that others can benefit as well.
Huge thanks -
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. -
Hierarchial Layout Saving with function modules
Hai to all
i am facing a problem while saving layout in Hierarchial list display with function module.
below error message is coming when i am going save my layout.
210 if l_def_variant-variant eq rs_variant-variant.
211 l_default = 'X'.
212 endif.
213 endif.
214
215 call function 'LT_FC_SAVE'
216 exporting
217 * I_TOOL = 'LT'
218 i_tabname = r_tabname
219 i_tabname_slave = r_tabname_slave
220 is_variant = rs_variant
221 it_fieldcat = rt_fieldcat[]
222 it_sort = rt_sort[]
223 it_filter = rt_filter[]
224 is_layout = rs_layout
225 i_default_variant = l_default
226 exceptions
227 fc_not_complete = 1
228 others = 2.
229 case sy-subrc.
230 when '0'.
231 message s018(0k).
232 when '1'.
>>>>> message x000(0k) with 'LT_FC_SAVE' sy-subrc
234 raising fc_not_complete.
235 endcase.
it is very urgent...
Subhash.Mdata: ls_vari type disvariant.
DATA: w_repid TYPE sy-repid.
ls_vari-report = w_repid.
ls_vari-username = sy-uname.
CALL FUNCTION 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
i_callback_program = w_repid
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = ' '
is_layout = wa_layout
it_fieldcat = i_fcat[]
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
it_sort = i_sort[]
IT_FILTER =
IS_SEL_HIDE =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
i_default = 'X'
i_save = 'X'
IS_VARIANT = ls_vari
it_events = i_event[]
IT_EVENT_EXIT =
i_tabname_header = 'I_FINAL1'
i_tabname_item = 'I_FINAL2'
I_STRUCTURE_NAME_HEADER =
I_STRUCTURE_NAME_ITEM =
is_keyinfo = wa_key
IS_PRINT =
IS_REPREP_ID =
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE =
IR_SALV_HIERSEQ_ADAPTER =
IT_EXCEPT_QINFO =
I_SUPPRESS_EMPTY_DATA = ABAP_FALSE
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
t_outtab_header = i_final1
t_outtab_item = i_final2
EXCEPTIONS
PROGRAM_ERROR = 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.
i have passed the parameters
but i am getting same dump again..
Subhash.M -
How to copy a generic extractor with function module into a new system?
Dear Gurus,
i would like to know how i can copy a gneric datasource with function module from one system to the target system.
Thank you
CheersHi Anesh,
thank you for replying.
Since the Datasource will have a new new in the new system, i will create a new one.
Create a generic datasource base on the table is not the problem.
My problem is how could i copy the FM in the new system?
If you can help me on that, it will be fine.
Thanks -
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. -
Generic Data Source with Function Module data mismatch
Hi All,
I'm using Generic Data Source with Function Module, When I execute the Function Module (Which I have Created), I'm getting 16000 records and when run extractor(in RSA3) im getting different no.of records(infact they are more no.).
when I run the InfoPackage in BI im Getting more no. of records than what i got executing the function module..
and single record is divided into 2 records in BI side(not all the records), how can it be possible???
is there anything Im missing to explain you my issue???
if understood please help me out.
Thanks n Regards,
ravi.HI rkiranbi,
1. FIrst you excute function module according to your paramers, you will get some records. then goto tcode RSA3 --> excute
Provide your Data source name and under setting we have options like Data records/calls, Display extractor calls and selections --> fields .
in that options you have to increase the values. and then you have to pass paramers in RSA3 according to your function module
selections in SE37. Now you will get equal values in both functin module selection and RSA3 Selection. if it fail means you need to
check coding logic in function module.
2. if your are getting wrong values in BI System then check with
1. compare with PSA data and data target data (here you need to check with characterstic as well as keyfigures)
if you find any mistake you need change the coding in function module according to client requirement.
2. compare data with RSA3 and bi report data or data target data.
check it properly above steps, you will get solution.
thanks and regards,
malli
Maybe you are looking for
-
Autoplay podcasts in sequence?
When I download several sequential podcasts on my iPhone, they will automatically play in sequence. However, on iPad, I have to click on each one, not always easy when driving. Is there a control for this?
-
How to use apache shiro in spring application
Hi every one, Can any please tell me the steps to integrate Apache Shiro and Spring . (Give me the sample web application ) Regards Siva Suresh
-
Error message when trying to play movies and music videos
I am getting the below message on my TV screen when i try to play movies via my iPad device through airplay. The irony of it is that I watched a whole movie before this problem developed. "This content requires HDCP for playback. HDCP is not support
-
Yikes!! (I lost my Effects Tab) .. Simple Question
Greetings all. I was editing a video on my copy of Premiere pro CS5 today and I somehow lost my effects tab. Where is says Audio mixer, thats where I used to be able to go on the Effects tab. I just want help getting it back. I was not paying attenti
-
Show .hidden files in Terminal by default?
Terminal on my machine has been setup so that all .invisible files show by default. I.e., when I type: "ls" .ds_stores shows How do I make this the default ls behavior on new systems? I know "ls -a" will produce the same result, but I am curious how