cancel
Showing results for 
Search instead for 
Did you mean: 

Access counter from Adapter Module

Former Member
0 Kudos

Hi all,

I have a rather short but not easy to answer question. The basic scenario is simple: you have a file receiver adapter with File Construction Mode set to "Add Counter". However, when you add a module before the CallSapAdapter module (which will calculate the next value of the counter suffix), is there some way to access this counter value from within the module code?

The standard API has not helped me further, I doubt whether it's even possible.

Any information would be of great help. Thanks!

Best regards,

Aerv

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi all,

I have decided to go with a number range object and wrapping GET_NUMBER_NEXT_V1 in an RFC and triggering this from a message mapping before reaching the adapter. This seems like the most standard way to handle this.

If you have other thoughts, feel free to contribute!

Answers (1)

Answers (1)

rajasekhar_reddy14
Active Contributor
0 Kudos

Accesing counter value(lookup) using module  not a right design,check my below doc

http://scn.sap.com/people/rajasekhar.reddy14/blog/2012/02/15/how-to-maintain-counter-sequence-to-fil...

Former Member
0 Kudos

I would need to do it in the module. We want to write the file with counter before it's stored by the CallSapAdapter module.

baskar_gopalakrishnan2
Active Contributor
0 Kudos

Few cents. How about creating a database table and update the counter every time and use that new value to the file receiver?  You can even handle via mapping UDF. Or if you want module then create a module that updates the counter every time using jdbc call and pass that value to the receiver adapter.

Just a thought... How you will be handling error or cancel messages w.r.t to counter values? Do you need to handle discrepancy during the cancel or system error messages?

Former Member
0 Kudos

Hi Baskar, thanks for your reply. I had thought about that, but would prefer not to use a back end table with the counter. Handling discrepancy would be another issue in this case.

I guess I'll have to rethink the solution. 🙂