‎2010 Jul 31 10:11 AM
Hi Experts,
I want to create a function module under FUNCTION EXIT_SAPMIWO0_020.How to access these values into the called function?
I tried it using IMPORT parameters of the called function.But while debugging I am not getting these values.
Can any1 suggest a solution for this problem?
Regards,
Sam.
‎2010 Jul 31 10:28 AM
Hi,
Explain how you have defined the importing parameters in the called function module.
Regards
Vinod
‎2010 Jul 31 10:28 AM
Hi,
Explain how you have defined the importing parameters in the called function module.
Regards
Vinod
‎2010 Jul 31 12:46 PM
Hi Vinod,
I have declared the variable in my function as mentioned below.
I_VIQMEL TYPE VIQMEL
Regards,
Sam.
‎2010 Jul 31 12:54 PM
Hi,
Can you share the code which is used to call the Function module ?
Alternatively, why you need the function module ? Already an include "zxqqmu20" is there in this Enhancement Component. I think you can write the required code within this include. The structure available in EXIT_SAPMIWO0_020 will be available in "zxqqmu20" also.
Regards
Vinod
Edited by: Vinod Kumar on Jul 31, 2010 5:24 PM
‎2010 Jul 31 1:12 PM
Hi Vinod,
My actual requirement is to send an outlook mail to the user along with the notification number.I am using a function which has Remote enable(RFC) module since there is a commit statement inside this function.I called the above function module under include ZXQQMU20 as follows
*CALL FUNCTION 'ZFUN_NAME'
STARTING NEW TASK 'ZML'.*
For sending mail
call method send_request->send.
COMMIT WORK.
SUBMIT rsconn01 WITH mode = 'INT' AND RETURN.
Regards,
Sam
Edited by: sam24 on Jul 31, 2010 2:26 PM
‎2010 Aug 01 8:28 AM
Hi Vinod,
As per ur suggestion I added my code in include zxqqmu20 and removed COMMIT WORK statement.Now I am able to send the mail but it is taking some time(5-6 min) to get delivered.Can we send the notification instantly without using COMMIT WORK.By using COMMIT WORK I am getting an error message.
Pls resolve this problem ASAP.
can it be resolved. by using any BADI's?
Regards,
Sam
Edited by: sam24 on Aug 1, 2010 9:32 AM
‎2010 Aug 01 9:48 AM
Hi,
I don't think the delay is anything related to the COMMIT statement. Check the other setttings related to the relay of mails.
Regards
Vinod
‎2010 Aug 01 9:06 PM
Hi Vinod,
While capturing Notification number using zxqqmu20 I am not getting the notification number since this number is generated after save and i am using the exit before saving.
If i want to capture this number which user exit i have to use?
Regards,
Sam
‎2010 Aug 02 9:14 PM
Hi Vinod,
After sending mail if I click on Start send process using SCOT Tcode,the mail is getting delivered instantly.Otherwise it is taking few minutes to deliver to users outlook.Also the sent item of the mail in outlook is 50 minutes ahead of our system time.Pls suggest a solution for this.
I used BAdi NOTIF_EVENT_SAVE instead of user exit so that i can capture notification number while saving the data.
Regards,
Sam
Edited by: sam24 on Aug 4, 2010 7:11 AM
‎2010 Aug 04 9:29 AM
In their official documentation (sap library), SAP recommends to send mails every X minutes (report RSCONN01 as a background job) if there are many mails sent from SAP system. So, ask your administrator if you can send mails immediately or not. Or maybe he'll agree to reduce the interval.
If your administrator agrees to send mails yourself, then you can submit RSCONN01 yourself (where you placed it, it makes no sense as there is no commit work done yet). Do it after the COMMIT WORK of the standard transaction, by calling it using tRFC in your user exit: CALL FUNCTION 'Z...' IN BACKGROUND JOB, and add AS SEPARATE UNIT so that to not interfere with other possible tRFC calls. Note: tRFC function modules are called asynchronously at the end of the COMMIT WORK.
I recommend that you always use a Z... function module to call RSCONN01, and never call RSCONN01 directly, so that the maintenance is easier if the administrator decides to prevent custom programs from sending mails immediately.
‎2010 Aug 04 10:30 AM
Hi Sandra,
Thanx for ur reply.
Earlier I was using RFC enabled function module for sending the mail under FUNCTION EXIT_SAPMIWO0_020 and the mail was getting delivered instantly.But I was not getting Notification number in this exit.So I tried BAdi.
Here also I am using COMMIT WORK before
SUBMIT rsconn01 WITH mode = 'INT' AND RETURN.
Also the sent item of the mail in outlook is 50 minutes ahead of our system time
Is it the reason for a delay in mail delivery?
How to solve this scenario?
Regards,
Sam
‎2010 Aug 04 10:43 AM
Good explanation on RSCONN01. As usual you keep enlightening me
‎2010 Aug 04 11:37 AM
> Earlier I was using RFC enabled function module for sending the mail under FUNCTION EXIT_SAPMIWO0_020
You were using aRFC (starting new task: it starts immediately and asynchronously), not tRFC (transactional RFC: it starts only at the end of COMMIT WORK).
> and the mail was getting delivered instantly.
It was only because you were using RSCONN01 (preceded by commit of course), not because of the aRFC.
> Here also I am using COMMIT WORK before
> SUBMIT rsconn01 WITH mode = 'INT' AND RETURN.
Well that's very strange it doesn't send the mail immediately! (see my answer below)
Note that it is dangerous (for many reasons I don't need to explain here) to run COMMIT WORK, SUBMIT, and a few other statements, in a BAdI, especially when it's at save time. Prefer to use tRFC as I said (and not the aRFC).
> Also the sent item of the mail in outlook is 50 minutes ahead of our system time
> Is it the reason for a delay in mail delivery?
As you call RSCONN01, the delay can only come from something external to SAP. Check the logs in SCOT, to make sure SAP has sent the mail immediately. In the mail you receive, look at the MIME information in the header of the mail, to check the times at which the mail is transferred from a server to another. Ask your administrator to help you.
‎2010 Aug 05 9:13 AM
Hi Sandra,
Thanx alot for ur valuable reply.I checked in SCOT and found that Scheduled Period for Active and Scheduled Send jobs is set as 10 min.I changed this time period as 1 min and now the mail is getting delivered after each minute.
You suggested not to use COMMIT and SUBMIT RSCONN01 WITH MODE EQ ' INT ' AND RETURN IN BAdi.
I tried to call this code in an RFC enabled function module.But the value is not getting exported to this function even after declaring the variable in IMPORT section of this function.
Can u pls help me to retrieve notification number generated in this BAdi to the function module.
Regards,
Sam
‎2010 Aug 05 10:34 AM
> I tried to call this code in an RFC enabled function module.But the value is not getting exported to this function even after declaring the variable in IMPORT section of this function.
> Can u pls help me to retrieve notification number generated in this BAdi to the function module.
There should be no issue with import parameters (just make sure they are typed identically), I never saw any problem with that. How do you know that the value is not transferred? (Could you also paste your code?) Thx!
‎2010 Aug 05 11:55 AM
1.Make sure your RFC is active and the check box "pass value" is valid.
2.try to call your RFC synchro,see if the import parameter is also blank.
‎2010 Aug 06 4:37 PM
Hi Sandra,
Under method IF_EX_NOTIF_EVENT_SAVE~CHANGE_DATA_AT_SAVE
I am calling RFC enabled function module as follow
CALL FUNCTION 'ZFUN_NAME'
STARTING NEW TASK 'ZMAIL'.
In function ZFUN_NAME,Under IMPORT tab I defined the parameter CS_VIQMEL type VIQMEL.
In source code, I am accessing the value of VIQMEL to a variable as mentioned below
Variable = CS_VIQMEL-QMNUM.
But when I am debugging the code,CS_VIQMEL-QMNUM is displaying blank.
Pls look into the above code and give me a solution.
Regards,
Sam
‎2010 Aug 06 4:55 PM
> CALL FUNCTION 'ZFUN_NAME'
> STARTING NEW TASK 'ZMAIL'.
1) Could you tell me why you still use asynchronous RFC? (instead of transactional RFC as I suggested) Maybe you didn't understand the concepts behind all that, so if asynchronous works for you, then very good. I advise you to read the SAP LUW concept and CALL FUNCTION and RFC documentations, so that you can benefit from the explanations given earlier.
2) Don't tell me that you called the function module without EXPORTING cs_viqmel = cs_viqmel (how do you think the parameter can be passed if you don't pass it! Programming is not kind of magic )
‎2010 Aug 06 5:33 PM
Hi sandra,
My problem is resolved now.
Actually I was not using EXPORTING cs_viqmel = cs_viqmel after function call.
I am using BAdi's for the first time.
thanx alot for ur valuable inputs.
Very very thankful to u.
Regards,
Sam