Wrong Display of Japanese Currency in ALV Report
Dear Friends,
I am facing a problem in Displaying a Japanese Currency in the ALV Report Output. I am mentioning the Currency Key field and the Currency field in the Report.
For example, the amount field should be displaying as 22838 instead of 228.38 where this is correct in case of USD but not correct in case of JPY.
Code where the i am appending the fieldcatlog:
ls_fieldcat-fieldname = 'WAERK'.
ls_fieldcat-datatype = 'CUKY'.
ls_fieldcat-outputlen = 8.
ls_fieldcat-seltext_l = Text-088.
ls_fieldcat-seltext_m = Text-088.
ls_fieldcat-seltext_s = Text-088.
ls_fieldcat-reptext_ddic = Text-088.
APPEND ls_fieldcat TO lt_fieldcat.
CLEAR ls_fieldcat.
ls_fieldcat-fieldname = 'BUCK0'.
ls_fieldcat-datatype = 'CURR'.
ls_fieldcat-outputlen = 16.
ls_fieldcat-seltext_l = Text-017.
ls_fieldcat-seltext_m = Text-017.
ls_fieldcat-seltext_s = Text-017.
ls_fieldcat-reptext_ddic = Text-017.
Please do suggest if any inputs on the same.
Thanks in Advance for you reply.
Thanks and Regards,
Saritha K
Hi,
All the Decimals related to currency fields will be stored in the table tcurx.
You have to get the currency and respective decimals into internal table.
Read the internal the table with key equal to currency.
And calculate the values as below :
loop at gt_output.
READ TABLE gt_tcurx WITH KEY currkey = gt_output-zwaers.
IF sy-subrc EQ 0.
IF gt_tcurx-currdec = '0'.
gt_output-dmbtr = gt_output-dmbtr * 100.
ELSEIF gt_tcurx-currdec = '3'.
gt_output-dmbtr = gt_output-dmbtr / 10.
ENDIF.
ENDIF.
MODIFY gt_output.
endloop. Then pass the gt_output to ALV FM.
In the above code gt_output is my final internal table which i am passing to the ALV FM. And gt_tcurx is the internal table consists of all the currency and their decimals.
Thanks,
Sri.
Similar Messages
-
I want to display header information of My ALV Report center Aligned.
Hi all,
I want to display header information of My ALV Report center Aligned. How can I do it..Also I want to show two different Layout display of ALV report according to the Radio Button Present in the selection screen.. Pls help me out in this.Hi,
call function 'REUSE_ALV_GRID_DISPLAY'
exporting
i_callback_program = gd_repid
i_callback_top_of_page = 'TOP-OF-PAGE' "see FORM
Form top-of-page.
*ALV Header declarations
data: t_header type slis_t_listheader,
wa_header type slis_listheader,
t_line like wa_header-info,
ld_lines type i,
ld_linesc(10) type c.
Title
wa_header-typ = 'H'.
wa_header-info = ' EKKO Table Report '. Leave Space such that it comes to Center
append wa_header to t_header.
clear wa_header.
Date
wa_header-typ = 'S'.
wa_header-key = 'Date: '.
CONCATENATE sy-datum+6(2) '.'
sy-datum+4(2) '.'
sy-datum(4) INTO wa_header-info. "todays date
append wa_header to t_header.
clear: wa_header.
Total No. of Records Selected
describe table it_ekko lines ld_lines.
ld_linesc = ld_lines.
concatenate 'Total No. of Records Selected: ' ld_linesc
into t_line separated by space.
wa_header-typ = 'A'.
wa_header-info = t_line.
append wa_header to t_header.
clear: wa_header, t_line.
call function 'REUSE_ALV_COMMENTARY_WRITE'
exporting
it_list_commentary = t_header.
i_logo = 'Z_LOGO'.
endform. -
Not showing Net Order Value in PO Currency in ALV report
Dear all,
Good day.
In my ALV report i want to display net order value in PO currency which comes from ekpo-netwr field. But this field is showing 0.00 for all records. i,e value is not coming here. Please tell me how to show the value in ALV and how to show blank space when value is not in database.
Thanks.
Best regards.Hi,
Place a break-point just before you call the ALV display "Reuse_alv_*".
Check the value here in the column price.
Most probably you do not have a value here which is why there is no value displayed.
Regards,
Jovito -
Display logo on screen in ALV Report.
Hello ,
I want to change the logo displayed in ALV report on screen.
I have imported logo from SE78 as BMP image.
The logo imported successfully.And it can be seen in SE78.
But when i replace the old logo name with new logo in function module
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
IT_LIST_COMMENTARY = LIST_TOP
I_LOGO = 'ENJOYSAP_LOGO'.
The logo is not getting displayed on screen.The dimensions and other parameters of old and new logo are same.
What needs to be done to resolve this problem?
Regards,
Deepak.GOTO - OAOR (Business Document Navigator)
Give Class Name - PICTURES Class Type - OT..... then Execute
It will show you the list, then select ENJOYSAP_LOGO.
On that list, you will find one control with a "create" tab.
Click std. doc types.
Select SCREEN and double-click.
It will push FILE selection screen.
Select your company logo (.gif) and press OK.
It will ask for a description- for instance: "company logo".
It will let you know your doc has been stored successfully.
You can find your logo under ENJOYSAP_LOGO->Screen->company logo.
Use the TOP-OF-PAE event.
FORM top_of_page.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
EXPORTING
it_list_commentary = gt_page
i_logo = 'ENJOYSAP_LOGO'.
ENDFORM. "top_of_page
Just run your ALV program, you should find your company logo in place of the EnjoySAP logo.
Cheers! -
Displaying selection screen details in Alv Report output display as Header
Hi all,
May be somebody knows how I can show selected values with select-options in top_of_page using REUSE_ALV_GRID_DISPLAY.
This shoud work for all the reports and diff selection screens .
I need one dynamic process which will for display any report selection screen selected details.(Basically varient information of report).
Small example if possible, please.
Thanks in advance,
RimasHi Thiru,
Thanks for the input.
This is my exact requirement.
Hi Experts,
I would like to Display / Print Select-options selected details in ALV Header.
Ex: Say suppose here i enter kunnr as 1000
lifnr as 2000 to 4000
p_langu as 'EN'.
p_dir as 'C:\TEMP,
p_upda as 'X'
for selection screen below.
SELECTION-SCREEN :BEGIN OF BLOCK blk1 WITH FRAME TITLE text-000.
SELECT-OPTIONS : s_kunnr FOR kna1-kunnr.
SELECT-OPTIONS : s_lifnr FOR lfa1-lifnr.
PARAMETER : p_lanuge LIKE t002-spras DEFAULT sy-langu.
PARAMETER: p_dir LIKE rlgrap-filename
DEFAULT text-003 LOWER CASE.
PARAMETERS: p_upd AS CHECKBOX DEFAULT 'X'.
I dont want to Hard code selection screen values like
DATA: header TYPE slis_t_listheader,
wa TYPE slis_listheader,
wa-typ = 'S'(093).
wa-key = s_lifnr .
wa-info = 'Vendor no".
APPEND wa TO header.
I want dynamic process for all of my selection screen values selected
hard code may be it will be fine small selection screen it will work.
Fur that i got one process to get dynamically through fm
Ex: DATA: irsparams TYPE rsparams OCCURS 0 WITH HEADER LINE.
CALL FUNCTION 'RS_REFRESH_FROM_SELECTOPTIONS'
EXPORTING
curr_report = program
TABLES
selection_table = irsparams
EXCEPTIONS
not_found = 1
no_report = 2
OTHERS = 3.
loop at irsparams.
write : / irsparams-SELNAME.
write : / irsparams-SIGN.
write : / irsparams-OPTION.
write : / irsparams-LOW.
write : / irsparams-HIGH.
endloop.
I have done my requirement partially but i am failed to achive my full requirement.
Because
rsparams strcture is diff from slis_t_listheader.
Can any one help me for further assistence to display irsparams strcture data in alv header.
Thanks
Nag -
Display Material |Attachment File in ALV report
Dear All,
I have to make ALV report for mutliple material attachment file.I want to display material wise attachment where user can see in report. We can see attachment list in Service For Object button in MM03 tcode for single material. And i also i do not want attachement list on tool bar where like MM03 is dispalying.
I need ALV report for materialcodewise image/attachment file like,
MaterialCode File
A101 any filename
B101 any filename
So user can click on file base on material, then file will open and he can see image/attachment.
Please guide me for above mentioned query.
Regards,
Shivam.Dear Shivam,
You can have multiple attachments for a sinlge material. You need to consider that in your report.
for getting the list of attachments using the static method CL_BINARY_RELATION=>READ_LINKS.
DATA: lw_BOR TYPE sibflporb.
DATA: lt_rel TYPE OBL_T_RELT,
lw_rel type OBL_S_RELT.
DATA: lt_links TYPE obl_t_link,
lw_links type OBL_S_LINK.
DATA: lo_root TYPE REF TO cx_root.
lw_bor-instid = <Materail no.> "<------- Materail No.
lw_bor-typeid = 'BUS1001006'.
lw_bor-catid = 'BO'.
lw_rel-sign = 'I'.
lw_rel-option = 'EQ'.
lw_rel-low = 'ATTA'. "<----------Attachments
APPEND lw_relt TO lt_rel.
TRY.
CALL METHOD cl_binary_relation=>read_links
EXPORTING
is_object = lw_bor
it_relation_options = lt_rel
IMPORTING
et_links = lt_links.
CATCH cx_root INTO lo_root.
ENDTRY.
Once you get the list of attachment populate your output table using the same.
you can use FM SO_OBJECT_READ to get details of attachment.
Make the column with attachment as hotspot, so that ALV take action in sinlge user click.
In the user-command of ALV write the code to open the attachment.
you can use the FM SO_DOCUMENTS_MANAGER
Hope this helps you.
Regards,
Sachinkumar Mehta -
Display a Long Text in ALV report
Hi,
I want to display the PO header long text in ALV Report that is 255 character width.
Please help me out how to do this.
please it is very urgent
Thanks and regards
KrishnaUse READ_TEXT and concatenate the first lines of the text.
CALL FUNCTION 'READ_TEXT'
EXPORTING
id = 'F01'
language = sy-langu
name = lv_name " purchase order with leading zeroes
object = 'EKKO'
TABLES
lines = t_lines
EXCEPTIONS
OTHERS = 8.
Regards -
Automatic Display of NEW Data in ALV Report using Classes and Methods
Hi,
I have developed a ALV Report for displaying data from a set of DB tables using ABAP OO, Classes and Methods. The requirement is to have the report output to be automatically updated with the new entries from the DB table at a regular frequency of tiem may be every two minutes.
Could anyone please tell me how can this be acheived.
Thanks and regards,
Raghavendra Goutham P.Yes its possible.
Take a look at this thread
Auto refresh of ALV Grid, without user interaction
Or Rich's blog
/people/rich.heilman2/blog/2005/10/18/a-look-at-clguitimer-in-46c
Regards,
Ravi
Note : Please mark all the helpful answers -
Display Page No in an ALV report
halo fellow SAPiens.
How can i display page no in an ALV repor .........the code i wrote is as follows
string = sy-cpage.
CONCATENATE 'Page No:' string INTO string.
gs_end_of_page-typ = 'S'.
gs_end_of_page-info = string.
APPEND gs_end_of_page TO gt_end_of_page.Hi,
TABLES: MARA,MARC,MARD.
internal table itab_mara 3 fields matnr, ernam,mtart
DATA: BEGIN OF ITAB_MARA OCCURS 0,
MATNR LIKE MARA-MATNR, " material number
ERNAM LIKE MARA-ERNAM, " name of person who create
MTART LIKE MARA-MTART, " Material Type
END OF ITAB_MARA.
internal table itab_marc 3 fields matnr, werks,lvorm
DATA: BEGIN OF ITAB_MARC OCCURS 0,
MATNR LIKE MARC-MATNR,
WERKS LIKE MARC-WERKS, " Plant
LVORM LIKE MARC-LVORM, " Flag Material for Deletion at Plant Level
END OF ITAB_MARC.
internal table itab_mard 2 fields
DATA: BEGIN OF ITAB_MARD OCCURS 0,
MATNR LIKE MARD-MATNR,
LGORT LIKE MARD-LGORT, " Storage Location
END OF ITAB_MARD.
SELECT-OPTIONS: S_MTART FOR MARA-MTART.
INITIALIZATION.
S_MTART-LOW = 'HALB'.
S_MTART-HIGH = 'HAWA'.
S_MTART-OPTION = 'BT'.
APPEND S_MTART.
START-OF-SELECTION.
SELECT MATNR ERNAM MTART FROM MARA INTO TABLE ITAB_MARA WHERE MTART IN
S_MTART.
PERFORM DISPLAY.
TOP-OF-PAGE.
WRITE:/2(15) 'MATERIAL NO',20(20) 'CREATED BY',45(15) 'MATERIAL TYPE'.
FORM DISPLAY.
LOOP AT ITAB_MARA.
WRITE:/ ITAB_MARA-MATNR UNDER 'MATERIAL NO' HOTSPOT ON,ITAB_MARA-ERNAM
UNDER 'CREATED BY',ITAB_MARA-MTART UNDER 'MATERIAL TYPE'.
HIDE: ITAB_MARA-MATNR.
ENDLOOP.
ENDFORM.
AT LINE-SELECTION.
CASE SY-LSIND.
WHEN 1.
SELECT MATNR WERKS LVORM FROM MARC INTO TABLE ITAB_MARC WHERE MATNR =
ITAB_MARA-MATNR.
PERFORM DISPLAY1.
WHEN 2.
SELECT MATNR LGORT FROM MARD INTO TABLE ITAB_MARD WHERE MATNR =
ITAB_MARC-MATNR.
PERFORM DISPLAY2.
when 3.
sy-lsind = 0.
ENDCASE.
FORM DISPLAY1.
LOOP AT ITAB_MARC.
WRITE:/ ITAB_MARC-MATNR HOTSPOT ON, ITAB_MARC-WERKS,ITAB_MARC-LVORM.
HIDE: ITAB_MARC-MATNR.
ENDLOOP.
WRITE:/ SY-LSIND.
ENDFORM.
FORM DISPLAY2.
LOOP AT ITAB_MARD.
WRITE:/ ITAB_MARD-MATNR, ITAB_MARD-LGORT.
ENDLOOP.
WRITE:/ SY-LSIND.
ENDFORM.
Reward if useful! -
Can't display three field in the ALV report
hi all,
i have made a report ALV in which i have to display these fields:
BANFN,EMATN,TXZ01,MENGE,NETPR,EBELN,BEDAT,LIFNR,NAME1 and the table which im using are EKKO,EKPO,LFA1.
Actually only three fileds i-e (EBELN,LIFNR,NAME1) are not displaying in the report.
I can't understand what is the problem in the coding.
This is the PERFROM ORGANIZE DATA coding:
form organizate_data.
data: lv_index type sy-tabix.
loop at itab_main.
move sy-tabix to itab_main-sno.
clear itab_ekpo.
read table itab_ekpo with key ebeln = itab_main-ebeln
ebelp = itab_main-ebelp.
ENDLOOP.
loop at itab_ekko where bedat = itab_main-bedat.
endloop.
clear itab_main.
loop at itab_ekpo.
move sy-tabix to itab_main-sno.
clear itab_ekko.
read table itab_ekko with key ebeln = itab_main-ebeln binary search.
move-corresponding itab_ekpo to itab_main.
move-corresponding itab_ekko to itab_main.
append itab_main.
endloop.
endform.
Thanks,
sappk25FROM ORGANIZATE DATA
form organizate_data.
data: lv_index type sy-tabix.
loop at itab_main.
move sy-tabix to itab_main-sno.
clear itab_ekpo.
read table itab_ekpo with key ebeln = itab_main-ebeln
ebelp = itab_main-ebelp.
ENDLOOP.
loop at itab_ekko where bedat = itab_main-bedat.
endloop.
clear itab_main.
CONCATENATE 'No.' itab_lfa1-lifnr 'Name:' itab_lfa1-name1 INTO itab_main-n3 SEPARATED BY space.
loop at itab_ekpo.
move sy-tabix to itab_main-sno.
clear itab_ekko.
read table itab_ekko with key ebeln = itab_main-ebeln binary search.
move-corresponding itab_ekpo to itab_main.
move-corresponding itab_ekko to itab_main.
append itab_main.
endloop.
endform. "organizate_data
continued from here... -
How to display selected table fields in ALV report.
Hi,
I am displaying data from table EKPO using ALV through this query.
select * from ekpo into table itab_ekpo up to 25 rows.
bt if i need to display selected fields like
select ebeln matnr netpr from ekpo into table itab_ekpo up to 25 rows.
IT gives error GETWA_NOT_ASSIGNED.
FIELD SYMBOL HAS NOT YET BEEN ASSIGNED
CAN ANYONE PLZ HELP ME.Hi ,
I am pasting the code in which i am getting the error.Plz help.
REPORT ZHALV.
tables:ekpo.
data itab_ekpo type ekpo occurs 100 with header line.
types: begin of itab_new,
f_ebeln type ekpo-ebeln,
f_matnr type ekpo-matnr,
f_netpr type ekpo-netpr,
end of itab_new.
data itab1 TYPE STANDARD TABLE OF itab_new initial size 0.
type-pools: slis.
DATA: lt_fieldcat TYPE slis_t_fieldcat_alv,
lf_fieldcat TYPE slis_fieldcat_alv.
DATA: ws_repid TYPE sy-repid VALUE 'ZHALV'.
DATA: l_layout TYPE slis_layout_alv.
selection-screen Begin of block block1 with frame title text-111.
select-options : S_EBELN for EKPO-EBELN.
selection-screen end of block block1.
INITIALIZATION.
start-of-selection.
select ebeln matnr netpr from ekpo into table itab1 up to 10 rows WHERE EBELN IN S_EBELN.
*select * from ekpo into table itab_ekpo up to 25 rows.
PERFORM build_fieldcatalog.
PERFORM build_layout.
PERFORM GET_DETAILS.
end-of-selection.
*& Form build_fieldcatalog
text
FORM build_fieldcatalog .
PURCHASING DOCUMENT NUMBER
CLEAR lf_fieldcat.
lf_fieldcat-fieldname = 'EBELN'.
lf_fieldcat-ref_tabname = 'EKKO'.
lf_fieldcat-ref_fieldname = 'EBELN'.
MATERIAL NUMBER
CLEAR lf_fieldcat.
lf_fieldcat-fieldname = 'MATNR'.
lf_fieldcat-ref_tabname = 'EKPO'.
lf_fieldcat-ref_fieldname = 'MATNR'.
APPEND lf_fieldcat TO lt_fieldcat.
NET PRICE IN PURCHASING DOCUMENT
CLEAR lf_fieldcat.
lf_fieldcat-fieldname = 'NETPR'.
lf_fieldcat-ref_tabname = 'EKPO'.
lf_fieldcat-ref_fieldname = 'NETPR'.
lf_fieldcat-cfieldname = 'WAERS'.
lf_fieldcat-do_sum = 'X'.
APPEND lf_fieldcat TO lt_fieldcat.
ENDFORM. " build_fieldcatalog
*& Form GET_DETAILS
text
FORM GET_DETAILS.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER = ' '
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = ws_repid
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 = 'EKPO'
I_BACKGROUND_ID = ' '
I_GRID_TITLE =
I_GRID_SETTINGS =
IS_LAYOUT =
IT_FIELDCAT = lt_fieldcat
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = 'A'
IS_VARIANT =
IT_EVENTS =
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 = itab1
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2.
IF SY-SUBRC <> 0.
WRITE: 'SY-SUBRC: ', SY-SUBRC .
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
*append itab_ekpo to i_tab.
ENDFORM. "GET_DETAILS -
Blinking display on output list of ALV Reports
Hi
As per the requirement i got i need to put the blinking display in the output ALV Llist, for example if there is Nil Quantity in the stock it should blink like buzzer light.
Kindly give me reply as soon as possible.Not possible.
Regards,
RIch Heilman -
Not able to display the values on the alv report.
Hi all,
loop at it_stpo.
indx = sy-tabix.
select single bdmng from resb into it_resb-bdmng
where matnr = it_stpo-idnrk
and xloek ne 'X'.
it_stpo-bdmng = it_resb-bdmng.
modify it_stpo index indx.
endloop.
in the above code, m fetchin the values of bdmng and populating it in the it_stpo.
the values get populated in the internal table.
But the problem is only the first value of all the entries gets populated.
For ex:
it_stpo-idnrk = C0201AA0800N ** under this components der r three entries***
i want to display all three values of these entries.
1.A0201AD6750N 990
2.A0201AJ0960N 1,578
3.A0201AJ1140N 2,996
but the value 990 gets repeated thrice for the above three entries. n the value 1598 n 2996 is not gettin displayed.
lll, for all other entries. only the first entry value gets displayed for their respective components.
suggest modification in my code so dat i cn display all the values.
thanks in advance.
regards,
purva.Hi all,
select bdmng from resb into corresponding fields of table it_stpo2
for all entries in it_stpo
where matnr = it_stpo-idnrk
and xloek ne 'X'.
loop at it_stpo2.
move-corresponding it_stpo2 to it_stpo.
append it_stpo.
endloop.
In the above code, m able to fetch the records in the table it_stpo2. but the data is not gettin populated in the final internal table it_stpo. Both the internal tables it_stpo & it_stpo2 are same.
The data is gettin moved from it_stpo2 to it_stpo but only upto the header level. its not gettin appended in the table it_stpo even after using append stmt.
Plz help me to resolve this issue. its urgent.
Rgds,
Purva -
How to get sum for each currency's in ALV Report
Hi,
A column has amounts with various currency's.
May I know how to get sum quantity for each currency in ALV Report?
Thanks in advance.Hi,
Currency value column should have reference to currency code column.
Regards,
Wojciech -
Issue in displaying header details in ALV report
Hi,
I have used slis_t_listheader and REUSE_ALV_COMMENTARY_WRITE to display the header details in ALV report.I want the details to be displayed as below.
Requester : ---------------------- Page: 1
Program: ----------------------- Date:---------
Title of Report
But when I use the structure slis_t_listheader to display the header details,all the fields are coming one below the other.
How can I get the fields as shown in the above format
Edited by: Abaper12345 on Jun 25, 2009 7:54 AMHi,
Go through following code... its showing the data exactly the way you want....
REPORT TEST3.
TYPE-POOLS:slis.
TABLES:MARA.
*Type Declaration
TYPES:BEGIN OF t_mara,
matnr TYPE mara-matnr,
ersda TYPE mara-ersda,
ernam TYPE mara-ernam,
END OF t_mara.
*Internal Table
data:it_mara type standard table of t_mara.
*Work Area
data:wa_mara type t_mara.
DATA:i_repid TYPE sy-repid .
i_repid = sy-repid.
*Declaration for field catalog
DATA : fcat TYPE slis_t_fieldcat_alv,
wa_fcat TYPE slis_fieldcat_alv.
*Declaration for Layout
data : WA_LAYOUT type SLIS_LAYOUT_ALV.
*Initializing ColumnWidth_Optimize For Layout
WA_LAYOUT-COLWIDTH_OPTIMIZE = 'X'.
START-OF-SELECTION
START-OF-SELECTION.
*Fetching data into internal tables
PERFORM get_data.
*Buil Fieldcatalog
PERFORM build_fcat.
*Display ALV Report
PERFORM alv_display.
*Build Fieldcat
FORM build_fcat .
wa_fcat-tabname = 'IT_MARA'.
wa_fcat-fieldname = 'MATNR'.
wa_fcat-inttype = 'C'.
wa_fcat-seltext_m = 'Material Number'.
wa_fcat-outputlen = 25.
wa_fcat-col_pos = 1.
APPEND wa_fcat TO fcat.
CLEAR wa_fcat.
wa_fcat-tabname = 'IT_MARA'.
wa_fcat-fieldname = 'ERSDA'.
wa_fcat-inttype = 'C'.
wa_fcat-seltext_m = 'Date'.
wa_fcat-outputlen = 25.
wa_fcat-col_pos = 1.
APPEND wa_fcat TO fcat.
CLEAR wa_fcat.
wa_fcat-tabname = 'IT_MARA'.
wa_fcat-fieldname = 'ERNAM'.
wa_fcat-inttype = 'C'.
wa_fcat-seltext_m = 'User'.
wa_fcat-outputlen = 25.
wa_fcat-col_pos = 1.
APPEND wa_fcat TO fcat.
CLEAR wa_fcat.
endform.
*& Form GET_DATA
text
--> p1 text
<-- p2 text
form GET_DATA .
select matnr ersda ernam from mara into table it_mara.
endform. " GET_DATA
*& Form ALV_DISPLAY
text
--> p1 text
<-- p2 text
form ALV_DISPLAY .
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER = ' '
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = i_repid
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = ' '
I_CALLBACK_TOP_OF_PAGE = ' '
I_CALLBACK_HTML_TOP_OF_PAGE = 'HTML_TOP_OF_PAGE'
I_CALLBACK_HTML_END_OF_LIST = ' '
I_STRUCTURE_NAME =
I_BACKGROUND_ID = ' '
I_GRID_TITLE =
I_GRID_SETTINGS =
IS_LAYOUT =
IT_FIELDCAT = fcat
TABLES
t_outtab = it_mara
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. " ALV_DISPLAY
*& Form html_top_of_page " I_CALLBACK_HTML_TOP_OF_PAGE "
FORM html_top_of_page USING document TYPE REF TO cl_dd_document.
CALL METHOD document->add_text
EXPORTING
text = 'Program'
sap_color = document->list_group
sap_fontstyle = document->standard
sap_emphasis = document->strong.
CALL METHOD document->new_line
EXPORTING
repeat = 1
CALL METHOD document->add_text
EXPORTING
text = 'Requester'
sap_color = document->list_group
sap_fontstyle = document->standard
sap_emphasis = document->strong.
CALL METHOD document->new_line
EXPORTING
repeat = 1
CALL METHOD document->add_gap
EXPORTING
width = 125
CALL METHOD document->add_text
EXPORTING
text = 'This Is Test Data'
sap_color = document->list_group
sap_fontsize = document->LARGE
sap_fontstyle = document->standard
sap_emphasis = document->strong.
ENDFORM. "HTML_TOP_OF_PAGE
Thanks & Regards
Ashu SIngh
Maybe you are looking for
-
Images on websites often do not load or load incorrectly/incompletely load even after refreshing page and clearing caches. Often have to "clear recent history" 5 or 6 times within a single firefox session to get working links, images, completely load
-
What to miss out in partial Time Machine migration?
I have a Mac Book early 2009 machine, running 10.7.5 which had become increasingly slow, with endless spining wheel syndrome, finder windows taking ages to respond etc. Sometimes it will not restart - getting as far as a blank desktop, then giving a
-
Please Help - I reset my MacBook!
Please help me! I got this MacBook as a gift. I reset it to factory settings so I could start it from scratch and make it my own. In resetting it, I had to buy Lion OS X, which is fine. But big problem.. I can't use the redemption code because i can'
-
BAPI - Change Payment Terms - FI Document
Hi, I need a BAPI to change the payment terms and the payment method supplement of FI documents. I'm trying the Function Module FI_ITEMS_CHANGE, even though I can change the payment block and some other fields with this one, I'm not able to change th
-
Populate html:select with List of Strings
Hello everyone, I need to populate an html:select with a List of Strings. The list I receive is not composed of objects, only Strings. I want each of these Strings to be an option of the select. I've tried this way: <html:select prope