Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

DOCHEADER_PERIOD_FIND_CHECK behaving differently in FB60 and standalon or custom program

ssharma28
Participant
0 Kudos

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

10 REPLIES 10

horst_keller
Product and Topic Expert
Product and Topic Expert

Debug it ...

0 Kudos

Thats what i did and got to know about this FM.

horst_keller
Product and Topic Expert
Product and Topic Expert
0 Kudos

And did you find the position where the error is thrown?

0 Kudos

Hi Horst,

Yes I found the position where it is throwing the error, it is written as W193 and throwing error.

Thanks

Seema

horst_keller
Product and Topic Expert
Product and Topic Expert
0 Kudos

Now it is clear.

The function module sends a message and the system behavior after sending a message is context sensitive.

https://help.sap.com/http.svc/rc/abapdocu_751_index_htm/7.51/en-US/index.htm?file=abenabap_messages_...

I bet, you call the FM in a context, where a warning is sent as an error.

0 Kudos

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

horst_keller
Product and Topic Expert
Product and Topic Expert
0 Kudos

In ABAP there is no "stand alone". All statements are executed in a context.

All possible contexts during dialog programming are listed in.

https://help.sap.com/http.svc/rc/abapdocu_751_index_htm/7.51/en-US/index.htm?file=abenabap_message_d...

horst_keller
Product and Topic Expert
Product and Topic Expert
0 Kudos

"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) ...

0 Kudos

By stand alone I meant, when FM is being executed alone not called from any program.

horst_keller
Product and Topic Expert
Product and Topic Expert
0 Kudos

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.