‎2011 Jan 04 1:49 PM
Hi Experts,
In side the loop, I am calling one Standard program in background job using SUBMIT.
Assume, that loop is having 7 records.
Each time, That STD program (GPDA7C6WM02XYYDQ35NFKAABWAJ002) should update the application server with related records.
Totally 7 times the loop will trigger. So 7 times the application server will get update.*
But my problem is
it is updating the application server only 4 times (randomly 4 updations).
When I see the job in SM37, it is showing 7 job has finished without error.**
When I debug the job in SM37 that time the data getting updated in the application server.**
The std prog Tcode is : GR55.
My code is like this:*
loop at itab.*
CALL FUNCTION 'JOB_OPEN'*
SUBMIT (v_program)*
*WITH $1kokre = p_kokrs*
*WITH $1gjahlj = p_gjahr*
*VIA JOB l_v_name NUMBER l_v_number*
*AND RETURN.*
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'*
CALL FUNCTION 'JOB_SUBMIT'*
CALL FUNCTION 'JOB_CLOSE'*
endloop.
Pls help me out..
regards,
Jeya
‎2011 Jan 04 2:22 PM
You haven't really explained what you're doing. First, that's a report writer program and GR55 is the entry transaction for report groups, so what exactly are you updating and where from? Second, app servers don't get updated, unless you count buffers. Third, why do you have a BAPI commit in that loop? What do you think you are committing there? Fourth, updates are never random; they happen or don't happen for a reason.
‎2011 Jan 05 6:16 AM
Hi Brad,
Thx for your response.
1. That standard program is updating cost center group related data in application server.
2. How to count the buffers to update the app. server
3. Bapi commit is for commit the work (instead of bapi I gave wait until sy-subrc = 0 up to 1 second) I thought, because of lack of time it is not updating the app server. So I gave wait.
4. While executing, let as say... first time the 1, 3,5 & 7th record is updated in app. server. Second time 2, 3,5 & 7th record is updated in app. server. So what ever, it is updating some records & not updating some records .
By,
Jeya
‎2011 Jan 05 6:42 AM
Hi,
Remove the AND RETURN statement and try the program.
It should work fine.
The reason this is happening is most probably cuz the jobs overlap each other and may be updating the same row.
Regards,
Jovito.
‎2011 Jan 05 6:56 AM
Hi Jovito.
Without the statement " AND RETURN " via JOB is not possible.
If i remove " AND RETURN ", it is showing the following synatax error.
" The addition "VIA JOB" only makes sense with the addition "AND RETURN" ".
Thx for your response.
Regards,
Jovito.
‎2011 Jan 05 9:46 AM
Hi,
I meant to say do not submit it via a job. Let it process in this program itself.
Another option is for you to edit the start condition of the job and make each job dependent on the previous one that was released.
Regards,
Jovito.