‎2005 Jul 20 11:23 AM
Hi All,
I want to execute my sub-routine after commit work, not on commit work.
If any one have answer please me at <REMOVED BY MODERATOR>
<LOCKED BY MODERATOR - USE BC FOR DIRECT CONTACT>
Edited by: Alvaro Tejada Galindo on Jun 1, 2010 3:58 PM
‎2005 Jul 20 11:29 AM
Hi,
just do:
...some actions...
commit work.
perform subroutine.
‎2005 Jul 20 11:40 AM
But I want to execute my subroutine after commit statement, but I am not able to keep subroutine after commit statement, because it is sap standard program
‎2005 Jul 20 12:05 PM
Do you call a standard program, or do you want to add some coding to a standard transaction?
‎2005 Jul 20 12:23 PM
No vinod,
Still it is not working, it is related to VL02N Tcode, here user is entering long text and pressing PGI button with out saving , in my userexit I have to catch that text. text is saving into database after commit only. but my userexit is triggering before that.
‎2005 Jul 20 1:26 PM
Hi
i had a similar problem with longtext for FI-Documents to catch the text in an user exit, before the text is written to DB. Normally the lontext is hold in the global memory of the function pool (or main program where it has been maintained). So you can try to catch these values from the global memory.
Enclosed the coding for my solution in FI.
FORM get_longtext_from_buffer USING p_l_bseg TYPE bseg.
DATA: l_eenot_notice TYPE eenot_notice,
l_tdname TYPE tdobname,
l_texte TYPE eenot_single_notice,
l_tline TYPE tline.
FIELD-SYMBOLS: <notice> TYPE eenot_notice.
CLEAR: gs_z1castxh, gs_z1castxl.
REFRESH: gt_z1castxl.
Get Text from Buffer
ASSIGN ('(SAPLFTXT)WA_DOC_NOTE-NOTE') TO <notice>.
IF sy-subrc = 0.
l_eenot_notice = <notice>.
READ TABLE l_eenot_notice-notizen
INTO l_texte INDEX l_eenot_notice-c-index.
IF sy-subrc = 0.
gs_z1castxh-tdobject = l_texte-head-tdobject.
gs_z1castxh-tdname = l_texte-head-tdname.
gs_z1castxh-tdid = l_texte-head-tdid.
gs_z1castxh-tdspras = l_texte-head-tdspras.
LOOP AT l_texte-lines INTO l_tline.
MOVE-CORRESPONDING l_tline TO gs_z1castxl.
APPEND gs_z1castxl TO gt_z1castxl.
ENDLOOP.
ENDIF.
ENDIF.
ENDFORM. " GET_LONGTEXT_FROM_BUFFER
May be this solution gives you a help, taht you can di it similar for your transaction. I think you have another function pool, but you can see it in the debugger when you maintain your longtext.
best regards.
‎2005 Jul 20 2:44 PM
Hi
Get Text from Buffer
ASSIGN ('(SAPLFTXT)WA_DOC_NOTE-NOTE') TO <notice>.
IF sy-subrc = 0.
l_eenot_notice = <notice>.
here I am getting sy-subrc eq 4.
Please suggest me any
‎2005 Jul 20 4:06 PM
Hi,
as i said it was an example how i did it in FI.
The approach for finding a solution for your problem should be similar. I debugged the longtext screen of your transaction and as far as i see the main program that is used is SAPLV70T (Function Pool V70T).
Maintaining text the workarea TLINETAB of this mainprogram is filled.
So my proposal is to access this workarea
ASSIGN('(SAPLV70T)TLINETAB) TO <TLINE>.
<TLINE> should have the same structure as TLINETAB.
But this is only the first step. You have to debug the longtext logic or to analyze to mainprogram to get the rest of information you need. It is a laborious work and my coding could not be taken 1:1 but the way to get the data is the same.
Hope this helps
‎2005 Jul 20 11:34 AM
If you want to execute this sub routine after all the other subroutines on commit work are finished then use the addition LEVEL idx after the ON COMMIT statement.
data w_idx type i.
w_idx = '99'.
PERFORM form ON COMMIT LEVEL w_idx.
‎2005 Jul 20 11:39 AM
But I want to execute my subroutine after commit statement, but I am not able to keep subroutine after commit statement, because it is sap standard program
‎2005 Jul 20 11:45 AM
In my example if you give level '99' then it will be the last one in the commit work execution. Could you try this out pls?