Date format in ALV report
Hi all,
I want to change date format in ALV list that is displayed in wrong format.
I use this piece of code:
CALL METHOD r_alv_grid->set_table_for_first_display
EXPORTING
i_structure_name = 'ZSTANJEKOMISIONARA'
is_layout = gs_layout
CHANGING
it_outtab = it_stanja
EXCEPTIONS
OTHERS = 4.
Problematic field of structure ZSTANJEKOMISIONARA is defined like this:
VRIJEDI_DO ZEVO_VRIJEDI_DO DATS 8
Now, date is displayed like this: 09.20.3009 insted it should be like this: 30.09.2009.
How can I change this? Thanks.
The data is internally stored in an external format. Go back to the program that filled this field, there is something missing there.
Look at FM like
- CONVERT_DATE_TO_INTERN_FORMAT
- CONVERSION_EXIT_PDATE_INPUT
You only keep date in external format when filling a BDC, for most other input mode (BAPI and the like) data must be converted to internal format.
Regards,
Raymond
Similar Messages
-
How to change date format in alv report
hi ,
i wanna change date format which is in yyyy.mm.dd to mm/dd/yyyy in alv report.
plz advise.
thanks
sudheerHi sudheer,
There is no direst Fm fro that.
But u can follw the below way. it worked for me. kindly chk it.
[code]DATA: V_DATE_IN(10) TYPE C,
V_DATE_SAP TYPE SY-DATUM.
V_DATE_IN = '01.01.2005.'.
CONCATENATE V_DATE_IN+6(4) "<--for Year
V_DATE_IN+3(2) "<--for month
V_DATE_IN+0(2) "<--for Day
INTO V_DATE_SAP.
now V_DATE_SAP will have value like 20060101.
now use.
CONVERSION_EXIT_PDATE_OUTPUT Conversion Exit for Domain GBDAT: YYYYMMDD -> DD/MM/YYYY[/code]
regards
anver
<b><i>if hlped pls mark points</i></b> -
Regarding Date format in ALV Report
Dear All,
In ALV Reoport I have inserted Field BSTDK table VBKD by comparing vbeln my Date is getting displayed, but Problem is that i want my date in this format for ex: 29.10.2008 but it is diaplaying as 20081029. this is an ex. same is repeating for all the dates against respective vbeln.
code as follows.
LOOP AT GT_OUT1.
SELECT SINGLE BSTDK INTO GT_OUT1-BSTDK
FROM VBKD WHERE VBELN = GT_OUT1-AUBEL.
MODIFY GT_OUT1.
ENDLOOP.Moderator message - Please see How to post code in SCN, and some things NOT to do... before posting (date question) - post locked
Rob -
Hi All,
I wanted to do the formatting in ALV report output. How I can do that?
Formatting means colour the field, & all.
If possible send me any sample code..
Regards,
Poonamhi
Coloring a row is a bit (really a bit) more complicated. To enable row coloring, you should add an additional field to your list data table. It should be of character type and length at least 4. This field will contain the color code for the row. So, lets modify declaration of our list data table gt_list.
Code Part 13 Adding the field that will contain row color data
As you guess, you should fill the color code to this field. Its format will be the same as explained before at section C.6.3. But how will ALV Grid know that you have loaded the color data for the row to this field. So, you make it know this by 1/0: intensifiedon/off - - 1/0: inverseon/off
Color numbers
Internal table holding list data
DATA BEGIN OF gt_list OCCURS 0 .
INCLUDE STRUCTURE SFLIGHT .
DATA rowcolor(4) TYPE c .
DATA END OF gt_list .
Passing the name of the field containing color codes to the field INFO_FNAME of the layout structure.
e.g. ps_layout-info_fname = <field_name_containing_color_codes>. e.g. ROWCOLOR
You can fill that field anytime during execution. But, of course, due to the flow logic of screens, it will be reflected to your list display as soon as an ALV refresh occurs. You can color an entire row as described in the next section. However, this method is less time consuming.
Here is a sample program.
report zrich_0002 .
Use of colours in ALV grid (cell, line and column) *
Table
tables : mara.
Type
types : begin of ty_mara,
matnr like mara-matnr,
matkl like mara-matkl,
counter(4) type n,
free_text(15) type c,
color_line(4) type c, " Line color
color_cell type lvc_t_scol, " Cell color
end of ty_mara.
Structures
data : wa_mara type ty_mara,
wa_fieldcat type lvc_s_fcat,
is_layout type lvc_s_layo,
wa_color type lvc_s_scol.
Internal table
data : it_mara type standard table of ty_mara,
it_fieldcat type standard table of lvc_s_fcat,
it_color type table of lvc_s_scol.
Variables
data : okcode like sy-ucomm,
w_alv_grid type ref to cl_gui_alv_grid,
w_docking_container type ref to cl_gui_docking_container.
parameters : p_column as checkbox,
p_line as checkbox,
p_cell as checkbox.
at selection-screen output.
perform get_data.
perform fill_catalog.
if w_docking_container is initial.
perform create_objects.
endif.
*& Form create_objects
form create_objects.
create object w_docking_container
exporting
ratio = 60
exceptions
cntl_error = 1
cntl_system_error = 2
create_error = 3
lifetime_error = 4
lifetime_dynpro_dynpro_link = 5
others = 6.
create object w_alv_grid
exporting
i_parent = w_docking_container.
Field that identify color line in internal table
move 'COLOR_LINE' to is_layout-info_fname.
Field that identify cell color in inetrnal table
move 'COLOR_CELL' to is_layout-ctab_fname.
call method w_alv_grid->set_table_for_first_display
exporting
is_layout = is_layout
changing
it_outtab = it_mara
it_fieldcatalog = it_fieldcat
exceptions
invalid_parameter_combination = 1
program_error = 2
too_many_lines = 3
others = 4.
endform.
*& Form get_data
form get_data.
select * from mara up to 5 rows.
clear : wa_mara-color_line, wa_mara-color_cell.
move-corresponding mara to wa_mara.
add 1 to wa_mara-counter.
move 'Blabla' to wa_mara-free_text.
if wa_mara-counter = '0002'
and p_line = 'X'.
Color line
move 'C410' to wa_mara-color_line.
elseif wa_mara-counter = '0004'
and p_cell = 'X'.
Color cell
move 'FREE_TEXT' to wa_color-fname.
move '6' to wa_color-color-col.
move '1' to wa_color-color-int.
move '1' to wa_color-color-inv.
append wa_color to it_color.
wa_mara-color_cell[] = it_color[].
endif.
append wa_mara to it_mara.
endselect.
endform.
*& Form fill_catalog
form fill_catalog.
Colour code : *
Colour is a 4-char field where : *
- 1st char = C (color property) *
- 2nd char = color code (from 0 to 7) *
0 = background color *
1 = blue *
2 = gray *
3 = yellow *
4 = blue/gray *
5 = green *
6 = red *
7 = orange *
- 3rd char = intensified (0=off, 1=on) *
- 4th char = inverse display (0=off, 1=on) *
Colour overwriting priority : *
1. Line *
2. Cell *
3. Column *
data : w_position type i value '1'.
clear wa_fieldcat.
move w_position to wa_fieldcat-col_pos.
move 'MATNR' to wa_fieldcat-fieldname.
move 'MARA' to wa_fieldcat-ref_table.
move 'MATNR' to wa_fieldcat-ref_field.
append wa_fieldcat to it_fieldcat.
add 1 to w_position.
clear wa_fieldcat.
move w_position to wa_fieldcat-col_pos.
move 'MATKL' to wa_fieldcat-fieldname.
move 'MARA' to wa_fieldcat-ref_table.
move 'MATKL' to wa_fieldcat-ref_field.
Color column
if p_column = 'X'.
move 'C610' to wa_fieldcat-emphasize.
endif.
append wa_fieldcat to it_fieldcat.
add 1 to w_position.
clear wa_fieldcat.
move w_position to wa_fieldcat-col_pos.
move 'COUNTER' to wa_fieldcat-fieldname.
move 'N' to wa_fieldcat-inttype.
move '4' to wa_fieldcat-intlen.
move 'Counter' to wa_fieldcat-coltext.
append wa_fieldcat to it_fieldcat.
add 1 to w_position.
clear wa_fieldcat.
move w_position to wa_fieldcat-col_pos.
move 'FREE_TEXT' to wa_fieldcat-fieldname.
move 'C' to wa_fieldcat-inttype.
move '20' to wa_fieldcat-intlen.
move 'Text' to wa_fieldcat-coltext.
append wa_fieldcat to it_fieldcat.
endform.
Copy and paste this program, click a checkbox from the right and click execute. The program will color the line, column, or cell.
chk this 4 more info...
Re: add color in alv need help
regards
Satish -
How to get this output format in ALV report
Hi.
Can any one pls let me know how to get the following output format in ALV report.Following are the outputfields
companycode location position approver
300 800 01 watson
null null 03 candy
null null 04 smith
null null 05 michael
one empty line after this again
300 800 01 ryant
null null 02 gyan
null null 03 fermi
null null 04 ogata
*Note: Null indicates empty space .( i.e I need to get empty space in output where ever null is there.)
Thanks in advance.
Kind Regards,
samiulla.hi,
u can use 'REUSE_ALV_LIST_DISPLAY'
or
'REUSE_ALV_GRID_DISPLAY' function modules.
SAMPLE CODE :
*& Report Y101982CHD
* TABLES
TABLES: vbak. " standard table
* Type Pools *
TYPE-POOLS: slis.
* Global Structure Definitions *
*-- Structure to hold data from table CE1MCK2
TYPES: BEGIN OF tp_itab1,
vbeln LIKE vbap-vbeln,
posnr LIKE vbap-posnr,
werks LIKE vbap-werks,
lgort LIKE vbap-lgort,
END OF tp_itab1.
*-- Data Declaration
DATA: t_itab1 TYPE TABLE OF tp_itab1.
DATA : i_fieldcat TYPE slis_t_fieldcat_alv.
* Selection Screen *
*--Sales document-block
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-t01.
SELECT-OPTIONS: s_vbeln FOR vbak-vbeln.
SELECTION-SCREEN END OF BLOCK b1.
*--Display option - block
SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-t02.
PARAMETERS: alv_list RADIOBUTTON GROUP g1,
alv_grid RADIOBUTTON GROUP g1.
SELECTION-SCREEN END OF BLOCK b2.
*file download - block
SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-t03.
PARAMETERS: topc AS CHECKBOX,
p_file TYPE rlgrap-filename.
SELECTION-SCREEN END OF BLOCK b3.
* Initialization. *
* At Selection Screen *
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
CALL FUNCTION 'F4_DXFILENAME_4_DYNP'
EXPORTING
dynpfield_filename = 'P_FILE'
dyname = sy-cprog
dynumb = sy-dynnr
filetype = 'P' "P-->Physical
location = 'P' "P Presentation Srever
server = space.
AT SELECTION-SCREEN ON s_vbeln.
PERFORM vbeln_validate.
* Start Of Selection *
START-OF-SELECTION.
*-- Fetching all the required data into the internal table
PERFORM select_data.
* End Of Selection *
END-OF-SELECTION.
IF t_itab1[] IS NOT INITIAL.
IF topc IS NOT INITIAL.
PERFORM download.
MESSAGE 'Data Download Completed' TYPE 'S'.
ENDIF.
PERFORM display.
ELSE.
MESSAGE 'No Records Found' TYPE 'I'.
ENDIF.
* Top Of Page Event *
TOP-OF-PAGE.
*& Form : select_data
* Description : Fetching all the data into the internal tables
* parameters : none
FORM select_data .
SELECT vbeln
posnr
werks
lgort
INTO CORRESPONDING FIELDS OF TABLE t_itab1
FROM vbap
WHERE vbeln IN s_vbeln.
IF sy-subrc <> 0.
MESSAGE 'Enter The Valid Sales Document Number'(t04) TYPE 'I'.
EXIT.
ENDIF.
ENDFORM. " select_data
*& Form : display
* decription : to display data in given format
* parameters : none
FORM display .
IF alv_list = 'X'.
PERFORM build_fieldcat TABLES i_fieldcat[]
USING :
*-Output-field Table Len Ref fld Ref tab Heading Col_pos
'VBELN' 'T_ITAB1' 10 'VBAP' 'VBELN' '' 1,
'POSNR' 'T_ITAB1' 6 'VBAP' 'POSNR' '' 2,
'WERKS' 'T_ITAB1' 4 'VBAP' 'WERKS' '' 3,
'LGORT' 'T_ITAB1' 4 'VBAP' 'LGORT' '' 4.
*CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'*
*EXPORTING*
*i_callback_program = sy-repid*
** i_callback_pf_status_set = c_pf_status*
*i_callback_user_command = 'USER_COMMAND '*
** it_events = t_alv_events[]*
*it_fieldcat = i_fieldcat[]*
*TABLES*
*t_outtab = t_itab1[]*
*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.*
ENDIF.
IF alv_grid = 'X'.
PERFORM build_fieldcat TABLES i_fieldcat[]
USING :
*-Output-field Table Len Ref fld Ref tab Heading Col_pos
'VBELN' 'T_ITAB1' 10 'VBAP' 'VBELN' '' 1,
'POSNR' 'T_ITAB1' 6 'VBAP' 'POSNR' '' 2,
'WERKS' 'T_ITAB1' 4 'VBAP' 'WERKS' '' 3,
'LGORT' 'T_ITAB1' 4 'VBAP' 'LGORT' '' 4.
*CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'*
*EXPORTING*
*i_callback_program = sy-repid*
** i_callback_pf_status_set = c_pf_status*
*i_callback_user_command = 'USER_COMMAND '*
*it_fieldcat = i_fieldcat*
*TABLES*
*t_outtab = t_itab1[]*
*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.*
*ENDIF.*
ENDFORM. " display
*& Form : vbeln_validate
* description : to validate sales document number
* parameters : none
FORM vbeln_validate .
DATA: l_vbeln TYPE vbak-vbeln.
SELECT SINGLE vbeln
FROM vbak
INTO l_vbeln
WHERE vbeln IN s_vbeln.
IF sy-subrc NE 0.
MESSAGE 'ENTER THE VALID SALES DOCUMENT NO:' TYPE 'I'.
EXIT.
ENDIF.
ENDFORM. " vbeln_validate
*& Form :build_fieldcat
* Description : This routine fills field-catalogue
* Prameters : none
FORM build_fieldcat TABLES fpt_fieldcat TYPE slis_t_fieldcat_alv
USING fp_field TYPE slis_fieldname
fp_table TYPE slis_tabname
fp_length TYPE dd03p-outputlen
fp_ref_tab TYPE dd03p-tabname
fp_ref_fld TYPE dd03p-fieldname
fp_seltext TYPE dd03p-scrtext_l
fp_col_pos TYPE sy-cucol.
*-- Local data declaration
DATA: wl_fieldcat TYPE slis_fieldcat_alv.
*-- Clear WorkArea
wl_fieldcat-fieldname = fp_field.
wl_fieldcat-tabname = fp_table.
wl_fieldcat-outputlen = fp_length.
wl_fieldcat-ref_tabname = fp_ref_tab.
wl_fieldcat-ref_fieldname = fp_ref_fld.
wl_fieldcat-seltext_l = fp_seltext.
wl_fieldcat-col_pos = fp_col_pos.
*-- Update Field Catalog Table
APPEND wl_fieldcat TO fpt_fieldcat.
ENDFORM. "build_fieldcat
*& Form : download
* description : To Download The Data
* Parameters : none
FORM download .
DATA: l_file TYPE string.
l_file = p_file.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = l_file
filetype = 'ASC'
TABLES
data_tab = t_itab1
EXCEPTIONS
file_write_error = 1
no_batch = 2
gui_refuse_filetransfer = 3
invalid_type = 4
no_authority = 5
unknown_error = 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.
ENDFORM. " download
HOPE IT WILL HELP YOU
REGARDS
RAHUL SHARMA -
Is there a way to set a custom date format on a report column? I am trying to use a format mask and it doesn't appear to be working. Maybe someone can spot my mistake:
Query: Hours Worked = Clock_IN - Clock_OUT
Format mask for Clock In/Clock Out - DD-MON-YYYY HH24:MI (from list)
Format mask for Hours Worked column: HH:MI (hand typed)
actual display (Timecard ID is edit link):
Timecard Employee Vehicle Clock IN Clock OUT Hours Worked
6 20044 26045 30-JUN-2006 13:28 30-JUN-2006 13:31 +000000000 00:03:43.000000
28 20044 144 06-JUL-2006 10:11 06-JUL-2006 10:39 +000000000 00:28:43.000000
48 20044 144 07-JUL-2006 09:03 07-JUL-2006 16:30 +000000000 07:27:50.000000
108 20044 26045 18-JUL-2006 15:35
128 20044 144 19-JUL-2006 14:57 19-JUL-2006 15:02 +000000000 00:05:06.000000These programs also..
GFW_PROG_BAR : Bar chart example
GFW_PROG_PIE: Pie chart example -
Changing date format in bw report
Hi,
Could anybody pls Explain How can I change date format in bw report from 19-03-2008 to 19 mar 2008.Is there any setting we need to do. Else do i need to write some ABAP code to get desired format.
Regards,
SarathHi Sarath,
I could have the routine enabled and its wrk for my DATS obj ...
else pls go through the following code
Check this example of how to get this format..
TABLES: T247.
DATA: V_DATE TYPE SYDATUM.
DATA: V_STRING(20).
V_DATE = SY-DATUM.
SELECT SINGLE * FROM T247
WHERE SPRAS = SY-LANGU
AND MNR = V_DATE+4(2).
IF SY-SUBRC = 0.
CONCATENATE V_DATE+6(2) '-' T247-KTX '-' V_DATE(4)
INTO V_STRING.
WRITE: / V_STRING.
ENDIF.
or make use of the routine make use of the FM
CONVERSION_EXIT_IDATE_OUTPUT
hope it helps you out...
regards,
pradeep
Assign points if useful. -
Application Date Format in Interactive Reports
Hi,
What should we define in Number/Date Format in interactive reports column attributes such that it will use application level date format?
ThanksHi,
You do not need define anything , then it use application date format
Br,Jari -
Display output fields in Hierarchy format in ALV report
Hi,
I have a requirement to display the output fileds in ALV report, the output format is like this . The output field should be in ALV format, under each purchase order its corresponding line item should appear.
Pruchase Order 4700000581
company code item
9001 10
9001 20.
9001 30.
Pruchase Order 4700000174
9001 10
9001 20.
Can any one please help me how to do this in ALV report.Hi
This can be achieved using the Heirarchial ALV list
see the sample and do it
REPORT ZALV5_OBJECTS.
TABLES : EKKO.
TYPE-POOLS : SLIS.
TYPES : BEGIN OF TY_EKKO,
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 TY_EKKO.
DATA: IT_EKKO TYPE STANDARD TABLE OF TY_EKKO INITIAL SIZE 0,
IT_EKPO TYPE STANDARD TABLE OF TY_EKKO INITIAL SIZE 0,
IT_EMPTYTAB TYPE STANDARD TABLE OF TY_EKKO INITIAL SIZE 0,
WA_EKKO TYPE TY_EKKO,
WA_EKPO TYPE TY_EKKO.
DATA: OK_CODE LIKE SY-UCOMM, "OK-Code
SAVE_OK LIKE SY-UCOMM.
*ALV data declarations
DATA: FIELDCATALOG TYPE LVC_T_FCAT WITH HEADER LINE.
DATA: GD_FIELDCAT TYPE LVC_T_FCAT,
GD_TAB_GROUP TYPE SLIS_T_SP_GROUP_ALV,
GD_LAYOUT TYPE SLIS_LAYOUT_ALV.
*ALVtree data declarations
CLASS CL_GUI_COLUMN_TREE DEFINITION LOAD.
CLASS CL_GUI_CFW DEFINITION LOAD.
DATA: GD_TREE TYPE REF TO CL_GUI_ALV_TREE,
GD_HIERARCHY_HEADER TYPE TREEV_HHDR,
GD_REPORT_TITLE TYPE SLIS_T_LISTHEADER,
GD_LOGO TYPE SDYDO_VALUE,
GD_VARIANT TYPE DISVARIANT.
*Create container for alv-tree
DATA: GD_TREE_CONTAINER_NAME(30) TYPE C,
GD_CUSTOM_CONTAINER TYPE REF TO CL_GUI_CUSTOM_CONTAINER.
*Includes
*INCLUDE ZDEMO_ALVTREEO01. "Screen PBO Modules
*INCLUDE ZDEMO_ALVTREEI01. "Screen PAI Modules
*INCLUDE ZDEMO_ALVTREEF01. "ABAP Subroutines(FORMS)
*Start-of-selection.
START-OF-SELECTION.
ALVtree setup data
PERFORM DATA_RETRIEVAL.
PERFORM BUILD_FIELDCATALOG.
PERFORM BUILD_LAYOUT.
PERFORM BUILD_HIERARCHY_HEADER CHANGING GD_HIERARCHY_HEADER.
PERFORM BUILD_REPORT_TITLE USING GD_REPORT_TITLE GD_LOGO.
PERFORM BUILD_VARIANT.
Display ALVtree report
CALL SCREEN 100.
*& Form data_retrieval
text
--> p1 text
<-- p2 text
FORM DATA_RETRIEVAL .
SELECT EBELN
UP TO 10 ROWS
FROM EKKO
INTO CORRESPONDING FIELDS OF TABLE IT_EKKO.
LOOP AT IT_EKKO INTO WA_EKKO.
SELECT EBELN EBELP STATU AEDAT MATNR MENGE MEINS NETPR PEINH
FROM EKPO
APPENDING TABLE IT_EKPO
WHERE EBELN EQ WA_EKKO-EBELN.
ENDLOOP.
ENDFORM. " data_retrieval
*& Form build_fieldcatalog
text
--> p1 text
<-- p2 text
FORM BUILD_FIELDCATALOG .
Please not there are a number of differences between the structure of
ALVtree fieldcatalogs and ALVgrid fieldcatalogs.
For example the field seltext_m is replace by scrtext_m in ALVtree.
FIELDCATALOG-FIELDNAME = 'EBELN'. "Field name in itab
FIELDCATALOG-SCRTEXT_M = 'Purchase Order'. "Column text
FIELDCATALOG-COL_POS = 0. "Column position
FIELDCATALOG-OUTPUTLEN = 15. "Column width
FIELDCATALOG-EMPHASIZE = 'X'. "Emphasize (X or SPACE)
FIELDCATALOG-KEY = 'X'. "Key Field? (X or SPACE)
fieldcatalog-do_sum = 'X'. "Sum Column?
fieldcatalog-no_zero = 'X'. "Don't display if zero
APPEND FIELDCATALOG TO GD_FIELDCAT.
CLEAR FIELDCATALOG.
FIELDCATALOG-FIELDNAME = 'EBELP'.
FIELDCATALOG-SCRTEXT_M = 'PO Iten'.
FIELDCATALOG-OUTPUTLEN = 15.
FIELDCATALOG-COL_POS = 1.
APPEND FIELDCATALOG TO GD_FIELDCAT..
CLEAR FIELDCATALOG.
FIELDCATALOG-FIELDNAME = 'STATU'.
FIELDCATALOG-SCRTEXT_M = 'Status'.
FIELDCATALOG-OUTPUTLEN = 15.
FIELDCATALOG-COL_POS = 2.
APPEND FIELDCATALOG TO GD_FIELDCAT..
CLEAR FIELDCATALOG.
FIELDCATALOG-FIELDNAME = 'AEDAT'.
FIELDCATALOG-SCRTEXT_M = 'Item change date'.
FIELDCATALOG-OUTPUTLEN = 15.
FIELDCATALOG-COL_POS = 3.
APPEND FIELDCATALOG TO GD_FIELDCAT..
CLEAR FIELDCATALOG.
FIELDCATALOG-FIELDNAME = 'MATNR'.
FIELDCATALOG-SCRTEXT_M = 'Material Number'.
FIELDCATALOG-OUTPUTLEN = 15.
FIELDCATALOG-COL_POS = 4.
APPEND FIELDCATALOG TO GD_FIELDCAT..
CLEAR FIELDCATALOG.
FIELDCATALOG-FIELDNAME = 'MENGE'.
FIELDCATALOG-SCRTEXT_M = 'PO quantity'.
FIELDCATALOG-OUTPUTLEN = 15.
FIELDCATALOG-COL_POS = 5.
APPEND FIELDCATALOG TO GD_FIELDCAT..
CLEAR FIELDCATALOG.
FIELDCATALOG-FIELDNAME = 'MEINS'.
FIELDCATALOG-SCRTEXT_M = 'Order Unit'.
FIELDCATALOG-OUTPUTLEN = 15.
FIELDCATALOG-COL_POS = 6.
APPEND FIELDCATALOG TO GD_FIELDCAT..
CLEAR FIELDCATALOG.
FIELDCATALOG-FIELDNAME = 'NETPR'.
FIELDCATALOG-SCRTEXT_M = 'Net Price'.
FIELDCATALOG-OUTPUTLEN = 15.
FIELDCATALOG-COL_POS = 7.
FIELDCATALOG-DATATYPE = 'CURR'.
APPEND FIELDCATALOG TO GD_FIELDCAT..
CLEAR FIELDCATALOG.
FIELDCATALOG-FIELDNAME = 'PEINH'.
FIELDCATALOG-SCRTEXT_M = 'Price Unit'.
FIELDCATALOG-OUTPUTLEN = 15.
FIELDCATALOG-COL_POS = 8.
APPEND FIELDCATALOG TO GD_FIELDCAT..
CLEAR FIELDCATALOG.
ENDFORM. " build_fieldcatalog
*& Form build_layout
text
--> p1 text
<-- p2 text
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 build_hierarchy_header
text
<--P_GD_HIERARCHY_HEADER text
FORM BUILD_HIERARCHY_HEADER CHANGING
P_HIERARCHY_HEADER TYPE TREEV_HHDR.
P_HIERARCHY_HEADER-HEADING = 'Hierarchy Header'(013).
P_HIERARCHY_HEADER-TOOLTIP = 'This is the Hierarchy Header !'(014).
P_HIERARCHY_HEADER-WIDTH = 30.
P_HIERARCHY_HEADER-WIDTH_PIX = ''.
ENDFORM. " build_hierarchy_header
*& Form build_report_title
text
-->P_GD_REPORT_TITLE text
-->P_GD_LOGO text
FORM BUILD_REPORT_TITLE USING PT_REPORT_TITLE TYPE SLIS_T_LISTHEADER
P_GD_LOGO TYPE SDYDO_VALUE.
DATA: LS_LINE TYPE SLIS_LISTHEADER,
LD_DATE(10) TYPE C.
List Heading Line(TYPE H)
CLEAR LS_LINE.
LS_LINE-TYP = 'H'.
ls_line-key "Not Used For This Type(H)
LS_LINE-INFO = 'PO ALVTree Display'.
APPEND LS_LINE TO PT_REPORT_TITLE.
Status Line(TYPE S)
LD_DATE(2) = SY-DATUM+6(2).
LD_DATE+2(1) = '/'.
LD_DATE3(2) = SY-DATUM4(2).
LD_DATE+5(1) = '/'.
LD_DATE+6(4) = SY-DATUM(4).
LS_LINE-TYP = 'S'.
LS_LINE-KEY = 'Date'.
LS_LINE-INFO = LD_DATE.
APPEND LS_LINE TO PT_REPORT_TITLE.
Action Line(TYPE A)
CLEAR LS_LINE.
LS_LINE-TYP = 'A'.
CONCATENATE 'Report: ' SY-REPID INTO LS_LINE-INFO SEPARATED BY SPACE.
APPEND LS_LINE TO PT_REPORT_TITLE.
ENDFORM. " build_report_title
*& Form build_variant
text
--> p1 text
<-- p2 text
FORM BUILD_VARIANT .
Set repid for storing variants
GD_VARIANT-REPORT = SY-REPID.
ENDFORM. " build_variant
Reward points for useful Answers
Regards
Anji -
Re: Display format in ALV report
Hi Expert,
I have develop an alv report with some like lifnr,name1,dmbtr,budat,zterm, But my requiremnt is output should come in
the below format like
vendor number vendor name payment tern jan feb mar april ...................... upto december.
no value no value no value no value ..................
Abouce is my report format below jan i have two fields no and value for i have written code output is comming in alv but it
is not commig in the above format
My code is
TYPE-POOLS: SLIS.
TABLES: LFA1,BSAK,BSIK.
TYPES: BEGIN OF TY_LFA1,
LIFNR TYPE LFA1-LIFNR, "VENDOR NUMBER
NAME1 TYPE LFA1-NAME1, "VENDOR NAME
END OF TY_LFA1.
TYPES: BEGIN OF TY_BSIK,
LIFNR TYPE BSIK-LIFNR, "VENDOR NUMBER
DMBTR TYPE BSIK-DMBTR, "AMOUNT IN LOCAL CURRENCY
WMWST TYPE BSIK-WMWST, "TAX AMOUNT IN DOCUMENT CURRENCY
BUDAT TYPE BSIK-BUDAT, "POSTING DATE
ZTERM TYPE BSIK-ZTERM, "TERM OF PAYMENT
END OF TY_BSIK.
TYPES: BEGIN OF TY_OUTPUT,
LIFNR TYPE LFA1-LIFNR,
NAME1 TYPE LFA1-NAME1,
DMBTR TYPE BSIK-DMBTR,
BUDAT TYPE BSIK-BUDAT,
ZTERM TYPE BSIK-ZTERM,
NEW TYPE SY-DATUM,
END OF TY_OUTPUT.
SELECT T1~LIFNR
T1~NAME1
T2~DMBTR
T2~BUDAT
T2~ZTERM
INTO TABLE GT_OUTPUT FROM LFA1 AS T1 INNER JOIN BSIK AS T2
ON T1LIFNR = T2LIFNR
WHERE T1~LIFNR IN S_LIFNR
AND T2~BUDAT IN S_BUDAT
AND ZTERM NE ' '.
and then i have use alv function module REUSE_ALV_GRID_DISPLAY..........................
How to display the report in the above format
can any one throw some light in this..............
Regards,
AdduDear Koolspy,
You are correct i have check in the table BSIK their is one field called SHKZG for credit and debt please can you let me know how to wrtie this in my code my main logic is below.
SELECT T1~LIFNR
T1~NAME1
T2~DMBTR
T2~BUDAT
T2~ZTERM
INTO TABLE GT_OUTPUT FROM LFA1 AS T1 INNER JOIN BSIK AS T2
ON T1LIFNR = T2LIFNR
WHERE T1~LIFNR IN S_LIFNR
AND T2~BUDAT IN S_BUDAT
AND ZTERM NE ' '.
LOOP AT GT_OUTPUT INTO WT_OUTPUT.
WT_FINAL-LIFNR = WT_OUTPUT-LIFNR.
WT_FINAL-NAME1 = WT_OUTPUT-NAME1.
WT_FINAL-DMBTR = WT_OUTPUT-DMBTR. "Amount
WT_FINAL-NEW = WT_OUTPUT-BUDAT+4(2). "posting date
WT_FINAL-ZTERM = WT_OUTPUT-ZTERM.
APPEND WT_FINAL TO IT_FINAL.
CLEAR WT_FINAL.
ENDLOOP.
LOOP AT IT_FINAL INTO WT_FINAL.
COLLECT WT_FINAL INTO GT_OUTPUT5.
ENDLOOP.
LOOP AT GT_OUTPUT5 INTO WT_OUTPUT5.
WT_OUTPUT2-LIFNR = WT_OUTPUT5-LIFNR.
WT_OUTPUT2-NAME1 = WT_OUTPUT5-NAME1.
WT_OUTPUT2-DMBTR = WT_OUTPUT5-DMBTR.
WT_OUTPUT2-NEW = WT_OUTPUT5-NEW.
WT_OUTPUT2-ZTERM = WT_OUTPUT5-ZTERM.
IF WT_OUTPUT5-NEW = '01'. "2
MOVE WT_OUTPUT5-DMBTR TO WT_OUTPUT2-JAN.
"2
ELSEIF WT_OUTPUT5-NEW = '02'.
MOVE WT_OUTPUT5-DMBTR TO WT_OUTPUT2-FEB.
ELSEIF WT_OUTPUT5-NEW = '03'.
MOVE WT_OUTPUT5-DMBTR TO WT_OUTPUT2-MAR.
ELSEIF WT_OUTPUT5-NEW = '04'.
MOVE WT_OUTPUT5-DMBTR TO WT_OUTPUT2-APR.
ELSEIF WT_OUTPUT5-NEW = '05'.
MOVE WT_OUTPUT5-DMBTR TO WT_OUTPUT2-MAY.
ELSEIF WT_OUTPUT5-NEW = '06'.
MOVE WT_OUTPUT5-DMBTR TO WT_OUTPUT2-JUN.
ELSEIF WT_OUTPUT5-NEW = '07'.
MOVE WT_OUTPUT5-DMBTR TO WT_OUTPUT2-JUL.
ELSEIF WT_OUTPUT5-NEW = '08'.
MOVE WT_OUTPUT5-DMBTR TO WT_OUTPUT2-AUG. "5
ELSEIF WT_OUTPUT5-NEW = '09'. "
MOVE WT_OUTPUT5-DMBTR TO WT_OUTPUT2-SEP.
ELSEIF WT_OUTPUT5-NEW = '10'.
MOVE WT_OUTPUT5-DMBTR TO WT_OUTPUT2-OCT.
ELSEIF WT_OUTPUT5-NEW = '11'.
MOVE WT_OUTPUT5-DMBTR TO WT_OUTPUT2-NOV.
ELSEIF WT_OUTPUT5-NEW = '12'.
MOVE WT_OUTPUT5-DMBTR TO WT_OUTPUT2-DEC.
MODIFY GT_OUTPUT2 FROM WT_OUTPUT2.
ENDIF.
APPEND WT_OUTPUT2 TO GT_OUTPUT2.
collect WT_OUTPUT2 inTO GT_OUTPUT2.
COLLECT WT_FINAL INTO GT_OUTPUT5.
clear : wt_output2.
ENDLOOP.
Please let me know where to insert that SHKZG field.
Regards,
Am -
Changing Date Format in ALV List for VKM1 transaction
Hi All,
I have to change date format to MM/DD/YY in the ALV list display of VKM1 transaction. There are user exits available.
I am trying to use EDIT_MASK option of the field catalog.. Without changing the code, I give value as __:__:__ or MM/DD/YY in the EDIT_MASK field of the fieldcatalog during DEBUG. Just before the RESUSE_ALV_LIST_DISPLAY is called.. but it is NOT showing any change in the display.
Please advice any alternate way to do the same.
Thanks a lot.Hi,
If u`ve access to User parameters, try tcode SU01 and give ur user name in the first parameter. Navigate to the defaults tab and you can find options for Date display and decimals display. Now identify the date format to your liking and change the same. From the next logon in ur user name, changes are reflected on your reports.
Reward points if my answer is worthfull.
Regards -
HI guys
i got two obiee server running in our env . both are identical . on one server when ever we rite any report with date column in it it comes up with dd/mm/yyyy output on another server if we right any report all the date column comes with dd mon yyyy format .. i want both of them should show date like dd mon yyyy format .. i checked all the conf files are both are looking same still not able to figure out where should i change for this to work .
please let me know if you need more info from my end.
Regards,
DevHI Kishore
Thanks for your reply i checked all the things but with no success. do think there could be any other place where i should check .
1. nqsconfig date format
its same for both the two installations
DATE_TIME_DISPLAY_FORMAT = "yyyy/mm/dd hh:mi:ss" ;
DATE_DISPLAY_FORMAT = "yyyy/mm/dd" ;
TIME_DISPLAY_FORMAT = "hh:mi:ss" ;
2. make sure that you didn't save date format in column properties from front-end
Just checked and we havan't saved anything in column properties .. even i created new report as well but still format was same ..
3. Did you mention anything in connection pool settings to set date format.
no we havan't mention anything in connection pool
4. Make sure that you are connecting to same database, and date format set for date is same here and there
yahh both the two installatiosn are connected to same database .. but not sure about "date format set for date is same here and there
" hw i can check this
finally, check this: http://108obiee.blogspot.com/2009/04/changing-date-format-mask-in-javascript.html
no its not on one column .. its to all the date format columns on all the reports .. so i think its not case with me .
please let me know if you need more info
Regards,
Dev -
Date format in Discovere Reports
We have created a workbook with a parameter which is supposed to show up an LOV for a parameter in the MON-RR format. Now this LOV shows up
correctly in the Discoverer Desktop edition as MON-RR format, but when we view
the same in Discoverer Viewer it shows up as DD-MON-RRRR.
Earlier we had got a partial resolution on this issue (TAR 3891425.996), wherein by changing the ICX
profile value in Oracle Applications, we are able to set the date mask to MON-R
R.
But now the above profile applies to all the reports and all the dates show up as MON-RR, whereas we want to continue showing the date in DD-MON-RRRR forma
t in some of the reports.
How can this be achieved ?HI Kishore
Thanks for your reply i checked all the things but with no success. do think there could be any other place where i should check .
1. nqsconfig date format
its same for both the two installations
DATE_TIME_DISPLAY_FORMAT = "yyyy/mm/dd hh:mi:ss" ;
DATE_DISPLAY_FORMAT = "yyyy/mm/dd" ;
TIME_DISPLAY_FORMAT = "hh:mi:ss" ;
2. make sure that you didn't save date format in column properties from front-end
Just checked and we havan't saved anything in column properties .. even i created new report as well but still format was same ..
3. Did you mention anything in connection pool settings to set date format.
no we havan't mention anything in connection pool
4. Make sure that you are connecting to same database, and date format set for date is same here and there
yahh both the two installatiosn are connected to same database .. but not sure about "date format set for date is same here and there
" hw i can check this
finally, check this: http://108obiee.blogspot.com/2009/04/changing-date-format-mask-in-javascript.html
no its not on one column .. its to all the date format columns on all the reports .. so i think its not case with me .
please let me know if you need more info
Regards,
Dev -
Hi,
I have created a SQL Report with following select statement. Looks like portal has default format mask for date type as 'DD-MM-YY'.
If I put DD-MM-YYYY or DD-MM-RRRR in Format Mask field in Column Formatting screen, the reports generates 04-10-0002 . It should
be 04-10-2002.
select process_id, last_update_date
from obm
where process_id like (:process_id)
I tried to use the to_char function as following. But it errors ORA-06502:PL/SQL:numeric or value error. Even though it works fine in
my sqlplus session.
select process_id, to_char(last_update_date, 'DD-MM-YYYY')
from obm
where process_id like (:process_id)
Does anyone have any idea?
ThanksHi,
Which version of portal are you using? The error with to_char comes in 30984. This is a bug. The bug no is 2567445. A one-off has been issued. Please look in metalink for it. And for the date formatting in the column formatting section the formatting should work fine. Please check the data in your table.
Thanks,
Sharmila -
Date formatting on updateable report
I have an updateable report with a date column. I would like the user to be able to use mm/dd/rrrr format.
Is this possible?
Thankswhen you use our tabular form wizard to generate a tabular form, you're somewhat limited in what you can do to the data that's being selected out of your table. it's currently set up that way because we do some optimistic locking stuff behind the scenes to maintain your data integrity for you. there might be other ways to deal with your specific request, but this approach seems easiest to me assuming that changing your db's default date format isn't an option:
put html db pl/sql processes on both your page rendering and page submission sections that set your nls_date_format for each of those db sessions. so both of your new html db processes would be of type "PL/SQL Anonymous Block". one would fire with a process point of "On Load - Before Header" and the other would fire "On Submit - Before Computations and Validations". both processes would look like...
begin
execute immediate 'alter session set nls_date_format = ''mm/dd/rrrr''';
end;
...and after those two changes, your tablular form should handle dates in the mm/dd/rrrr format you're looking for.
hope this helps,
raj
Maybe you are looking for
-
How do I connect a Windows 8.1 tablet to a new Macbook Pro?
I am going to be purchasing a new Macbook Pro soon. In addition, I'll probably purchase a new Windows 8.1 tablet to replace my aging iPad 2. How can I connect the Windows tablet to the new Macbook Pro so I can add/remove data & movies? Thanks to ev
-
Santa Rosa MBP - DVI to VGA Projector problems
When hooking up a Sharp PG M20X using a [DVI toVGA cable] and a [VGA to DVI adaptor] the MBP sees the projector, but the projector cannot see the computer. This is a problem because, I may find myself in situations where this is the only configuratio
-
Could not open PS scratch file or initialize because disk not available.
I have a new MAC and am putting all of the adobe programs on the new machine. When opening PS the dialogue box gives the above error and will not open the program. I did see that I needed to diactivate PS on the old system. I did that and still get t
-
hi all I'm doing a BPM scenario in which i want to receive an IDOC. The scenario goes like this: an IDOC is sent from source(from SWCV1) and an interface mapping(done in SWCV2) is done before the IDOC is received in the BPM.I have made an abstract as
-
Upgrade from 10.2.0.3 to 10.2.0.4
Hi , Currently OEM repository database is running in 10.2.0.3 and we planning to do upgrade to 10.2.0.4.Please let me know,is there any documnet to perform this upgrade and URL.Where patches available. Thanks,