Field description in two line in ALV report
Hi ,
In ALV report I want the description for each field to be displayed in two lines . For example
the description for field matnr is " Material No for grade A " which is displayed in one line . But i want to display it as : Material No
for grade A
in two lines . Is it possible . Please help me out .
Neetesh
Hi Neetesh,
Its not possible to display as you like in 2 lines header for single column. But i can provide the alternative way , it won't good logically. Please try the following logic.
Let suppose you have 10 fields F1-f10. Each field has the 2 lines header. So take 20fields in your fields catalog ie take 10 dummy fields which are equal lenght of the fields F1-f10. and for the last 10 fields(F11-F20) set the row pos as 2, set the second line header to these field(F11-F20). So you will succed to display the 2 level header for single column. But the problem here is you will get one empty row additional row for each row. Because you have taken (F11-F20) fields are dummy and don't have the data also. This solution will works only in the case of ALV List display not in Grid Display.
But Before that tell to your customer about this problem , Because I have done the same things when my customer giving important to 2 lines header and he accepeted that also.
If suppose you have the data in 2 lines for each column then this solution will work fine. Thats what i implemented in my ALV Report.
Warm Regards,
Vijay.
Similar Messages
-
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 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,
JBHai 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 -
SAP Script : to display the material description in two lines
Hi All,
I'm working on scripts.
the material description field is been passed from my driver program ..into the script..
Ex: &gs_final-maktx& ..
There r a number of other fields to be displayed ...after this field ....
Is there any option to split the 'Material description into two lines'?
Ex: at present it is :
This is material description
Requirement is:
This is material
description
I mean that there a number of field berfore and after this field......in the same line
I need to jst split the materia description ...& make it to appear in two lines.....!!
Expecting your suggestions....
Edited by: vidya vidya on Nov 11, 2008 3:17 PM
Edited by: vidya vidya on Nov 11, 2008 3:20 PMFM TEXT_SPLIT ?
..but i handled this by code.
DATA: zzboldsx(18) TYPE c,
zzboldsx2(18) TYPE c,
zzboldsx3(18) TYPE c,
zzboldsx4(18) TYPE c.
DATA: i_lines TYPE STANDARD TABLE OF tline WITH HEADER LINE ,
r_lines TYPE tline,
v_cnt LIKE sy-tabix.
CALL FUNCTION 'READ_TEXT'
EXPORTING
client = sy-mandt
id = stxh-tdid
language = stxh-tdspras
name = name
object = stxh-tdobject
TABLES
lines = i_lines[]
EXCEPTIONS
id = 1
language = 2
name = 3
not_found = 4
object = 5
reference_check = 6
wrong_access_to_archive = 7
OTHERS = 8.
IF sy-subrc = 0.
* Only 4 lines of Header text supported. Can add if needed
LOOP AT i_lines INTO r_lines.
CONDENSE r_lines-tdline NO-GAPS.
v_cnt = v_cnt + 1.
CASE v_cnt.
WHEN 1.
zzboldsx = r_lines-tdline.
WHEN 2.
zzboldsx2 = r_lines-tdline.
WHEN 3.
zzboldsx3 = r_lines-tdline.
WHEN 4.
zzboldsx4 = r_lines-tdline.
WHEN OTHERS.
EXIT.
ENDCASE.
* zzbolDSX = i_lines-tdline .
ENDLOOP. -
Parameter description in two lines
hi All,
i need to have a big description for one of the parameter.
how can i have the description in two line for the same parameter.
I have use Coment statement for the parameter.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT (45) text-002 FOR FIELD p_devatn.
PARAMETER: p_devatn(13) TYPE c DEFAULT '0.01'.
SELECTION-SCREEN END OF LINE.
kindly suggest me a way to get the description in two lines.
Description of parameter input filed of the parameter
This is paramerter for
value range
many thanks,
Anuj.
Edited by: Anuj112143 on Nov 24, 2010 4:33 AMHello Anuj ,
I dont think you can have the description of the parameter on 2 lines , may be what you can do is to use comment for the 2nd line .
E.g.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT (45) text-001 FOR FIELD p_matnr.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT (45) text-002 FOR FIELD p_matnr.
parameters : p_matnr type mara-matnr.
SELECTION-SCREEN END OF LINE.
Regards,
Arun -
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. -
How to Increase Line space between two lines in ALV Grid
hi,
I want to increase the line space between any two lines in ALV GRID. Can anybody has solution for this issue.
Regards,
MadanHi Madan
It's not possible
Regards
Gregory -
ALV report : to display description in two lines.
Hi all,
In a ALV grid display, I want to print description(40 characters) of a field in two lines(20 characters in each).
Please suggest me how to achive the same.
Thanks in advance.make the description field of 20 char legth in your final internal table.
while passing data to your final internal table, pass all fields along with 20chars from description to one line of final table and in the same loop add another row with all fields blank but the description with rest of the fields..
loop at it_1 into it_s.
is_final-desc = it_s-desc+0(20).
apppend is_fianl to it_final.
clear is_final.
is_fianl-desc = it_1-desc+20(20).
apppend is_fianl to it_final.
clear it_s.
endloop. -
Hello experts,
How to get the header in two lines with the use of ALV...like
PO LINE # ORD QTY UNIT MATERIAL DESCRIPTION QTY TO RECV QTY RECV
VEND MAT ST LOCSHELF BIN ST LOCBULK BIN
I am not getting the correct format here but the scenario is like in the first line at the first second and forth columns i have 3 fields n in the second line at the third postion i have one more field...
Can any one guide me in this plz its bit urgent....
SRIhi,
Finally one more question....
I need some outlined logic for the below requirement... can u guide me plz
functional specs like goes here
SAP Assumes that all stock receipts will occur online using the MIGO_GR transaction. However most dealers receive from a paper receiver report. Some dealers use a blind receipt in which the goods receiver writes down the quantities counted. Others use an 'open' receivers report where the receiver can see the open quantities to be received. The report should have a run flag which supports both options. The receiver report should capture the basic information from the purchase order to include:
Vendor
Purchase Order Number
Line Item Details
Material ( Vendor Material Number )
Dealer Material Number
Quantity Ordered/To-be-received
Unit of Measure * Receiver Name ( Write In Blank )
Buyer
Plz gimme some guidance...
SRI -
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 select multiple lines in ALV report
hi gurus,
I am working on an interactive ALV report where i have to select multiple lines from the basic list into an internal table, based on check box clicks. Using RS_SELFIELD i can select only 1 row. The coding has been done based on Call Function. Can u please suggest some way.
Regards,
Satyajithi,
try like this
TABLES: ekko.
TYPE-POOLS: slis. "ALV Declarations
TYPES: BEGIN OF t_ekko,
sel, "stores which row user has selected
ebeln TYPE ekpo-ebeln,
ebelp TYPE ekpo-ebelp,
statu TYPE ekpo-statu,
aedat TYPE ekpo-aedat,
matnr TYPE ekpo-matnr,
menge TYPE ekpo-menge,
meins TYPE ekpo-meins,
netpr TYPE ekpo-netpr,
peinh TYPE ekpo-peinh,
END OF t_ekko.
DATA: it_ekko TYPE STANDARD TABLE OF t_ekko INITIAL SIZE 0,
wa_ekko TYPE t_ekko.
DATA: fieldcatalog TYPE slis_t_fieldcat_alv WITH HEADER LINE,
fieldcatalog1 TYPE slis_t_fieldcat_alv WITH HEADER LINE,
gd_tab_group TYPE slis_t_sp_group_alv,
gd_layout TYPE slis_layout_alv,
gd_repid LIKE sy-repid.
DATA : BEGIN OF det_tab OCCURS 0,
ebeln LIKE ekpo-ebeln,
END OF det_tab.
START-OF-SELECTION.
PERFORM data_retrieval.
PERFORM build_fieldcatalog.
PERFORM build_layout.
PERFORM display_alv_report.
*& Form BUILD_FIELDCATALOG
* Build Fieldcatalog for ALV Report
FORM build_fieldcatalog.
fieldcatalog-fieldname = 'EBELN'.
fieldcatalog-seltext_m = 'Purchase Order'.
fieldcatalog-outputlen = 10.
fieldcatalog-emphasize = 'X'.
fieldcatalog-key = 'X'.
APPEND fieldcatalog TO fieldcatalog.
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'EBELP'.
fieldcatalog-seltext_m = 'PO Item'.
APPEND fieldcatalog TO fieldcatalog.
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'STATU'.
fieldcatalog-seltext_m = 'Status'.
APPEND fieldcatalog TO fieldcatalog.
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'AEDAT'.
fieldcatalog-seltext_m = 'Item change date'.
APPEND fieldcatalog TO fieldcatalog.
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'MATNR'.
fieldcatalog-seltext_m = 'Material Number'.
APPEND fieldcatalog TO fieldcatalog.
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'MENGE'.
fieldcatalog-seltext_m = 'PO quantity'.
APPEND fieldcatalog TO fieldcatalog.
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'MEINS'.
fieldcatalog-seltext_m = 'Order Unit'.
APPEND fieldcatalog TO fieldcatalog.
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'NETPR'.
fieldcatalog-seltext_m = 'Net Price'.
fieldcatalog-outputlen = 15.
fieldcatalog-do_sum = 'X'. "Display column total
fieldcatalog-datatype = 'CURR'.
APPEND fieldcatalog TO fieldcatalog.
CLEAR fieldcatalog.
fieldcatalog-fieldname = 'PEINH'.
fieldcatalog-seltext_m = 'Price Unit'.
APPEND fieldcatalog TO fieldcatalog.
CLEAR fieldcatalog.
ENDFORM. " BUILD_FIELDCATALOG
*& Form BUILD_LAYOUT
* Build layout for ALV grid report
FORM build_layout.
gd_layout-box_fieldname = 'SEL'.
"set field name to store row selection
gd_layout-edit = 'X'. "makes whole ALV table editable
gd_layout-zebra = 'X'.
ENDFORM. " BUILD_LAYOUT
*& Form DISPLAY_ALV_REPORT
* Display report using ALV grid
FORM display_alv_report.
gd_repid = sy-repid.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = gd_repid
i_callback_user_command = 'USER_COMMAND'
i_callback_pf_status_set = 'SET_STAT'
is_layout = gd_layout
it_fieldcat = fieldcatalog[]
i_save = 'X'
TABLES
t_outtab = it_ekko
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_ALV_REPORT
*& Form DATA_RETRIEVAL
* Retrieve data form EKPO table and populate itab it_ekko
FORM data_retrieval.
SELECT ebeln ebelp statu aedat matnr menge meins netpr peinh
UP TO 10 ROWS
FROM ekpo
INTO CORRESPONDING FIELDS OF TABLE it_ekko.
ENDFORM. " DATA_RETRIEVAL
* FORM USER_COMMAND *
* --> R_UCOMM *
* --> RS_SELFIELD *
FORM user_command USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
* Check function code
CASE r_ucomm.
WHEN '&IC1'.
IF rs_selfield-fieldname = 'EBELN'.
READ TABLE it_ekko INTO wa_ekko INDEX rs_selfield-tabindex.
SET PARAMETER ID 'BES' FIELD wa_ekko-ebeln.
CALL TRANSACTION 'ME23N' AND SKIP FIRST SCREEN.
ENDIF.
WHEN 'DET'. "button add by me
CLEAR det_tab.
REFRESH det_tab.
LOOP AT it_ekko INTO wa_ekko WHERE sel = 'X'.
MOVE-CORRESPONDING wa_ekko TO det_tab.
APPEND det_tab.
ENDLOOP.
PERFORM build_cat.
PERFORM dis_data.
ENDCASE.
ENDFORM. "user_command
*& Form set_stat
* text
* -->RT_EXTAB text
FORM set_stat USING rt_extab TYPE slis_t_extab.
SET PF-STATUS 'ZSTAT' EXCLUDING rt_extab.
ENDFORM. "set_stat
*& Form build_cat
* text
FORM build_cat.
CLEAR fieldcatalog1.
REFRESH fieldcatalog1.
fieldcatalog1-fieldname = 'EBELN'.
fieldcatalog1-tabname = 'DET_TAB'.
fieldcatalog1-seltext_m = 'Order No.'.
fieldcatalog1-outputlen = 10.
APPEND fieldcatalog1 TO fieldcatalog1.
CLEAR fieldcatalog1.
ENDFORM. "build_cat
*& Form dis_data
* text
FORM dis_data.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = 'ZTEST_DS'
it_fieldcat = fieldcatalog1[]
i_save = 'X'
TABLES
t_outtab = det_tab.
ENDFORM. "dis_data
here i have copied standard gui status of ALV into my z status ZSTAT and add one button DET......
here u can select morethan one line using control(ctrl)
reward if usefull... -
How to add 2 more field to the Header of FBL5N ALV report output
Hi All,
I have copied and made some modification to the standard transaction FBL5N and added some fields to the ALV report line Items but how to add fields to the header part i.e if you execute the transaction FBL5n, you will get the ALV report, in the header part customer no, company code then I need to add the 2 more fields. can any one tell me that which structure or where I need to add these fields to be appear in ALV output screen.
Thanks in advance.
Swapna.Hi Mohamed,
If you copied Z-FM successfully, then you have to go to subroutine TOP_OF_PAGE to add your field:
*& Form TOP_OF_PAGE
FORM top_of_page.
DATA: b_suppress LIKE boole-boole,
opfi_text LIKE eptext OCCURS 10 WITH HEADER LINE,
n_color TYPE i.
* IF NOT it_items-bukrs IS INITIAL "737295
* AND NOT it_items-konto IS INITIAL "737295
* AND NOT it_items-koart IS INITIAL. "737295
gs_items = gt_alv.
* ENDIF. "737295
* skip first call at top of page:
IF NOT gd_first_top IS INITIAL.
CLEAR gd_first_top.
EXIT.
ENDIF.
IF x_grid = c_x OR x_inet = c_x. "1012201
PERFORM grid_top_of_page.
EXIT.
ENDIF.
*... open FI: get header text.
* first fill some RFXPO fields for general info:
CLEAR: s_rfxpo, wa_kna1, wa_lfa1, wa_ska1.
s_rfxpo-bukrs = gs_items-bukrs.
s_rfxpo-kkber = gs_items-kkber.
s_rfxpo-koart = gs_items-koart.
s_rfxpo-konto = gs_items-konto.
s_rfxpo-vrbez = gs_variant-variant.
s_rfxpo-waers = gs_items-waers.
* update master record:
PERFORM fill_master_rec USING gs_items-koart
gs_items-konto
gs_items-bukrs. " note 698396
CALL FUNCTION 'OPEN_FI_PERFORM_00001640_E'
EXPORTING
i_rfxpo = s_rfxpo
i_kna1 = wa_kna1
i_lfa1 = wa_lfa1
i_ska1 = wa_ska1
IMPORTING
e_suppress_standard = b_suppress
TABLES
t_lines = opfi_text.
*... display open FI text:
IF x_konto_sort = 'X'.
LOOP AT opfi_text.
CASE opfi_text-color.
WHEN 1.
FORMAT COLOR 1.
WHEN 2.
FORMAT COLOR 2.
WHEN 3.
FORMAT COLOR 3.
WHEN 4.
FORMAT COLOR 4.
WHEN 5.
FORMAT COLOR 5.
WHEN 6.
FORMAT COLOR 6.
WHEN 7.
FORMAT COLOR 7.
ENDCASE.
WRITE: / opfi_text-text.
ENDLOOP.
FORMAT RESET.
ENDIF.
*... display other header text:
IF b_suppress NE 'X'.
PERFORM display_custom_header.
PERFORM display_ccard_lines.
ENDIF.
" Put your field somewhere...
ENDFORM. " TOP_OF_PAGE
Good luck,
Thanks, -
How to add field to the header for FBL5N ALV report
Hi,
I need to add fields to the customer line item display ALV report(FBL5N) header part.Right now there are four fields in the header like customer, company code, name and city, after that I need to add first name last name and phone no. Can any one tell me where exactly I need to add and populate there fields to be appear in ALV output list.
Thanks in Advance
SwapnaYes I have tried, I have place a break point in that perform but it does not stop. I think that is not the correct place to added and populate fields. That routine is for populate selection screen ranges single and multiple values and parameters only.
Thanks
Swapna -
Display Long field Description in 2 lines in Header when using REUSE_ALV_HI
Hi,
I am using REUSE_ALV_HIERSEQ_LIST_DISPLAY .
I need to have 2 lines in the header to display long field descriptions like
Ex Shipment Notification Idoc or Billing Document Cancel should appear as
Shipment Notification Billing Document
Idoc Cancel
Is there a way of doing this when calling the above ALV function?
Thanks
PrashantHi Prashanta ,
We can give headers in ALV using short/medium/long text.
And this comes in one line. You can use short/medium text, if possible.
Hence , having 2 lines in the header to display long field descriptions is not possible.
Hope this helps you. -
Hi Experts,
I want to make color to parrticular line when it satisfies the condition in ALV report.
I am not using SLIS.
so is there any alternavite to clolor row on specific condition like...NETWR > 10000,
that row shold be in RED color.
Please give me Example of code.
Poins will be awarded soon.
Thanks,
RohanHi,
You have to expand your internal table with a field named eg. LINE_COLOR wich has 4 char's.
Then in building your internal table you can set that field with the appropriate value.
eg. wa_itab-line_color = C600. "( red )
Then when calling your first display of your ALV you do this
alv_grid_layout-info_fname = 'LINE_COLOR'.
Then
call method alv_grid->set_table_for_first_display
That should do the trick.
Best regards,
Dirk.
Maybe you are looking for
-
Videos won't play in succession
Videos in playlists won't play in succession. the one I select plays, then repeats but won't play the rest of the videos unless individually selected.
-
VPN Client 5.0.00.0340 on Vista says connected when not
Hi all, I'm using VPN Client 5.0.00.0340 on Windows Vista to connect to one of our customers. When I go to connect and type in my password, it always seems to authenticate correctly and connect to the VPN successfully. However, about 75% of the time,
-
Slow PS3 Connection on WRT300N
Hi, I have just added a PS3 to my wireless network, but the connection is really slow; Has anybody had any experience with similar problems?
-
After upgrading to Quicktime 7.1.1 I've lost sound in iMovie 5. Previously recorded movies have lost their sound together with any new recordings I make. Volume levels are still shown in the timeline but no sound is produced. All other applications a
-
Third Party PO "No direct postings can be made to G/L"
Hi, I am not able to create a PO from a Sales order/Pur.Req. and receive this error message "No direct postings can be made to G/L acct. 401201 in CoCode 0015. Message no. ME038. The G/L account you entered is a control account. Transactions cannot b