2006 Aug 01 8:56 AM
Hello,
I would like to display an ALV using
REUSE_ALV_GRID_DISPLAY.
In this ALV, I need to display an header and to do this, I use a TopOfPage Callback form in whichI call
Reuse_ALv_commentary_Write with a parameter table.
The type of that table is 'slis_t_listheader'.
The problem is that the displayed data of a slis_t_listheader table is the field 'Info' andis field size is 60 char max but I must display more than 60 char by line.
So I don't know what to do cause I really need to found a solution to di this;
Thanks for your help
2006 Aug 01 9:04 AM
Hello Morgan,
U can use this Code.
Work Area TOP-OF-PAGE commentary
DATA: WA_COMMENTARY TYPE SLIS_LISTHEADER,
L_F_INFO(132),
L_F_DATUM(10),
L_F_TIME(8),
L_F_LOW LIKE PRPS-POSID,
L_F_HIGH LIKE PRPS-POSID,
L_F_DATL(10),
L_F_DATH(10).
CLEAR : WA_COMMENTARY,
IT_COMMENTARY,
IT_COMMENTARY[].
CONCATENATE TEXT-013 SY-REPID INTO L_F_INFO
SEPARATED BY ' '.
WA_COMMENTARY-TYP = 'H'.
WA_COMMENTARY-INFO = L_F_INFO.
APPEND WA_COMMENTARY TO IT_COMMENTARY.
WRITE SY-DATUM TO L_F_DATUM.
WRITE SY-UZEIT TO L_F_TIME.
CONCATENATE TEXT-017 L_F_DATUM TEXT-018 L_F_TIME INTO L_F_INFO
SEPARATED BY ' '.
WA_COMMENTARY-TYP = 'S'.
WA_COMMENTARY-INFO = L_F_INFO.
APPEND WA_COMMENTARY TO IT_COMMENTARY.
L_F_INFO = TEXT-001.
WA_COMMENTARY-TYP = 'S'.
WA_COMMENTARY-INFO = L_F_INFO.
APPEND WA_COMMENTARY TO IT_COMMENTARY.
IF NOT S_PROJ[] IS INITIAL.
READ TABLE S_PROJ INDEX 1.
CALL FUNCTION 'CONVERSION_EXIT_ABPSN_OUTPUT'
EXPORTING
INPUT = S_PROJ-LOW
IMPORTING
OUTPUT = L_F_LOW.
IF L_F_LOW IS INITIAL.
L_F_LOW = SPACE.
ENDIF.
CALL FUNCTION 'CONVERSION_EXIT_ABPSN_OUTPUT'
EXPORTING
INPUT = S_PROJ-HIGH
IMPORTING
OUTPUT = L_F_HIGH.
IF L_F_HIGH IS INITIAL.
L_F_HIGH = SPACE.
ENDIF.
IF S_PROJ-OPTION = 'EQ'.
CONCATENATE TEXT-023 ':' L_F_LOW TEXT-020 L_F_HIGH '+' INTO
L_F_INFO SEPARATED BY ' '.
ELSE.
CONCATENATE TEXT-023 ':' L_F_LOW TEXT-020 L_F_HIGH INTO
L_F_INFO SEPARATED BY ' '.
ENDIF.
ELSE.
CONCATENATE TEXT-023 ':' TEXT-021 INTO
L_F_INFO SEPARATED BY ' '.
ENDIF.
WA_COMMENTARY-TYP = 'S'.
WA_COMMENTARY-INFO = L_F_INFO.
APPEND WA_COMMENTARY TO IT_COMMENTARY.
IF NOT S_WBS[] IS INITIAL.
READ TABLE S_WBS INDEX 1.
CALL FUNCTION 'CONVERSION_EXIT_ABPSN_OUTPUT'
EXPORTING
INPUT = S_WBS-LOW
IMPORTING
OUTPUT = L_F_LOW.
IF L_F_LOW IS INITIAL.
L_F_LOW = SPACE.
ENDIF.
CALL FUNCTION 'CONVERSION_EXIT_ABPSN_OUTPUT'
EXPORTING
INPUT = S_WBS-HIGH
IMPORTING
OUTPUT = L_F_HIGH.
IF S_WBS-OPTION = 'EQ'.
CONCATENATE TEXT-005 ':' L_F_LOW L_F_HIGH '+' INTO
L_F_INFO SEPARATED BY ' '.
ELSE.
CONCATENATE TEXT-023 ':' L_F_LOW TEXT-020 L_F_HIGH INTO
L_F_INFO SEPARATED BY ' '.
ENDIF.
ELSE.
CONCATENATE TEXT-005 ':' TEXT-021 INTO
L_F_INFO SEPARATED BY ' '.
ENDIF.
WA_COMMENTARY-TYP = 'S'.
WA_COMMENTARY-INFO = L_F_INFO.
APPEND WA_COMMENTARY TO IT_COMMENTARY.
IF NOT S_VKBUR[] IS INITIAL.
READ TABLE S_VKBUR INDEX 1.
IF S_VKBUR-OPTION = 'EQ'.
CONCATENATE TEXT-004 ':' S_VKBUR-LOW TEXT-020 S_VKBUR-HIGH '+' INTO
L_F_INFO SEPARATED BY ' '.
ELSE.
CONCATENATE TEXT-004 ':' S_VKBUR-LOW TEXT-020 S_VKBUR-HIGH INTO
L_F_INFO SEPARATED BY ' '.
ENDIF.
ELSE.
CONCATENATE TEXT-004 ':' TEXT-021 INTO
L_F_INFO SEPARATED BY ' '.
ENDIF.
WA_COMMENTARY-TYP = 'S'.
WA_COMMENTARY-INFO = L_F_INFO.
APPEND WA_COMMENTARY TO IT_COMMENTARY.
IF NOT S_AUDAT[] IS INITIAL.
READ TABLE S_AUDAT INDEX 1.
WRITE: S_AUDAT-LOW TO L_F_DATL,
S_AUDAT-HIGH TO L_F_DATH.
IF S_AUDAT-OPTION = 'EQ'.
CONCATENATE TEXT-014 ':' L_F_DATL TEXT-020 L_F_DATH '+' INTO
L_F_INFO SEPARATED BY ' '.
ELSE.
CONCATENATE TEXT-014 ':' L_F_DATL TEXT-020 L_F_DATH INTO
L_F_INFO SEPARATED BY ' '.
ENDIF.
ELSE.
CONCATENATE TEXT-014 ':' TEXT-021 INTO
L_F_INFO SEPARATED BY ' '.
ENDIF.
WA_COMMENTARY-TYP = 'S'.
WA_COMMENTARY-INFO = L_F_INFO.
APPEND WA_COMMENTARY TO IT_COMMENTARY.
CONCATENATE TEXT-015 ':' P_FILE INTO L_F_INFO SEPARATED BY ' '.
WA_COMMENTARY-TYP = 'S'.
WA_COMMENTARY-INFO = L_F_INFO.
APPEND WA_COMMENTARY TO IT_COMMENTARY.
IF NOT P_TAB IS INITIAL.
CONCATENATE TEXT-016 ':' TEXT-019 INTO L_F_INFO SEPARATED BY ' '.
ELSE.
CONCATENATE TEXT-016 ':' P_TRZEI INTO L_F_INFO SEPARATED BY ' '.
ENDIF.
WA_COMMENTARY-TYP = 'S'.
WA_COMMENTARY-INFO = L_F_INFO.
APPEND WA_COMMENTARY TO IT_COMMENTARY.
ENDFORM. " REPORT_HEADING
Work Area TOP-OF-PAGE commentary
DATA: WA_COMMENTARY TYPE SLIS_LISTHEADER,
L_F_INFO(132),
L_F_DATUM(10),
L_F_TIME(8),
L_F_LOW LIKE PRPS-POSID,
L_F_HIGH LIKE PRPS-POSID,
L_F_DATL(10),
L_F_DATH(10).
CLEAR : WA_COMMENTARY,
IT_COMMENTARY,
IT_COMMENTARY[].
CONCATENATE TEXT-013 SY-REPID INTO L_F_INFO
SEPARATED BY ' '.
WA_COMMENTARY-TYP = 'H'.
WA_COMMENTARY-INFO = L_F_INFO.
APPEND WA_COMMENTARY TO IT_COMMENTARY.
WRITE SY-DATUM TO L_F_DATUM.
WRITE SY-UZEIT TO L_F_TIME.
CONCATENATE TEXT-017 L_F_DATUM TEXT-018 L_F_TIME INTO L_F_INFO
SEPARATED BY ' '.
WA_COMMENTARY-TYP = 'S'.
WA_COMMENTARY-INFO = L_F_INFO.
APPEND WA_COMMENTARY TO IT_COMMENTARY.
L_F_INFO = TEXT-001.
WA_COMMENTARY-TYP = 'S'.
WA_COMMENTARY-INFO = L_F_INFO.
APPEND WA_COMMENTARY TO IT_COMMENTARY.
IF NOT S_PROJ[] IS INITIAL.
READ TABLE S_PROJ INDEX 1.
CALL FUNCTION 'CONVERSION_EXIT_ABPSN_OUTPUT'
EXPORTING
INPUT = S_PROJ-LOW
IMPORTING
OUTPUT = L_F_LOW.
IF L_F_LOW IS INITIAL.
L_F_LOW = SPACE.
ENDIF.
CALL FUNCTION 'CONVERSION_EXIT_ABPSN_OUTPUT'
EXPORTING
INPUT = S_PROJ-HIGH
IMPORTING
OUTPUT = L_F_HIGH.
IF L_F_HIGH IS INITIAL.
L_F_HIGH = SPACE.
ENDIF.
IF S_PROJ-OPTION = 'EQ'.
CONCATENATE TEXT-023 ':' L_F_LOW TEXT-020 L_F_HIGH '+' INTO
L_F_INFO SEPARATED BY ' '.
ELSE.
CONCATENATE TEXT-023 ':' L_F_LOW TEXT-020 L_F_HIGH INTO
L_F_INFO SEPARATED BY ' '.
ENDIF.
ELSE.
CONCATENATE TEXT-023 ':' TEXT-021 INTO
L_F_INFO SEPARATED BY ' '.
ENDIF.
WA_COMMENTARY-TYP = 'S'.
WA_COMMENTARY-INFO = L_F_INFO.
APPEND WA_COMMENTARY TO IT_COMMENTARY.
IF NOT S_WBS[] IS INITIAL.
READ TABLE S_WBS INDEX 1.
CALL FUNCTION 'CONVERSION_EXIT_ABPSN_OUTPUT'
EXPORTING
INPUT = S_WBS-LOW
IMPORTING
OUTPUT = L_F_LOW.
IF L_F_LOW IS INITIAL.
L_F_LOW = SPACE.
ENDIF.
CALL FUNCTION 'CONVERSION_EXIT_ABPSN_OUTPUT'
EXPORTING
INPUT = S_WBS-HIGH
IMPORTING
OUTPUT = L_F_HIGH.
IF S_WBS-OPTION = 'EQ'.
CONCATENATE TEXT-005 ':' L_F_LOW L_F_HIGH '+' INTO
L_F_INFO SEPARATED BY ' '.
ELSE.
CONCATENATE TEXT-023 ':' L_F_LOW TEXT-020 L_F_HIGH INTO
L_F_INFO SEPARATED BY ' '.
ENDIF.
ELSE.
CONCATENATE TEXT-005 ':' TEXT-021 INTO
L_F_INFO SEPARATED BY ' '.
ENDIF.
WA_COMMENTARY-TYP = 'S'.
WA_COMMENTARY-INFO = L_F_INFO.
APPEND WA_COMMENTARY TO IT_COMMENTARY.
IF NOT S_VKBUR[] IS INITIAL.
READ TABLE S_VKBUR INDEX 1.
IF S_VKBUR-OPTION = 'EQ'.
CONCATENATE TEXT-004 ':' S_VKBUR-LOW TEXT-020 S_VKBUR-HIGH '+' INTO
L_F_INFO SEPARATED BY ' '.
ELSE.
CONCATENATE TEXT-004 ':' S_VKBUR-LOW TEXT-020 S_VKBUR-HIGH INTO
L_F_INFO SEPARATED BY ' '.
ENDIF.
ELSE.
CONCATENATE TEXT-004 ':' TEXT-021 INTO
L_F_INFO SEPARATED BY ' '.
ENDIF.
WA_COMMENTARY-TYP = 'S'.
WA_COMMENTARY-INFO = L_F_INFO.
APPEND WA_COMMENTARY TO IT_COMMENTARY.
IF NOT S_AUDAT[] IS INITIAL.
READ TABLE S_AUDAT INDEX 1.
WRITE: S_AUDAT-LOW TO L_F_DATL,
S_AUDAT-HIGH TO L_F_DATH.
IF S_AUDAT-OPTION = 'EQ'.
CONCATENATE TEXT-014 ':' L_F_DATL TEXT-020 L_F_DATH '+' INTO
L_F_INFO SEPARATED BY ' '.
ELSE.
CONCATENATE TEXT-014 ':' L_F_DATL TEXT-020 L_F_DATH INTO
L_F_INFO SEPARATED BY ' '.
ENDIF.
ELSE.
CONCATENATE TEXT-014 ':' TEXT-021 INTO
L_F_INFO SEPARATED BY ' '.
ENDIF.
WA_COMMENTARY-TYP = 'S'.
WA_COMMENTARY-INFO = L_F_INFO.
APPEND WA_COMMENTARY TO IT_COMMENTARY.
CONCATENATE TEXT-015 ':' P_FILE INTO L_F_INFO SEPARATED BY ' '.
WA_COMMENTARY-TYP = 'S'.
WA_COMMENTARY-INFO = L_F_INFO.
APPEND WA_COMMENTARY TO IT_COMMENTARY.
IF NOT P_TAB IS INITIAL.
CONCATENATE TEXT-016 ':' TEXT-019 INTO L_F_INFO SEPARATED BY ' '.
ELSE.
CONCATENATE TEXT-016 ':' P_TRZEI INTO L_F_INFO SEPARATED BY ' '.
ENDIF.
WA_COMMENTARY-TYP = 'S'.
WA_COMMENTARY-INFO = L_F_INFO.
APPEND WA_COMMENTARY TO IT_COMMENTARY.
ENDFORM. " REPORT_HEADING
If useful reward.
Vasanth
2006 Aug 01 9:27 AM
Thanks Vasanth M
I don't understand what in the code above allow me to have a Topofpage with line of more than 60 char in my ALV ???
You fill WA_COMMENTARY-INFO with wlaues of 132 char but where do u call something to write this text in top of the ALV ? How do U allow text of more than 60 to be taken into consideration?