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

two transactions, same program, processed in background task problem

Former Member
0 Likes
882

Y0 Team ABAP,

i got something here that bugs me.

I have done a report. Nothing special, simple selection screen, selection of data, and output via SALV.

One of my selection screen fields (a parameter) is VKBUR and it is "obligatory".

2 weeks ago i got the requirement to create a copy of this program, and adopt VKBUR as select option.

Since i didnt want changeanomalies i decided not to duplicate the program, but just add a second transaction to my program.

In a routine at event at-selection-screen output, i´m hiding either the parameter or the select option, depending on which tcode was used.

In some routine which gets triggered at the event at-selection-screen i´m moving either what we got in our parameter to our local range we use for the select, or just assign the select option to our local range, or process an error message if according field is not filled. Yeah that obligatory condition is done by myself since i cant just set the obligatory addition to the statement.

This all works quite fine so far.

BUT:

Today i hear that the end-users process that report in background task by pressing F9.

Problem is now that when it is processed in background task, sy-tcode is initial, so i dont know which of the transactions the user picked, and so i dont know which of the two fields has to be filled.

Sure i could do another report, containing just my second selection screen, and when this is checked, do a submit on my real report, tho i still believe there must be some more elegant way.

Any ideas?

1 ACCEPTED SOLUTION
Read only

Varamanoj
Participant
0 Likes
842

Hi,

Why dont you create varaints and make use of varaints in this case.

Best Regards

Manoj

6 REPLIES 6
Read only

Varamanoj
Participant
0 Likes
843

Hi,

Why dont you create varaints and make use of varaints in this case.

Best Regards

Manoj

Read only

0 Likes
842

Problem is in background mode SY-SLSET is also empty, I believe; so you still don't really know which one has been selected.

Read only

ThomasZloch
Active Contributor
0 Likes
842

What I don't understand yet based on your description is why two entry points are necessary at all, if you have just one VKBUR selection option, those who only need a single value (= parameter) may just enter that, and those who need a selection by range enter that as well.

Please help me.

Thomas

Read only

0 Likes
842

well yeah you´re right thomas.

Just for the sake of the select this aint really neccesary. Tho in case they pick the transaction with the select option i gotta manually add subtotal lines in my output.

right now i´m trying it with two seperate selection screens in one report. seems doable but i am not too far. reporting back soon.

Read only

0 Likes
842

Can the required subtotals be handled by standard ALV functionality? If yes, then you could have the ALV layout as a selection screen parameter as well, prepare some standard "/..." layouts for the users (e.g. one with subtotals, one without) and let them do anything else by themselves via their own layouts and variants. Sounds more flexible to me than a hard wired "parameter = no subtotals, select option = subtotals" logic. Of course I don't know all the circumstances/restrictions at your place.

Thomas

Read only

0 Likes
842

Unfortunateley those subtotals cant be handeled by the layout, thats why i manually add them.

But you got me back on track! right now i´m for your solution.

right now i´m having just ONE selection screen with the select option on it.

User can decide if he fills just one value or more.

In the end i loop over my output table and look if there are records of different VKBUR´s.

If there are i know he wants subtotals and process them. If its just data of one VKBUR i can spare myself the hassle as there is anyway just one records per VKBUR so subtotaling this wouldnt make sense.

thanks. Thats what i will present my consultant now lets see if i can get him satisfied with it...