Application Development 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: 

ALV header !! urgent

Former Member
0 Kudos

Hi guys,

I have a requirement in which i have to display the records fetched from PLAF table using an ALV program (this ALV program fetched records from PLAF table and show it as an ALV report.

I have given the TITLE of this program as 'Customised transaction to convert planned orders' (which is asked while creating a new program in SE38).

The requirement is such that when u go to SE11 and fetch some records from PLAF table u see a message:-

'DATA BROWSER: TABLE PLAF Select Entries 14'

this means that 14 entries were selected from PLAF table.

Similarly i have to display how many records were fetched from PLAF table and i have to display it in the title of the program. I dont have to use ALV GRID.

Can this be done ? if yes then please tell me how to do that.

Regards

Rahul

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi

This can be done. Once you get the records from PLAF hold the systme variables SY-DBCNT into a global variable.

While passing the arguements to ALV FM, pass a sub-routine name for I_CALLBACK_TOP_OF_PAGE. Create a new sub-routine in your program in the same as what you passed before. There you use the FM REUSE_ALV_COMMENTARY_WRITE by passing the Sy-DBCNT variable data. This write the number of records selected from PLAF in you output.

Let me know if you need more info.

~ Ranganath

4 REPLIES 4

Former Member
0 Kudos

Hi

This can be done. Once you get the records from PLAF hold the systme variables SY-DBCNT into a global variable.

While passing the arguements to ALV FM, pass a sub-routine name for I_CALLBACK_TOP_OF_PAGE. Create a new sub-routine in your program in the same as what you passed before. There you use the FM REUSE_ALV_COMMENTARY_WRITE by passing the Sy-DBCNT variable data. This write the number of records selected from PLAF in you output.

Let me know if you need more info.

~ Ranganath

0 Kudos

Hi Ranganath,

Actually i want this to be displayed as the title of the program and not as the header of the ALV.

Regards

Rahul

0 Kudos

Try

sy-title = required title.

awrd points if helpful

Bhupal

Former Member
0 Kudos

Hi Rahul,

I will send a sample code for how to place HEADER

in ALV check it once ok.Instead of GRID DISPLAY use LIST DISPLAY ok.

Code:

DATA: gt_header TYPE slis_t_listheader, "For Headings

wa_header TYPE slis_listheader.

perform place_events.

CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'

EXPORTING

  • I_INTERFACE_CHECK = ' '

  • I_BYPASSING_BUFFER =

  • I_BUFFER_ACTIVE = ' '

i_callback_program = sy-cprog

  • I_CALLBACK_PF_STATUS_SET = ' '

i_callback_user_command = 'USERCOMMAND'

  • I_STRUCTURE_NAME =

is_layout = wa_layout

it_fieldcat = gt_fieldcat

  • IT_EXCLUDING =

  • IT_SPECIAL_GROUPS =

  • IT_SORT =

  • IT_FILTER =

  • IS_SEL_HIDE =

  • I_DEFAULT = 'X'

  • I_SAVE = ' '

  • IS_VARIANT =

it_events = gt_events

  • IT_EVENT_EXIT =

  • IS_PRINT =

  • IS_REPREP_ID =

  • I_SCREEN_START_COLUMN = 0

  • I_SCREEN_START_LINE = 0

  • I_SCREEN_END_COLUMN = 0

  • I_SCREEN_END_LINE = 0

  • IMPORTING

  • E_EXIT_CAUSED_BY_CALLER =

  • ES_EXIT_CAUSED_BY_USER =

TABLES

t_outtab = gt_headerdat

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. " display_list

&----


*& Form place_events

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM place_events .

CALL FUNCTION 'REUSE_ALV_EVENTS_GET'

EXPORTING

i_list_type = 0

IMPORTING

et_events = gt_events

EXCEPTIONS

list_type_wrong = 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.

READ TABLE gt_events INTO wa_events WITH KEY name = 'TOP_OF_PAGE'.

IF sy-subrc = 0.

wa_events-form = 'HEADING'.

MODIFY gt_events FROM wa_events INDEX sy-tabix.

ENDIF.

FORM heading.

WRITE:/6 'THIS REPORT DISPLAYS THE PURCHASE ORDER DETAILS'.

WRITE:/6 'CLICK ON PURCHASE DOC NO FIELD(INTERACTIVE LIST)'.

ENDFORM. "heading

Award points if helpful.

Kiran Kumar.G.A