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: 

how to know from what program is execute POSTING_INTERFACE_DOCUMENT

Former Member
0 Kudos

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

8 REPLIES 8

Former Member
0 Kudos

Hi Maria,

Can you please elaborate your requirement.

Regards,

Kannnan

0 Kudos

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

0 Kudos

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

former_member195431
Participant
0 Kudos

Hello Maria,

You can put break point in both and check which one is being executed in the BTE

Thanks

0 Kudos

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

0 Kudos

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

0 Kudos

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

raymond_giuseppi
Active Contributor
0 Kudos

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