‎2013 Nov 14 10:33 AM
Dear friends
i am working on SAP FI - funds management,
my requirement is to create function modules ( as there are no BAPi's ) for Creating payment Request ( tcode F871 ), then Release Request ( F874 ) and finally Post Request ( tcode F870 ), i have created 3 function modules for all the above transactions, individually its working fine
but when i am trying to call all the three above function modules in one function module...its not working, can any one please help me in this issue
in one function module, i want all the above three functions
Thanks
Vijaya
‎2013 Nov 14 10:36 AM
What is the issue you are facing when called together? did you debug themm..? Please check whether you have proper commit etc called.
‎2013 Nov 14 10:37 AM
Hi,
Can you paste the error screen shot. You can differentiate the Three FM by actvity type parameter.
Thanks & Regards
Priyesh Shah
‎2013 Nov 14 10:37 AM
Hi-
Use COMMIT WORK AND WAIT. statement after every FM call.
-Venkat
‎2013 Nov 14 10:39 AM
Hi Laxmi,
Please elaborate your question in detail and share the errors you are getting.
‎2013 Nov 14 10:45 AM
Thanks friends for replies
i am not getting any error,
the first function module is working fine, its stopped at second function module , please let me know if anything is missing and you want any information
Thanks
Vijaya
‎2013 Nov 14 10:46 AM
‎2013 Nov 14 10:51 AM
Hi-
Does your parameters for 2nd FM is depended on 1st FM result? If so check in debugging mode whether you are able to get those details from 1st FM results.
Are you using COMMIT WORK AND WAIT after every FM call?
-Venkat
‎2013 Nov 14 11:09 AM
Hi Vijaya Laxmi
Past your code here..... to know your problem...
‎2013 Nov 14 11:19 AM
Hi Laxmi,
Check the necessary parameters which are needed for Second FM to succeed and after that for third FM. If every thing is good it should complete your task and dont forget to specify Commit work and wait for every FM call .
Regards,
Venkat.
‎2013 Nov 14 11:15 AM
Hi Lakshmi,
Use this statement (WAIT UP TO X SECONDS.) in between your function modules.
while we do parallel processing of transactions we need to give enough time for the commit work, else it will be in lock and rest of the transaction won't work because of lock concept.
Eg. WAIT UP TP 10 SECONDS
Thanks
Sai Krishna
‎2013 Nov 14 11:15 AM
This is my code, i am not using COMMIT WORK and WAIT, can you please let me know how to use COMMIT WORK and WAIT
FUNCTION zfm_payment_request.
*"----------------------------------------------------------------------
*"*"Local Interface:
*" IMPORTING
*" REFERENCE(IM_BLDAT) TYPE CHAR10
*" REFERENCE(IM_BUKRS) TYPE BUKRS
*" REFERENCE(IM_BUDAT) TYPE CHAR10
*" REFERENCE(IM_XBLNR) TYPE XBLNR
*" REFERENCE(IM_BKTXT) TYPE BKTXT
*" REFERENCE(IM_LIFNR) TYPE LIFNR
*" REFERENCE(IM_FIPEX) TYPE FIPEX
*" REFERENCE(IM_FISTL) TYPE FISTL
*" REFERENCE(IM_WRBTR) TYPE CHAR14
*" TABLES
*" ITAB_MSG TYPE ZTT_MSSGS
*"----------------------------------------------------------------------
DATA : lv_req TYPE pso_lotkz,
belnr TYPE belnr_d,
l_belnr TYPE belnr_d,
p_req type pso_lotkz.
* CALL FUNCTION 'ZFM_PAY_REQ'
* EXPORTING
* bldat = im_bldat
* bukrs = im_bukrs
* budat = im_budat
* xblnr = im_xblnr
* bktxt = im_bktxt
* lifnr = im_lifnr
* fipex = im_fipex
* fistl = im_fistl
* wrbtr = im_wrbtr
* IMPORTING
* req = lv_req
* TABLES
* it_msg = itab_msg.
*
*
* CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
* EXPORTING
* input = lv_req
* IMPORTING
* output = lv_req.
*
*
CALL FUNCTION 'ZFM_PAY_REQ_APP'
EXPORTING
i_lotkz = lv_req
* IMPORTING
* REQ =
TABLES
it_msg = itab_msg.
CALL FUNCTION 'ZFM_PAY_REQ_POST'
EXPORTING
im_lotkz = lv_req
TABLES
lt_msg = itab_msg.
ENDFUNCTION.
‎2013 Nov 14 11:24 AM
Hi
You will have to use commit work and wait if you are not using in first FM. Since 2 and 3 are dependent on value of LV_REQ which may not have got genearted.
‎2013 Nov 14 11:24 AM
Hi Laxmi,
Find my Code in Bold.
FUNCTION zfm_payment_request.
*"----------------------------------------------------------------------
*"*"Local Interface:
*" IMPORTING
*" REFERENCE(IM_BLDAT) TYPE CHAR10
*" REFERENCE(IM_BUKRS) TYPE BUKRS
*" REFERENCE(IM_BUDAT) TYPE CHAR10
*" REFERENCE(IM_XBLNR) TYPE XBLNR
*" REFERENCE(IM_BKTXT) TYPE BKTXT
*" REFERENCE(IM_LIFNR) TYPE LIFNR
*" REFERENCE(IM_FIPEX) TYPE FIPEX
*" REFERENCE(IM_FISTL) TYPE FISTL
*" REFERENCE(IM_WRBTR) TYPE CHAR14
*" TABLES
*" ITAB_MSG TYPE ZTT_MSSGS
*"----------------------------------------------------------------------
DATA : lv_req TYPE pso_lotkz,
belnr TYPE belnr_d,
l_belnr TYPE belnr_d,
p_req type pso_lotkz.
* CALL FUNCTION 'ZFM_PAY_REQ'
* EXPORTING
* bldat = im_bldat
* bukrs = im_bukrs
* budat = im_budat
* xblnr = im_xblnr
* bktxt = im_bktxt
* lifnr = im_lifnr
* fipex = im_fipex
* fistl = im_fistl
* wrbtr = im_wrbtr
* IMPORTING
* req = lv_req
* TABLES
* it_msg = itab_msg.
*
*
* CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
* EXPORTING
* input = lv_req
* IMPORTING
* output = lv_req.
*
*
commit work and wait.
I think here lv_req value is required, then write like
if lv_req is not initial.
CALL FUNCTION 'ZFM_PAY_REQ_APP'
EXPORTING
i_lotkz = lv_req
* IMPORTING
* REQ =
TABLES
it_msg = itab_msg.
commit work and wait.
CALL FUNCTION 'ZFM_PAY_REQ_POST'
EXPORTING
im_lotkz = lv_req
TABLES
lt_msg = itab_msg.
else.
populate some message into itab_msg here.
endif.
ENDFUNCTION.
Regards,
Venkat.
‎2013 Nov 14 11:27 AM
FUNCTION zfm_payment_request.
*"----------------------------------------------------------------------
*"*"Local Interface:
*" IMPORTING
*" REFERENCE(IM_BLDAT) TYPE CHAR10
*" REFERENCE(IM_BUKRS) TYPE BUKRS
*" REFERENCE(IM_BUDAT) TYPE CHAR10
*" REFERENCE(IM_XBLNR) TYPE XBLNR
*" REFERENCE(IM_BKTXT) TYPE BKTXT
*" REFERENCE(IM_LIFNR) TYPE LIFNR
*" REFERENCE(IM_FIPEX) TYPE FIPEX
*" REFERENCE(IM_FISTL) TYPE FISTL
*" REFERENCE(IM_WRBTR) TYPE CHAR14
*" TABLES
*" ITAB_MSG TYPE ZTT_MSSGS
*"----------------------------------------------------------------------
DATA : lv_req TYPE pso_lotkz,
belnr TYPE belnr_d,
l_belnr TYPE belnr_d,
p_req type pso_lotkz.
* CALL FUNCTION 'ZFM_PAY_REQ'
* EXPORTING
* bldat = im_bldat
* bukrs = im_bukrs
* budat = im_budat
* xblnr = im_xblnr
* bktxt = im_bktxt
* lifnr = im_lifnr
* fipex = im_fipex
* fistl = im_fistl
* wrbtr = im_wrbtr
* IMPORTING
* req = lv_req
* TABLES
* it_msg = itab_msg.
COMMIT WORK AND WAIT.
if lv_req is not INITIAL.
*
*
* CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
* EXPORTING
* input = lv_req
* IMPORTING
* output = lv_req.
*
*
COMMIT WORK AND WAIT.
CALL FUNCTION 'ZFM_PAY_REQ_APP'
EXPORTING
i_lotkz = lv_req
* IMPORTING
* REQ =
TABLES
it_msg = itab_msg.
COMMIT WORK AND WAIT.
CALL FUNCTION 'ZFM_PAY_REQ_POST'
EXPORTING
im_lotkz = lv_req
TABLES
lt_msg = itab_msg.
endif.
ENDFUNCTION.
‎2013 Nov 14 11:24 AM
Use Commit work after the function modules.
are you using BDC for the transaction codes ?
‎2013 Nov 14 11:30 AM
‎2013 Nov 14 12:08 PM
I believe you are not using BDC Session method.
Is the first function module works fine? Read its BDC message/return parameter.
I believe second function module for F874 is using the Request Number generated from F871. Check if its getting any request number or not.
-Satya
‎2013 Nov 14 11:25 AM
Please use the keyword wait upto 5 seconds
or commit work and wait for between the function Modules.
for e.g.
CALL FUNCTION 'ZFM_PAY_REQ_APP'
EXPORTING
i_lotkz = lv_req
* IMPORTING
* REQ =
TABLES
it_msg = itab_msg.
commit work and wait. (or) wait upto 5 seconds.
CALL FUNCTION 'ZFM_PAY_REQ_POST'
EXPORTING
im_lotkz = lv_req
TABLES
lt_msg = itab_msg.
‎2013 Nov 14 11:56 AM
In your BDC, check the Update mode at CALL TRANSACTION statement. It should be 'S'.
Debug your first functional module and check if it is returning the value for variable lv_req properly.
‎2013 Nov 14 12:30 PM
Hi Ashish
my first function module returning the lv_req properly, but this value is not get populated in
the screen of second transcation ( ie Release Request ( F874 ) ) and also bdc_ok code ( ie ENTER BUTTON ) is not populating, could you please let me know how to solve this issue
Thanks
Vijaya
‎2013 Nov 14 12:35 PM
Can you please check your BDC recording..try to run in Mode A. Debug and check. Compare the recording of second FM with the BDCDATA structure it should be same
‎2013 Nov 14 12:47 PM
Vijaya Laxmi wrote:
This is my code, i am not using COMMIT WORK and WAIT, can you please let me know how to use COMMIT WORK and WAIT
FUNCTION zfm_payment_request.
*"----------------------------------------------------------------------
*"*"Local Interface:
*" IMPORTING
*" REFERENCE(IM_BLDAT) TYPE CHAR10
*" REFERENCE(IM_BUKRS) TYPE BUKRS
*" REFERENCE(IM_BUDAT) TYPE CHAR10
*" REFERENCE(IM_XBLNR) TYPE XBLNR
*" REFERENCE(IM_BKTXT) TYPE BKTXT
*" REFERENCE(IM_LIFNR) TYPE LIFNR
*" REFERENCE(IM_FIPEX) TYPE FIPEX
*" REFERENCE(IM_FISTL) TYPE FISTL
*" REFERENCE(IM_WRBTR) TYPE CHAR14
*" TABLES
*" ITAB_MSG TYPE ZTT_MSSGS
*"----------------------------------------------------------------------
DATA : lv_req TYPE pso_lotkz,
belnr TYPE belnr_d,
l_belnr TYPE belnr_d,
p_req type pso_lotkz.
* CALL FUNCTION 'ZFM_PAY_REQ'
* EXPORTING
* bldat = im_bldat
* bukrs = im_bukrs
* budat = im_budat
* xblnr = im_xblnr
* bktxt = im_bktxt
* lifnr = im_lifnr
* fipex = im_fipex
* fistl = im_fistl
* wrbtr = im_wrbtr
* IMPORTING
* req = lv_req
* TABLES
* it_msg = itab_msg.
*
*
* CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
* EXPORTING
* input = lv_req
* IMPORTING
* output = lv_req.
*
*
CALL FUNCTION 'ZFM_PAY_REQ_APP'
EXPORTING
i_lotkz = lv_req LV_REQ HAS NOT BEEN ASSIGNED ANY VALUE IN THE CODE ABOVE SO NOTHING IS EXPORTING HERE
* IMPORTING
* REQ =
TABLES
it_msg = itab_msg.
CALL FUNCTION 'ZFM_PAY_REQ_POST'
EXPORTING
im_lotkz = lv_req SAME HERE. LV_REQ IS NOT GIVEN ANY VALUE . IT IS INITIAL
TABLES
lt_msg = itab_msg.
ENDFUNCTION.
You need to uncomment the two function calls above that are commented or populate LV_REQ by some other way.
regards,
Ashish Rawat