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 Header Help

Former Member
0 Likes
640

Hi,

Can some one help me with the code for designing the alv header exactly like this:

DATE: SY-DATUM REPORT TITLE PAGE: #

COMPANY NAME: ABC Company COMPANY: XXX

Rgds,

Sanjay

5 REPLIES 5
Read only

Former Member
0 Likes
621

Hi Sanjaysapian,

Welcome to SCN. In which event you are writing this code. You have many sample ALV with code. Search SCN for examples.

Regards,

Suneel G

Read only

former_member188827
Active Contributor
0 Likes
621

write your code in top-of-page event

Read only

Former Member
0 Likes
621

Hi,

Use 'REUSE_ALV_COMMENTARY_WRITE' function module for refrence check Below code .

DATA : S_LIST_TOPOFPAGE TYPE SLIS_LISTHEADER.

DATA : IST_LIST_TOPOFPAGE TYPE SLIS_T_LISTHEADER .

  • Here Use ur Varible SO_BUKRS-LOW

CONCATENATE 'Company Code From : ' SO_BUKRS-LOW

'To : ' SO_BUKRS-HIGH

INTO TEXT_01 SEPARATED BY SPACE.

IF NOT TEXT_01 IS INITIAL.

S_LIST_TOPOFPAGE-TYP = 'S'.

S_LIST_TOPOFPAGE-INFO = TEXT_01.

APPEND S_LIST_TOPOFPAGE TO L_IT_LIST_TOPOFPAGE.

CLEAR S_LIST_TOPOFPAGE.

ENDIF.

FORM TOP_OF_PAGE.

CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'

EXPORTING

IT_LIST_COMMENTARY = IST_LIST_TOPOFPAGE.

ENDFORM.

PERFORM CREATE_EVENT USING WF_EVENTS.

FORM CREATE_EVENT USING P_WF_EVENTS.

***This Function is to get the events

CALL FUNCTION 'REUSE_ALV_EVENTS_GET'

EXPORTING

I_LIST_TYPE = 0

IMPORTING

ET_EVENTS = WF_EVENTS

EXCEPTIONS

LIST_TYPE_WRONG = 1

OTHERS = 2.

SORT WF_EVENTS BY NAME.

READ TABLE WF_EVENTS INTO WF_EVENT WITH KEY NAME =

SLIS_EV_TOP_OF_PAGE BINARY SEARCH.

IF SY-SUBRC = 0.

MOVE FORMNAME_TOP_OF_PAGE TO WF_EVENT-FORM.

APPEND WF_EVENT TO WF_EVENTS.

ENDIF.

ENDFORM. " CREATE_EVENT

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

I_CALLBACK_PROGRAM = WF_REPID

I_CALLBACK_USER_COMMAND = 'USER_COMMAND'

IT_FIELDCAT = FIELDCAT1[]

I_SAVE = C_SAVE

IS_VARIANT = GX_VARIANT

IT_EVENTS = WF_EVENTS

TABLES

T_OUTTAB = IOUTAB

EXCEPTIONS

PROGRAM_ERROR = 1

OTHERS = 2.

Salil...

Read only

Former Member
0 Likes
621

Hi,

For creating top of page you have to declare like:




DATA: IT_HEADER TYPE SLIS_T_LISTHEADER,
      WA_HEADER TYPE SLIS_LISTHEADER.

In fuction module,


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          = ' '
*    I_CALLBACK_USER_COMMAND           = ' '
    I_CALLBACK_TOP_OF_PAGE            = 'TOP'

Here this top will point to the subroutine top declared.

 FORM TOP.

WA_HEADER-TYP = 'S'.
WA_HEADER-KEY = TEXT-001.
WA_HEADER-INFO = SY-REPID.
APPEND WA_HEADER TO IT_HEADER.
CLEAR WA_HEADER.

WA_HEADER-TYP = 'S'.
WA_HEADER-KEY = TEXT-002.
WA_HEADER-INFO = SY-UNAME.
APPEND WA_HEADER TO IT_HEADER.
CLEAR WA_HEADER.

WA_HEADER-TYP = 'S'.
WA_HEADER-KEY = TEXT-003.
WA_HEADER-INFO = SY-DATUM.
APPEND WA_HEADER TO IT_HEADER.
CLEAR WA_HEADER.

CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
  EXPORTING
    it_list_commentary       = IT_HEADER
*   I_LOGO                   =
*   I_END_OF_LIST_GRID       =
*   I_ALV_FORM               =
          .
ENDFORM.

Hope it helps

Regards

Mansi

Read only

Former Member
0 Likes
621

hi,

please search the forums before posting the question.Their are so many threads available similar to ur ur question

fareed