‎2010 Apr 28 8:25 PM
Hi ,
I created a BDC program for data upload using CALL TRANSACTION statement. (No open group and close group)
Program is initially designed running in foreground(no screen display) and not a batch job.
program logic..
Loop ITAB
CALL TRANSACTION ...using bdcdata
MESSAGES INTO messtab.
IF MESSTAB - NO ERRORS - If the previous record created successfully
THEN CONTINUE NEXT RECORD IN THE LOOP.
ELSE.
SKIP executing the next records with same material in the ITAB loop . And continue with different material record from ITAB loop.
ENDIF.
ENDLOOP.
This is my current program logic.
My question - If I want to run this program as BATCHMODE - What are the changes I have to do in my program ?
Basically how I can run this program in BATCHMODE?
Thanks in advnace for your time. I appriciate your response.
Edited by: Murali M on Apr 28, 2010 9:25 PM
‎2010 Apr 28 8:32 PM
‎2010 Apr 28 8:56 PM
Hi Rob,
1. If we use call transaction (no session create) is it going to work if we run as a background job program?
2. I tried - I executed as background job and some reason it is failing - When I check spool results output results - in message tab it is not having any errors but at the same time it is not returning the document number-basically record not created and failing.
If I run the same data in foreground with out batch then it will created the record.
Thanks,
M.
‎2010 Apr 28 9:00 PM
I have done this many times with no problem; however, some transactioons are not sutable for batch input because they do not run in the backgraound (no GUI). What transaction are you executing?
Rob
‎2010 Apr 28 9:41 PM
‎2010 Apr 28 10:13 PM
As there is no error message, it probably stopped when it encountered a commit work. You should use CALL TRANSACTION ... OPTIONS FROM <structure>, set <structure>-racommit = 'X' to tell SAP to continue after commit work.
‎2010 Apr 28 10:38 PM
Hi Rossi,
Thanks for the reply.
Yes I tried now that options also.
options-RACOMMIT = 'X'.
but still its doing same thing.. - no error messages in messagetab and document not created.
First thing how to find out it is triggering the call transaction or not? Because if it went throught the transaction then there should be error message or document should be created right?
Thanks.
M
Edited by: Murali M on Apr 28, 2010 11:38 PM
‎2010 Apr 28 10:48 PM
> First thing how to find out it is triggering the call transaction or not?
To make sure, add breakpoint to your program, then run it in SM37 with JDBG okcode
> Because if it went throught the transaction then there should be error message or document should be created right?
It should but there may be bugs
‎2010 Apr 28 11:08 PM
Hi Rossi ,
If I goto debug mode from SM37 with JDBG okcode It is working fine no issues. Document is creating.
I think if I am in debug mode that means it is running in foreground right? not a batch job thats why may be it is working.? ??
Thanks.
M
‎2010 Apr 28 11:25 PM
What we are looking for is why the program behaves differently in background. There are a few possibilities that the standard program tests the context: sy-batch (it is set to X in background, or if we run the job using JDBG, it's what we checked), sy-binpt (it is always set to X in both dialog and in background). Recently, someone told us that using option-nobinpt = 'X' (sy-binpt will then have space value) had solved the issue, maybe you can try.
About what Rob said previously, if a control is displayed, the program should dump (CNDP_ERROR or something like that), but maybe
Another possibility is that the cursor is not positioned explicitly (BDC_CURSOR "field") although you use a command which is based on cursor position: in dialog, it will go to a default position, but in background it does not.
‎2010 Apr 29 6:54 AM
Hi,
When I was doing recording in SHDB for this transaction C201 I selected 'Not a Batch input session' option in SHDB becuase for all other options one of the screen was showing different comparing with actual screen in C201 (second screen).
So in my program I already have this code.
option-nobinpt = 'X'
This one also not working. Any ideas how to solve this issue?
Thanks.
M
‎2010 Apr 29 8:48 AM
Maybe the program simply tests if there is a GUI connection (function module GUI_IS_AVAILABLE for example), and behaves differently. There can be many cases I think.
If you want to make sure what the problem is, you can do a trace of all procedure calls, and compare them between dialog and background. You can achieve it using SE30, use option "no aggregation" so that to get the list of all procedure calls. For the interactive call, it's easy. For the background job, you should use the "schedule for user/service" button. See [this blog for more information|http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/17050] [original link is broken] [original link is broken] [original link is broken];.
Then, when you understand exactly what happens, you can decide the right actions.
‎2010 Apr 29 2:20 PM