BDC Session in background
Hi...
I write a BDC Program using Session method.
Now the requirement is , it should be run every 1 hour in background..
Can U Please tell me the procedure to do this background process.
Thanks in advance
Ganesh Reddy
Hello,
Search in sap formus you will find the options
https://www.sdn.sap.com/irj/scn/advancedsearch?cat=sdn_all&query=bdcSessioninbackground+&adv=false&sortby=cm_rnd_rankvalue
Similar Messages
-
URGENT - HOW TO PROCESS A BDC SESSION (IN BACKGROUND) FROM INSIDE A REPORT
Hi All,
I have a requirement wherein I need to create a BDC session for mass update(from file) of one transaction and check if at all that update has taken place and proceed with the same session for another transaction.
For this I need to know how to process the session in background in a report, so that if the processing is done, the next set of data to update a different transaction can happen.
All inputs are welcome and highly valuable to me.
If someone is unable to intrepret this, I'll detail it again.
Thanks in advance,
Vaishnavi VaradarajanHi,
1.Use RSBDCDRU is an exe pg.With this u can download the logs into local file.
2.It will create the spool request .from there u can download or print.
OtherWise:
Use the code from the link below. U need to provide the session queue id as input and it will download the log to an excel file. U can change it to ur reqmt.
Re: BDC
regards
kiran -
Updating a DB table by a BDC session in background
Hi,
I need to update a DB table with records using a BDC session. I need to run this session in background. But the Error Log I'm getting suggests that Table Maintenance is required for the same.
Note that I can very well insert records in this table thru se11 and also by running the session in foreground.
Is there any work-around for this issue?
Thanks.Hi
If at all you are using any DOWNLOAD and UPLOAD related function modules you can't run the BDC program in the background.
If it is a Z table update you can create the table maintenance generator.
other wise you can do it.
You can run session in background.
Reward points if useful
Regards
Anji -
Process bdc session in Background
Hi all,
I have created a BDC Session, Now i want to process it in Foreground not in Background.
I know taht we use report RSBDCSUB for background processing but don't know the procedure for Forground.
Sugess.
Points will be sured for valuable answers.
Thanks
Sanket sethihi,
if you want it to be done by program then try this which is done through program
TABLES: LFA1,
RF02K.
TYPES: BEGIN OF TY_ITAB,
LIFNR LIKE RF02K-LIFNR,
KTOKK LIKE RF02K-KTOKK,
NAME1 LIKE LFA1-NAME1,
SORTL LIKE LFA1-SORTL,
LAND1 LIKE LFA1-LAND1,
SPRAS LIKE LFA1-SPRAS,
END OF TY_ITAB.
DATA: T_ITAB TYPE TABLE OF TY_ITAB,
W_ITAB TYPE TY_ITAB.
DATA: I_BDCDATA TYPE TABLE OF BDCDATA,
WA_BDCDATA TYPE BDCDATA.
DATA : ITAB1 LIKE ALSMEX_TABLINE OCCURS 0 WITH HEADER LINE.
DATA : JOBNAME(32) TYPE C,
JOBCOUNT(8) TYPE C.
DATA: R1 TYPE I VALUE 1,
C1 TYPE I VALUE 1,
R2 TYPE I VALUE 4,
C2 TYPE I VALUE 8,
FILEPATH LIKE RLGRAP-FILENAME.
SELECTION-SCREEN: BEGIN OF BLOCK B1.
PARAMETERS:P_SRCFIL LIKE RLGRAP-FILENAME.
SELECTION-SCREEN: END OF BLOCK B1.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_SRCFIL.
PERFORM SELECT_FILE USING P_SRCFIL.
START-OF-SELECTION.
FILEPATH = P_SRCFIL.
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
FILENAME = FILEPATH
I_BEGIN_COL = 1
I_BEGIN_ROW = 1
I_END_COL = 8
I_END_ROW = 4
TABLES
INTERN = ITAB1.
PERFORM ORGANIZE_UPLOADED_DATA.
CALL FUNCTION 'BDC_OPEN_GROUP'
EXPORTING
CLIENT = SY-MANDT
DEST = FILLER8
GROUP = 'XK01'
HOLDDATE = FILLER8
KEEP = 'X'
USER = SY-UNAME.
LOOP AT T_ITAB INTO W_ITAB.
PERFORM BDC_DYNPRO USING 'SAPMF02K' '0100'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'RF02K-KTOKK'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'/00'.
PERFORM BDC_FIELD USING 'RF02K-LIFNR'
W_ITAB-LIFNR.
PERFORM BDC_FIELD USING 'RF02K-KTOKK'
W_ITAB-KTOKK.
PERFORM BDC_DYNPRO USING 'SAPMF02K' '0110'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'LFA1-SPRAS'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'/00'.
PERFORM BDC_FIELD USING 'LFA1-NAME1'
W_ITAB-NAME1.
PERFORM BDC_FIELD USING 'LFA1-SORTL'
W_ITAB-SORTL.
PERFORM BDC_FIELD USING 'LFA1-LAND1'
W_ITAB-LAND1.
PERFORM BDC_FIELD USING 'LFA1-SPRAS'
W_ITAB-SPRAS.
PERFORM BDC_DYNPRO USING 'SAPMF02K' '0120'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'LFA1-KUNNR'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'/00'.
PERFORM BDC_DYNPRO USING 'SAPMF02K' '0130'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'LFBK-BANKS(01)'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=ENTR'.
PERFORM BDC_DYNPRO USING 'SAPMF02K' '0380'.
PERFORM BDC_FIELD USING 'BDC_CURSOR' 'KNVK-NAMEV(01)'.
PERFORM BDC_FIELD USING 'BDC_OKCODE' '=ENTR'.
CLEAR W_ITAB.
CALL FUNCTION 'BDC_INSERT'
EXPORTING
TCODE = 'XK01'
TABLES
DYNPROTAB = I_BDCDATA.
REFRESH I_BDCDATA.
ENDLOOP.
CALL FUNCTION 'BDC_CLOSE_GROUP' .
JOBNAME = 'JOB'.
CALL FUNCTION 'JOB_OPEN'
EXPORTING
DELANFREP = ' '
JOBGROUP = ' '
JOBNAME = JOBNAME
IMPORTING
JOBCOUNT = JOBCOUNT
CHANGING
RET =
EXCEPTIONS
CANT_CREATE_JOB = 1
INVALID_JOB_DATA = 2
JOBNAME_MISSING = 3
OTHERS = 4
IF SY-SUBRC = 0.
MESSAGE I000(0) WITH 'SUCCESSFUL JOB OPENING'.
SUBMIT RSBDCSUB
WITH MAPPE = 'XK01'
WITH VON = SY-DATUM
*WITH Z_VERARB = 'X'
WITH ERR = 'X'
WITH LOGALL = 'X'
AND RETURN EXPORTING LIST TO MEMORY.
ENDIF.
CALL FUNCTION 'JOB_CLOSE'
EXPORTING
JOBCOUNT = JOBCOUNT
JOBNAME = JOBNAME
EXCEPTIONS
CANT_START_IMMEDIATE = 1
INVALID_STARTDATE = 2
JOBNAME_MISSING = 3
JOB_CLOSE_FAILED = 4
JOB_NOSTEPS = 5
JOB_NOTEX = 6
LOCK_FAILED = 7
INVALID_TARGET = 8
OTHERS = 9
IF SY-SUBRC <> 0.
MESSAGE I000(0) WITH 'JOBCLOSE'.
ENDIF.
*& Form ORGANIZE_UPLOADED_DATA
text
--> p1 text
<-- p2 text
FORM ORGANIZE_UPLOADED_DATA .
SORT ITAB1 BY ROW COL.
LOOP AT ITAB1.
CASE ITAB1-COL.
WHEN 1.
W_ITAB-LIFNR = ITAB1-VALUE.
WHEN 2.
W_ITAB-KTOKK = ITAB1-VALUE.
WHEN 3.
W_ITAB-NAME1 = ITAB1-VALUE.
WHEN 4.
W_ITAB-SORTL = ITAB1-VALUE.
WHEN 5.
W_ITAB-LAND1 = ITAB1-VALUE.
WHEN 6.
W_ITAB-SPRAS = ITAB1-VALUE.
ENDCASE.
AT END OF ROW.
APPEND W_ITAB TO T_ITAB.
CLEAR W_ITAB.
ENDAT.
ENDLOOP.
ENDFORM. " ORGANIZE_UPLOADED_DATA
*& Form select_file
text
-->P_P_SRCFIL text
FORM SELECT_FILE USING P_SRCFIL.
CALL FUNCTION 'F4_FILENAME'
EXPORTING
PROGRAM_NAME = SYST-CPROG
DYNPRO_NUMBER = SYST-DYNNR
FIELD_NAME = ' '
IMPORTING
FILE_NAME = P_SRCFIL
ENDFORM. " select_file
*& Form bdc_dynpro
text
-->P_0131 text
-->P_0132 text
FORM BDC_DYNPRO USING PROGRAM LIKE BDCDATA-PROGRAM DYNPRO LIKE BDCDATA-DYNPRO.
CLEAR WA_BDCDATA.
WA_BDCDATA-PROGRAM = PROGRAM.
WA_BDCDATA-DYNPRO = DYNPRO.
WA_BDCDATA-DYNBEGIN = 'X'.
APPEND WA_BDCDATA TO I_BDCDATA.
ENDFORM. " bdc_dynpro
*& Form bdc_field
text
-->P_0136 text
-->P_0137 text
FORM BDC_FIELD USING FNAM LIKE BDCDATA-FNAM FVAL TYPE ANY .
CLEAR WA_BDCDATA.
WA_BDCDATA-FNAM = FNAM.
WA_BDCDATA-FVAL = FVAL.
APPEND WA_BDCDATA TO I_BDCDATA.
ENDFORM. " bdc_field
reward if useful,
thanks and regards -
How to Resubmit a BDC session in the background
If it is in call transaction use the mode 'N'
If it is session method use the submit the program rsbdcsub via selection screen .
give ur variant name.
Regards,
Venkat
Edited by: venkat reddy on May 2, 2008 7:14 AM -
Resubmitting a BDC session in the background
Hi,
How to Resubmit a BDC session in the background
Thanks,Hi,
If you need to submit a BDC session in the background you can use report RSBDCSUB. It takes the bBDC session name as input and will run it through the system again for you in the background.
reward if helpful...
Sowjanya. -
Batch input session in background BDC
Hi to all,
Please clarify me about below BDC point.
Call to the transaction should be in background through batch input session. does It mean that we have to use session method and call this in back ground through RSBDCSUB, is this approach is correct or some thing else i nend to do.Please tell me briefley.
I want to track all the errors, how to track the errrors with out using call tranaction.
could any one help me on this issue please.
Regards
RaadhaHi,
as per your approach is correct in BDC session method ,in session method generally you want run the bdc in backgroung using in RSBDCSUB is used for scheduling .
in program after writing bdc_close_group ,just use submit statement and schedule the background.
and generally in session method execute the program and going to the sm35 selcting particular session name manually processing that session,when schedule rsbdcsub it is directly going to the background screen ,then give the session name and run the program.
Regards,
Madhu -
BDC session error handling for IW41 transaction
Hi,
When the order confirmation is done by BDC session program, it is executed without any error. But if we do the same process manually, it is showing the error message as 'Posting period is Locked for 001 2012'. My question here is why this is not happening when it is executed through bdc session program.
Anyone can help us?
Thanks,
GunaIt is difficult to believe that you would get good results from background BDC process and error in foreground using same transaction and exactly the same data. Beyond that, why is month 1 of the current year locked? Are you absolutely sure that:
BDC works correctly? maybe does NOT and the errors have been missed or ignored?
Data is precisely the same for both BDC sessions?
Same transaction is called?
Sounds silly perhaps, but I have to believe that something is very different between the two sessions. -
SM35 Re-processing of Incorrect/Error session in Background Mode
Hi all,
I am trying to reprocess a session in SM35 which is in Error status. Here I am a facing an issue, if I reprocess this session in background mode then it says that Batch input data is not available for a screen which is already processed. Ideally it should start from the screen where it threw error in the first run. If I select mode as Foreground or Display error then session is getting processed correctly.
Note:
If the session is in Ready to Process state then processing in background works perfectly fine. Has anyone came across this problem ?
Has anyone tried reprocessing Incorrect Session in background mode ??????
Regrads,
AntonyThanks Sandra,
Indeed I understood the problem. And the problem is that transaction KEBC is always executed correctly & since its processed correctly its removed from the BDC Queue
Here transaction KEBC, sets a Memory Parameter, and transaction KEU2, first checks whether the memory parameter is initial, if found intial it pops-up a screen and makes the user enter it. In my case KEBC always run successfully
As you rightly suggested when session is in error, transaction KEBC is not getting called again to set the memory parameter & its throwing the pop-up from the transaction KEU2 to be entered by the user. ( BDCDATA currently dosent handle this Pop-up).
I could have omitted the KEBC transaction, but handling this pop-up from transaction KEU2 becomes tricky since it will only pop-up if the memory parameter is initial. And unfortunately Pop-up is the first screen in the sequence for transaction for KEU2 & nothing can be done in coding level to call KEU2 with the pop-up in all scenarios(Even when Memmory varaible is set) !
So I am kind of in a dilema, how to handle this? What I am suggesting to the Functional consultant is that let the session be only run in background mode (as it will be always in a new internal session memory variable will always be inital ) & I will record this pop-up in my BDC omitting transaction KEBC.
Do you have anyother solution for this?
Or is there any option to re process even the successfull transacations ? -
Processing the session in background
Hi experts,
I have created a BDC program in session method. Once i executed the program, it creates a session name.
Then i select the corresponding session name in SM35 and process it in background.
But i dont want to goto SM35 and process the session explicitely.
How to process the session in background without going to SM35 tcode?
Regards,
ShanthiHi shanti,
check with below code... but one point keep remember. when your trying to post a question check SDN and if your not succeeded then only post the question. so it will avoid the duplicate postings on the same topic i am right ?.
Hi,
Use this sample code
DATA: RUNTIME TYPE I. "Runtime
DATA: GROUP LIKE APQI-GROUPID, " Mappenname
BDCIMMED LIKE RFIPI-BDCIMMED, " nur BDC: sof. Abspielen
BDCSTRTDT LIKE TBTCJOB-SDLSTRTDT, "nur BDC: Startdatum
BDCSTRTTM LIKE TBTCJOB-SDLSTRTTM. "nur BDC: Startzeit
form mappe_abspielen_im_batch.
GET RUN TIME FIELD RUNTIME.
JOBNAME = 'RFEBFD00-FIEB'.
JOBNAME+14 = RUNTIME.
eak-point.
CALL FUNCTION 'JOB_OPEN'
EXPORTING
JOBNAME = JOBNAME
JOBGROUP = 'FIEB'
IMPORTING
JOBCOUNT = JOBCOUNT
EXCEPTIONS
CANT_CREATE_JOB = 01
INVALID_JOB_DATA = 02
JOBNAME_MISSING = 03.
IF SY-SUBRC NE 0.
MESSAGE E015 RAISING SESSION_NOT_PROCESSABLE.
ENDIF.
SUBMIT RSBDCSUB AND RETURN
USER SY-UNAME
VIA JOB JOBNAME NUMBER JOBCOUNT
with mappe = group
WITH MAPPE = BI-NAME
WITH VON = SY-DATUM
WITH BIS = SY-DATUM
WITH Z_VERARB = 'X'.
BDCSTRTDT = SY-DATUM.
BDCSTRTDT = SPACE.
BDCSTRTTM = SPACE.
BDCIMMED = 'X'.
bdcstrttm = runtime.
CALL FUNCTION 'JOB_CLOSE'
EXPORTING
JOBNAME = JOBNAME
JOBCOUNT = JOBCOUNT
STRTIMMED = BDCIMMED
SDLSTRTDT = BDCSTRTDT
SDLSTRTTM = BDCSTRTTM
EXCEPTIONS
CANT_START_IMMEDIATE = 01
JOBNAME_MISSING = 02
JOB_CLOSE_FAILED = 03
JOB_NOSTEPS = 04
JOB_NOTEX = 05
LOCK_FAILED = 06.
IF SY-SUBRC NE 0.
MESSAGE E015 RAISING SESSION_NOT_PROCESSABLE.
ENDIF.
CLEAR BDCIMMED.
BDCSTRTDT = SPACE.
BDCSTRTTM = SPACE.
~lingannna -
Error in BDC session processing
hi all,
I am running the BDC session method. while running the session the interface throws warning message. If it gives more than one warning message in background the session goes into error. is there any way to skip these and still continue the processing of session in backgroundPraveen,
By default all the warnings are suppressed irrespective of the number of warnings.
You must be encountering a error not a warning
Regards,
Ravi
Note : Please mark the helpful answers -
BDC Session Saves Data Only in Foreground
I have created a bdc program to create an SM35 session of CA02. The wierd thing is that the session will run in background with no errors, but the data is not updated. If I run the session in foreground the data is updated. Have I overlooked something simple?
To see what is going on, I commented out the save at the end to force it to error out. If I run the session in foreground the data is changed. If I run it in display errors only mode, the data is not changed. So it seems not to have anything to do with the save at the end. Perhaps it is now appropriate to post some of the code.
After the data file is uploaded into the itab and the bdc group has been created, for each routing group I do the following:
PERFORM dynpro USING:
* *** Initial Screen ***
'X' 'SAPLCPDI' '1010',
' ' 'RC271-PLNNR' gk_rec-groupnum,
' ' 'BDC_OKCODE' '/00',
* *** Header Overview ***
'X' 'SAPLCPDI' '1200',
' ' 'BDC_OKCODE' 'MTUE'. "open material allocation screen
Then for each material allocation the data file says to delete:
PERFORM dynpro USING:
* *** Material Allocation ***
'X' 'SAPLCZDI' '1010',
' ' 'RC27X-ENTRY_ACT' gv_entry, "gv_entry holds row number to delete
' ' 'BDC_OKCODE' 'ENT1', "position button
'X' 'SAPLCZDI' '1010',
' ' 'BDC_CURSOR' 'MAPL-MATNR(01)', "place cursor on the line to delete
' ' 'BDC_OKCODE' 'LOE', "delete line
'X' 'SAPLSPO1' '0100',
' ' 'BDC_OKCODE' 'YES'. "confirm dialog
then at the end of the session:
PERFORM dynpro USING:
'X' 'SAPLCZDI' '1010',
' ' 'BDC_OKCODE' 'BACK', "leave material allocation screen
'X' 'SAPLCPDI' '1200',
' ' 'BDC_OKCODE' 'BU'. "save
Then, I insert into the bdc session using tcode ca02. All this given the following subroutine:
FORM dynpro USING p_dynbegin TYPE any p_name TYPE any p_value TYPE any.
CLEAR gk_bdc_tab.
IF p_dynbegin = 'X'.
MOVE: p_name TO gk_bdc_tab-program,
p_value TO gk_bdc_tab-dynpro,
'X' TO gk_bdc_tab-dynbegin.
ELSE.
MOVE: p_name TO gk_bdc_tab-fnam,
p_value TO gk_bdc_tab-fval.
ENDIF.
APPEND gk_bdc_tab TO gt_bdc_tab.
ENDFORM.
It seems that the cursor isn't specifying the line to delete when run in background. -
Can anybody pls tell me limitations of BDC Session & Call transaction?
hi, Guys, this is srinivas.
How can we deside which method is to(BDC session/ Call transaction)
use to upload data to SAP database?
Can we run Call Transaction in Background?
Which is preferable for bulk data? and Why?
how can we restart Session if any error occurs?
Thanku?Hi,
Hope it helps this......
SAP BDC INTERVIEW QUESTIONS & ANSWERS
1. What is full form of BDC Session?
Batch Data Communication Session.
2. What are the steps in a BDC session?
The first step in a BDC session is to identify the screens of the transaction that the program will process. Next step is to write a program to build the BDC table that will be used to submit the data to SAP. The final step is to submit the BDC table to the system in the batch mode or as a single transaction by the CALL TRANSACTION command.
3. How do you find the information on the current screen?
The information on the current screen can be found by SYSTEM à STATUS command from any menu.
4. How do you save data in BDC tables?
The data in BDC tables is saved by using the field name BDC_OKCODE and field value of /11.
5. What is the last entry in all BDC tables?
In all BDC tables the last entry is to save the data by using the field name BDC_OKCODE and a field value of /11.
6. What is a multiple line field?
A multiple line field is a special kind of field which allows the user to enter multiple lines of data into it.
7. How do you populate data into a multiple line field?
To populate data into a multiple line field, an index is added to the field name to indicate which line is to be populated by the BDC session (Line index).
8. Write the BDC table structure.
BDC table structure
FIELD TYPE DESCRIPTION
Program CHAR (8) Program name of transaction.
DynPro CHAR (4) Screen number of transaction.
DynBegin CHAR (1) Indicator for new screen.
Fnam CHAR (35) Name of database field from screen.
Fval CHAR (80) Value to submit to field.
9. Does the CALL TRANSACTION method allow multiple transactions to be processed by SAP?
No. The CALL TRANSACTION method allows only a single transaction to be processed by SAP.
10. Does the BDC-INSERT function allow multiple transactions to be processed by SAP?
Yes.
11. What is the syntax for CALL TRANSACTION?
CALL TRANSACTION trans .
Three possible entries are there for MODE.
A - Show all screens.
E - Show only screens with errors.
N - Show no screens.
Regards,
V.Balaji
Reward if usefull -
How to overcome view changes in bdc session method using recording ?
how to overcome view changes in bdc session method using recording ?
ex-for mm01 in recording if i selected views basic data1 and basic data2.
i seheduleded for background for after 3 days .
if any body changes views by selecting other views also.
how to overcome this with out programming ?
is there any settings ?Hi,
I am attaching few threads.Hope these will help you.
If there are any error records in session, all those error records will get poulated in log .SM35 and after the session is completed , u can see error records which can be corrected and reprocessed again
We have the structures BDCLD and BDCLM, which will capture the log details inthe session. Firstly, sesssion should be processed. After that log will be created. Then caputure the information into an internal table using BDCLM and BDCLD.
and refer the link.
error correction in bdc session
regards
Madhu -
BDC Error in background 'The difference is too large for clearing'
Hi,
In foreground the BDC session runs perfectly and errors only when the program is running in the background.
In background, the following messages are captured.
Select line items first of all FB05 1 SAPMF05A 0300
163 items were selected FB05 1 SAPMF05A 0710
The difference is too large for clearing FB05 1 SAPDF05X 3100
No batch input data for screen SAPDF05X 3100 FB05 1 SAPDF05X 3100
But, in real BDCDATA contains all the above said screens. Kindly note the above comes as a success message in the background and does not appear in the foreground.
Any response is highly appreciated.
AshishHello Ashish,
I suggest you to run FB05 for clearance for the same data and check if this message is encountered.
Please contact your functional guy and check the business reasons about this message.
Kindly go through the below links
http://scn.sap.com/thread/985136
https://scn.sap.com/thread/472069
Thanks
Maybe you are looking for
-
I have a late 2009 iMac (2.93 Ghz Intel Core Duo, 4GB of ram, model id is 9.1) running Lion right now. I upgraded it all the way from Leopard using the standard keep-all-your-apps-and-settings way. After looking at the hardware requirements for Mount
-
Image size limit in Lr 5.3-64 and Ps CC-64
What is image size limit in Lightroom 5.3 - 64 bit And Ps CC - 64 bit?
-
How and when does table SWIWIOBJCT being updated / populated with workitem
Hi Experts, I am currently debugging an issue wherein a Invoice Workflow is being displayed in the Purchase Order Workflow Overview. I debugged this and found out that this is because there are entries being selected from table SWIWIOBJCT and this wi
-
HT5891 I upgraded to mavericks and my photo booth just get dark. HELP
I upgraded to mavericks just right now and my photo booth dosnt work, is too dark and pictures are really dark, I tried all but no help, please help me.
-
What happened to the cover flow with the album artwork?? is it somewhere on the new itunes version??