Application Development and Automation 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: 
Read only

Regarding Finding the Z program name when processing session

Former Member
0 Likes
551

Hi All,

I have a BDC program which creates a session in SM35.In Bdc program we have used the tcode F-04.

I have an requirement that when I pass an FI Document to F-04 it ll display all line items under that document and if same document number present for other year which are not cleared are also get displayed.So i have to restrict it to current year and enhancement for same is done.But this functionality should carry out only if transaction is called by Z program.

So, can anyone help me with giving logic to find the Z program name from which session is created while processing it.

Thanks&Regards,

Sneha Kumari

3 REPLIES 3
Read only

brad_bohn
Active Contributor
0 Likes
516

Why don't you mark a document header field or a document text from the Z-program and read the value in the enhancement?

Read only

Former Member
0 Likes
516

Try SY-BATCH field check in your F-04 enhancement. If SY-BATCH field is not initial that means F-04 is running in background session assuming being called from your custom BDC program.

regards,

Pranav

Read only

0 Likes
516

Try SY-BATCH field check in your F-04 enhancement. If SY-BATCH field is not initial that means F-04 is running in background session assuming being called from your custom BDC program.

That's a bad assumption - and what happens if the user runs the session in foreground? SY-BINPT is much better but still not a good idea...