This website is not affiliated with, sponsored by, or approved by SAP AG.

REUSE_ALV_GRID_DISPLAY issues

Development (ABAP Development WorkBench, ABAP/4 programming)

Moderators: Snowy, thx4allthefish, YuriT, Gothmog

REUSE_ALV_GRID_DISPLAY issues

Postby Squarebear » Wed May 21, 2014 8:18 am

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?
Possibly the most modest person in the world.
Squarebear
 
Posts: 230
Joined: Thu Apr 17, 2003 8:24 am
Location: UK

Re: REUSE_ALV_GRID_DISPLAY issues

Postby Gothmog » Wed May 21, 2014 8:47 am

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?
68 74 74 70 3a 2f 2f 74 69 6e 79 75 72 6c 2e 63 6f 6d 2f 62 64 6f 37 6d 77 67
Gothmog
 
Posts: 1941
Joined: Wed Sep 12, 2007 4:46 am
Location: Probably not home

Re: REUSE_ALV_GRID_DISPLAY issues

Postby Squarebear » Wed May 21, 2014 9:06 am

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...
Possibly the most modest person in the world.
Squarebear
 
Posts: 230
Joined: Thu Apr 17, 2003 8:24 am
Location: UK

Re: REUSE_ALV_GRID_DISPLAY issues

Postby Gothmog » Wed May 21, 2014 9:31 am

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.
68 74 74 70 3a 2f 2f 74 69 6e 79 75 72 6c 2e 63 6f 6d 2f 62 64 6f 37 6d 77 67
Gothmog
 
Posts: 1941
Joined: Wed Sep 12, 2007 4:46 am
Location: Probably not home

Re: REUSE_ALV_GRID_DISPLAY issues

Postby Squarebear » Thu May 22, 2014 7:48 am

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.
Possibly the most modest person in the world.
Squarebear
 
Posts: 230
Joined: Thu Apr 17, 2003 8:24 am
Location: UK


Return to ABAP

Who is online

Users browsing this forum: No registered users and 8 guests





loading...


This website is not affiliated with, sponsored by, or approved by SAP AG.