2009 Mar 27 3:33 AM
Hello Experts,
I have developed on Z report and from this report BDC for Transaction CO11 is runnning using CALL TRANSACTION statement.
On Selection screen there is a option for selecting the BDC mode either in Background or Forground or Error mode.
My question is:- how do I recognize this selected BDC mode in the function exit ZXMBCU02.
This exit triggers when transaction CO11 runs.
Because based on the selected BDC mode i have to apply some logic in this exit.
Please suggest.
Regards,
Jagesh
2009 Mar 27 3:48 AM
Hi,
You can check the value of system variable:
SY-BATCH-Will give you is program is running in the
background or not.
Hope it helps
Regards
Mansi
Hello Experts,
I have developed on Z report and from this report BDC for Transaction CO11 is runnning using CALL TRANSACTION statement.
On Selection screen there is a option for selecting the BDC mode either in Background or Forground or Error mode.
My question is:- how do I recognize this selected BDC mode in the function exit ZXMBCU02.
This exit triggers when transaction CO11 runs.
Because based on the selected BDC mode i have to apply some logic in this exit.
Please suggest.
Regards,
Jagesh
2009 Mar 27 3:39 AM
2009 Mar 27 3:48 AM
Hi,
You can check the value of system variable:
SY-BATCH-Will give you is program is running in the
background or not.
Hope it helps
Regards
Mansi
2009 Mar 27 4:41 AM
Hi Mansi,
Thanks for your reply.
I have used the same SY-BATCH in the exit ZXMBCU02 but in debugging I found its value ' ' in both the cases.
Here my Report runs online and within the Program BDC for CO11 is running either in Background or Foreground mode as per the radio button selection.
So thats why i am confused in using the SY-BATCH system field.
Please suggest.
Regards
Jagesh
2009 Mar 27 5:09 AM
Hi Jagesh...
You can do the following..
1. Export the Batch Input Mode in to ABAP memory using the EXPORT statement.
2. Import that value in the user exit.
3. To execute your code only if its batch input mode, use the field SY-BINPT.
You can also check if this structure "BDCRUN" is used in that program, b'cas this is contained in the VA01 an VA02 transacation, this would contain all the data.
CALL FUNCTION 'BDC_RUNNING'
IMPORTING
bi_info = bi_info
EXCEPTIONS
OTHERS = 1.
bi_info will contain all the data.
GET PARAMETER ID 'SD_BACKGROUND_DEBUG' FIELD background_debug.
Best Regards,
Pradeep.
2009 Mar 27 8:32 AM
Hi Pradeep,
I have used this FM BDC_RUNNING and it is working fine.
Thanks for your suggestion and I am closing this Thread now.
Regards,
Jagesh
2009 Mar 27 3:55 AM
Hi Jagdish,
As Kritesh and Mansi told, SY-BATCH is the most appropriate way to know whether your program is running in Background or Foreground Mode.
Moreover you have mentioned that in your selection screen there is an option to choose between forground and background. That could be useful if it is used to decide whether to create a session and schedule it ( if background is chosen ) or call transaction and do it right away (if Foreground is chosen ). If it used to decide whether it is currently running in Foreground/ background by specifying variant, then it is wrong.
Guess SY-BATCH Should solve the requirement.
If resolved, please close the issue becoz posts marked answered are more useful while searching tomorrow with similar requirement.
Thanks.
2009 Mar 27 8:33 AM
U can do it in 2 ways ;
1) append a new field(CI) in any strucure and pass a flag to the exit for sy-batch(ie back ground)
check the flag in the exit and do ur code.
2)Or export to memory and u can do it (not recomended)..
Regards
Anoop Chandran
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |