2009 Jun 20 9:48 AM
Hi,
I have a custom output type and a Custom function module for issueing the output for delivery, my prob is that it processing log is getting updated for the send in batch and other options but it is not getting updated for the SEND IMMEDIATLY, I am using the same FM for the Output issue I am checking if they have selected output type as 4 if yes, I am calling a FM in perform by saying
PERFORM xxxxxxxx ON COMMITand in the perform I am calling a FM
CALL FUNCTION xxxxxxxxx in BACKGROUND TASK AS A SEPARATE TASK,
the functioanlity of issueing the output is working but the Processing log is not getting updated.
What might be the problem ? it is getting updated for Send in batch but not for except 4.
Hi,
I have a custom output type and a Custom function module for issueing the output for delivery, my prob is that it processing log is getting updated for the send in batch and other options but it is not getting updated for the SEND IMMEDIATLY, I am using the same FM for the Output issue I am checking if they have selected output type as 4 if yes, I am calling a FM in perform by saying
PERFORM xxxxxxxx ON COMMITand in the perform I am calling a FM
CALL FUNCTION xxxxxxxxx in BACKGROUND TASK AS A SEPARATE TASK,
the functioanlity of issueing the output is working but the Processing log is not getting updated.
What might be the problem ? it is getting updated for Send in batch but not for except 4.
2009 Jun 20 9:55 AM
Hi,
Normally it should work with processing option send immediately also.
Try calling the FM TH_IN_UPDATE_TASK before your FM and check.
call function 'TH_IN_UPDATE_TASK'
importing
in_update_task = lv_subrcRegards,
Ankur Parab
2009 Jun 22 6:06 AM
Hi ,
This did not resolve my issue, it is still not getting updated.Worst thing is I am unable to debug it to know the reason.Any inputs ? Is any one there ?
Edited by: Varun on Jun 22, 2009 12:17 PM
2009 Jun 22 7:54 AM
Hi,
To debug; just put a breakpoint on it and in your debugger turn update debuggin on and click the "In background task : Do not process" check box in the debugger in the settings tab.
It should go to your FM. If it goes then your FM will be recorded in SM58.
You can debug your FM from there.
Regards,
Ankur Parab
2009 Jun 22 8:04 AM
The issue is my Program in Form Routine is not getting triggered I have place a break point there and then issued the output but it did not get into my report but I have received email which is my output .
2009 Jun 22 8:24 AM
Hi,
What does your subroutine and FM do exactly?
Can you give more details?
Regards,
Ankur Parab
2009 Jun 22 8:29 AM
Hi,
It will fetch all the delivery details and send an email to the external system.We are receiving the email but the log is not updating.
2009 Jun 22 8:31 AM
2009 Jun 22 8:35 AM
I am updating Log using this form
at every step I am collecting the messages and passing them to this form.
FORM update_nast_log USING p_msgid
p_msgnr
p_msgty
p_msgv1
p_msgv2
p_msgv3
p_msgv4.
* Local data declaration
DATA: lv_msgid LIKE sy-msgid,
lv_msgnr LIKE sy-msgno,
lv_msgty LIKE sy-msgty,
lv_msgv1 LIKE sy-msgv1,
lv_msgv2 LIKE sy-msgv2,
lv_msgv3 LIKE sy-msgv3,
lv_msgv4 LIKE sy-msgv4.
* clear all the local variables
CLEAR:lv_msgid,
lv_msgnr,
lv_msgty,
lv_msgv1,
lv_msgv2,
lv_msgv3,
lv_msgv4.
* move message ID,number,msg type and the messsages
* to local variables
MOVE: p_msgid TO lv_msgid,
p_msgnr TO lv_msgnr,
p_msgty TO lv_msgty,
p_msgv1 TO lv_msgv1,
p_msgv2 TO lv_msgv2,
p_msgv3 TO lv_msgv3,
p_msgv4 TO lv_msgv4.
* Update nast table using nast protocol update
CALL FUNCTION 'NAST_PROTOCOL_UPDATE'
EXPORTING
msg_arbgb = lv_msgid
msg_nr = lv_msgnr
msg_ty = lv_msgty
msg_v1 = lv_msgv1
msg_v2 = lv_msgv2
msg_v3 = lv_msgv3
msg_v4 = lv_msgv4.
ENDFORM. " UPDATE_NAST_LOG
2009 Jun 22 8:39 AM
Hi,
I am sorry but i am getting confused.
If you have written the code to send the mail within a perform which is to be called during update and if you are getting the mail it means that the perform is getting called.
If you want to update the log after this then you should call this perform after sending the email.
So where exactly is the problem which you are facing?
Regards,
Ankur Parab
2009 Jun 22 8:43 AM
Yes, what we are doing is we are updating an internal table at every point(this is being done in the FM), where we want to update the log then passing this itab to the return of the FM after coming out of the FM we are looping at this return table of the FM and then passing the entries to the above perform.
2009 Jun 22 8:49 AM
Hi,
I am assuming that your code is like this.
PERFORM xxxxxxxx ON COMMIT.
In this perform you are calling the FM to send the delivery to email.
Now the PERFORM to update the log should be called within the FM and not after the FM.
This is because your FM will be started as a separate TASK. So you wont get any return table from it and your log will not be added.
So call the code to update the log within your FM itself.
Regards,
Ankur Parab
2009 Jun 22 9:16 AM
2009 Jun 22 9:20 AM
Hi Varun
Incase you have your logic for sending the email within the FM and it is working fine then do one thing.
Go into debugging.
Set the checkbox for "In background task : Do not execute" in the settings tab.
Now your FM will not be called. It will be saved as an LUW in SM58.
Debug your LUW from there. Now check that if you are updating the LOG within the FM then why they are not getting updated.
Regards,
Ankur Parab
2009 Jun 22 9:45 AM
How to go into the Debugging mode, as soon as I issue output for immediate(4) in vl02n and when I open it, it is already processed.We are using SAP 4.7 version.Any inputs ?
Edited by: Varun on Jun 22, 2009 2:30 PM
2009 Jun 22 10:28 AM
Hi,
Just before you click on SAVE; activate debugging.
Activate update debugging also. Click the check box and save the settings.
Press F8 and continue. When a new window opens up for update debugging in that also check the check box and save the settings and press F8.
Regards,
Ankur Parab
2009 Jun 22 12:17 PM
Hi Varun
Did this help you ? Is the problem solved?
Regards,
Ankur Parab
2009 Jun 22 1:22 PM
What is the importance of this
Perform ****************** on commit
in perform
Call Function *********** in Background task as separate unit,once I removed this I am etting the email and also processing log is also getting updated, what happens if I remove this ?
2009 Jun 22 1:34 PM
Hi,
When you call a perform on commit it means that the perform would be called after commit work happens i.e. in the update task.
when you call a FM in background task as a separate unit it means that the FM will be called as a seperate LUW once the commit occurs.
Regards,
Ankur Parab
2009 Jun 22 1:46 PM
So there will not be much difference apart from some performace prob, am I correct ? If yes then why is the log gettting updated in this mode, I also tried in Debug but once it is coming to my FM, although I pressed f5 it is executing the FM with out returning any values, so I had to remove them, my concern is will there be any unseen issues if I remove them.
| User | Count |
|---|---|
| 6 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |