04-11-2017 3:04 PM
Hi All,
I am posting document via FB60 and we are getting warning when posting date and invoice date are in different fiscal year.
But when i use the FM DOCHEADER_PERIOD_FIND_CHECK standalone in custom program, it is throwing error for the above case.
FB60 also calls the same FM.
What could be the reason for this FM to behave differently in FB60 and custom program.
The passing parameters are same in both the cases. i also checked if there is any global variable being used in case of FB60 which makes it as warning instead of error. but there is none.
Thanks
Seema
04-11-2017 6:17 PM
04-11-2017 7:00 PM
04-12-2017 6:22 AM
04-12-2017 5:03 PM
Hi Horst,
Yes I found the position where it is throwing the error, it is written as W193 and throwing error.
Thanks
Seema
04-12-2017 5:10 PM
Now it is clear.
The function module sends a message and the system behavior after sending a message is context sensitive.
I bet, you call the FM in a context, where a warning is sent as an error.
04-12-2017 8:20 PM
So my custom program is a context from where this FM is being called.
Only list processing can convert warning into error as per the above link.
I want to understand one more thing that when we call this FM stand alone then also it is being shown as error.
Thanks
04-12-2017 9:12 PM
In ABAP there is no "stand alone". All statements are executed in a context.
All possible contexts during dialog programming are listed in.
04-13-2017 8:32 AM
"Only list processing can convert warning into error as per the above link."
No, not only list processing. Also START-OF-SELECTION and other reporting events. And now guess, where the test call of SE37 is executed (or debug it, to see it) ...
04-18-2017 3:39 PM
By stand alone I meant, when FM is being executed alone not called from any program.
04-18-2017 5:21 PM
You cannot execute an FM alone. Of course it is always called from a program. What else is the function builder but an ABAP program? As I said, set a breakpoint in any FM, execute it "standalone", and look at the callstack.