cancel
Showing results for 
Search instead for 
Did you mean: 

Commit work and wait after ISU_S_FICA_DOC_CREATE

0 Kudos

Dear experts,

I have a question regarding the FM ISU_S_FICA_DOC_CREATE.

I'm using this FM to create a tax document, the problem is that after running this FM successufuly I check DFKKOP table to see if my document was added, I don't find it,

Why am I looking for it in DFKKOP? well, after creating this document I need to create a payement for this doc so I am using FKK_CD_PAYMENT_CREATE , and while this FM tries to update DFKKOP I get a short dump (SOMETIMES, not everytime because when I re-run the same test I don't get any dump), so I supposed that maybe I need a very brief delay until the document is added to dfkkop.

Do I need to add a COMMIT WORK AND WAIT statement after each one of the FMs?

Regards,

Houriya

Accepted Solutions (1)

Accepted Solutions (1)

raymond_giuseppi
Active Contributor
0 Kudos

Non-liability clause: Many unreleased FM?

you can try the COMMIT WORK AND WAIT statement, but insure pass an initial value to paraleter I_COMMIT of the FM, else the FM execute a COMMIT WORK without the WAIT option, and your statement won't have any effect.

Nevertheless there are potential delays in the database update and buffer management, so you could try to read from database the generated document before calling next FM, in some DO/SELECT/if found EXIT/else WAIT UP TO 0 SECONDS/ENDDO.

0 Kudos

Thanks for the replay,

So what you are suggesting is that I set the I_commit parameter to 'X' and add the Commit work and wait statement to the both Function Module

I've already tried to read from the database before calling the second FM ( using a while endwhile loop ) but it ended as an endless loop ( as I don't know exactely when does SAP add that entery to DFKKOP)

so here is the code

CALL FUNCTION 'ISU_S_FICA_DOC_CREATE'
      EXPORTING
        i_fikey       = fikey
        i_applk       = applk
        i_herkf       = herkf
        i_blart       = 'FT'
        i_waers       = devise
        i_bldat       = sy-datum
        i_budat       = sy-datum
        i_gpart       = partner
*       I_XNETT       =
        i_commit      = 'X'
        i_update_task = 'X'
*       I_XBLNR       =
      IMPORTING
        e_opbel       = opbel_tax
      TABLES
        t_input_pos   = t_input_pos
*       T_ISUCADOC_FKKOP       =
* EXCEPTIONS
*       NOT_CREATED   = 1
*       OTHERS        = 2.
    IF sy-subrc <> 0.
    ELSE.
      commit work and wait.

      call function 'FKK_CD_PAYMENT_CREATE'
        if sy-subrc = 0.
          commit work and wait.
        endif.
    endif.

Regards,

Houriya

0 Kudos

You've also mentionned something about the unreleased FM? how to know if function is released I check

TFDIR table for the two FMs 'freedate' was initial so they're unreleased ?

Would you please explain ?

Regards,

Houriya

raymond_giuseppi
Active Contributor

Quite the reveses, keep the I_COMMIT to space, and then you can use the COMMIT AND WAIT.

raymond_giuseppi
Active Contributor
0 Kudos

Yes, not release date EQ not released. (look with SE37 for FM attributes) so use BAPI_ISUCADOC_CREATEFROMDATA.

0 Kudos

Is there any thing wrong with using the unreleased FM?

I've already checked for BAPI_ISUCADOC_CREATEFROMDATA in TFDIR table FREEDATE is also initial, plus this BAPI calls ISU_S_FICA_DOC_CREATE.

raymond_giuseppi
Active Contributor

Many people use unreleased FM when no other solution exists, this is mainly some warranty/support problem (read 109533 - Use of SAP function modules and 415983 - Modification/customer developments of SAP function modules) so at your own/company/customer risks.

For the BAPI, check object ISUSLDCMNT in SWO1. But alas even the 'BAPI' FM appears to be implemented and not released (no longyuer?) So consider looking at the released BAPIs BAPI_CTRACDOCUMENT_*, e.g. BAPI_CTRACDOCUMENT_CREATE.

Answers (0)