How to display two lables in alv report
Is there any chance to display two lables in alv report
for example..
AMOUNT
Rs | Ps
|
like that this for an example.
thanks,
JB
Hai Babu
Go through the following Code
using Classes & Methods
try with the following Code( Just copy the code & try with in SE38 Tcode & Execute it that all)
REPORT ZALV_SALES_HEADER_DETAIL MESSAGE-ID Z50650(MSG) .
TABLES
TABLES: VBAK . "SALES DOCUMENT HEADER
DATA OBJECTS DECLARATION
DATA: IT_VBAK TYPE STANDARD TABLE OF ZVBAK_STRUC,
IT_VBAP TYPE STANDARD TABLE OF ZVBAP_STRUC,
GS_LAYOUT TYPE LVC_S_LAYO,
GS1_LAYOUT TYPE LVC_S_LAYO,
GRID TYPE REF TO CL_GUI_ALV_GRID,
CUSTOM_CONTAINER TYPE REF TO CL_GUI_CUSTOM_CONTAINER,
VBAK_CONTAINER TYPE REF TO CL_GUI_CONTAINER,
VBAP_CONTAINER TYPE REF TO CL_GUI_CONTAINER,
WA_VBAK LIKE LINE OF IT_VBAK,
WA_VBAP LIKE LINE OF IT_VBAP,
SPLITTER TYPE REF TO CL_GUI_SPLITTER_CONTAINER,
TOP_OF_PAGE_CONTAINER TYPE REF TO CL_GUI_CONTAINER,
GRID_VBAP TYPE REF TO CL_GUI_ALV_GRID,
TOP_PAGE TYPE REF TO CL_DD_DOCUMENT,
FLAG(1).
*"EVENT RECIEVER CLASS DEFINITION
CLASS LCL_EVENT_RECIEVER DEFINITION DEFERRED.
DATA: OBJ_EVENT TYPE REF TO LCL_EVENT_RECIEVER.
SELECTION-SCREEN
SELECTION-SCREEN: BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
SELECT-OPTIONS: S_VBELN FOR VBAK-VBELN.
PARAMETERS: P_VBTYP LIKE VBAK-VBTYP DEFAULT 'C'.
SELECTION-SCREEN: END OF BLOCK B1.
CLASS DEFINITION AND DECLARATIONS
CLASS LCL_EVENT_RECIEVER DEFINITION.
PUBLIC SECTION.
EVENTS:DOUBLE_CLICK,
TOP_OF_PAGE.
METHODS:HANDLE_DOUBLE_CLICK FOR EVENT DOUBLE_CLICK OF CL_GUI_ALV_GRID
IMPORTING E_ROW .
METHODS: HANDLE_TOP_OF_PAGE FOR EVENT TOP_OF_PAGE OF CL_GUI_ALV_GRID.
ENDCLASS. "LCL_EVENT_RECIEVER DEFINITION
CLASS LCL_EVENT_RECIEVER IMPLEMENTATION
CLASS LCL_EVENT_RECIEVER IMPLEMENTATION.
METHOD: HANDLE_DOUBLE_CLICK.
READ TABLE IT_VBAK INDEX E_ROW-INDEX INTO WA_VBAK.
PERFORM FETCH_ITEM_DETAILS USING WA_VBAK.
PERFORM ALV_GRID.
ENDMETHOD. "HANDLE_DOUBLE_CLICK
METHOD: HANDLE_TOP_OF_PAGE.
CALL METHOD TOP_PAGE->ADD_TEXT
EXPORTING
TEXT = 'SALES HEADER & ITEM DETAILS'.
CALL METHOD TOP_PAGE->DISPLAY_DOCUMENT
EXPORTING
PARENT = TOP_OF_PAGE_CONTAINER.
ENDMETHOD. "HANDLER_TOP_OF_PAGE
ENDCLASS. "LCL_EVENT_RECIEVER IMPLEMENTATION
AT SELECTION-SCREEN
AT SELECTION-SCREEN.
IF S_VBELN IS NOT INITIAL.
SELECT COUNT(*)
FROM VBAK
WHERE VBELN IN S_VBELN.
IF SY-DBCNT = 0.
MESSAGE E000 WITH 'NO TABLE ENTRIES FOUND FOR LOW KEY SPECIFIED'.
ENDIF.
ENDIF.
START-OF-SELECTION.
START-OF-SELECTION.
PERFORM FETCH_SALES_HEADER_RECORD.
PERFORM CREATE_CALL. "CREATION OF OBJECTS & CALLING METHODS
END-OF-SELECTION.
END-OF-SELECTION.
*& Module STATUS_0100 OUTPUT
text
MODULE STATUS_0100 OUTPUT.
SET PF-STATUS 'ZSTATUS'.
SET TITLEBAR 'xxx'.
ENDMODULE. " STATUS_0100 OUTPUT
*& Form FETCH_SALES_HEADER_RECORD
text
--> p1 text
<-- p2 text
FORM FETCH_SALES_HEADER_RECORD .
SELECT
VBELN
AUDAT
VBTYP
AUART
AUGRU
NETWR
WAERK
FROM VBAK
INTO CORRESPONDING FIELDS OF TABLE IT_VBAK
WHERE VBELN IN S_VBELN
AND VBTYP = P_VBTYP.
ENDFORM. " FETCH_SALES_HEADER_RECORD
*& Form CREATE_CALL
text
--> p1 text
<-- p2 text
FORM CREATE_CALL .
IF CUSTOM_CONTAINER IS INITIAL.
CREATE OBJECT CUSTOM_CONTAINER
EXPORTING
PARENT =
CONTAINER_NAME = 'CUSTOM_CONTAINER'
STYLE =
LIFETIME = lifetime_default
REPID =
DYNNR =
NO_AUTODEF_PROGID_DYNNR =
EXCEPTIONS
CNTL_ERROR = 1
CNTL_SYSTEM_ERROR = 2
CREATE_ERROR = 3
LIFETIME_ERROR = 4
LIFETIME_DYNPRO_DYNPRO_LINK = 5
OTHERS = 6
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CREATE OBJECT SPLITTER
EXPORTING
TOP = 5
PARENT = CUSTOM_CONTAINER
ROWS = 3
COLUMNS = 1
EXCEPTIONS
CNTL_ERROR = 1
CNTL_SYSTEM_ERROR = 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 METHOD SPLITTER->GET_CONTAINER
EXPORTING
ROW = 1
COLUMN = 1
RECEIVING
CONTAINER = TOP_OF_PAGE_CONTAINER.
CALL METHOD SPLITTER->GET_CONTAINER
EXPORTING
ROW = 2
COLUMN = 1
RECEIVING
CONTAINER = VBAK_CONTAINER.
CALL METHOD SPLITTER->GET_CONTAINER
EXPORTING
ROW = 3
COLUMN = 1
RECEIVING
CONTAINER = VBAP_CONTAINER.
CREATE OBJECT GRID
EXPORTING
I_SHELLSTYLE = 0
I_LIFETIME =
I_PARENT = VBAK_CONTAINER
I_APPL_EVENTS = space
I_PARENTDBG =
I_APPLOGPARENT =
I_GRAPHICSPARENT =
I_NAME =
EXCEPTIONS
ERROR_CNTL_CREATE = 1
ERROR_CNTL_INIT = 2
ERROR_CNTL_LINK = 3
ERROR_DP_CREATE = 4
OTHERS = 5
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
GS_LAYOUT-GRID_TITLE = 'SALES HEADER DETAILS.'(100).
CALL METHOD GRID->SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING
I_BUFFER_ACTIVE =
I_BYPASSING_BUFFER =
I_CONSISTENCY_CHECK =
I_STRUCTURE_NAME = 'ZVBAK_STRUC'
IS_VARIANT =
I_SAVE =
I_DEFAULT = 'X'
IS_LAYOUT = GS_LAYOUT
IS_PRINT =
IT_SPECIAL_GROUPS =
IT_TOOLBAR_EXCLUDING =
IT_HYPERLINK =
IT_ALV_GRAPHICS =
IT_EXCEPT_QINFO =
CHANGING
IT_OUTTAB = IT_VBAK
IT_FIELDCATALOG =
IT_SORT =
IT_FILTER =
EXCEPTIONS
INVALID_PARAMETER_COMBINATION = 1
PROGRAM_ERROR = 2
TOO_MANY_LINES = 3
OTHERS = 4
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDIF.
CREATE OBJECT OBJ_EVENT .
SET HANDLER OBJ_EVENT->HANDLE_DOUBLE_CLICK FOR GRID.
SET HANDLER OBJ_EVENT->HANDLE_TOP_OF_PAGE FOR GRID.
CREATE OBJECT TOP_PAGE
EXPORTING
STYLE = 'ALV_GRID'
CALL METHOD TOP_PAGE->INITIALIZE_DOCUMENT.
CALL METHOD GRID->LIST_PROCESSING_EVENTS
EXPORTING
I_EVENT_NAME = 'TOP_OF_PAGE'
I_DYNDOC_ID = TOP_PAGE.
CALL SCREEN 100.
ENDFORM. " CREATE_CALL
*& Module USER_COMMAND_0100 INPUT
text
MODULE USER_COMMAND_0100 INPUT.
CASE SY-UCOMM.
WHEN 'EXIT'.
LEAVE PROGRAM.
WHEN 'BACK'.
LEAVE TO SCREEN 0.
ENDCASE.
ENDMODULE. " USER_COMMAND_0100 INPUT
*& Form FETCH_ITEM_DETAILS
text
--> p1 text
<-- p2 text
FORM FETCH_ITEM_DETAILS USING WA_VBAK TYPE ZVBAK_STRUC .
SELECT
VBELN
POSNR
MATNR
MATWA
PMATN
CHARG
FROM VBAP
INTO TABLE IT_VBAP
WHERE VBELN = WA_VBAK-VBELN.
IF SY-SUBRC <> 0.
MESSAGE E000 WITH 'NO RECORDS FOUND FOR SPECIFIED KEY'.
ENDIF.
ENDFORM. " FETCH_ITEM_DETAILS
*& Module STATUS_0200 OUTPUT
text
MODULE STATUS_0200 OUTPUT.
SET PF-STATUS 'ZSTATUS'.
SET TITLEBAR 'xxx'.
ENDMODULE. " STATUS_0200 OUTPUT
*& Module USER_COMMAND_0200 INPUT
text
MODULE USER_COMMAND_0200 INPUT.
CASE SY-UCOMM.
WHEN 'EXIT'.
LEAVE PROGRAM.
WHEN 'BACK'.
LEAVE TO SCREEN 0.
ENDCASE.
ENDMODULE. " USER_COMMAND_0200 INPUT
*& Form alv_grid
text
--> p1 text
<-- p2 text
FORM ALV_GRID .
IF FLAG = ''.
FLAG = 'X'.
CREATE OBJECT GRID_VBAP
EXPORTING
I_SHELLSTYLE = 0
I_LIFETIME =
I_PARENT = VBAP_CONTAINER
I_APPL_EVENTS = space
I_PARENTDBG =
I_APPLOGPARENT =
I_GRAPHICSPARENT =
I_NAME =
EXCEPTIONS
ERROR_CNTL_CREATE = 1
ERROR_CNTL_INIT = 2
ERROR_CNTL_LINK = 3
ERROR_DP_CREATE = 4
others = 5
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDIF.
GS1_LAYOUT-GRID_TITLE = 'SALES ITEM DETAILS.'(100).
CALL METHOD GRID_VBAP->SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING
I_BUFFER_ACTIVE =
I_BYPASSING_BUFFER =
I_CONSISTENCY_CHECK =
I_STRUCTURE_NAME = 'ZVBAP_STRUC'
IS_VARIANT =
I_SAVE =
I_DEFAULT = 'X'
IS_LAYOUT = GS1_LAYOUT
IS_PRINT =
IT_SPECIAL_GROUPS =
IT_TOOLBAR_EXCLUDING =
IT_HYPERLINK =
IT_ALV_GRAPHICS =
IT_EXCEPT_QINFO =
CHANGING
IT_OUTTAB = IT_VBAP
IT_FIELDCATALOG =
IT_SORT =
IT_FILTER =
EXCEPTIONS
INVALID_PARAMETER_COMBINATION = 1
PROGRAM_ERROR = 2
TOO_MANY_LINES = 3
OTHERS = 4
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. " alv_grid
Thansk & regards
Sreenivasulu P
Similar Messages
-
How to display 3 level hierarchy alv report using SALV
Hi ,
I need to display a Hierarchy ALV report with 3 level.I thought of trying CL_SALV_HIERSEQ_TABLE but i am able to display only two level report.
How can i display the 3 - level heirarchy report using SALV. I don't want to use SALV_TREE.
Regards,
Aditya Tanguturi.Hi Aditya,
Please check this thread
Is it possible to display more than 2 levels us... | SCN
Thanks !
Amit -
How to Display Page Numbers in ALV Report HTML End of page Event
hai Gurus
Greetings
Please tell me how to get current page noumber and total number of pages in ALV Report (in HTML End of Page Event)
i tried with sy-pagno system field but it is not working
so please guide me
Thanks
Rameshcheck below code....
*Work area for Layout
gf_layout type slis_layout_alv,
*Work area for HEADER FOOTER
gf_header type slis_listheader,
*Work area for Field catalogue
gf_fieldcat type slis_fieldcat_alv.
it_top_page type slis_t_listheader,
*Internal table for Field catalogue
it_fcat type slis_t_fieldcat_alv.
perform:fill_layout,
prepare_header,
field_catlog,
display_report.
Form fill_layout
form fill_layout .
gf_layout-colwidth_optimize = 'X'.
endform. " fill_layout
Form field_catlog
form field_catlog .
data : lf_fcat type line of slis_t_fieldcat_alv,
l_cnt type i.
clear : lf_fcat, l_cnt.
Employee Number
add 1 to l_cnt.
lf_fcat-fieldname = 'EMPLID'.
lf_fcat-tabname = 'IT_EMPLOYEE'.
lf_fcat-col_pos = l_cnt.
lf_fcat-emphasize = 'X'.
lf_fcat-outputlen = 8.
lf_fcat-seltext_l = text-003.
append lf_fcat to it_fcat.
clear lf_fcat.
*Last Name
add 1 to l_cnt.
lf_fcat-fieldname = 'USERNAME'.
lf_fcat-tabname = 'IT_EMPLOYEE'.
lf_fcat-col_pos = l_cnt.
lf_fcat-emphasize = 'X'.
lf_fcat-outputlen = 20.
lf_fcat-seltext_l = text-004.
append lf_fcat to it_fcat.
*First Name
add 1 to l_cnt.
lf_fcat-fieldname = 'EMPMAIL'.
lf_fcat-tabname = 'IT_EMPLOYEE'.
lf_fcat-col_pos = l_cnt.
lf_fcat-emphasize = 'X'.
lf_fcat-outputlen = 40.
lf_fcat-seltext_l = text-005.
append lf_fcat to it_fcat.
*Known As
clear lf_fcat.
add 1 to l_cnt.
lf_fcat-fieldname = 'EMPSTATUS'.
lf_fcat-tabname = 'IT_EMPLOYEE'.
lf_fcat-col_pos = l_cnt.
lf_fcat-emphasize = 'X'.
lf_fcat-outputlen = 10.
lf_fcat-seltext_l = text-006.
append lf_fcat to it_fcat.
clear lf_fcat.
*System UserID
add 1 to l_cnt.
lf_fcat-fieldname = 'COSTCENTER'.
lf_fcat-tabname = 'IT_EMPLOYEE'.
lf_fcat-col_pos = l_cnt.
lf_fcat-emphasize = 'X'.
lf_fcat-outputlen = 10.
lf_fcat-seltext_l = text-007.
append lf_fcat to it_fcat.
clear lf_fcat.
*EMail ID
add 1 to l_cnt.
lf_fcat-fieldname = 'DEPTDESC'.
lf_fcat-tabname = 'IT_EMPLOYEE'.
lf_fcat-col_pos = l_cnt.
lf_fcat-emphasize = 'X'.
lf_fcat-outputlen = 8.
lf_fcat-seltext_l = text-008.
append lf_fcat to it_fcat.
clear lf_fcat.
*Employment Status
add 1 to l_cnt.
lf_fcat-fieldname = 'LOC'.
lf_fcat-tabname = 'IT_EMPLOYEE'.
lf_fcat-col_pos = l_cnt.
lf_fcat-emphasize = 'X'.
lf_fcat-outputlen = 20.
lf_fcat-seltext_l = text-009.
append lf_fcat to it_fcat.
clear lf_fcat.
*Personnel Area
add 1 to l_cnt.
lf_fcat-fieldname = 'TITLE'.
lf_fcat-tabname = 'IT_EMPLOYEE'.
lf_fcat-col_pos = l_cnt.
lf_fcat-emphasize = 'X'.
lf_fcat-outputlen = 40.
lf_fcat-seltext_l = text-010.
append lf_fcat to it_fcat.
clear lf_fcat.
*Personnel Area Text
clear lf_fcat.
add 1 to l_cnt.
lf_fcat-fieldname = 'HDATE'.
lf_fcat-tabname = 'IT_EMPLOYEE'.
lf_fcat-col_pos = l_cnt.
lf_fcat-emphasize = 'X'.
lf_fcat-outputlen = 10.
lf_fcat-seltext_l = text-011.
append lf_fcat to it_fcat.
clear lf_fcat.
*Country Grouping text
add 1 to l_cnt.
lf_fcat-fieldname = 'MGRID'.
lf_fcat-tabname = 'IT_EMPLOYEE'.
lf_fcat-col_pos = l_cnt.
lf_fcat-emphasize = 'X'.
lf_fcat-outputlen = 10.
lf_fcat-seltext_l = text-012.
append lf_fcat to it_fcat.
clear lf_fcat.
*Cost Center
add 1 to l_cnt.
lf_fcat-fieldname = 'MGRNAME'.
lf_fcat-tabname = 'IT_EMPLOYEE'.
lf_fcat-col_pos = l_cnt.
lf_fcat-emphasize = 'X'.
lf_fcat-outputlen = 20.
lf_fcat-seltext_l = text-013.
append lf_fcat to it_fcat.
clear lf_fcat.
*Employee Group
add 1 to l_cnt.
lf_fcat-fieldname = 'MGMAIL'.
lf_fcat-tabname = 'IT_EMPLOYEE'.
lf_fcat-col_pos = l_cnt.
lf_fcat-emphasize = 'X'.
lf_fcat-outputlen = 40.
lf_fcat-seltext_l = text-014.
append lf_fcat to it_fcat.
clear lf_fcat.
*Organizational Unit
add 1 to l_cnt.
lf_fcat-fieldname = 'DIV'.
lf_fcat-tabname = 'IT_EMPLOYEE'.
lf_fcat-col_pos = l_cnt.
lf_fcat-emphasize = 'X'.
lf_fcat-outputlen = 25.
lf_fcat-seltext_l = text-015.
append lf_fcat to it_fcat.
clear lf_fcat.
*Supervisor
add 1 to l_cnt.
lf_fcat-fieldname = 'BUSUNIT'.
lf_fcat-tabname = 'IT_EMPLOYEE'.
lf_fcat-col_pos = l_cnt.
lf_fcat-emphasize = 'X'.
lf_fcat-outputlen = 25.
lf_fcat-seltext_l = text-016.
append lf_fcat to it_fcat.
clear lf_fcat.
endform. " field_catlog
Form display_report
form display_report .
data : l_repid type sy-repid.
clear l_repid.
l_repid = sy-repid.
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = l_repid
is_layout = gf_layout
it_fieldcat = it_fcat
i_callback_top_of_page = 'TOP-OF-PAGE'
tables
t_outtab = it_employee
exceptions
program_error = 1
others = 2.
endform. " display_report
Form PREPARE_HEADER
form prepare_header.
data:l_header1(20),
l_header2(60).
data:l_header3(20),
l_header4(60).
l_header1 = 'Met Life Census Data'.
l_header2+40(8) = 'Run Date'.
write sy-datum to l_header2+50(10).
header
gf_header-typ = 'S'.
gf_header-key = l_header1.
gf_header-info = l_header2.
append gf_header to it_top_page.
clear gf_header.
endform. " PREPARE_HEADER
form top-of-page.
call function 'REUSE_ALV_COMMENTARY_WRITE'
exporting
it_list_commentary = it_top_page.
endform. "TOP-OF-PAGE
*& Form end_of_list_html
output at the end of the list - not in printed output *
FORM END_OF_LIST_HTML USING END TYPE REF TO CL_DD_DOCUMENT.
DATA: LS_TEXT TYPE SDYDO_TEXT_ELEMENT,
L_GRID TYPE REF TO CL_GUI_ALV_GRID,
F(14) TYPE C VALUE 'SET_ROW_HEIGHT'.
LS_TEXT+0(20) = 'Total Employees'.
LS_TEXT+40(10) = g_count.
CALL METHOD END->ADD_TEXT
EXPORTING
TEXT = LS_TEXT
SAP_EMPHASIS = 'STRONG'.
*adds new line (start new line)
CALL METHOD END->NEW_LINE.
CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
IMPORTING
e_grid = l_grid.
CALL METHOD l_grid->parent->parent->(f)
EXPORTING
id = 3
height = 10.
ENDFORM. -
How to display two database field in report
hi,
i have made a report and in that report i am displaying two fields with same data and these fields are database.In the FORM f_display_report i have given the same name in both fields.But when i going to SUM it gave me only one field SUM and other fields gives null.
give me some guidance as i have to display both fields with same data and same amount of SUM.
Thanksif i am using the database field i-e wt_qbshb then it gave me the data but when im going to sum both field it gave me sum of only one field.This the code:
ITAB:
BEGIN OF gi_main OCCURS 1,
belnr LIKE bseg-belnr, " Document No.
buzei LIKE bseg-buzei, " Item
blart LIKE bkpf-blart, " Document Type
lifnr LIKE bseg-lifnr, " Vendor No.
lifntn LIKE lfa1-stcd2, " NTN
lifnic LIKE lfa1-stcd1, " CNIC
name1 LIKE lfa1-name1, " Vendor Name
stras LIKE lfa1-stras, " Address
ort01 LIKE lfa1-ort01, " City
qekar LIKE v_t059e-qekar, " Source of income Description
qscod LIKE v_t059z-qscod, " Section Code
budat LIKE bkpf-budat, " Date of Payment(DD/MM/YYYY).
dmbtr LIKE bseg-dmbtr, " WHT Base Amount
qsatz LIKE v_t059z-qsatz, " Rate of WHT
dmbtr LIKE bseg-dmbtr, " WHT Base Amount
wt_qbshb LIKE with_item-wt_qbshb, " Amt of tax collected & deducted
AMT_TAX TYPE with_item-wt_qbshb, "Amt tax Deposited.
p_tax type sy-datum, " Date of Tax Deposited
witht LIKE t059z-witht, " WHT Type
wt_withcd LIKE t059z-wt_withcd, " WHT Code
hkont LIKE with_item-hkont, " Gl Code
text40 LIKE t059ot-text40, " Section Description
eatxt LIKE v_t059e-eatxt, " Source of Income Code
END OF gi_main,
and this is the BEGIN OF gi_main OCCURS 1,
belnr LIKE bseg-belnr, " Document No.
buzei LIKE bseg-buzei, " Item
blart LIKE bkpf-blart, " Document Type
lifnr LIKE bseg-lifnr, " Vendor No.
lifntn LIKE lfa1-stcd2, " NTN
lifnic LIKE lfa1-stcd1, " CNIC
name1 LIKE lfa1-name1, " Vendor Name
stras LIKE lfa1-stras, " Address
ort01 LIKE lfa1-ort01, " City
qekar LIKE v_t059e-qekar, " Source of income Description
qscod LIKE v_t059z-qscod, " Section Code
budat LIKE bkpf-budat, " Date of Payment(DD/MM/YYYY).
dmbtr LIKE bseg-dmbtr, " WHT Base Amount
qsatz LIKE v_t059z-qsatz, " Rate of WHT
dmbtr LIKE bseg-dmbtr, " WHT Base Amount
wt_qbshb LIKE with_item-wt_qbshb, " Amt of tax collected & deducted
AMT_TAX TYPE with_item-wt_qbshb, "Amt tax Deposited.
p_tax type sy-datum, " Date of Tax Deposited
witht LIKE t059z-witht, " WHT Type
wt_withcd LIKE t059z-wt_withcd, " WHT Code
hkont LIKE with_item-hkont, " Gl Code
text40 LIKE t059ot-text40, " Section Description
eatxt LIKE v_t059e-eatxt, " Source of Income Code
END OF gi_main,
and this is the BEGIN OF gi_main OCCURS 1,
belnr LIKE bseg-belnr, " Document No.
buzei LIKE bseg-buzei, " Item
blart LIKE bkpf-blart, " Document Type
lifnr LIKE bseg-lifnr, " Vendor No.
lifntn LIKE lfa1-stcd2, " NTN
lifnic LIKE lfa1-stcd1, " CNIC
name1 LIKE lfa1-name1, " Vendor Name
stras LIKE lfa1-stras, " Address
ort01 LIKE lfa1-ort01, " City
qekar LIKE v_t059e-qekar, " Source of income Description
qscod LIKE v_t059z-qscod, " Section Code
budat LIKE bkpf-budat, " Date of Payment(DD/MM/YYYY).
dmbtr LIKE bseg-dmbtr, " WHT Base Amount
qsatz LIKE v_t059z-qsatz, " Rate of WHT
dmbtr LIKE bseg-dmbtr, " WHT Base Amount
wt_qbshb LIKE with_item-wt_qbshb, " Amt of tax collected & deducted
AMT_TAX TYPE with_item-wt_qbshb, "Amt tax Deposited.
p_tax type sy-datum, " Date of Tax Deposited
witht LIKE t059z-witht, " WHT Type
wt_withcd LIKE t059z-wt_withcd, " WHT Code
hkont LIKE with_item-hkont, " Gl Code
text40 LIKE t059ot-text40, " Section Description
eatxt LIKE v_t059e-eatxt, " Source of Income Code
END OF gi_main,
and this is the PERFROM DISPLAY REPORT:
PERFORM fill_fieldcat USING 'LIFNTN' 11 'NTN' 'GI_MAIN'.
PERFORM fill_fieldcat USING 'LIFNIC' 16 'NIC' 'GI_MAIN'.
PERFORM fill_fieldcat USING 'LIFNR' 10 'Vendor' 'GI_MAIN'.
PERFORM fill_fieldcat USING 'NAME1' 35 'Name' 'GI_MAIN'.
PERFORM fill_fieldcat USING 'STRAS' 35 'Address' 'GI_MAIN'.
PERFORM fill_fieldcat USING 'ORT01' 35 'City' 'GI_MAIN'.
PERFORM fill_fieldcat USING 'QEKAR' 40 'Nature of Payment etc' 'GI_MAIN'.
PERFORM fill_fieldcat USING 'QSCOD' 10 'Payment Section Code' 'GI_MAIN'.
PERFORM fill_fieldcat USING 'BUDAT' 10 'Date of Payment(dd/mm/yyyy)' 'GI_MAIN'.
PERFORM fill_fieldcat USING 'DMBTR' 20 'Value/Amount on which Tax Collected or Deducted' 'GI_MAIN'.
PERFORM fill_fieldcat USING 'QSATZ' 10 'Rate of tax (%)' 'GI_MAIN'.
PERFORM fill_fieldcat USING 'WT_QBSHB' 16 'Tax Amount Collected/Deducted' 'GI_MAIN'.
PERFORM fill_fieldcat USING 'WT_QBSHB' 16 'Amount of Deposited' 'GI_MAIN'.
PERFORM fill_fieldcat USING 'P_TAX'(001) 15 'Date of Tax Deposited(DD/MM/YYYY)' 'GI_MAIN'.
Thanks. -
How To Add Two Heading in ALV Report
Hello Guys,
Currently I am Working on a report Contain 45 Column. Each 45 Column have there own heading like Days Target,Days Achieve..like this.
Our Requirement is That
1.Upper side of the First 10 Column one more heading required like Production Details .
2. From 11 to 20 One More Heading Called Furnace Oil. like that only.
I ask users That is not possible in ALV but they are adhere to that requirement.
Can it's is possible in ALV Grid To have a two Heading Column.
Thanks in Advance.
Regards
Swati NamdevHi swati,
Normally the specified requirment is not possible with the ALV...
But you can try with the tricky way... where you need to use the Hierarchical ALV.
Here you need to specify the two fields in the header table for the specified headings, and you need to declare these two fields in the item table also.
But in this case you will have one blank line on the report output(for the header data).
Regards,
Satya. -
How to display subtotal text in alv report for particular group of values
Hi,
if material number falls 1 to 10 then i considered be calculate and display subtotal qty amount with subtotal text " Total of the mat1" and if material number falls 11 to 20 then again i need to be claculate and display subtotal qty amount with subtotal text "total of the mat2". if material number falls 21 to 30 then i don't want to display any subtotal and At last grand total also is not required.
Please help me asapjust check the thread...
Can we modify a sub-total in ALV -
Displaying data in Two line in ALV report
Hi,
I want to know how to display the data in alv in two lines for Fild name as well as for fild value
like in below case
wa_fieldcata-fieldname = 'WRBTR'.
wa_fieldcata-seltext_l = 'AMOUNT IN DOCUMENT CURRENCY'.
wa_fieldcata-outputlen = 18.
wa_fieldcata-DO_SUM = 'X'.
APPEND wa_fieldcata TO it_fieldcat.
CLEAR wa_fieldcata.
by this on alv COLUMN headig is coming as 'AMOUNT IN DOCUMENT CURRENCY' in one linw i want to display 'AMOUNT IN ' in first line and then 'DOCUMENT CURRENCY' below that
'AMOUNT IN
DOCUMENT CURRENCY' ***
similarly how to display value of three fidls in one column
like for a vendor I have one column Vandor name in that column i want to display from table LFA1,
NAME1
NAME2
NAME3
NAME4,
in one column only how to do it.
regards,
zafarHi,
Ref . early reply can u help me how to uset his in ALV code and can u give some example for this how to display it in two lines as my column heading is of 60 characters 5 word i want to display it in two line in one column only .
How to use : SLIS_EV_AFTER_LINE_OUTPUT
to get this.
or is there any other method.
regards,
zafar -
How to create check box in ALV Reports?
how to create check box in ALV Reports?
Hi
check the report BCALV_TEST_GRID_EDITABLE
or
check this report
REPORT ZRFC346_TST.
TABLES:SFLIGHT,RL034.
TYPE-POOLS:SLIS.
INCLUDE:<ICON>,<SYMBOL>.
DATA: G_REPID LIKE SY-REPID,
G_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
G_IT_SORT TYPE SLIS_T_SORTINFO_ALV,
G_LAYOUT TYPE SLIS_LAYOUT_ALV,
G_TABNAME_HEADER TYPE SLIS_TABNAME,
G_TABNAME_ITEM TYPE SLIS_TABNAME,
G_KEYINFO TYPE SLIS_KEYINFO_ALV,
G_VARIANT LIKE DISVARIANT,
G_EXTAB TYPE SLIS_T_EXTAB,
I_SLIS_EXIT_BY_USER TYPE SLIS_EXIT_BY_USER.
DATA: XEVENT TYPE SLIS_T_EVENT,
AEVENT TYPE SLIS_ALV_EVENT,
VARIANT LIKE DISVARIANT,
LAYOUT TYPE SLIS_LAYOUT_ALV,
ASP_GROUP TYPE SLIS_SP_GROUP_ALV,
GT_SP_GROUP TYPE SLIS_T_SP_GROUP_ALV,
EXTAB TYPE SLIS_T_EXTAB WITH HEADER LINE,
XFIELD TYPE SLIS_T_FIELDCAT_ALV,
AFIELD TYPE SLIS_FIELDCAT_ALV,
G_SUCOMM LIKE SY-UCOMM,
G_SELFLD TYPE SLIS_SELFIELD.
DATA: SAV_SY_REPID LIKE SY-REPID.
CONSTANTS: CON_SFLIGHT TYPE LVC_FNAME VALUE 'SFLIGHT',
CON_DISPLAY_FULL TYPE I VALUE 3.
Data to be displayed
DATA: BEGIN OF GT_SFLIGHT OCCURS 0.
INCLUDE STRUCTURE SFLIGHT.
DATA:ACTIVATE(1).
DATA: END OF GT_SFLIGHT.
INITIALIZATION.
*........Initialisierung...............................................
PERFORM INITIALIZATION_RL034.
*........Field cata....................................................
PERFORM FIELD_CAT.
*........SPECIAL GROUP.................................................
PERFORM E07_SP_GROUP_BUILD USING GT_SP_GROUP[].
START-OF-SELECTION.
Selection
SELECT * FROM SFLIGHT INTO TABLE GT_SFLIGHT.
*........ALV CALL.......................................................
PERFORM ALV_CALL.
PERFORM USER_COMMAND_LOCAL USING G_SUCOMM G_SELFLD.
FORM USER_COMMAND_LOCAL *
--> G_UCOMM *
--> G_SELFIELD *
FORM USER_COMMAND_LOCAL USING G_UCOMM LIKE SY-UCOMM
G_SELFIELD TYPE SLIS_SELFIELD.
CASE G_UCOMM.
WHEN 'ACT'.
ENDCASE.
ENDFORM.
FORM ALV_CALL *
FORM ALV_CALL.
Call ABAP List Viewer (ALV)
G_LAYOUT-BOX_FIELDNAME = 'ACTIVATE'.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_BACKGROUND_ID = 'ALV_BACKGROUND'
I_BYPASSING_BUFFER = SPACE
I_BUFFER_ACTIVE = SPACE
I_CALLBACK_PROGRAM = SAV_SY_REPID
I_CALLBACK_PF_STATUS_SET = 'STATUS'
I_CALLBACK_USER_COMMAND = 'USER_COMMAND_LOCAL'
I_CALLBACK_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_END_OF_LIST = ' '
I_STRUCTURE_NAME = 'SFLIGHT'
I_BACKGROUND_ID = ' '
I_GRID_TITLE =
I_GRID_SETTINGS =
IS_LAYOUT = G_LAYOUT
IT_FIELDCAT = XFIELD[]
IT_EXCLUDING =
IT_SPECIAL_GROUPS = GT_SP_GROUP[]
IT_SORT =
IT_FILTER =
IS_SEL_HIDE = 'X'
I_DEFAULT = 'X'
I_SAVE = 'A'
IS_VARIANT =
IT_EVENTS = XEVENT
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
IT_ALV_GRAPHICS =
IT_ADD_FIELDCAT =
IT_HYPERLINK =
I_HTML_HEIGHT_TOP =
I_HTML_HEIGHT_END =
IT_EXCEPT_QINFO =
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
T_OUTTAB = GT_SFLIGHT
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 status *
--> EXTAB *
FORM STATUS USING EXTAB TYPE SLIS_T_EXTAB.
SET PF-STATUS 'STAT' EXCLUDING EXTAB.
ENDFORM. " STATUS
*& Form INITIALIZATION_RL034
text
--> p1 text
<-- p2 text
FORM INITIALIZATION_RL034.
SAV_SY_REPID = SY-REPID.
ENDFORM. " INITIALIZATION_RL034
*& Form DEFINE_EVENTS_RL034
text
--> p1 text
<-- p2 text
FORM DEFINE_EVENTS_RL034.
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
I_LIST_TYPE = 0
IMPORTING
ET_EVENTS = XEVENT.
exceptions
list_type_wrong = 1
others = 2.
ENDFORM. " DEFINE_EVENTS_RL034
*& Form FIELD_CAT
text
--> p1 text
<-- p2 text
FORM FIELD_CAT.
DATA: LS_FCAT TYPE SLIS_FIELDCAT_ALV,
L_LIN TYPE I.
REFRESH XFIELD.
1. per Default eingeblendete Felder *
*........Ikone/Symbol..................................................
CLEAR AFIELD.
DATA: LS1_FCAT TYPE SLIS_FIELDCAT_ALV,
L_LIN1 TYPE I.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
I_STRUCTURE_NAME = CON_SFLIGHT
I_BYPASSING_BUFFER = SPACE
I_BUFFER_ACTIVE = SPACE
CHANGING
CT_FIELDCAT = XFIELD
EXCEPTIONS
INCONSISTENT_INTERFACE = 1
PROGRAM_ERROR = 2
OTHERS = 3.
DESCRIBE TABLE XFIELD LINES L_LIN1.
ADD 1 TO L_LIN1.
CLEAR LS_FCAT.
LS1_FCAT-FIELDNAME = 'ACTIVATE'.
LS1_FCAT-CHECKBOX = 'X'.
LS1_FCAT-KEY = 'X'.
LS1_FCAT-INPUT = 'X'.
LS1_FCAT-EDIT = 'X'.
LS1_FCAT-INTTYPE = 'C'.
LS1_FCAT-DATATYPE = 'CHAR'.
LS1_FCAT-INTLEN = 1.
LS1_FCAT-COL_POS = L_LIN1.
LS1_FCAT-SELTEXT_S = LS1_FCAT-FIELDNAME.
LS1_FCAT-SELTEXT_M = LS1_FCAT-FIELDNAME.
LS1_FCAT-SELTEXT_L = LS1_FCAT-FIELDNAME.
LS1_FCAT-SP_GROUP = 'A'.
APPEND LS1_FCAT TO XFIELD.
ADD 1 TO L_LIN.
ENDFORM. " FIELD_CAT
FORM E07_SP_GROUP_BUILD USING E07_LT_SP_GROUP TYPE SLIS_T_SP_GROUP_ALV.
DATA: LS_SP_GROUP TYPE SLIS_SP_GROUP_ALV.
CLEAR LS_SP_GROUP.
LS_SP_GROUP-SP_GROUP = 'A'.
LS_SP_GROUP-TEXT = 'SPECIAL'.
APPEND LS_SP_GROUP TO E07_LT_SP_GROUP.
ENDFORM.
Regards
Shiva -
How to display the fields in ALV Output without using Field catalog?
How to display the fields in ALV Output without using Field catalog?
Could you pls tell me the coding?
Akshitha.Hi,
u mean without building field catalog. is it? I that case, we can use the FM REUSE_ALV_FIELDCATALOG_MERGE.
data: itab type table of mara.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = sy-repid
i_structure_name = itab
CHANGING
ct_fieldcat = lt_fieldcat[]
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3.
*Pass that field catalog into the fillowing FM
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = gd_repid
i_grid_title = 'REPORTING'
is_layout = gt_layout
it_fieldcat = lt_fieldcat[]
tables
t_outtab = itab. -
Can anyone tell me how to use GUI status in ALV report.
Can anyone tell me how to use GUI status in ALV report. I want to use buttons in ALV report.
Juheb,
see the link
http://help.sap.com/saphelp_nw2004s/helpdata/en/5e/88d440e14f8431e10000000a1550b0/frameset.htm
http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCSRVALV/BCSRVALV.pdf
Adding a button on the ALV grid using OOPs
check these sites.
https://www.sdn.sap.com/irj/sdn/wiki?path=/display/snippets/webDynproABAP-ALVControllingStandard+Buttons&
chk this.
alv-pfstatus:
http://www.sapdevelopment.co.uk/reporting/alv/alvgrid_pfstatus.htm
then how to capture that button click.
http://www.sapdevelopment.co.uk/reporting/alv/alvgrid_ucomm.htm
REPORT ZTESTALV.
TYPE-POOLS: SLIS.
*- Fieldcatalog
DATA: IT_FIELDCAT TYPE LVC_T_FCAT,
IT_FIELDCAT1 TYPE SLIS_T_FIELDCAT_ALV..
*- For Events
DATA:IT_EVENTS TYPE SLIS_T_EVENT.
DATA: X_FIELDCAT TYPE LVC_S_FCAT,
X_FIELDCAT1 TYPE SLIS_FIELDCAT_ALV.
DATA:X_LAYOUT TYPE LVC_S_LAYO.
"{ FOR DISABLE
DATA: LS_EDIT TYPE LVC_S_STYL,
LT_EDIT TYPE LVC_T_STYL.
"} FOR DISABLE
DATA: BEGIN OF IT_VBAP OCCURS 0,
VBELN LIKE VBAP-VBELN,
POSNR LIKE VBAP-POSNR,
HANDLE_STYLE TYPE LVC_T_STYL, "FOR DISABLE
<b> BUTTON(10),</b>
END OF IT_VBAP.
DATA: LS_OUTTAB LIKE LINE OF IT_VBAP.
SELECT VBELN
POSNR
UP TO 10 ROWS
INTO CORRESPONDING FIELDS OF TABLE IT_VBAP
FROM VBAP.
DATA:L_POS TYPE I VALUE 1.
CLEAR: L_POS.
L_POS = L_POS + 1.
<b>X_FIELDCAT-SELTEXT = 'Button'.
x_fieldcat-fieldname = 'BUTTON'.
X_FIELDCAT-TABNAME = 'ITAB'.
X_FIELDCAT-COL_POS = L_POS.
X_FIELDCAT-OUTPUTLEN = '10'.
X_FIELDCAT-style = X_FIELDCAT-style bit-xor
cl_gui_alv_grid=>MC_STYLE_BUTTON bit-xor
cl_gui_alv_grid=>MC_STYLE_ENABLEd.
APPEND X_FIELDCAT TO IT_FIELDCAT.
CLEAR X_FIELDCAT.</b>
L_POS = L_POS + 1.
X_FIELDCAT-SELTEXT = 'VBELN'.
X_FIELDCAT-FIELDNAME = 'VBELN'.
X_FIELDCAT-TABNAME = 'ITAB'.
X_FIELDCAT-COL_POS = L_POS.
X_FIELDCAT-EDIT = 'X'.
X_FIELDCAT-OUTPUTLEN = '10'.
x_fieldcat-ref_field = 'VBELN'.
x_fieldcat-ref_table = 'VBAK'.
APPEND X_FIELDCAT TO IT_FIELDCAT.
CLEAR X_FIELDCAT.
L_POS = L_POS + 1.
X_FIELDCAT-SELTEXT = 'POSNR'.
X_FIELDCAT-FIELDNAME = 'POSNR'.
X_FIELDCAT-TABNAME = 'ITAB'.
X_FIELDCAT-COL_POS = L_POS.
X_FIELDCAT-EDIT = 'X'.
X_FIELDCAT-OUTPUTLEN = '5'.
APPEND X_FIELDCAT TO IT_FIELDCAT.
CLEAR X_FIELDCAT.
L_POS = L_POS + 1.
"{FOR DISABLE HERE 6ROW IS DISABLED
SY-TABIX = 6.
LS_EDIT-FIELDNAME = 'VBELN'.
LS_EDIT-STYLE = CL_GUI_ALV_GRID=>MC_STYLE_DISABLED.
LS_EDIT-STYLE2 = SPACE.
LS_EDIT-STYLE3 = SPACE.
LS_EDIT-STYLE4 = SPACE.
LS_EDIT-MAXLEN = 10.
INSERT LS_EDIT INTO TABLE LT_EDIT.
*LS_EDIT-FIELDNAME = 'POSNR'.
*LS_EDIT-STYLE = CL_GUI_ALV_GRID=>MC_STYLE_DISABLED.
*LS_EDIT-STYLE2 = SPACE.
*LS_EDIT-STYLE3 = SPACE.
*LS_EDIT-STYLE4 = SPACE.
*LS_EDIT-MAXLEN = 6.
*INSERT LS_EDIT INTO TABLE LT_EDIT.
INSERT LINES OF LT_EDIT INTO TABLE LS_OUTTAB-HANDLE_STYLE.
MODIFY IT_VBAP INDEX SY-TABIX FROM LS_OUTTAB TRANSPORTING
HANDLE_STYLE .
X_LAYOUT-STYLEFNAME = 'HANDLE_STYLE'.
"} UP TO HERE
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC'
EXPORTING
I_CALLBACK_PROGRAM = SY-REPID
IS_LAYOUT_LVC = X_LAYOUT
IT_FIELDCAT_LVC = IT_FIELDCAT
TABLES
T_OUTTAB = IT_VBAP[]
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.
Don't forget to reward if useful.... -
How to display two grids in same screen using SALV Method
Hi Freinds,
Please let me know how to display two grids in same screen using SALV Method.
Thank you
Regards,
SDVUsing the same concept as described in How to dispaly Three Internal Table Data (One below another) in ALV OOPS .
All you need to add is passing your new containers as r_container parementer of factory method.
"1st one
cl_salv_table=>factory(
EXPORTING
R_CONTAINER = g_top_container
"2nd one
cl_salv_table=>factory(
EXPORTING
R_CONTAINER = g_bottom_container
Regards
Marcin -
Displaying data on an ALV report
Hi Abaper's
I have data that is stored in an internal table and I want to display it in an ALV report, How can I achieve this?
Thanx in advance
ThandieHi,
Try to run the following code you will find the Ans.
TABLES : ekpo.
TYPE-POOLS : slis.
TYPES : BEGIN OF t_ekpo,
ebeln TYPE ekpo-ebeln,
ebelp TYPE ekpo-ebelp,
matnr TYPE ekpo-matnr,
werks TYPE ekpo-werks,
menge TYPE ekpo-menge,
END OF t_ekpo.
*VARIABLES
DATA : check(1),
rep_id TYPE sy-repid.
*INTERNAL TABLE TYPE OF ZEKPO
DATA : it_ekpo TYPE STANDARD TABLE OF t_ekpo WITH HEADER LINE.
*FIELD CATALOG
DATA : it_field TYPE slis_t_fieldcat_alv,
wa_field TYPE slis_fieldcat_alv.
*SORTING
DATA : it_sort TYPE slis_t_sortinfo_alv,
wa_sort TYPE slis_sortinfo_alv.
INITIALIZATION.
check = 'X'.
rep_id = sy-repid.
START-OF-SELECTION.
SELECT ebeln
ebelp
matnr
werks
menge
FROM ekpo
INTO CORRESPONDING FIELDS OF TABLE it_ekpo.
* FIELD CATALOG
wa_field-fieldname = 'EBELN'.
wa_field-tabname = 'IT_TAB'.
wa_field-outputlen = 10.
wa_field-seltext_l = 'PO #'.
APPEND wa_field TO it_field.
CLEAR wa_field.
wa_field-fieldname = 'EBELP'.
wa_field-tabname = 'IT_TAB'.
wa_field-outputlen = 10.
wa_field-seltext_l = 'Line Item'.
APPEND wa_field TO it_field.
CLEAR wa_field.
wa_field-fieldname = 'MATNR'.
wa_field-tabname = 'IT_TAB'.
wa_field-outputlen = 15.
wa_field-seltext_l = 'Material'.
APPEND wa_field TO it_field.
CLEAR wa_field.
wa_field-fieldname = 'WERKS'.
wa_field-tabname = 'IT_TAB'.
wa_field-outputlen = 6.
wa_field-seltext_l = 'Plant'.
APPEND wa_field TO it_field.
CLEAR wa_field.
wa_field-fieldname = 'MENGE'.
wa_field-tabname = 'IT_TAB'.
wa_field-outputlen = 10.
wa_field-seltext_l = 'Qty.'.
* wa_field-outputlen = 17.
* wa_field-edit = 'X'.
wa_field-do_sum = check.
APPEND wa_field TO it_field.
CLEAR wa_field.
* SORT W.R.T. PURCHASE ORDER NUMBER
wa_sort-spos = 1.
wa_sort-fieldname = 'EBELN'.
wa_sort-tabname = 'IT_EKPO'.
wa_sort-up = check.
wa_sort-subtot = check.
APPEND wa_sort TO it_sort.
CLEAR wa_sort.
* DISPLAY RECORDS IN ALV GRID
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = rep_id
it_fieldcat = it_field
it_sort = it_sort
TABLES
t_outtab = it_ekpo
EXCEPTIONS
program_error = 1
OTHERS = 2.
IF sy-subrc = 0.
ENDIF.
Kind Regards,
Faisal -
How to insert horizontal lines in alv report?
hi,
i have to insert horizontal lines in alv report.( RM07MLBB )
actually my requirement is:
basis list = RM07MLBB.
first secondary list = another report is called here ( RM07DOCS )
i want to insert horizontal lines in the first secondary list, when i execute individually RM07DOCS , i can get horizontal lines, but when i dounle click in the basic list --> in the first secondary list , i am not getting the horizontal lnes.
functional modules used are REUSE_ALV_HIERSEQ_LIST_DISPLAY & REUSE_ALV_GRID_DISPLAY.
here in this program,
is_layout = alv_layout.
hence i tried to give
alv_layout-no_hline = ' '.
but not effecting.
can some one please tell me , how to insert lines in the alv report.
thanks in advance,
Dastagir.hello,
so i cannot insert horizontal lines in the first secondary list according to my sorting condition, i.e., in a single block there should be :
if same delivery challan number is repeating they should come in the same block,
for the corresponding delivery challen number, if have po number, is repeating , they also should come in the same block.
in this way i have to seperate the blocks containing EXNUM , EBELN CONDITIONED. -
Displaying special characters in ALV report.
Hi Experts,
Can we display special characters in ALV reports? Special characters such as tick mark.(Like in character map(Font Bookshelf Symbol 7) of windows ).
I tried with icons in ALV report, I was able to display tick icon in the ALV report, but when we export the report in to a excel, the icons comes in as Hexadecimal code.
Can any we display special characters like tick in ALV report or display the icons in excel aswell?
I will be gratefull for the <urgency reduced by moderator> response.
Regards,
Sharath.
Edited by: Thomas Zloch on May 10, 2011 10:26 AMSharath,
I think it is possible to do so.
Please check this link.
http://www.sapfans.com/forums/viewtopic.php?f=13&t=322569
Thanks,
Guru. -
How to select multiple row in ALV report
Hi friends,
1. How to select multiple row in ALV report
( How to set tab in ALV report and want to select multiple line.)
Thanking you.
SubashHi Sahoo,
If you are using the class CL_GUI_ALV_GRID. In methods SET_TABLE_FOR_FIRST_DISPLAY.
in layout structure you will find field SEL_MODE
pass :
LS_LAYOUT-SEL_MODE = 'A'.
In PAI.
CALL METHOD GRID->GET_SELECTED_ROWS
IMPORTING
ET_INDEX_ROWS = T_ROWS
ET_ROW_NO = T_ROWID.
Hope these will solve your problem.
Regards,
Kumar M.
Maybe you are looking for
-
Phone and contacts app freezes, becomes slow and scrolling is jittery
My setup: iPhone 4 with iOS 4.2.1 (8C148) I don't have 3G on my CIM (provider BASE.BE), I can only use WiFi to connect to internet. I sync my gmail contact (mail and calendar are turned off) through the iPhone built in Exchange account connector. Fe
-
Upgraded to CS3 - What do I uninstall now?
I had DW MX 2004 on my XP Pro SP2 system until just now uninstalling it. I also have these six main Adobe programs: Premiere Elements 3 (trial) Audition 1.5 InDesign CS2 Acrobat 7 Standard Photoshop Elements 2.0 Visual Communicator 3 (beta) I've just
-
Helpful Hint to get round builds of ungrouped objects in Keynote
For those of you keen to 'build' a group of objects and have the build as a group there are two alternatives: 1. Add a build for each component of the 'group' but when choosing 'options' choose 'with build x' rather than 'after build x' 2. For an eas
-
I want to get something clear: Is it for oracle 10g still true that it is best to use indicator variables in order to prevent oracle error ora-01405 ? Or is there another, smarter way to handle null values in columns. Also, I don't see this error mes
-
Hello OTN community members. I'd recently been tasked with investigating why the JDeveloper 11.1.1.7.0 integrated WebLogic server and deployment of Apache Trinidad-based applications to the integrated server have seemed notoriously slow on the comput