Page 1 of 1


Posted: Wed May 21, 2014 8:18 am
by Squarebear
A bit embarrassing, this. Hopefully I can bypass the "Why are you using this antique?" questions as well as the scornful "There are hundreds of threads out there" quips. I have been instructed not to switch to a class-based solution, and I have searched unsuccessfully for answers until I reached the point of wanting to jump out of the window.

I'm amending a piece of code and have two separate problems centring on this function module.

1. When data is displayed for the first time I want to suppress repeated key fields. So only the first occurrence appears, and the remainder are blank until change of key. And so on and so forth.

I seem unable to make this happen the first time the ALV is displayed. Is this possible? If so please can you tell me how I achieve it?

2. The table I am displaying has a SELKZ field (for selection) and a hotspot. If I select rows 1 and 2 then click on the hotspot on row 3 (then go off and do something before back-arrowing to return to the ALV) lines 1 and 2 are no longer selected.

How can I ensure that when I return to the ALV the selected rows remain as they were prior to clicking on the hotspot?


Posted: Wed May 21, 2014 8:47 am
by Gothmog
But... I like my "Why are you using this antique?" speach! It's not nice to deny me the occasion to use it! :(

Let's see if I can remember, then...

1. In order to have cell merging, your data needs to be sorted, and field CELL_MERGE in the is_layout structure should be (I think) space (as it is a NO cell merge field, apparently). But I'm not sure it'll work for the first time. A saved default variant should work, though.

2. Are you refreshing the table after coming back from your hotspot processing?


Posted: Wed May 21, 2014 9:06 am
by Squarebear
Thanks. How do you retain this stuff? I can barely remember my own name these days.

Just before I hit Google to learn more about IS_VARIANT I will respond to your refresh question:

I tried inserting a POPULATE_TAB statement immediately following my hotspot processing, so the table is as I want it at that point.

BUT after that control passes to SAPLSLVC_FULLSCREEN, passing through PAI and then PBO. Then the ALV is displayed with nothing selected.

I wonder if one option is to save a variant at the point at which I begin hotspot processing then retrieve the selected values upon returning to the ALV...


Posted: Wed May 21, 2014 9:31 am
by Gothmog
I remember all sort of useless stuff - custom report names from clients years ago, dozens of decimals of pi... but don't ask me to remember names, faces or birthdays.

A variant won't save the selected rows.
I think the lines may be unselected when you click on any other line, regardless of the hotspot status of the field you clicked on, so it could be tricky to catch them.
If you really need this, maybe you could use a checkbox field as your first column (and lose any standard selected rows functionality, probably) and use this as a selection marker (not as a IS_LAYOUT-BOX_NAME field) for your interactions.


Posted: Thu May 22, 2014 7:48 am
by Squarebear
Checkboxes indeed were the answer. So thank you for that.

The suppression of (or more specifically the non-showing of) duplicate keys - once they were told it seemed not to be an option - seemed not to matter to them.

Your help has been greatly appreciated.