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

CL_SALV_HIERSEQ_TABLE how to add function (customized button)

glauco
Active Contributor
0 Likes
2,944

Hi.

I'm searching but did not find how to add customized button.

I need to add as customer here required it so I can save Header and Slave internal tables as EXCEL.

I think we can not do it with standard CL_SALV_HIERSEQ_TABLE solution to save both tables in users PC.

1 ACCEPTED SOLUTION
Read only

Sandra_Rossi
Active Contributor
0 Likes
2,118

"HIERSEQ" corresponds to the display as a full screen, so you can't add buttons dynamically.

You can only define an initial "GUI status" via the method SET_SCREEN_STATUS. The prerequisite is to create the custom GUI status by copying the standard one which is probably STANDARD_FULLSCREEN in program SAPLSLVC_FULLSCREEN, and add your own buttons.

I don't know what are the available types of exports for a HIERSEQ ALV.

6 REPLIES 6
Read only

Sandra_Rossi
Active Contributor
0 Likes
2,119

"HIERSEQ" corresponds to the display as a full screen, so you can't add buttons dynamically.

You can only define an initial "GUI status" via the method SET_SCREEN_STATUS. The prerequisite is to create the custom GUI status by copying the standard one which is probably STANDARD_FULLSCREEN in program SAPLSLVC_FULLSCREEN, and add your own buttons.

I don't know what are the available types of exports for a HIERSEQ ALV.

Read only

glauco
Active Contributor
0 Likes
2,118

hi sandra.rossi .

Do you know where to use IF sy-ucomm= 'MYCUSTOM_BUTTON' statment with no screen ?

I'll try to test some report events to do it.

Read only

0 Likes
2,118

Use GET_EVENTS to retrieve the event instance, then register a handler for the event ADDED_FUNCTION. The function code is in parameter E_SALV_FUNCTION.

Read only

glauco
Active Contributor
0 Likes
2,118

Hi Sandra.

I used set pf-status inside form show_alv_tree but it is not showing it.

Probably I'm getting rust on this. 🙂

Do you know the correct place to use it ?

SET PF-STATUS 'STANDARD_FULLSCREEN'.

Another question.
I already have a local class to handle events and already have for example another method on_single_click to handle my hot spots.

I created a method to handle user command like you said but it is not getting called probably because my PF-STATUS is yet the standard of my report.

I need to set this custom pf-status to get this solved probably.

Read only

2,118

I said "method SET_SCREEN_STATUS" (of the HIERSEQ instance) 🙂

Read only

glauco
Active Contributor
2,118

Solved. many thanks to sandra.rossi .

Called this method just before the display method.

"Set PF-Status
 gr_hierseq->set_screen_status(
 EXPORTING
 report = sy-repid
 pfstatus = 'STANDARD_FULLSCREEN'
* set_functions =
 ).SET HANDLER gr_events->on_user_command FOR lr_events.

Added this method on my existing local class

      on_user_command FOR EVENT added_function OF cl_salv_events_hierseq
 IMPORTING e_salv_function sender.

And put a break inside this new method and it is executed always when I click my new Excel button.

 METHOD on_user_command.
 break-point.
 ENDMETHOD.

I've already copied that PF-STATU from that standard program mentioned above and created already my new button on it.

Works like magic.

many thanks to you Sandra. 🙂