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

ALV LIst

Former Member
0 Likes
1,186

Hi,

I ahve developed a report using REUSE_ALV_HIERSEQ_LIST_DISPLAY.

I need to add a button for the toolbar..what shoule be done.

Pls help me with an example.

Thanks

14 REPLIES 14
Read only

gopi_narendra
Active Contributor
0 Likes
1,164

Set the value for I_CALLBACK_PF_STATUS_SET parameter in the FM.

to create a GUI Status, go to SE41 and ProgName :SAPLKKBL Status : STANDARD and press Ctrl+F6, which can be copied to your custom program.

After copying you can do the changes accordingly to the GUI Status in SE41.

Regards

Gopi

Read only

Former Member
0 Likes
1,164

Hi Prabha,

If you wanna add a button to the standard tool bar then it can be using SET PF_STATUS statement.

If you wanna add a button to the ALV tool bar it can be done by using the PF-Status pf the ALV.

Regards,

Ravi G

Read only

0 Likes
1,164

Hi,

I want to add a button to the ALV Hierechy list tool bar. There will be exissting toolbar already. I need to remove the defaults ones and add new ones.

Pls help

Thanks

Read only

Former Member
0 Likes
1,164

Hi Prabha,

To do this use SET PF-STATUS.

use SET PF-STATUS in Subroutine and give the name of that subroutine in field catalog.

I did by this "REUSE_ALV_GRID_DISPLAY" FM.

If you think it will solve your purpose please reply this post and give me more details so that i can help you.

Reward if useful,

Sachin.

Read only

0 Likes
1,164

Hi,

Pls help me with an example code.

Thanks

Read only

0 Likes
1,164

Hi prabha,

You need to create PF Status to use it.

This is the Code.

TYPE-POOLS: slis.

  • TABLES USED.

TABLES: bsik,bseg.

                          • User defined Types *************

TYPES: BEGIN OF st_bsik,

bukrs TYPE bsik-bukrs,

lifnr TYPE bsik-lifnr,

belnr TYPE bsik-belnr,

wrbtr TYPE bsik-wrbtr,

shkzg TYPE bsik-shkzg,

waers TYPE bsik-waers,

budat TYPE bsik-budat,

gjahr TYPE bsik-gjahr,

END OF st_bsik.

TYPES: BEGIN OF st_bsik_ctm,

lifnr TYPE bsik-lifnr,

waers TYPE bsik-waers,

dramt TYPE bsik-wrbtr,

cramt TYPE bsik-wrbtr,

END OF st_bsik_ctm.

TYPES: BEGIN OF st_bsik_h,

lifnrh TYPE C,

waersh TYPE C,

dramth TYPE C,

cramth TYPE C,

chk type c,

END OF st_bsik_h.

******************************************

DATA: it_bsik TYPE STANDARD TABLE OF st_bsik INITIAL SIZE 0,

it_bsik_wa TYPE st_bsik,

it_bsik_ctm TYPE STANDARD TABLE OF st_bsik_ctm INITIAL SIZE 0,

it_bsik_ctm_wa TYPE st_bsik_ctm,

it_bsik_h TYPE STANDARD TABLE OF st_bsik_h INITIAL SIZE 0,

it_bsik_h_wa TYPE st_bsik_h.

DATA: ls_fieldcat TYPE slis_fieldcat_alv,

lt_fieldcat TYPE slis_t_fieldcat_alv with header line,

ls_layout TYPE slis_layout_alv,

lt_sort TYPE slis_t_sortinfo_alv,

ls_sort TYPE slis_sortinfo_alv.

  • Selection Screen *****************************

SELECTION-SCREEN BEGIN OF BLOCK bl_bsik WITH FRAME TITLE title.

SELECT-OPTIONS ccode FOR bsik-bukrs. "obligatory.

SELECT-OPTIONS vno FOR bsik-lifnr." obligatory.

SELECT-OPTIONS yod FOR bsik-gjahr." obligatory.

SELECTION-SCREEN END OF BLOCK bl_bsik.

*End of Selection Screen **********************

                                                  • Start of Selection *****************

START-OF-SELECTION.

PERFORM popuplist.

FORM popuplist.

DATA: P_TITLE TYPE SY-TITLE VALUE 'Popup with Checkbox'.

  • GET DATA INTO ITAB FROM DB.

SELECT bukrs lifnr wrbtr shkzg waers belnr budat gjahr FROM bsik

INTO CORRESPONDING FIELDS OF TABLE it_bsik

WHERE bukrs IN ccode

AND lifnr IN vno

AND gjahr IN yod.

  • it_bsik_ctm[] = it_bsik.

LOOP AT it_bsik INTO it_bsik_wa.

MOVE it_bsik_wa-lifnr TO it_bsik_ctm_wa-lifnr.

MOVE it_bsik_wa-waers TO it_bsik_ctm_wa-waers.

IF it_bsik_wa-shkzg = 'S'.

MOVE it_bsik_wa-wrbtr TO it_bsik_ctm_wa-dramt.

ELSEIF it_bsik_wa-shkzg = 'H'.

MOVE it_bsik_wa-wrbtr TO it_bsik_ctm_wa-cramt.

ENDIF.

COLLECT it_bsik_ctm_wa INTO it_bsik_ctm.

  • APPEND it_bsik_ctm_wa TO it_bsik_ctm.

CLEAR it_bsik_wa.

ENDLOOP.

  • gd_layout-box_fieldname = 'SEL'.

ls_fieldcat-tabname = 'it_bsik_ctm'.

ls_fieldcat-col_pos = '1'.

ls_fieldcat-seltext_m = 'Vendor No'.

ls_fieldcat-fieldname = 'LIFNR'.

APPEND ls_fieldcat TO lt_fieldcat.

CLEAR ls_fieldcat.

ls_fieldcat-tabname = 'it_bsik_ctm'.

ls_fieldcat-col_pos = '2'.

ls_fieldcat-seltext_m = 'Currency Key'.

ls_fieldcat-fieldname = 'WAERS'.

APPEND ls_fieldcat TO lt_fieldcat.

CLEAR ls_fieldcat.

ls_fieldcat-tabname = 'it_bsik_ctm'.

ls_fieldcat-col_pos = '3'.

ls_fieldcat-seltext_m = 'Sum of Debit'.

ls_fieldcat-fieldname = 'DRAMT'.

APPEND ls_fieldcat TO lt_fieldcat.

CLEAR ls_fieldcat.

ls_fieldcat-tabname = 'it_bsik_ctm'.

ls_fieldcat-col_pos = '4'.

ls_fieldcat-seltext_m = 'Sum of Credit'.

ls_fieldcat-fieldname = 'CRAMT'.

APPEND ls_fieldcat TO lt_fieldcat.

CLEAR ls_fieldcat.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

  • I_INTERFACE_CHECK = ' '

  • I_BYPASSING_BUFFER = ' '

  • I_BUFFER_ACTIVE = ' '

i_callback_program = sy-repid

I_CALLBACK_PF_STATUS_SET = 'SETSTATUS'

I_CALLBACK_USER_COMMAND = 'USRCMD'

  • I_CALLBACK_TOP_OF_PAGE = ' '

  • I_CALLBACK_HTML_TOP_OF_PAGE = ' '

  • I_CALLBACK_HTML_END_OF_LIST = ' '

  • I_GRID_TITLE =

  • I_GRID_SETTINGS =

IS_LAYOUT = ls_layout

it_fieldcat = lt_fieldcat[]

  • IT_EXCLUDING =

  • IT_SPECIAL_GROUPS =

IT_SORT = lt_sort

  • IT_FILTER =

  • IS_SEL_HIDE =

  • I_DEFAULT = 'X'

I_SAVE = 'A'

  • IT_ALV_GRAPHICS =

  • IT_HYPERLINK =

  • IT_ADD_FIELDCAT =

  • IT_EXCEPT_QINFO =

  • IR_SALV_FULLSCREEN_ADAPTER =

  • IMPORTING

  • E_EXIT_CAUSED_BY_CALLER =

  • ES_EXIT_CAUSED_BY_USER =

TABLES

t_outtab = it_bsik_ctm[]

EXCEPTIONS

PROGRAM_ERROR = 1

OTHERS = 2

.

IF sy-subrc <> 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

ENDFORM.

FORM setstatus USING rt_extab TYPE slis_t_extab.

SET PF-STATUS 'APPTOOLBAR'.

ENDFORM.

Read only

0 Likes
1,164

Hi,

I tried with same example.

Actaully i'm displaying a report in tree view where at the Header level then will be a EXPAND button. Clicking on which the items will be displayed.

If i include my own pf-status..then when i click on the expand button in the header, it doen't work..

Pls help.

Read only

0 Likes
1,164

HI PRABHA.............. WHERE R U WORKING AT ??????

Read only

0 Likes
1,164

Why U want to know that?

Read only

0 Likes
1,164

JUST LIKE THAT ............BUT Y R U SO RUDE .........I M JUST ASKING ...

Read only

0 Likes
1,164

Pls help me with a solution..

Read only

0 Likes
1,164

KK ..............ask me anything ..............i ll help u ..........but dont be depresed ...

Read only

0 Likes
1,164

hi

u told that u want change the exiting one ...put break points and ...find the exact place like pf-status .. then do modifications....

i hope this will help u ..if u not clear u can contact me ...if it is usefull u can reward with pints...

bye

leee

Read only

0 Likes
1,164

Hey Prabha,

Are you been able to make PF-STATUS or Not. bcoz solution depends on it only.

Sachin