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

Help in BDC

Former Member
0 Likes
516

Hi All,

I am uploading a file to transaction CJR2 through BDC recording.

when a user manually enters values in CJR2 but has not yet saved and If my program is executed for the same set of header data but different item level data then even after the program execution has completed i could not find the values inserted through program in CJR2,but the values which the user inputs manually is present in CJR2.

This happens only when the transaction is open of editing and the program is executed simultaneously(for same header data).

If the transaction is not open for editing then my program uploads the values from the file into the transaction.

Should this be resolved through locking mechanism.Please give your suggestions to handle this scenario.

Regards,

S.Subasree

Hi All,

I am uploading a file to transaction CJR2 through BDC recording.

when a user manually enters values in CJR2 but has not yet saved and If my program is executed for the same set of header data but different item level data then even after the program execution has completed i could not find the values inserted through program in CJR2,but the values which the user inputs manually is present in CJR2.

This happens only when the transaction is open of editing and the program is executed simultaneously(for same header data).

If the transaction is not open for editing then my program uploads the values from the file into the transaction.

Should this be resolved through locking mechanism.Please give your suggestions to handle this scenario.

Regards,

S.Subasree

2 REPLIES 2
Read only

Former Member
0 Likes
462

You have at least two options:

You could call the change transaction code in call transaction (ALWAYS synchronous) with the document no., just go into the first screen, then immediately exit...if you have a sy-subrc not equal 0, then you have to assume that a user has the document open on a desktop, and you're not going to be able to update the data...

So you have two BDC sessions, actually.... one with just the initial screen data and the back or exit button pressed. If you get sy-subrc equal 0 from this call transaction, proceed with the 'real' BDC session (preferably in another call transaction), or do a wait up to xxx seconds...then try the whole process again. Of course, there is always the possibility that a user will open your document between your two sessions, but you can't predict everything in an OLTP system, can you?

Or, you could enqueue table ( or table and row), if enqueue is successful then perform your BDC then dequeue....

Read only

Former Member
0 Likes
462

Hi,

Is there any function module available to lock the entire transaction(CJR2)?

Or can i use get parameter id of the header fields (WBS Element,Cost Center,Activity Type,Version,Fiscal year) in my report and do not perform BDC Call transaction if the values in input file is same as the values in the get parameter id ? Will this work ?

Please give me your suggestions.