Application Development 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: 

Batch ABAP uses GET PARAMETER of the user

former_member517
Participant
0 Kudos
195

Dear all,

I have the following curious effect when I start an ABAP in Batch. There are some selection criteria with a GET PARAMETER which are blocked in the variant. In dialog everything works fine. In batch mode the variant in SM37 is also correct. Example code :

select-options:

p_land1 for kna1-land1 memory id lan,

p_kunnr for kna1-kunnr memory id kun.

But when I switch on the ALV display of the selection the empty fields connected to a GET PARAMETER now have the values of GET PARAMETER of the user who runs the ABAP and the data base selctions get wrong !

I tried to scan OSS but there is either too much information or not the right one.

SAP is ECC6.0 and ABAP/Basis is on 70014

Thank you for your help

Rabanus Diehl

1 ACCEPTED SOLUTION

kesavadas_thekkillath
Active Contributor
0 Kudos
92

It takes the batch user details when executed in background.

may be you can make some relevant changes in your program.

5 REPLIES 5

kesavadas_thekkillath
Active Contributor
0 Kudos
93

It takes the batch user details when executed in background.

may be you can make some relevant changes in your program.

0 Kudos
92

Thank you,

this was also my first idea and I put the memory id part of the selection into comments and then the batch works correctly.

But according to SAP's description on how SPA parameters work this should not happen (eg OSS note 26573).

Best regards

Rabanus DIehl

0 Kudos
92

Yeah SPA parameters are global !!!

What about creating a hidden input field and filling in the memory id value to it

and then run the job

0 Kudos
92

I finally decided to open an OSS call and the result is that there is an inconsistency in the handling of SPA/GPA parameters in batch mode. Those parameters which are on the main screen will not be filled by GPA mechanism but those on Subscreens will be filled !

SAP considers it illogic as well, but they hesitate to correct the error, because batch jobs at customers may be influenced.

My impression is that, if someone has recognized this illogic behaviour at all, he has switched off the GPA handling in his program, which is my workaround as well. But I doubt that there were many people recognizing this problem.

So if someone stumbled over it, please feel free to comment.

Best regards

Rabanus Diehl

0 Kudos
92

Finally SAP created a new OSS note 1430115, where 2 function modules are implemented, one to prevent the GPA parameter on a subscreen from being imported in batch

RS_DISABLE_SPAGPA_ON_CURR_DYNP

and the second one to undo this action

RS_ENABLE_SPAGPA_ON_CURR_DYNP

I am not really happy with that, but it works.

Best regards

Rabanus Diehl