ALV With Multiple Header information
Hi Friends,
I have the following requirement.
Company Header Information 1
Company Header Information 2
Company Header Information 3
Company Header Information 4
Company Header Information 5
Operator1 Details1
Operator1 Details2
Customer Information A
Sales InformationA1
Sales InformationA2
Sales InformationA3
Sales InformationA4
Operator1 Information2
Customer Information B
Sales InformationB1
Sales InformationB2
Sales InformationB3
Sales InformationB4
Is this possible through any ALV?
Thanks & Regards,
Lijo Joseph
hi,
Execute this program nad check if this helps in ur requirement.
*& Report ZKEERTHI_ALV3 *
REPORT ZKEERTHI_ALV3 LINE-COUNT 100 .
*& tables declaration
TABLES: MARA.
*& type-pools declaration
TYPE-POOLS: SLIS.
*& data declaration
DATA: G_REPID TYPE SY-REPID.
DATA : IT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV, "mara
WA_FIELDCAT TYPE SLIS_FIELDCAT_ALV.
DATA : IT_FIELDCAT1 TYPE SLIS_T_FIELDCAT_ALV, "makt
WA_FIELDCAT1 TYPE SLIS_FIELDCAT_ALV.
DATA : IT_FIELDCAT2 TYPE SLIS_T_FIELDCAT_ALV, "marc
WA_FIELDCAT2 TYPE SLIS_FIELDCAT_ALV.
DATA: GT_PRINT TYPE SLIS_PRINT_ALV,
WA_LAYOUT TYPE SLIS_LAYOUT_ALV,
XS_EVENT TYPE SLIS_ALV_EVENT,
GT_XEVENTS TYPE SLIS_T_EVENT,
GT_YEVENTS TYPE SLIS_T_EVENT,
GT_ZEVENTS TYPE SLIS_T_EVENT,
WA_SORT TYPE SLIS_SORTINFO_ALV,
IT_SORT TYPE SLIS_T_SORTINFO_ALV.
DATA: BEGIN OF IT_MARA OCCURS 0,
MATNR LIKE MARA-MATNR,
MTART LIKE MARA-MTART,
MATKL LIKE MARA-MATKL,
MEINS LIKE MARA-MEINS,
NTGEW LIKE MARA-NTGEW,
END OF IT_MARA.
DATA: BEGIN OF IT_MAKT OCCURS 0,
MATNR LIKE MAKT-MATNR,
SPRAS LIKE MAKT-SPRAS,
MAKTX LIKE MAKT-MAKTX,
MAKTG LIKE MAKT-MAKTG,
END OF IT_MAKT.
DATA: BEGIN OF IT_MARC OCCURS 0,
MATNR LIKE MARC-MATNR,
WERKS LIKE MARC-WERKS,
LADGR LIKE MARC-LADGR,
MTVFP LIKE MARC-MTVFP,
DISPR LIKE MARC-DISPR,
DISMM LIKE MARC-DISMM,
DISPO LIKE MARC-DISPO,
END OF IT_MARC.
*& initialisation
INITIALIZATION.
G_REPID = SY-REPID.
*& selection screen
SELECTION-SCREEN BEGIN OF BLOCK B WITH FRAME TITLE TEXT-001.
SELECT-OPTIONS: S_MATNR FOR MARA-MATNR,
S_MTART FOR MARA-MTART.
SELECTION-SCREEN END OF BLOCK B.
*& start of selection
START-OF-SELECTION.
PERFORM GET_MARADETAILS.
PERFORM GET_MAKTDETAILS.
PERFORM GET_MARCDETAILS.
*& Form get_maradetails
text
--> p1 text
<-- p2 text
FORM GET_MARADETAILS .
SELECT MATNR
MTART
MATKL
MEINS
NTGEW FROM MARA
INTO TABLE IT_MARA
WHERE MATNR IN S_MATNR AND
MTART IN S_MTART.
ENDFORM. " get_maradetails
*& Form get_maktdetails
text
--> p1 text
<-- p2 text
FORM GET_MAKTDETAILS .
SELECT MATNR
SPRAS
MAKTX
MAKTG FROM MAKT INTO TABLE IT_MAKT
FOR ALL ENTRIES IN IT_MARA
WHERE MATNR = IT_MARA-MATNR..
ENDFORM. " get_maktdetails
*& Form get_marcdetails
text
--> p1 text
<-- p2 text
FORM GET_MARCDETAILS .
SELECT MATNR
WERKS
LADGR
MTVFP
DISPR
DISMM
DISPO FROM MARC
INTO TABLE IT_MARC
FOR ALL ENTRIES IN IT_MARA
WHERE MATNR = IT_MARA-MATNR.
ENDFORM. " get_marcdetails
*& end of selection
END-OF-SELECTION.
PERFORM SORT_LIST.
PERFORM MODIFY_FIELDCAT.
PERFORM EVENT_LIST.
PERFORM BLOCK_LIST.
*& Form modify_fieldcat
text
--> p1 text
<-- p2 text
FORM MODIFY_FIELDCAT .
CLEAR WA_FIELDCAT.
WA_FIELDCAT-FIELDNAME = 'MATNR'.
WA_FIELDCAT-TABNAME = 'IT_MARA'.
WA_FIELDCAT-SELTEXT_L = 'MATERIAL NUM'.
WA_FIELDCAT-COL_POS = 1.
WA_FIELDCAT-OUTPUTLEN = 18.
APPEND WA_FIELDCAT TO IT_FIELDCAT.
CLEAR WA_FIELDCAT.
WA_FIELDCAT-FIELDNAME = 'MTART'.
WA_FIELDCAT-TABNAME = 'IT_MARA'.
WA_FIELDCAT-SELTEXT_L = 'MAT TYPE'.
WA_FIELDCAT-COL_POS = 2.
WA_FIELDCAT-OUTPUTLEN = 5.
APPEND WA_FIELDCAT TO IT_FIELDCAT.
CLEAR WA_FIELDCAT.
WA_FIELDCAT-FIELDNAME = 'MATKL'.
WA_FIELDCAT-TABNAME = 'IT_MARA'.
WA_FIELDCAT-SELTEXT_L = 'MAT GROUP'.
WA_FIELDCAT-COL_POS = 3.
WA_FIELDCAT-OUTPUTLEN = 10.
APPEND WA_FIELDCAT TO IT_FIELDCAT.
CLEAR WA_FIELDCAT.
WA_FIELDCAT-FIELDNAME = 'MEINS'.
WA_FIELDCAT-TABNAME = 'IT_MARA'.
WA_FIELDCAT-SELTEXT_L = 'UNIT'.
WA_FIELDCAT-COL_POS = 4.
WA_FIELDCAT-OUTPUTLEN = 5.
APPEND WA_FIELDCAT TO IT_FIELDCAT.
CLEAR WA_FIELDCAT.
WA_FIELDCAT-FIELDNAME = 'NTGEW'.
WA_FIELDCAT-TABNAME = 'IT_MARA'.
WA_FIELDCAT-DO_SUM = 'X'.
WA_FIELDCAT-SELTEXT_L = 'QUANTITY'.
WA_FIELDCAT-COL_POS = 5.
WA_FIELDCAT-OUTPUTLEN = 15.
APPEND WA_FIELDCAT TO IT_FIELDCAT.
CLEAR WA_FIELDCAT.
CLEAR WA_FIELDCAT1.
WA_FIELDCAT1-FIELDNAME = 'MATNR'.
WA_FIELDCAT1-TABNAME = 'IT_MAKT'.
WA_FIELDCAT1-SELTEXT_L = 'MATERIAL NUM'.
WA_FIELDCAT1-COL_POS = 1.
WA_FIELDCAT1-OUTPUTLEN = 18.
APPEND WA_FIELDCAT1 TO IT_FIELDCAT1.
CLEAR WA_FIELDCAT1.
WA_FIELDCAT1-FIELDNAME = 'SPRAS'.
WA_FIELDCAT1-TABNAME = 'IT_MAKT'.
WA_FIELDCAT1-SELTEXT_L = 'LANGUAGE'.
WA_FIELDCAT1-COL_POS = 2.
WA_FIELDCAT1-OUTPUTLEN = 2.
APPEND WA_FIELDCAT1 TO IT_FIELDCAT1.
CLEAR WA_FIELDCAT1.
WA_FIELDCAT1-FIELDNAME = 'MAKTX'.
WA_FIELDCAT1-TABNAME = 'IT_MAKT'.
WA_FIELDCAT1-SELTEXT_L = 'MAT DESC'.
WA_FIELDCAT1-COL_POS = 3.
WA_FIELDCAT1-OUTPUTLEN = 40.
APPEND WA_FIELDCAT1 TO IT_FIELDCAT1.
CLEAR WA_FIELDCAT1.
WA_FIELDCAT1-FIELDNAME = 'MAKTG'.
WA_FIELDCAT1-TABNAME = 'IT_MAKT'.
WA_FIELDCAT1-SELTEXT_L = 'GRP DESC'.
WA_FIELDCAT1-COL_POS = 4.
WA_FIELDCAT1-OUTPUTLEN = 40.
APPEND WA_FIELDCAT1 TO IT_FIELDCAT1.
CLEAR WA_FIELDCAT1.
CLEAR WA_FIELDCAT2.
WA_FIELDCAT2-FIELDNAME = 'MATNR'.
WA_FIELDCAT2-TABNAME = 'IT_MARC'.
WA_FIELDCAT2-SELTEXT_L = 'MATERIAL NUM'.
WA_FIELDCAT2-COL_POS = 1.
WA_FIELDCAT2-OUTPUTLEN = 18.
APPEND WA_FIELDCAT2 TO IT_FIELDCAT2.
CLEAR WA_FIELDCAT2.
WA_FIELDCAT2-FIELDNAME = 'WERKS'.
WA_FIELDCAT2-TABNAME = 'IT_MARC'.
WA_FIELDCAT2-SELTEXT_L = 'PLANT'.
WA_FIELDCAT2-COL_POS = 2.
WA_FIELDCAT2-OUTPUTLEN = 4.
APPEND WA_FIELDCAT2 TO IT_FIELDCAT2.
CLEAR WA_FIELDCAT2.
WA_FIELDCAT2-FIELDNAME = 'LADGR'.
WA_FIELDCAT2-TABNAME = 'IT_MARC'.
WA_FIELDCAT2-SELTEXT_L = 'LOAD GRP'.
WA_FIELDCAT2-COL_POS = 3.
WA_FIELDCAT2-OUTPUTLEN = 4.
APPEND WA_FIELDCAT2 TO IT_FIELDCAT2.
CLEAR WA_FIELDCAT2.
WA_FIELDCAT2-FIELDNAME = 'MTVFP'.
WA_FIELDCAT2-TABNAME = 'IT_MARC'.
WA_FIELDCAT2-SELTEXT_L = 'GRP CHK'.
WA_FIELDCAT2-COL_POS = 4.
WA_FIELDCAT2-OUTPUTLEN = 4.
APPEND WA_FIELDCAT2 TO IT_FIELDCAT2.
CLEAR WA_FIELDCAT2.
WA_FIELDCAT2-FIELDNAME = 'DISPR'.
WA_FIELDCAT2-TABNAME = 'IT_MARC'.
WA_FIELDCAT2-SELTEXT_L = 'MRP PROFILE'.
WA_FIELDCAT2-COL_POS = 5.
WA_FIELDCAT2-OUTPUTLEN = 4.
APPEND WA_FIELDCAT2 TO IT_FIELDCAT2.
CLEAR WA_FIELDCAT2.
WA_FIELDCAT2-FIELDNAME = 'DISMM'.
WA_FIELDCAT2-TABNAME = 'IT_MARC'.
WA_FIELDCAT2-SELTEXT_L = 'MRP TYPE'.
WA_FIELDCAT2-COL_POS = 6.
WA_FIELDCAT2-OUTPUTLEN = 4.
APPEND WA_FIELDCAT2 TO IT_FIELDCAT2.
CLEAR WA_FIELDCAT2.
WA_FIELDCAT2-FIELDNAME = 'DISPO'.
WA_FIELDCAT2-TABNAME = 'IT_MARC'.
WA_FIELDCAT2-SELTEXT_L = 'MRP CON'.
WA_FIELDCAT2-COL_POS = 7.
WA_FIELDCAT2-OUTPUTLEN = 4.
APPEND WA_FIELDCAT2 TO IT_FIELDCAT2.
CLEAR WA_FIELDCAT2.
ENDFORM. " modify_fieldcat
*& Form BLOCK_LIST
text
--> p1 text
<-- p2 text
FORM BLOCK_LIST .
CLEAR WA_LAYOUT.
WA_LAYOUT-ZEBRA = 'X'.
WA_LAYOUT-TOTALS_TEXT = 'TOTAL'.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_INIT'
EXPORTING
I_CALLBACK_PROGRAM = G_REPID
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = 'user_command'.
IT_EXCLUDING =
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
EXPORTING
IS_LAYOUT = WA_LAYOUT
IT_FIELDCAT = IT_FIELDCAT[]
I_TABNAME = 'IT_MARA'
IT_EVENTS = GT_XEVENTS
IT_SORT = IT_SORT
I_TEXT = ' '
TABLES
T_OUTTAB = IT_MARA
EXCEPTIONS
PROGRAM_ERROR = 1
MAXIMUM_OF_APPENDS_REACHED = 2
OTHERS = 3
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
EXPORTING
IS_LAYOUT = WA_LAYOUT
IT_FIELDCAT = IT_FIELDCAT1
I_TABNAME = 'IT_MAKT'
IT_EVENTS = GT_YEVENTS
IT_SORT =
I_TEXT = ' '
TABLES
T_OUTTAB = IT_MAKT
EXCEPTIONS
PROGRAM_ERROR = 1
MAXIMUM_OF_APPENDS_REACHED = 2
OTHERS = 3
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
EXPORTING
IS_LAYOUT = WA_LAYOUT
IT_FIELDCAT = IT_FIELDCAT2
I_TABNAME = 'IT_MARC'
IT_EVENTS = GT_ZEVENTS
IT_SORT =
I_TEXT = ' '
TABLES
T_OUTTAB = IT_MARC
EXCEPTIONS
PROGRAM_ERROR = 1
MAXIMUM_OF_APPENDS_REACHED = 2
OTHERS = 3
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
IS_PRINT = GT_PRINT
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 =
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. " BLOCK_LIST
*& Form EVENT_LIST
text
--> p1 text
<-- p2 text
FORM EVENT_LIST .
CLEAR XS_EVENT.
XS_EVENT-NAME = SLIS_EV_TOP_OF_PAGE.
XS_EVENT-FORM = 'XTOP_OF_PAGE'.
APPEND XS_EVENT TO GT_XEVENTS.
CLEAR XS_EVENT.
XS_EVENT-NAME = SLIS_EV_END_OF_PAGE.
XS_EVENT-FORM = 'XEND_OF_PAGE'.
APPEND XS_EVENT TO GT_XEVENTS.
CLEAR XS_EVENT.
XS_EVENT-NAME = SLIS_EV_TOP_OF_LIST.
XS_EVENT-FORM = 'XTOP_OF_LIST'.
APPEND XS_EVENT TO GT_XEVENTS.
CLEAR XS_EVENT.
XS_EVENT-NAME = SLIS_EV_END_OF_LIST.
XS_EVENT-FORM = 'XEND_OF_LIST'.
APPEND XS_EVENT TO GT_XEVENTS.
CLEAR XS_EVENT.
XS_EVENT-NAME = SLIS_EV_END_OF_PAGE.
XS_EVENT-FORM = 'YEND_OF_PAGE'.
APPEND XS_EVENT TO GT_YEVENTS.
CLEAR XS_EVENT.
XS_EVENT-NAME = SLIS_EV_TOP_OF_PAGE.
XS_EVENT-FORM = 'YTOP_OF_PAGE'.
APPEND XS_EVENT TO GT_YEVENTS.
CLEAR XS_EVENT.
XS_EVENT-NAME = SLIS_EV_TOP_OF_LIST.
XS_EVENT-FORM = 'YTOP_OF_LIST'.
APPEND XS_EVENT TO GT_YEVENTS.
CLEAR XS_EVENT.
XS_EVENT-NAME = SLIS_EV_END_OF_LIST.
XS_EVENT-FORM = 'YEND_OF_LIST'.
APPEND XS_EVENT TO GT_YEVENTS.
CLEAR XS_EVENT.
XS_EVENT-NAME = SLIS_EV_END_OF_PAGE.
XS_EVENT-FORM = 'ZEND_OF_PAGE'.
APPEND XS_EVENT TO GT_ZEVENTS.
CLEAR XS_EVENT.
XS_EVENT-NAME = SLIS_EV_TOP_OF_PAGE.
XS_EVENT-FORM = 'ZTOP_OF_PAGE'.
APPEND XS_EVENT TO GT_ZEVENTS.
CLEAR XS_EVENT.
XS_EVENT-NAME = SLIS_EV_TOP_OF_LIST.
XS_EVENT-FORM = 'ZTOP_OF_LIST'.
APPEND XS_EVENT TO GT_ZEVENTS.
CLEAR XS_EVENT.
XS_EVENT-NAME = SLIS_EV_END_OF_LIST.
XS_EVENT-FORM = 'ZEND_OF_LIST'.
APPEND XS_EVENT TO GT_ZEVENTS.
CLEAR XS_EVENT.
ENDFORM. " EVENT_LIST
FORM XTOP_OF_PAGE.
WRITE:/ 'TOP OF PAGE FOR MARA'.
ENDFORM.
FORM YTOP_OF_PAGE.
WRITE:/ 'TOP OF PAGE FOR MAKT'.
ENDFORM.
FORM ZTOP_OF_PAGE.
WRITE:/ 'TOP OF PAGE FOR MARC'.
ENDFORM.
FORM XEND_OF_PAGE.
WRITE:/ 'END OF PAGE FOR MARA'.
ENDFORM.
FORM YEND_OF_PAGE.
WRITE:/ 'END OF PAGE FOR MAKT'.
ENDFORM.
FORM ZEND_OF_PAGE.
WRITE:/ 'END OF PAGE FOR MARC'.
ENDFORM.
FORM XTOP_OF_LIST.
WRITE:/ 'TOP OF LIST FOR MARA'.
ENDFORM.
FORM YTOP_OF_LIST.
WRITE:/ 'TOP OF LIST FOR MAKT'.
ENDFORM.
FORM ZTOP_OF_LIST.
WRITE:/ 'TOP OF LIST FOR MARC'.
ENDFORM.
FORM XEND_OF_LIST.
WRITE:/ 'END OF LIST FOR MARA'.
ENDFORM.
FORM YEND_OF_LIST.
WRITE:/ 'END OF LIST FOR MAKT'.
ENDFORM.
FORM ZEND_OF_LIST.
WRITE:/ 'END OF LIST FOR MARC'.
ENDFORM.
*& Form sort_list
text
--> p1 text
<-- p2 text
FORM SORT_LIST .
CLEAR WA_SORT.
WA_SORT-FIELDNAME = 'MTART'.
WA_SORT-SUBTOT = 'X'.
APPEND WA_SORT TO IT_SORT.
CLEAR WA_SORT.
WA_SORT-FIELDNAME = 'MATKL'.
WA_SORT-SUBTOT = 'X'.
APPEND WA_SORT TO IT_SORT.
CLEAR WA_SORT.
ENDFORM. " sort_list
regards,
keerthi
Similar Messages
-
ALV with multiple header & dynamic columns
Hello All,
I have a requirement where in I need to print multiple header in alv.
For eg.
User Name : <Name_1>
Channel : <Channel_1>
Sale Org : <Sales Org_1>
Col1 Col2 Col3 Col4 Col5 Col6 Col7 Col8
User Name : <Name_2>
Channel : <Channel_2>
Sale Org : <Sales Org_2>
Col1 Col2 Col3 Col4 Col5 Col6 Col7 Col8
no of columns (Col1 , col2 ) are dynamic . Which would be the best alv type do I need do use? Is it possible using simple alv grid display. How to handle dynamic column.
Thnx.it is not possible with normal grid or list.
I guess it is possible by using ALV Block list
Modified below program to get mutiple header
REPORT z_alv_block_list.
Type-pools
TYPE-POOLS: slis.
Data declarations.
DATA: BEGIN OF t_vbak OCCURS 0,
vbeln TYPE vbeln,
bstnk TYPE vbak-bstnk,
erdat TYPE vbak-erdat,
kunnr TYPE vbak-kunnr,
END OF t_vbak.
DATA: BEGIN OF t_vbap OCCURS 0,
vbeln TYPE vbeln,
matnr TYPE vbap-matnr,
netpr TYPE vbap-netpr,
waerk TYPE vbap-waerk,
kwmeng TYPE vbap-kwmeng,
meins TYPE vbap-meins,
END OF t_vbap.
DATA: t_fieldcatalog1 TYPE slis_t_fieldcat_alv.
DATA: t_fieldcatalog2 TYPE slis_t_fieldcat_alv.
DATA: v_repid TYPE syrepid.
DATA: s_layout TYPE slis_layout_alv.
DATA: v_tabname TYPE slis_tabname.
DATA: t_events TYPE slis_t_event.
start-of-selection event.
START-OF-SELECTION.
v_repid = sy-repid.
Get the fieldcatalog for the first block
PERFORM get_fieldcat1 CHANGING t_fieldcatalog1.
Get the fieldcatalog for the second block
PERFORM get_fieldcat2 CHANGING t_fieldcatalog2.
Get the data for the first block
SELECT vbeln bstnk erdat kunnr UP TO 10 ROWS
INTO TABLE t_vbak
FROM vbak WHERE vbeln > '0060000100'.
Get the data for the second block
SELECT vbeln matnr netpr waerk kwmeng meins UP TO 10
ROWS
INTO TABLE t_vbap
FROM vbap WHERE vbeln > '0060000100'.
init
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_INIT'
EXPORTING
i_callback_program = v_repid.
First block
v_tabname = 'ITAB1'.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
EXPORTING
is_layout = s_layout
it_fieldcat = t_fieldcatalog1
i_tabname = v_tabname
it_events = t_events
TABLES
t_outtab = t_vbak.
Second block
v_tabname = 'ITAB2'.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
EXPORTING
is_layout = s_layout
it_fieldcat = t_fieldcatalog2
i_tabname = v_tabname
it_events = t_events
TABLES
t_outtab = t_vbap.
*Display
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_DISPLAY'
FORM GET_FIELDCAT1
Get the field catalog for the first block
FORM get_fieldcat1 CHANGING lt_fieldcatalog TYPE
slis_t_fieldcat_alv.
DATA: s_fieldcatalog TYPE slis_fieldcat_alv.
Order number
s_fieldcatalog-col_pos = '1'.
s_fieldcatalog-fieldname = 'VBELN'.
s_fieldcatalog-tabname = 'T_VBAK'.
s_fieldcatalog-ref_tabname = 'VBAK'.
s_fieldcatalog-ref_fieldname = 'VBELN'.
APPEND s_fieldcatalog TO lt_fieldcatalog.
CLEAR s_fieldcatalog.
Customer purchase order.
s_fieldcatalog-col_pos = '2'.
s_fieldcatalog-fieldname = 'BSTNK'.
s_fieldcatalog-tabname = 'T_VBAK'.
s_fieldcatalog-ref_tabname = 'VBAK'.
s_fieldcatalog-ref_fieldname = 'BSTNK'.
APPEND s_fieldcatalog TO lt_fieldcatalog.
CLEAR s_fieldcatalog.
Creation date.
s_fieldcatalog-col_pos = '3'.
s_fieldcatalog-fieldname = 'ERDAT'.
s_fieldcatalog-tabname = 'T_VBAK'.
s_fieldcatalog-ref_tabname = 'VBAK'.
s_fieldcatalog-ref_fieldname = 'ERDAT'.
APPEND s_fieldcatalog TO lt_fieldcatalog.
CLEAR s_fieldcatalog.
Customer
s_fieldcatalog-col_pos = '4'.
s_fieldcatalog-fieldname = 'KUNNR'.
s_fieldcatalog-tabname = 'T_VBAK'.
s_fieldcatalog-ref_tabname = 'VBAK'.
s_fieldcatalog-ref_fieldname = 'KUNNR'.
APPEND s_fieldcatalog TO lt_fieldcatalog.
CLEAR s_fieldcatalog.
ENDFORM.
FORM GET_FIELDCAT2
Get the field catalog for the second block
FORM get_fieldcat2 CHANGING lt_fieldcatalog TYPE
slis_t_fieldcat_alv.
DATA: s_fieldcatalog TYPE slis_fieldcat_alv.
Order number
s_fieldcatalog-col_pos = '1'.
s_fieldcatalog-fieldname = 'VBELN'.
s_fieldcatalog-tabname = 'T_VBAP'.
s_fieldcatalog-ref_tabname = 'VBAP'.
s_fieldcatalog-ref_fieldname = 'VBELN'.
APPEND s_fieldcatalog TO lt_fieldcatalog.
CLEAR s_fieldcatalog.
Material number
s_fieldcatalog-col_pos = '2'.
s_fieldcatalog-fieldname = 'MATNR'.
s_fieldcatalog-tabname = 'T_VBAP'.
s_fieldcatalog-ref_tabname = 'VBAP'.
s_fieldcatalog-ref_fieldname = 'MATNR'.
APPEND s_fieldcatalog TO lt_fieldcatalog.
CLEAR s_fieldcatalog.
Net price
s_fieldcatalog-col_pos = '3'.
s_fieldcatalog-fieldname = 'NETPR'.
s_fieldcatalog-tabname = 'T_VBAP'.
s_fieldcatalog-ref_tabname = 'VBAP'.
s_fieldcatalog-ref_fieldname = 'NETPR'.
s_fieldcatalog-cfieldname = 'WAERK'.
s_fieldcatalog-ctabname = 'T_VBAP'.
APPEND s_fieldcatalog TO lt_fieldcatalog.
CLEAR s_fieldcatalog.
Currency.
s_fieldcatalog-col_pos = '4'.
s_fieldcatalog-fieldname = 'WAERK'.
s_fieldcatalog-tabname = 'T_VBAP'.
s_fieldcatalog-ref_tabname = 'VBAP'.
s_fieldcatalog-ref_fieldname = 'WAERK'.
APPEND s_fieldcatalog TO lt_fieldcatalog.
CLEAR s_fieldcatalog.
Quantity
s_fieldcatalog-col_pos = '5'.
s_fieldcatalog-fieldname = 'KWMENG'.
s_fieldcatalog-tabname = 'T_VBAP'.
s_fieldcatalog-ref_tabname = 'VBAP'.
s_fieldcatalog-ref_fieldname = 'KWMENG'.
s_fieldcatalog-qfieldname = 'MEINS'.
s_fieldcatalog-qtabname = 'T_VBAP'.
APPEND s_fieldcatalog TO lt_fieldcatalog.
CLEAR s_fieldcatalog.
UOM
s_fieldcatalog-col_pos = '6'.
s_fieldcatalog-fieldname = 'MEINS'.
s_fieldcatalog-tabname = 'T_VBAP'.
s_fieldcatalog-ref_tabname = 'VBAP'.
s_fieldcatalog-ref_fieldname = 'MEINS'.
APPEND s_fieldcatalog TO lt_fieldcatalog.
CLEAR s_fieldcatalog.
ENDFORM. -
Help on ALV with multiple header/item output
Dear all:
Below is the actual working code on a multiple header/item display. The alv is supposed to output the details differently in each list. But somehow it only display the last i_tab I gave in all the list(they all look the same). Please help me out here how I can change my code to work properly. Thanks...
*& Report ZTEST2
REPORT ZTEST2.
type-pools: slis.
data : NUM1 type I,
NUM type I,
begin of str,
client like mara-mandt,
mat like mara-matnr,
end of str,
tab like standard table of str.
data :wa2 type slis_alv_event ,
tab2 like standard table of wa2,
wa1 type slis_layout_alv,
wa type line of slis_t_fieldcat_alv,
tab1 like standard table of wa.
wa-reptext_ddic = 'Client Num'.
wa-fieldname = 'CLIENT'.
wa-tabname = 'TAB'.
wa-ref_fieldname = 'MANDT'.
wa-ref_tabname = 'MARA'.
wa-seltext_l = 'CLIENT'.
append wa to tab1.
wa-reptext_ddic = 'Mat Number'.
wa-fieldname = 'MAT'.
wa-tabname = 'TAB'.
wa-ref_fieldname = 'MATNR'.
wa-ref_tabname = 'MARA'.
wa-seltext_l = 'MATERIAL'.
append wa to tab1.
wa1-no_colhead = 'X'.
wa2-NAME = SLIS_EV_TOP_OF_PAGE.
wa2-FORM = 'WRITE_TOP_PAGE'.
APPEND wa2 TO tab2.
NUM = 0.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_INIT'
EXPORTING
I_CALLBACK_PROGRAM = sy-cprog.
do 2 times.
NUM1 = NUM1 + 10.
refresh: tab.
select mandt matnr up to NUM1 rows from mara into table tab.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
EXPORTING
IS_LAYOUT = wa1
IT_FIELDCAT = tab1
I_TABNAME = 'TAB'
IT_EVENTS = tab2
TABLES
T_OUTTAB = tab.
enddo.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_DISPLAY'.
FORM WRITE_TOP_PAGE.
NUM = NUM + 1.
WRITE: / ,
/ 'TABLE NUMBER :', NUM.
ENDFORM.Hi Jim,
yes for some reason ALV expects you to be using different tables. It seems that it does not save the contents of the tables at each call of 'append' rather it waits until 'display' to deal with the table contents at that time, which in your case is the 20 items.
What you can do is use dynamic tables. check this out:
REPORT ZNRW_ALV_BLOCK .
type-pools: slis.
data : NUM1 type I,
NUM type I.
types:
begin of str,
client like mara-mandt,
mat like mara-matnr,
end of str.
data
tab type standard table of str.
data :wa2 type slis_alv_event ,
tab2 like standard table of wa2,
wa1 type slis_layout_alv,
wa type line of slis_t_fieldcat_alv,
tab1 like standard table of wa.
wa-reptext_ddic = 'Client Num'.
wa-fieldname = 'CLIENT'.
wa-tabname = 'TAB'.
wa-ref_fieldname = 'MANDT'.
wa-ref_tabname = 'MARA'.
wa-seltext_l = 'CLIENT'.
append wa to tab1.
wa-reptext_ddic = 'Mat Number'.
wa-fieldname = 'MAT'.
wa-tabname = 'TAB'.
wa-ref_fieldname = 'MATNR'.
wa-ref_tabname = 'MARA'.
wa-seltext_l = 'MATERIAL'.
append wa to tab1.
wa1-no_colhead = 'X'.
wa2-NAME = SLIS_EV_TOP_OF_PAGE.
wa2-FORM = 'WRITE_TOP_PAGE'.
APPEND wa2 TO tab2.
NUM = 0.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_INIT'
EXPORTING
I_CALLBACK_PROGRAM = sy-cprog.
DATA tabDREF TYPE REF TO DATA.
FIELD-SYMBOLS <tab> TYPE table.
do 2 times.
CREATE DATA tabdref TYPE table of str.
ASSIGN tabDREF->* TO <tab>.
NUM1 = NUM1 + 10.
refresh: tab.
select mandt matnr up to NUM1 rows from mara into table <tab>.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
EXPORTING
IS_LAYOUT = wa1
IT_FIELDCAT = tab1
I_TABNAME = 'TAB'
IT_EVENTS = tab2
TABLES
T_OUTTAB = <tab>.
enddo.
CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_DISPLAY'.
FORM WRITE_TOP_PAGE.
NUM = NUM + 1.
WRITE: / ,
/ 'TABLE NUMBER :', NUM.
ENDFORM. -
Re: to create outbound file with multiple header ,detail and trailor in informatica
Dear Mohan Prakash, Please mentation The Target Which Format you need. Please let me know. Thanks & RegardsKasireddy+966545281845
hi I want to create a file with muiltple header detail and trailorSample of my file 1F99500094959 5F99000000999911025F99000000999912025F99000000999913029F99500094959 1G83341002729803 5G83000000999918020109G83341002729803 1G83910377940 5G830000009999190201011050003522029G83910377940 T20110720000000900000006750{ In this file 1 is header and 5 is detail and 9 is trailer and in last T segment is also trailerI have any idea to create seperate 3 files and in lastconcatenate all file with the help of unixbut in my case data is so large (in millions) this approach is not use full please suggest my any ideaHow to create VSAM file
-
Displaying columns of alv with Main Heading and Sub Heading
Hi friends.
I have certain fields in display of ALV.
Out of all fields(columns), I would have to display some columns with one Main Heading,Below it's being split in multiple rows.
I have data relevent to that multiple fields.
Let say ,
In first row it will show |Allowance |
In second |HRA |PA | OTHERS|
Thanks And Regards,
Amit RautHi,
This is not possible
Refer these links
Re: ALV query
Re: Multiple lines in alv column headings
If this solves ur problem reward points and close the thread -
Hello All,
i have a requirement where i have to have multiple headers in a single alv.
The exact requirement is like.
Header1----
row1
row2 1 unit
row3
row4----
Header2
row1
row2
row3
row4
Header3
row1
row2
row3
row4
and the number of individual units is not fixed and will be determined at runtime.
Can somebody tell me the steps to achieve it.
actually i tried using block alv in loop but it is showing inconsistent data and moreover it has a limitation of 19 appends.make you are looking a break page
check this
http://hosteddocs.ittoolbox.com/kk021909.pdf -
Match 2 itab into 1 alv with not identical header.
Hello experts,
I have 2 itab: it_reguh with 12 fields, and it_regup with 9 fields.
For all 1 row from it_reguh can be some row correctly in it_regup, and header not identical.
How can i to join them to 1 alv with the header of it_reguh and header of it_regup ?
For example: ALV like this:
IT_REGUH-HEADER.
IT_REGUH-ROW1.
IT_REGUP-HEADER.
IT_REGUP-ROW1.
IT_REGUP-ROW2.
IT_REGUH-HEADER.
IT_REGUH-ROW2.
IT_REGUP-HEADER.
IT_REGUP-ROW1.
IT_REGUP-ROW2.
Thanks for the help,
Avi.Hi,
Generally this is the relationship between Header(REGUH) and Item(REGUP)
** Getting the item Data REGUP from header table REGUH
CLEAR : l_regup_data,wa_with_item.
REFRESH :l_regup_data.
SELECT * FROM regup INTO TABLE l_regup_data
WHERE laufd = reguh_data-laufd
AND laufi = reguh_data-laufi
AND xvorl = reguh_data-xvorl
AND zbukr = reguh_data-zbukr
AND lifnr = reguh_data-lifnr
AND vblnr = reguh_data-vblnr.
IF sy-subrc = 0.
ENDIF.
so try to create common internal table with Reguh and regup table.
write the below query
Loop at regup.
read table reguh with above key combination.
If sy-subrc = 0.
"Append reguh and regup contents to final internal table
endif.
ENDloop.
Prabhudas -
Calling Web Service with SOAP header from BPEL
Hi,
I am calling a web service (with header information) from BPEL. In the Invoke activity, i created a header variable to pass the header information.
But, when i test the BPEL service, invoke activity fails because the header information is not being passed.
Below is the error message (copied from clipboard).
+<messages><input><Invoke_1_getsubinfo_InputVariable><part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="parameters"><getsubinfoElement xmlns="http://ws/its/tabs/webservices/SingleRowWS/SingleRowWS.wsdl">+
+<pSubnoin>+
+<insubno>12345678</insubno>+
+</pSubnoin>+
+</getsubinfoElement>+
+</part></Invoke_1_getsubinfo_InputVariable></input><fault><bindingFault xmlns="http://schemas.oracle.com/bpel/extension"><part name="summary"><summary>exception on JaxRpc invoke:+
start fault message:+
Internal Server Error (Caught exception while handling request: javax.xml.rpc.JAXRPCException: Not authenticated user)+
*:end fault message*</summary>
+</part></bindingFault></fault></messages>+
As said, no header information is visible in the Invoke activity.
Please provide help for the above issue.
-MJHello Patrick,
Thanks for the response. I am using normal assign activity to assign values to the header variable as shown below. HeadMT is the header variable which is passed in the invoke activity.
+<assign name="Assign_Header">+
+<copy>+
+<from expression="'tkl12'"/>+
+<to query="/ns1:LOGIN_INFO/ns1:USER_NAME" variable="*HeadMT*"+
part="payload"/>
+</copy>+
+<copy>+
+<from expression="'tkl123'"/>+
+<to query="/ns1:LOGIN_INFO/ns1:PASSWORD" variable="*HeadMT*"+
part="payload"/>
+</copy>+
+<copy>+
+<from expression="'TKL'"/>+
+<to query="/ns1:LOGIN_INFO/ns1:CHANNEL_ID" variable="*HeadMT*"+
part="payload"/>
+</copy>+
+</assign>+
The expected input by the web service is as below with the header information highlighted.
+<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://ws/webservices/RowWS/RowWS.wsdl">+
+*<soap:Header>*+
+*<ns1:LOGIN_INFO>*+
+*<ns1:USERNAME>tkl12</ns1:USERNAME>*+
+*<ns1:PASSWORD>tkl123</ns1:PASSWORD>*+
+*<ns1:CHANNEL_ID>TKL</ns1:CHANNEL_ID>*+
+*</ns1:LOGIN_INFO>*+
+*</soap:Header>*+
+<soap:Body>+
+<ns1:substatusElement>+
+<ns1:pInparam>+
+<ns1:insubno>7674988</ns1:insubno>+
+</ns1:pInparam>+
+</ns1:substatusElement>+
+</soap:Body>+
+</soap:Envelope>+ -
Multiple Header line in Receiver File adapter
Hi,
I have an issue in Receiver File adapter with multiple header lines. I am able to get only 1 header lines in the receiver file but not multiple header lines with 'nl' since it is static in file mode
[CommunityTag:Header]
empNo,EmpName,Age
[CommunityTag]
I tried with the below in content conversion one as below with no luck
Root.addHeaderLine=1
Root.headerLine=[CommunityTag:Header] 'nl' empNo,EmpName,Age 'nl' [CommunityTag]
Root.fiedSeparator=,
Root.endSeparator='nl'
I am getting the Header line as same row as static text.
Can you advise this.Hi Gabriel, I suggest to produce the header lines from additional nodes in the message payload. That means you need to modify the data type of the target message in order to generate an extra structure in the payload. Use constants in message mapping to generate the header column names, e.g.
<Header>
<H1>CommunityTag:Header</H1>
<H2>empNo,EmpName,Age</H2>
<H3>CommunityTag</H3>
</Header>
In content conversion you have to convert the Header row with
Header.endSeparator='nl'
You won't need parameter addHeaderLine anymore then.
Regards, Martin -
List of IIS websites with Host header
Hi,
I am looking for a script, to export a list of websites along with host header information. This should accept list of IIS servers 6/7/7.5 and provide output into a text file.
Thanks,
Kunal JaiswalMight look around here.
https://gallery.technet.microsoft.com/scriptcenter/site/search?f%5B0%5D.Type=RootCategory&f%5B0%5D.Value=servers&f%5B0%5D.Text=Servers&f%5B1%5D.Type=SubCategory&f%5B1%5D.Value=iis&f%5B1%5D.Text=IIS
or try asking them over here.
http://forums.iis.net/
Regards, Dave Patrick ....
Microsoft Certified Professional
Microsoft MVP [Windows]
Disclaimer: This posting is provided "AS IS" with no warranties or guarantees , and confers no rights. -
Posting an Idoc with Multiple Headers and Multiple Lines
Hi all,
I have a scenario like this fileXIIdoc
Invoice file comes in text file with multiple header and multiple lines like this
111 aaa 13214234 US (header)
09082010 ABC 9999 A (Line)
222 ccc 43454543 US (header)
09082010 XYZ 7777 B (Line)
09082010 PQR 8888 C (Line)
I need to post single Idoc with all the headers and lines
we are planning to use Custom Idoc,Is this possible by having the header segment as unbounded??
Regards
Edited by: Vamsi Krishna on Sep 8, 2010 8:05 PMhi,
lets go again.
you have to edit the custom IDoc and change the ocurrance on the header segment. also modify the details segment adding an addtional field that identify which header that this detail belong.
for this case you cannot change the occurrance in SAP PI because you wont identify what i have told you before. in PI apply to change the occurrance if you could send ONE Idoc Per Header.
now is better clear???
Let us know.
Thanks
Rodrigo P-. -
ALV column header with multiple rows and ALV column header span
How could I have in an ALV a column header on several lines and/or a column header that spans on multiple columns?
i.e. I would like to have in an ALV two columns, each with it's own distinct header and additionally another column header for both of the columns, that spans across both columns. How could I program this?Hi,
follow below mentioned code
SET THE LABEL OF THE COLUMN
DATA: hr_weeknum TYPE REF TO cl_salv_wd_column_header.
CALL METHOD lr_weeknum->get_header
RECEIVING
value = hr_weeknum.
CALL METHOD lr_weeknum->set_resizable
EXPORTING
value = abap_false.
hr_weeknum->set_prop_ddic_binding_field(
property = if_salv_wd_c_ddic_binding=>bind_prop_text
value = if_salv_wd_c_ddic_binding=>ddic_bind_none ).
set the text of the column
CALL METHOD hr_weeknum->set_text
EXPORTING
value = 'C Form'.
Regards,
Srini. -
Hello ,
I have a requirement to display Multiple heading in ALV Grid, I am using the Class 'cl_gui_alv_grid'. please let me know if you have Any suggestions.
Ex:
| Divison |
Sub D:1
Sub D: 2
Sub D: 3
Like wise i have few more divisions to display and Under we need to display the Sub Division also .
Thanks in Advance.. Waiting for your suggestions.
With Best Regards
NagsHi,
I had attempted to do it in the object oriented way, but found no ready solution, so I settled for the below solution.
Please use the function REUSE_ALV_COMMENTARY_WRITE.
This allows you to print multiple lines in the header.
I had a requirement of showing 5 lines in the header.
So i went on like:
DATA: it_list_commentary TYPE slis_t_listheader,
wa_list_commentary TYPE slis_listheader.
wa_list_commentary-typ = 'H'.
wa_list_commentary-info = <text>.
APPEND wa_list_commentary TO it_list_commentary.
wa_list_commentary-typ = 'S'.
wa_list_commentary-info = <text>.
APPEND wa_list_commentary TO it_list_commentary.
I fed he internal table with all 5 lines like above.
Finally I called the function.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = it_list_commentary.
Regards,
Prosenjit.
Edited by: prosenjit chaudhuri on Jan 28, 2009 6:14 AM -
ALV Grid with Multiple Headers
Dear All ,
I want to know is it possible to display Multiple header in the ALV Grid Display it is possible in List Display that i dne but i want in
My requirment is :
Header 1 | Header 2
SubHeader 1 | SubHeader 2 | SubHeader 3 | SubHeader 4
R1 | R2 | R1 | R2 |
R1 | R2 | R1 | R2 |
R1 | R2 | R1 | R2 |
R1 | R2 | R1 | R2 |
R1 | R2 | R1 | R2 |
R1 | R2 | R1 | R2 |
Header line 1 and Header line 2 in this format .
How it could be possible Please suggest or its not at all possible . Please suggest .
Thanks & Regards,
Aryan>
Aryan@sap wrote:
> That i will do in end but i want with ALV Grid . If it wont be possible with ALV grid i will finally do with ALV List .
> If any solution possible through ALV Grid then Please Suggest .
Then go for ALV List. But i am not sure if you can achieve this using the method suggested by Soumyaprakash.
You can give it a try though.
It is possible because that I have seen in standard here i cant paste the screen shot . but how its comming tht i am not able to analysis .
This is news to me now. Which standard code are you referring to?
Good luck !! -
ALV Hierarichal display with multiple line headings
Hi,
I have designed an ALV report with Hierarichal display with multiple line headings...
When i change the layout of this report,the headings which we enter manually will not take effect.The column we can hide in the report using the layout management.But the heading remains the same since it was written manually in top of page.
Is there any possiblity to work out the Manual headings based on the layout fields.Hi,
Do you use REUSE_ALV_HIERSEQ_LIST_DISPLAY? Why do you write heading manually? You can use IT_FIELDCAT parameter for defining a field catalog.
Maybe you are looking for
-
File sender adapter is not working
Hello All, We are facing a problems with file sender adapter. Communication channel is not picking the files from the directory, but the status in RWB for that channel is 'Functioning'. We are not sure whether the channel is locked or any other probl
-
Video Issues in Adobe Presenter 9
Video issues - I have inserted a 3 minute video in a Presenter 9 file and it plays fine when previewing but only 6 seconds when published. Plays 6 seconds and then buffers. I have tried inserting different formats and still get the same results.
-
Need help placing image behind design
I am currently designing a DVD case for a wedding client. I have everything on it completed, except that I cannot send the picture behind the design, so that it is only visible through the circular opening. I've tried rearranging layers, changing vis
-
Multiple XSL Transformations in ASP
Dreamweaver will permit multiple inserts of XSL Transformations in PHP but when attempting the same in ASP -after inserting and testing the first, the option: Insert > Application Object > XSL Transformation is greyed out. If I try pasting in the tra
-
Ipod nano saying my ipod is a removable G disk drive
I have 2 ipod nanos (one 3rd Generation and other 4th Generation) when i use my 2.0 USB cable and have ITUNES open it comes up as a removable disk drive G and is a FAT32 system. How do i correct this problem. Any help would be appericated thanks.