Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

issue with Function module

Former Member
0 Likes
2,471

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

22 REPLIES 22
Read only

nabheetscn
SAP Champion
SAP Champion
0 Likes
2,386

What is the issue you are facing when called together? did you debug themm..? Please check whether you have proper commit etc called.

Read only

Former Member
0 Likes
2,386

Hi,

Can you paste the error screen shot. You can differentiate the Three FM by actvity type parameter.

Thanks & Regards

Priyesh Shah

Read only

venkat_aileni
Contributor
0 Likes
2,386

Hi-

Use COMMIT WORK AND WAIT. statement after every FM call.

-Venkat

Read only

NeerajRao
Explorer
0 Likes
2,386

Hi Laxmi,

Please elaborate your question in detail and share the errors you are getting.

Read only

Former Member
0 Likes
2,386

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

Read only

Former Member
0 Likes
2,386

Please provide the exact nature of error you are facing

Read only

0 Likes
2,386

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

Read only

0 Likes
2,386

Hi Vijaya Laxmi


Past your code here..... to know your problem...

Read only

0 Likes
2,386

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.

Read only

sai_krishna24
Active Participant
0 Likes
2,386

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

Read only

Former Member
0 Likes
2,386

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.

Read only

0 Likes
2,386

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.

Read only

0 Likes
2,386

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.

Read only

0 Likes
2,386

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.

Read only

satyabrata_sahoo3
Contributor
0 Likes
2,386

Use Commit work after the function modules.

are you using BDC for the transaction codes ?

Read only

0 Likes
2,386

YES...i used BDC

Read only

0 Likes
2,386

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

Read only

thangam_perumal
Contributor
0 Likes
2,386

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.

Read only

Former Member
0 Likes
2,386

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.

Read only

0 Likes
2,386

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

Read only

0 Likes
2,386

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

Read only

Former Member
0 Likes
2,386

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