Alv report filter a filed
hi,
please give help on filtering on particular field in alv gird display.
i want to filter on MARA-MRTAR ( Matrial type) .give me code for that.
plz i need urgently.
hi,.
Thanks for you reply.
i need to display with out filter of gsber and lifner also and give me ur syntax also.
my requriment is :
if i given gsber input on selection screen i need to display particular gsber only and
if i given lifner input without gsber i need to display particular lifner details only and
if i given gsber and lifner on selction screen i need to display for particular lifner and plant only and
if i am not given gsber and lifner also i need to display output
here gsber and lifner both are select-options.
please give me solution on that scenario.
Edited by: vasanth kandula on Jan 1, 2008 10:55 AM
Edited by: vasanth kandula on Jan 1, 2008 10:56 AM
Similar Messages
-
In ALV Report Filter selection should be case sensitive
Dear All,
since one field is case sensitive in database table , i have to fetch that in alv report , but when i am applying filter on that field its is simply fetching data with case description. if its in caps it should fetch caps data but in smaal case report showing no data
Regards,
Pankaj VashistaHi,
All text datas are case sensitive.
To make it work perfectly You have to Use the Keyword translate to Upper Case than display
Now filter can work.
Without Transalation to Upper Case filter will not work.
Regards
Arbind -
hi,
IF p_hkont IS INITIAL.
IF S_GSBER IS INITIAL.
SELECT * FROM bsik
INTO TABLE ibsik
WHERE bukrs = 'DHPL' AND
lifnr IN s_lifnr AND "Customer
umskz = p_umskz AND
budat <= p_budat.
ELSE.
SELECT * FROM bsik
INTO TABLE ibsik
WHERE bukrs = 'DHPL' AND
lifnr IN s_lifnr AND "Customer
umskz = p_umskz AND
budat <= p_budat.
ENDIF.
else.
IF S_GSBER IS INITIAL.
SELECT * FROM bsik
INTO TABLE ibsik
WHERE bukrs = 'DHPL' AND
hkont = p_hkont AND "GL accnt
umskz = p_umskz AND
GSBER IN S_GSBER AND
budat <= p_budat.
ELSE.
SELECT * FROM bsik
INTO TABLE ibsik
WHERE bukrs = 'DHPL' AND
hkont = p_hkont AND "GL accnt
umskz = p_umskz AND
GSBER IN S_GSBER AND
budat <= p_budat.
ENDIF.
ENDIF.
IF p_hkont IS INITIAL.
IF S_GSBER IS INITIAL.
if s_lifnr is NOT initial.
SELECT * FROM bsik
INTO TABLE ibsik
WHERE bukrs = 'DHPL' AND
lifnr IN s_lifnr AND "Customer
umskz = p_umskz AND
budat <= p_budat.
ELSE.
SELECT * FROM bsik
INTO TABLE ibsik
WHERE bukrs = 'DHPL' AND
lifnr IN s_lifnr AND "Customer
umskz = p_umskz AND
budat <= p_budat.
ENDIF.
ENDIF.
else.
IF S_GSBER IS INITIAL.
if s_lifnr is NOT initiaL.
SELECT * FROM bsik
INTO TABLE ibsik
WHERE bukrs = 'DHPL' AND
hkont = p_hkont AND "GL accnt
umskz = p_umskz AND
GSBER IN S_GSBER AND
budat <= p_budat.
ELSE.
SELECT * FROM bsik
INTO TABLE ibsik
WHERE bukrs = 'DHPL' AND
hkont = p_hkont AND "GL accnt
umskz = p_umskz AND
GSBER IN S_GSBER AND
budat <= p_budat.
ENDIF.
endif.
endif.
i am trying to filter gsber and lifnr at atime. but i am not able to filter with this code .give me solution.urgent.
Edited by: vasanth kandula on Jan 1, 2008 10:23 AMhi,.
Thanks for you reply.
i need to display with out filter of gsber and lifner also and give me ur syntax also.
my requriment is :
if i given gsber input on selection screen i need to display particular gsber only and
if i given lifner input without gsber i need to display particular lifner details only and
if i given gsber and lifner on selction screen i need to display for particular lifner and plant only and
if i am not given gsber and lifner also i need to display output
here gsber and lifner both are select-options.
please give me solution on that scenario.
Edited by: vasanth kandula on Jan 1, 2008 10:55 AM
Edited by: vasanth kandula on Jan 1, 2008 10:56 AM -
Set Filter in ALV report, blank screen returned
I have a standard ALV report (uses REUSE_ALV_GRID_DISPLAY). The user has to be able to filter the results based on entries from certain columns.
When I try to filter any columns other than a column with a date a blank screen is returned.
This filtering problem only exists with the Single value field. I can filter the results in the "select ranges", "exclude values" and "exclude ranges" without any problems.
Any suggestions?
Edited by: Damien Crowe on Jul 6, 2009 5:09 PM
Set the fieldcatalog-edit_maskto "==ALPHA".
Edited by: Damien Crowe on Jul 14, 2009 5:35 PMwhat was the solution to this problem?
Thanks -
Filter not working in ALV Report....
Hi All,
I have developed an ALV Report using REUSE_ALV_GRID_DISPLAY.
Everything is working perfectly except Filtering...
When i enter data for filtering, the ALV list will become empty. Then if i choose to delete the entry made in filter window, the filter input shows only first 4 digits of the entered value.......If i delete that value, again the data will be displayed in the ALV Screen.....
All other standard Functions like sort, export to excel sheet are working fine...
What might be the reason for this bug..?????
Please Help me...
Regards
PavanThanks Prasanth,
This is the code...
It has been observed that few columns can be filtered...Like date, Quantity and few more...
But there is a column for Production Order number, which can not be filtered...
What might be the reason..?????
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = v_repid
i_callback_top_of_page = 'TOP_OF_PAGE'
is_layout = gs_layout
it_fieldcat = gt_fieldcat[]
it_sort = t_sort[]
i_default = c_x
is_variant = v_variant
i_save = c_a
it_events = t_events
is_print = wa_prntparams
TABLES
t_outtab = i_aufk
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. -
Filter criteria in ALV report not working
Hi,
In ALV report , when i click on filter button , it does not filter the report according to the filtered criteria. this happens in the cases where the selection criteria is a lengthy field. when i debug after the filter criteria it goes into standard function.
i am using REUSE_ALV_GRID_DISPLAY
is there any way in which i can correct this?
thanks,
Amit
nullchk this useful thread
Re: ALV problem (with filter use) -
hello!
i have a weird problem in alv report with the filter function.
for example the field serial like viqmel-serial, if it contains the value for example 1234 the filter want work. if it contains the value N16 the filter will work.
i cant understand what might be the problem.
another information that concerns this field is that the ls_fieldcat-inttype is 'C' and that the intlen eq ' '.
thanks
yifatI think your problem is with internal/external format. The reason that N16 works, is because in the database it is stored as N16. The reason why 1234 doesn't work, is because it is stored in the database as 000000000000001234. I suggest that you make sure that you filter includes the internal format. You could use a function module to convert it.
<b>
CONVERSION_EXIT_ALPHA_INPUT
</b>
Regards,
Rich Heilman -
Filter Function problems on ALV report. [Resolved]
Hi,
I developed an ALV report by using function as below:
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = G_REPID
* I_CALLBACK_PF_STATUS_SET = status_set
* I_CALLBACK_USER_COMMAND = USER_COMMAND
I_STRUCTURE_NAME = 'T_BSIK'
IS_LAYOUT = GS_LAYOUT
IT_FIELDCAT = GT_FIELDCAT[]
TABLES
T_OUTTAB = TAB_BSIK.
And this ALV custom report is referenced from standard function FBL5N.
After i completed this report, i made an comparision of FBL5N and my custom report.
When I apply the filter function, for example, on the document type, I cannot input 2 characters in the document type field under the filter function. The field length is only 1 character. Similar case results on the field document date.
While the standard function FBL5N works very nice.
What should i do to make the filter function of my own ALV report as the same as the standard function FBL5N do?
Thanks in advance.
Lala
Message was edited by:
Hoo lalaOh, i found where the problem is...
add below 2 statements, then the question is resolved.
LS_FIELDCAT-ref_fieldname = ****
LS_FIELDCAT-ref_tabname = ***
FORM FIELDCAT_INIT tables RT_FIELDCAT.
CLEAR LS_FIELDCAT.
LS_FIELDCAT-COL_POS = 3.
LS_FIELDCAT-FIELDNAME = 'BLART'.
LS_FIELDCAT-TABNAME = 'TAB_BSIK'.
LS_FIELDCAT-SELTEXT_L = 'Document Type'.
LS_FIELDCAT-ref_fieldname = 'BLART'.
LS_FIELDCAT-ref_tabname = 'BSIK'.
APPEND LS_FIELDCAT TO RT_FIELDCAT.
endform.
Fine now.
Lala -
How to filter standard ALV report with custom UI element?
Hello Expert,
I got a requirement to filter standard ALV report based on the custom UI element (which is created in the screen before displaying the ALV report). Upon entering the values in the Custom field, the ALV report is displayed accordingly.
Any ideas how to approach it?
Thanks,
MohammedHi,
Okay, let me explain the steps in detail
Let us say you have alv table with 10 records and alv table is shown first time with all 10 records
Create an internal table in component controller's attribute GT_ORIGINAL_DATA and save all 10 records into this table first time
Now, user enters value in FILTER_MATNR field 123 and press apply_filter button or press enter key
Read the value of field filter_matnr and get the only matching records from global internal table GT_ORIGINAL_DATA into local internal table as below
data lv_matnr type matnr.
data lt_data like wd_comp_controller->gt_original_data.
" read the value from context attribute of filter_matnr
lv_matnr = ???
" copy all data into local table
lt_data[] = wd_comp_controller->gt_original_data.
"delete the records which does not match
delete lt_data where matnr NP lv_matnr.
Now, bind the data lt_data to context node of alv table
Hope this helps you.
Regards,
Rama -
Filed in the ALV report in which user can enter text manually
Hi,
Is it possible to enter a field in the report where user can enter data manually and save it in a ALV report?
If yes then letHi, SATYA
Test the following Sample Report it hope it will solve out your Problems related to ALV.
REPORT zfsl_alv_test.
TYPES: BEGIN OF t_it,
mname(10),
amount1 TYPE p,
amount2 TYPE p,
END OF t_it.
*TABLES : it1_sum.
TYPE-POOLS : slis.
*VARIABLES
DATA : check(1),
rep_id TYPE sy-repid.
*INTERNAL TABLE TYPE OF t_name
DATA: it1_sum TYPE STANDARD TABLE OF t_it WITH HEADER LINE,
wa_it1_sum TYPE t_it,
it2_sum TYPE STANDARD TABLE OF t_it WITH HEADER LINE,
wa_it2_sum TYPE t_it.
*List Header
DATA : it_listheader TYPE STANDARD TABLE OF slis_listheader WITH HEADER LINE,
wa_listheader TYPE slis_listheader.
*Event Raising to Display Heading.
DATA: event TYPE slis_t_event,
event_str TYPE slis_alv_event. "Event String.
*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.
*Layout
DATA : wa_layout TYPE slis_layout_alv.
INITIALIZATION.
check = 'X'.
rep_id = sy-repid.
START-OF-SELECTION.
wa_it1_sum-mname = 'BBB'.
wa_it1_sum-amount1 = '-500'.
wa_it1_sum-amount2 = '-200'.
APPEND wa_it1_sum TO it1_sum.
wa_it1_sum-mname = 'BBB'.
wa_it1_sum-amount1 = 100.
wa_it1_sum-amount2 = 200.
APPEND wa_it1_sum TO it1_sum.
wa_it1_sum-mname = 'CCC'.
wa_it1_sum-amount1 = 500.
wa_it1_sum-amount2 = 10000.
APPEND wa_it1_sum TO it1_sum.
wa_it1_sum-mname = 'CCC'.
wa_it1_sum-amount1 = 105000.
wa_it1_sum-amount2 = 20500.
APPEND wa_it1_sum TO it1_sum.
wa_it1_sum-mname = 'AAA'.
wa_it1_sum-amount1 = 21000.
wa_it1_sum-amount2 = 22000.
APPEND wa_it1_sum TO it1_sum.
wa_it1_sum-mname = 'BBB'.
wa_it1_sum-amount1 = 5500.
wa_it1_sum-amount2 = 2200.
APPEND wa_it1_sum TO it1_sum.
* Heading
wa_listheader-typ = 'H'.
wa_listheader-info = 'ALV TEST Top-of-Page'.
APPEND wa_listheader TO it_listheader.
* FIELD CATALOG
wa_field-col_pos = 1 .
wa_field-tabname = 'IT1_SUM'.
wa_field-fieldname = 'MNAME'.
wa_field-seltext_m = 'Material Number'.
*ls_fcat-do_sum = 'X'.
APPEND wa_field TO it_field.
CLEAR wa_field.
wa_field-col_pos = 2 .
wa_field-tabname = 'IT1_SUM'.
wa_field-fieldname = 'AMOUNT1'.
wa_field-seltext_m = 'Amount 1'.
wa_field-do_sum = check.
wa_field-edit = 'X'. " To add this you can edit any Colum
wa_field-edit_mask = 'V___________'. " Use this to place the (-) Minus Signe on the left side
*ls_fcat-do_sum = 'X'.
APPEND wa_field TO it_field.
CLEAR wa_field.
wa_field-col_pos = 3 .
wa_field-tabname = 'IT1_SUM'.
wa_field-fieldname = 'AMOUNT1'.
wa_field-seltext_m = 'Amount 2'.
wa_field-do_sum = check.
wa_field-edit_mask = 'V___________'.
*ls_fcat-do_sum = 'X'.
APPEND wa_field TO it_field.
CLEAR wa_field.
* SORT By MNAME
wa_sort-spos = 1.
wa_sort-fieldname = 'MNAME'.
wa_sort-tabname = 'IT1_SUM'.
wa_sort-up = check. " Here Use u2018downu2019 for descending Order
wa_sort-subtot = check.
APPEND wa_sort TO it_sort.
CLEAR wa_sort.
* ALV Layout Setting
wa_layout-zebra = 'X'.
wa_layout-colwidth_optimize = 'X'.
* Calling function to raise event to display heading and icon above ALV
CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
EXPORTING
i_list_type = 0
IMPORTING
et_events = event[]
* EXCEPTIONS
* LIST_TYPE_WRONG = 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.
* Calling TOP_OF_PAGE Event
READ TABLE event WITH KEY name = 'TOP_OF_PAGE' INTO event_str.
IF sy-subrc = 0.
MOVE: 'TOP_OF_PAGE' TO event_str-form.
APPEND event_str TO event.
ENDIF.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
* I_INTERFACE_CHECK = ' '
* I_BYPASSING_BUFFER = ' '
* I_BUFFER_ACTIVE = ' '
i_callback_program = sy-cprog
* I_CALLBACK_PF_STATUS_SET = ' '
* I_CALLBACK_USER_COMMAND = ' '
* I_CALLBACK_TOP_OF_PAGE = ' '
* I_CALLBACK_HTML_TOP_OF_PAGE = ' '
* I_CALLBACK_HTML_END_OF_LIST = ' '
* I_STRUCTURE_NAME =
* I_BACKGROUND_ID = ' '
i_grid_title = 'ALV Test'
* I_GRID_SETTINGS =
is_layout = wa_layout
it_fieldcat = it_field
* IT_EXCLUDING =
* IT_SPECIAL_GROUPS =
it_sort = it_sort
* IT_FILTER =
* IS_SEL_HIDE =
i_default = 'X'
i_save = 'X'
* IS_VARIANT =
it_events = event[]
* 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
* I_HTML_HEIGHT_TOP = 0
* I_HTML_HEIGHT_END = 0
* IT_ALV_GRAPHICS =
* IT_HYPERLINK =
* IT_ADD_FIELDCAT =
* IT_EXCEPT_QINFO =
* IR_SALV_FULLSCREEN_ADAPTER =
* IMPORTING
* E_EXIT_CAUSED_BY_CALLER =
* ES_EXIT_CAUSED_BY_USER =
TABLES
t_outtab = it1_sum
* 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.
*& Form top_of_page
* text
FORM top_of_page.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = it_listheader[]
i_logo = 'ENJOYSAP_LOGO'
* I_END_OF_LIST_GRID =
* I_ALV_FORM =
ENDFORM. "top_of_page
Kind Regards,
Faisal -
Short dump while filtering an ALV report
Hi ,
I have an ALV report which gives me short dump when I filter any of the 'P' type field. I tried to implement sap note 839839 in debug mode but in vain. Should I implement this note first and then check the chnage?
the short dump error "..........
Error in ASSIGN: Memory protection error.
The current program "SAPLSSEL " uses the ASSIGN statement.
However, the offset of the segment (20208) plus the length (69)
is greater than the length of the segment (20264).
This is not allowed.
If the error is in one of your own ABAP programs or an SAP program that
you have modified, try to correct it.
Reduce the offset and/or length that you are using.
If the error occurred in a non-modified SAP program, you may be
able to find a solution in the SAP note system.
If you have access to the note system yourself, use the following
search criteria:
"ASSIGN_OFFSET+LENGTH_TOOLARGE"
"SAPLSSEL " or "LSSELFDI "
"FILL_DYN_FROM_FIELD_SEL" ........."
I appreciate ur inputs.
thanks in advance,
regards,
shanHi Guys,
I found the answer. I had to define all P type fields with eaxact length of 16 . Its working fine.
thanks for all your help.
regards,
shan -
How to Change the position of Column in ALV report
Hi Follks,
Is is possible to change the position of column in ALV report?.If yes then how?
Basically my requirement is, that user want afacility where , he should be able to change the position
of column aftre he runs the report.
Eg: After running the report , user felt that column 5 should be at position 2 , in that case he should
be able to drag column 5 at position 2 and vice versa.
Please help me, how to solve this issue.
Note : I am using NW 7.0 SP 9
Regards
PG
Edited by: PG on Apr 13, 2009 11:10 AMHI PG,
do below whie filling the filed catlog
wa_fieldcat-fieldname = 'Field1".
wa_fieldcat-COL_POS = '1',
append wa_fieldcat to it_fieldcat.
wa_fieldcat-fieldname = 'Field2".
wa_fieldcat-COL_POS = '2',
wa_fieldcat-fieldname = 'Field3".
wa_fieldcat-COL_POS = '3',
Thanks! -
Printing problem in ALV report.
Hi,
I have made an ALV report using 'REUSE_ALV_LIST_DISPLAY' FM. There are 18 coloumns in this report which i want to print in A4 paper. Thses all coloumns are printing but the font size is too small and also printing start from left most i.e. no margin for FILING. How to increase font size and left margin for filing. Kindly suggest.
Regards,
Rajesh VasudevaHi
The font size depends on the format you've choosen for the print.
The abap list arranges the page as grid: colunmXrow.
Every colunm of a page means a character.
If you use the standard format X_65_200, it means you're page is arranged for 65 row and 200 colunm:
that means the size of a character is optimized to can print 200 chararcter in a A4 page.
If you use the standard format X_65_132 it means you're page is arranged for 65 row and132 colunm:
that means the size of a character is optimized to can print 132 chararcter in a A4 page.
So that mean the size of format X_65_132 will be bigger than X_65_200, because in the same space (page A4) it needs to write 132 char instead of 200.
If your report print NN char, u should use the format wiith number colunm is closer to NN.
If there isn't a format or u use the first available format or u create a new one by trx SPAD.
Max -
Filtering programatically in alv report
please let me know is it posible to filering in alv report.please respond immediately....
Hi anil,
here a short extract with 2 Filter-Parameters as i use:
DATA: FILTER_1 TYPE SLIS_T_FILTER_ALV.
DATA: BEGIN OF ITEM_ALL OCCURS 0,
KUNNR LIKE KNA1-KUNNR,
VBELN LIKE VBAP-VBELN,
POSNR LIKE VBAP-POSNR,
MATNR LIKE VBAP-MATNR,
MATKL LIKE MARA-MATKL,
MAKTX LIKE MAKT-MAKTX,
KWMENG LIKE VBAP-KWMENG, "Menge Auftrag
VRKME LIKE VBAP-VRKME,
RFMNGJ LIKE VBFA-RFMNG, "Menge Lieferung
RFMNGR LIKE VBFA-RFMNG, "Menge Warenbewegung
RFMNGM LIKE VBFA-RFMNG, "Menge Faktura
END OF ITEM_ALL.
Filter für detail setzen
WA_FILTER-TABNAME = 'ITEM_ALL'.
WA_FILTER-FIELDNAME = 'KUNNR'.
WA_FILTER-SIGN0 = 'I'.
WA_FILTER-OPTIO = 'BT'.
WA_FILTER-VALUF_INT = KUNNR. "From Kunnr
WA_FILTER-VALUT_INT = KUNNR. "TO Kunnr
APPEND WA_FILTER TO FILTER_1.
WA_FILTER-TABNAME = 'ITEM_ALL'.
WA_FILTER-FIELDNAME = 'MATNR'.
WA_FILTER-SIGN0 = 'I'.
WA_FILTER-OPTIO = 'BT'.
WA_FILTER-VALUF_INT = MATNR. "From Matnr
WA_FILTER-VALUT_INT = MATNR. "To Matnr
APPEND WA_FILTER TO FILTER_1.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = PROGNAME
I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
IT_FIELDCAT = FIELDCAT_1
IT_FILTER = FILTER_1
IT_EVENTS = EVENTS
IT_EVENT_EXIT = EVENT_EXIT
I_SCREEN_START_COLUMN = 20
I_SCREEN_START_LINE = 05
I_SCREEN_END_COLUMN = 100
I_SCREEN_END_LINE = 30
TABLES
T_OUTTAB = ITEM_ALL
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2.
Regards, Dieter -
The filtering , sorting , totaling action on ALV report is lost
Hi ,
I have an Interactive ALV report which i sort it , filter it and total it before I enter into my Z customised screen, from my Z cusomised screen when I come back to the ALV report, the report is no more sorted, no more filtered and no more totaled.
Please help me on this its a bit urgent.*& Report ZALV_SUM
REPORT ZNNR_ALV_SUM.
TABLES: ekko.
type-pools: slis. "ALV Declarations
*Data Declaration
TYPES: BEGIN OF t_vbap,
vbeln TYPE vbap-vbeln,
matnr TYPE vbap-matnr,
netwr TYPE vbap-netwr,
waerk TYPE vbap-waerk,
END OF t_vbap.
DATA: it_vbap TYPE STANDARD TABLE OF t_vbap INITIAL SIZE 0,
wa_vbap TYPE t_vbap.
*ALV data declarations
data: fieldcatalog 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.
*Start-of-selection.
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 = 'VBELN'.
fieldcatalog-seltext_m = 'Sales Order'.
fieldcatalog-col_pos = 0.
fieldcatalog-outputlen = 10.
fieldcatalog-emphasize = 'X'.
fieldcatalog-key = 'X'.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'MATNR'.
fieldcatalog-seltext_m = 'Material Number'.
fieldcatalog-col_pos = 4.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'NETWR'.
fieldcatalog-seltext_m = 'Net Price'.
fieldcatalog-col_pos = 7.
fieldcatalog-outputlen = 15.
fieldcatalog-do_sum = 'X'. "Display column total
fieldcatalog-cfieldname = 'WAERK'.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
fieldcatalog-fieldname = 'WAERK'.
fieldcatalog-seltext_m = 'Price Curr'.
fieldcatalog-col_pos = 8.
append fieldcatalog to fieldcatalog.
clear fieldcatalog.
endform. " BUILD_FIELDCATALOG
*& Form BUILD_LAYOUT
Build layout for ALV grid report
form build_layout.
gd_layout-no_input = 'X'.
gd_layout-colwidth_optimize = 'X'.
gd_layout-totals_text = 'Totals'(201).
gd_layout-totals_only = 'X'.
gd_layout-f2code = 'DISP'. "Sets fcode for when double
"click(press f2)
gd_layout-zebra = 'X'.
gd_layout-group_change_edit = 'X'.
gd_layout-header_text = 'helllllo'.
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_top_of_page = 'TOP-OF-PAGE' "see FORM
i_callback_user_command = 'USER_COMMAND'
i_grid_title = outtext
is_layout = gd_layout
it_fieldcat = fieldcatalog[]
it_special_groups = gd_tabgroup
IT_EVENTS = GT_XEVENTS
i_save = 'X'
is_variant = z_template
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.
endform. " DISPLAY_ALV_REPORT
*& Form DATA_RETRIEVAL
Retrieve data form EKPO table and populate itab it_ekko
form data_retrieval.
select vbeln matnr netwr waerk
up to 50 rows
from vbap
into table it_vbap.
endform. " DATA_RETRIEVAL
Maybe you are looking for
-
Some, I can't open at all because of the error message. How do I fix this? I have tried syncing to iTunes, updating software, etc.
-
Hi All, cud anybody pls let me know abt the <b>creation and maintenace of indexes</b>?? any screenshots or step-by-step procedure.....!!! its quite urgent.. regards, abc xyz
-
Getting error in ABAP coding after Upgradation of kernel
Today our basis team has updated kernel. Now while writing code for Ex: write:/ u2018SAPu2019. Its giving error Field "u2018SAPu2019" is unknown. It is neither in one of the specified tables nor defined by a "DATA" statement. I want to know is there
-
If this is the wrong part of the forum i apologize... Now onto the reason I am here.. I have a user that has Adobe Xi Pro installed along with IE8 locally. Do to job requirements of opening several pdf's hourly and editing them, how would we get it s
-
How to change the Dynamic Selection screen
Dear Freinds, I have requirement where in on the selection of Dynamic Selections ( iam using PNP logical database) i want to add another fields , could any one tell me how to change Dynamic Selections as per my requirement. please let m