04-10-2015 12:00 PM
Hi,
I need to know where i am calling the posting_interface_document FM or the call transaction FB01. I need to know in which program is the sentence because when we créate a document AE from a standar transaction we need to not allow to create the document, but when is created from a Z transaction we need to allow it. In the Z programs we do call transacton or use the posting_interface_document FM that starts a new LUW.
Thanks,
María
04-10-2015 12:08 PM
Hi Maria,
Can you please elaborate your requirement.
Regards,
Kannnan
04-11-2015 8:47 AM
Hi Kannan,
sorry. I try to explain better. I have a Z program in which I cal the posting_document_interface FM and also I do call tx FB01 and VF01. Then I have BTEs in which I make some checks. I would like to know in the BTE if I'am calling from the Z program or the standard transaction. Is there any way?
I hope now is better explanation.
Regards,
María
04-12-2015 1:52 PM
Hi Maria,
use import/export statement.
Please export to memory id in your z program also post a flag there and import it in BTE.
in Z program
data flag(1).
flag = 'X'.
free memory id '<zprogramname>'.
export flag to memory id '<zprogramname>'.
in BTE.
import flag from memory id '<zprogramname>'.
Regards
Gaurav Ahluwalia
04-11-2015 9:52 AM
Hello Maria,
You can put break point in both and check which one is being executed in the BTE
Thanks
04-12-2015 9:46 AM
HI Rajit,
when I put the breakpoint always say that is the FB01 the transaction. This is because when you make a call transaction starts a new LUW. This is my problema, I was thinking make a import and export sentence, but may be the concurrence can be a problem.
Thanks,
María
04-12-2015 12:25 PM
Is it the "new" debug? if yes, you can find the caller programs in the 'Abap and Screen Stack' under the 'Desktop 2' tab.
Stack - ABAP - Analysis Tools - SAP Library
Regards,
Felipe
04-12-2015 12:28 PM
Hello Maria,
You can write the code "BREAK user_name" wherein user_name is your sap login id - (sy-uname) in the beginning of the Z program and it will be triggered if and when the Z prog is called.
Please let me know if it works
Thanks
04-13-2015 7:37 AM
In your BTE implementing FM (or Validation Exit) you could call FM SYSTEM_CALLSTACK, analyze the call stack looking for your “allowed” programs or FM, if not found, raise an error. Another solution, store some information in memory when using the allowed program, check it at same exits, don't forget to clear/free memory after.
NB: Of course that won't perform in some case, e.g.SM35 execution won't any longer allow identification of the caller but you could try to get field APQI-PROGID from BKPF-GRPID and some date/time fields, RFC execution, etc won't either.
Regards,
Raymond