Need help in fetching data based on date
i want to write the query for the below statements ?
1) net_bank_cr from rm_memorandum for the previous year end 31st March
2) net_bank_cr from rm_memorandum for the as on date
3) net_bank_cr from rm_memorandum as one year prior to current reporting date
The table structure of rm_memorandum is as given below:
create table RM_MEMO
AS_ON_DT DATE,
PAID_CAPITAL NUMBER(20,2),
TOTAL_OBE NUMBER(20,2),
CR_EQI_OBE NUMBER(20,2),
NET_BANK_CR NUMBER(20,2),
ADJ_NET_BANK_CR NUMBER(20,2),
DEP_CURREMT_CRR NUMBER(20,2),
LIAB_OTH_CRR NUMBER(20,2),
TOTAL_CRR NUMBER(20,2)
)
may be like ..
WITH t AS
(SELECT TO_DATE ('31/12/2010', 'dd/mm/yyyy') as_on_dt, 205 net_bank_cr
FROM DUAL
UNION ALL
SELECT TO_DATE ('15/03/2011', 'dd/mm/yyyy'), 205
FROM DUAL
UNION ALL
SELECT TO_DATE ('15/03/2011', 'dd/mm/yyyy'), 666
FROM DUAL
UNION ALL
SELECT TO_DATE ('31/03/2011', 'dd/mm/yyyy'), 9856
FROM DUAL
UNION ALL
SELECT TO_DATE ('31/03/2011', 'dd/mm/yyyy'), 521
FROM DUAL
UNION ALL
SELECT TO_DATE ('05/04/2011', 'dd/mm/yyyy'), 20
FROM DUAL
UNION ALL
SELECT TO_DATE ('07/05/2011', 'dd/mm/yyyy'), 965
FROM DUAL)
SELECT *
FROM t
WHERE t.as_on_dt
BETWEEN (CASE
WHEN (SYSDATE >
ADD_MONTHS (TRUNC (t.as_on_dt, 'YYYY'), 3)
- 1
THEN ADD_MONTHS (TRUNC (ADD_MONTHS (SYSDATE, -12),
'YYYY'
3
- 1
WHEN (SYSDATE <=
ADD_MONTHS (TRUNC (t.as_on_dt, 'YYYY'), 3)
- 1
THEN ADD_MONTHS (TRUNC (ADD_MONTHS (SYSDATE, -24),
'YYYY'
3
- 1
END
+ 1 -- plus 1 to ensure it is the 1st Apr
AND CASE
WHEN (SYSDATE > ADD_MONTHS (TRUNC (t.as_on_dt, 'YYYY'), 3) - 1)
THEN ADD_MONTHS (TRUNC (SYSDATE, 'YYYY'), 3) - 1
WHEN (SYSDATE <= ADD_MONTHS (TRUNC (t.as_on_dt, 'YYYY'), 3) - 1)
THEN ADD_MONTHS (TRUNC (ADD_MONTHS (SYSDATE, -12), 'YYYY'), 3)
- 1
ENDand result would be ....
AS_ON_DT NET_BANK_CR
31-DEC-10 205
15-MAR-11 205
15-MAR-11 666
31-MAR-11 9856
31-MAR-11 521regards,
friend
Similar Messages
-
Urgent!!!Need code to fetch all sales order data and download to flat file
urgent!!!Need code to fetch all sales order data and download to flat file
D A T A B A S E T A B L E S *
TABLES: vbak, "Sales Document: Header Data
VBAP, "Sales Document: Item Data
MARA,VAPMA,VBPA,VBLB,VBEP,
VBKD. "Murali Poli .
I N T E R N A L T A B L E S *
Internal table to hold the Delphi material numbers file
DATA: BEGIN OF tbl_matnr OCCURS 0,
matnr LIKE mara-matnr, "Material number
END OF tbl_matnr.
Internal table to hold customer cross ref data
DATA: BEGIN OF TBL_CUST_SA OCCURS 0,
OLD_KUNNR LIKE KNA1-KUNNR, "Old Customer
OLD_VKORG LIKE A004-VKORG, "Old Sales organisation
OLD_VTWEG LIKE A004-VTWEG, "Old Distribution channel
NEW_KUNNR LIKE KNA1-KUNNR, "New Customer
NEW_VKORG LIKE A004-VKORG, "New Sales organisation
NEW_VTWEG LIKE A004-VTWEG, "New Distribution channel
PARVW LIKE VBPA-PARVW , "Partner function
END OF TBL_CUST_SA.
Internal table to check the material numbers of the input file
DATA: tbl_mara LIKE tbl_matnr OCCURS 0 WITH HEADER LINE.
Work area to hold the header record
DATA: BEGIN OF w_sa_header,
recordtype(1), "Record type
schedulingagreement(4), "SA Type
contractreference(10), "Contract Reference
salesorg(4), "Sales Organization
distrchannel(2), "Distribution channel
division(2), "Sales division
PONUMBER(35), "Purchase order number"gsbhondave
soldtoparty(12), "Sold-to party
shiptoparty(12), "Ship-to party
collectivenumber(10), "Collective number
description(40), "Description
roundqty(13), "Rounding Qty
pdsi(4), "PDI
correctiondeliverydate(8), "Correction Delivery Dt
correctionqty(13), "Correction Qty
cumulativereceivedqty(13), "Cumulative Received Qty
forecastdeliveryschedule(17), "Forecast Delivery Schedule
forecastdelscheddate(8), "Forecast Delivery Schedule Dt
jitdeliveryschedule(17), "JIT Delivery Schedule
jitdeliveryscheduledate(8), "JIT Delivery Schedule Dt
materialnumber(18), "Material number
plant(4), "Plant
item_category(4), "Item Category
suppliercode(15), "Supplier code
scac(4), "SCAC
deloc(12), "DELOC
pkg_id(12), "Packaging ID
catno(30), "Ultimate Cust Part
lgort(4), "Storage Location
vstel(4), "Shipping point
Adding fields by Murali Poli
VSBED(2), "Shipping conditions
INCO1(3), "Incoterms (part 1)
INCO2(28), "Incoterms (part 2)
ZECN(1), "Engineering Change Letter
End of Adding fields by Murali Poli
END OF w_sa_header.
Work area to hold the forecast record
DATA: BEGIN OF w_sa_forecast,
recordtype(1), "Record Type
dateformat(1), "Date format
forecastdate(8), "Forecast date
forecastorderqty(13), "Order Qty
END OF w_sa_forecast.
Work area to hold the jit record
DATA: BEGIN OF w_sa_jit,
recordtype(1), "Record Type
dateformat(1), "Date format
jitdate(8), "JIT date
jittime(6), "JIT Time
jitorderqty(13), "Order Qty
END OF w_sa_jit.
Internal table to hold the Extracted data
DATA: BEGIN OF tbl_record OCCURS 0,
record_type,
DATA(400), " changed from 325 to 400
END OF tbl_record.
Internal table to capture the errors
DATA: BEGIN OF tbl_error OCCURS 0,
error_text(135),
END OF tbl_error.
Internal table to hold the records of VBAP_VAPMA
DATA: BEGIN OF tbl_vbap_vapma OCCURS 0,
VBELN LIKE VAPMA-VBELN, "Sales and distribution document number
POSNR LIKE VAPMA-POSNR, "Item number
AUART LIKE VAPMA-AUART, "SA Type
VKORG LIKE VAPMA-VKORG, "Sales Organization
VTWEG LIKE VAPMA-VTWEG, "Distribution channel
SPART LIKE VAPMA-SPART, "Division
KUNNR LIKE VAPMA-KUNNR, "Sold-to
plavo like vbap-plavo, "PDI
MATNR LIKE VAPMA-MATNR, "Material number
WERKS LIKE VAPMA-WERKS, "Plant
TRVOG LIKE VAPMA-TRVOG, "Transaction group
VBTYP LIKE VBAK-VBTYP, "SD document category "Murali Poli
VSBED LIKE VBAK-VSBED, "Shipping conditions "Murali Poli
BSTNK LIKE VBAK-BSTNK, " Purchase order number " gsbhondave
KTEXT LIKE VBAK-KTEXT,
VGBEL LIKE VBAP-VGBEL, "Reference document no
ABLFZ LIKE VBAP-ABLFZ, "Rounding qty
PSTYV LIKE VBAP-PSTYV, "Item category
LGORT LIKE VBAP-LGORT, "Storage location
VSTEL LIKE VBAP-VSTEL, "Shipping point
END OF TBL_VBAP_VAPMA.
DATA: BEGIN OF TBL_VBAP OCCURS 0,
VBELN LIKE VAPMA-VBELN,
POSNR LIKE VAPMA-POSNR,
VGBEL LIKE VBAP-VGBEL,
ABLFZ LIKE VBAP-ABLFZ,
PSTYV LIKE VBAP-PSTYV,
LGORT LIKE VBAP-LGORT,
VSTEL LIKE VBAP-VSTEL,
END OF TBL_VBAP.
Adding by Murali Poli
DATA:BEGIN OF TBL_VBKD OCCURS 0,
VBELN LIKE VBKD-VBELN,
POSNR LIKE VBKD-POSNR,
INCO1 LIKE VBKD-INCO1,
INCO2 LIKE VBKD-INCO2,
END OF TBL_VBKD.
End by Murali Poli
Internal table to hold temporarily the records of VBAP_VAPMA
DATA: tbl_vbap_vapma_temp LIKE tbl_vbap_vapma OCCURS 0 WITH HEADER LINE.
Internal table to hold the records of VBPA
DATA: BEGIN OF tbl_vbpa OCCURS 0,
vbeln LIKE vbpa-vbeln, "Sales and distribution
"document number
posnr LIKE vbpa-posnr, "Item number
parvw LIKE vbpa-parvw, "SP Partner type
kunnr LIKE vbpa-kunnr, "Customer number
lifnr LIKE vbpa-lifnr, "SCAC code "DN3K923909
END OF tbl_vbpa.
Internal table to hold the records of VBLB (Forecast)
DATA: BEGIN OF tbl_vblb_forecast OCCURS 0,
vbeln LIKE vblb-vbeln,
posnr LIKE vblb-posnr,
abart LIKE vblb-abart, "Release type
abefz LIKE vblb-abefz, "Cumulative Quantity
"Received by Customer
labnk LIKE vblb-labnk, "Delivery schedule
abrdt LIKE vblb-abrdt, "Deivery date
gjkun LIKE vblb-gjkun, "Current fiscal year
vjkun LIKE vblb-vjkun, "Previous fiscal year
END OF tbl_vblb_forecast.
Internal table to hold the records of VBLB (JIT)
DATA: BEGIN OF tbl_vblb_jit OCCURS 0,
vbeln LIKE vblb-vbeln,
posnr LIKE vblb-posnr,
abart LIKE vblb-abart, "Release type
abefz LIKE vblb-abefz, "Cumulative Quantity
"Received by Customer
labnk LIKE vblb-labnk, "Delivery schedule
abrdt LIKE vblb-abrdt, "Deivery date
gjkun LIKE vblb-gjkun, "Current fiscal year
vjkun LIKE vblb-vjkun, "Previous fiscal year
END OF tbl_vblb_jit.
Internal table to hold the Forecast Schedule lines
DATA: BEGIN OF tbl_vbep_forecast OCCURS 0,
vbeln LIKE vbep-vbeln, "Sales document
posnr LIKE vbep-posnr, "Item number
etenr LIKE vbep-etenr, "Schedule line
edatu LIKE vbep-edatu, "Schedule line date
ezeit LIKE vbep-ezeit, "Arrival time "DN3K923909
wmeng LIKE vbep-wmeng, "Order quantity in sales units
prgrs LIKE vbep-prgrs, "Date type (day, week, month, interval)
abart LIKE vbep-abart, "Release type "DN3K923909
END OF tbl_vbep_forecast.
Internal table to hold the JIT Schedule lines
DATA: BEGIN OF tbl_vbep_jit OCCURS 0,
vbeln LIKE vbep-vbeln, "Sales document
posnr LIKE vbep-posnr, "Item number
etenr LIKE vbep-etenr, "Schedule line
edatu LIKE vbep-edatu, "Schedule line date
ezeit LIKE vbep-ezeit, "Arrival time
wmeng LIKE vbep-wmeng, "Order quantity in sales units
prgrs LIKE vbep-prgrs, "Date type (day, week, month, interval)
abart LIKE vbep-abart, "Release type "DN3K923909
END OF tbl_vbep_jit.
Internal table for Long texts
DATA: tbl_tline LIKE tline OCCURS 0 WITH HEADER LINE.
V A R I A B L E S *
DATA: v_count TYPE i,
V_REPID LIKE SY-REPID,
w_eins LIKE vbap-umvkz VALUE 1,
v_cumulative_deli_qty LIKE vblb-abefz,
v_text_name LIKE thead-tdname,
v_week LIKE scal-week,
v_count_h TYPE i, "Count of header records
v_count_f TYPE i, "Count of Forecast records
v_count_j TYPE i, "Count of JIT records
v_count_t TYPE i. "Count of Shipping instructions
TYPES: unixfile LIKE rlgrap-filename,
unixdir LIKE rlgrap-filename.
DATA: v_file1 TYPE unixfile,
v_file2 TYPE unixfile.
DATA: tbl_dynpfields LIKE dynpread OCCURS 0 WITH HEADER LINE.
*data tbl_cust_sa.
S E L E C T - O P T I O N S / P A R A M E T E R S *
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
Valid-to date
PARAMETER:
p_gueen like vbak-gueen obligatory,
Correction Delivery date
P_DELDT LIKE VBAK-GUEEN OBLIGATORY.
Begin of Changes - TIR-40266
Plant
SELECT-OPTIONS: s_werks FOR vbap-werks.
*SD document category
SELECT-OPTIONS: S_VBTYP FOR VBAK-VBTYP OBLIGATORY." Murali Poli
Sales organization
SELECT-OPTIONS: S_VKORG FOR VBAK-VKORG OBLIGATORY.
End of Changes - TIR-40266
SELECTION-SCREEN SKIP 1.
PARAMETER: r1 RADIOBUTTON GROUP rg1.
Material numbers file
PARAMETER: P_FILE1 LIKE RLGRAP-FILENAME.
PARAMETER: P_FILE6 LIKE RLGRAP-FILENAME.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(32) text-003.
SELECTION-SCREEN POSITION 33.
SD SA Extract file
PARAMETER: P_FILE2 LIKE RLGRAP-FILENAME
DEFAULT 'C:\sd_sa_extract.txt'.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN SKIP 2.
PARAMETER: r2 RADIOBUTTON GROUP rg1.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(32) text-004.
SELECTION-SCREEN POSITION 33.
PARAMETER: p_path1 TYPE unixdir OBLIGATORY DEFAULT '/tmp/'.
SELECTION-SCREEN END OF LINE.
Material numbers file
PARAMETER: PU_FILE1 LIKE RLGRAP-FILENAME.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(32) text-003.
SELECTION-SCREEN POSITION 33.
SD SA Extract file
PARAMETER: PU_FILE2 LIKE RLGRAP-FILENAME.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(64) text-005.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN END OF BLOCK b1.
A T S E L E C T I O N S C R E E N E V E N T S *
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file1.
v_repid = syst-repid.
CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
EXPORTING
program_name = v_repid
CHANGING
file_name = p_file1
EXCEPTIONS
mask_too_long = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE e009.
Message shown as 'Error while getting the file name'
ENDIF.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE6.
CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
EXPORTING
program_name = v_repid
CHANGING
FILE_NAME = P_FILE6
EXCEPTIONS
mask_too_long = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE e009.
Message shown as 'Error while getting the file name'
ENDIF.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file2.
v_repid = syst-repid.
CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
EXPORTING
program_name = v_repid
CHANGING
file_name = p_file2
EXCEPTIONS
mask_too_long = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE e009.
Message shown as 'Error while getting the file name'
ENDIF.
AT SELECTION-SCREEN ON RADIOBUTTON GROUP rg1.
IF r1 = 'X'.
IF p_file1 = '' OR p_file2 = ''.
MESSAGE w000 WITH 'Please select a PC file'.
ENDIF.
LOOP AT SCREEN.
IF screen-name = 'P_FILE1' OR
screen-name = 'P_FILE2'.
screen-input = '1'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ELSEIF r2 = 'X'.
PERFORM get_value USING 'P_PATH1' CHANGING p_path1.
PERFORM get_value USING 'PU_FILE1' CHANGING pu_file1.
PERFORM get_value USING 'P_PATH1' CHANGING p_path1.
PERFORM get_value USING 'PU_FILE2' CHANGING pu_file2.
IF pu_file1 = '' OR pu_file2 = ''.
MESSAGE w000 WITH 'Please select a UNIX file'.
LOOP AT SCREEN.
IF screen-name = 'PU_FILE1' OR
screen-name = 'PU_FILE2'.
screen-input = '1'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.
ENDIF.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR pu_file1.
PERFORM get_value USING 'P_PATH1' CHANGING p_path1.
PERFORM get_value USING 'PU_FILE1' CHANGING pu_file1.
PERFORM popup_unix_filename CHANGING p_path1 pu_file1.
PERFORM set_value USING 'P_PATH1' p_path1.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR pu_file2.
PERFORM get_value USING 'P_PATH1' CHANGING p_path1.
PERFORM get_value USING 'PU_FILE2' CHANGING pu_file2.
PERFORM popup_unix_filename CHANGING p_path1 pu_file2.
PERFORM set_value USING 'P_PATH1' p_path1.
T O P - O F - P A G E *
TOP-OF-PAGE.
PERFORM delphi_header(z_delphi_header_footer)
USING
'E & S SD SCHEDULING AGREEMENTS EXTRACT DATA'(016)
space
sy-linsz.
S T A R T - O F - S E L E C T I O N *
START-OF-SELECTION.
IF r1 = 'X'.
PERFORM upload_data_from_pc_files.
ELSEIF r2 = 'X'.
PERFORM upload_data_from_unix_files.
ENDIF.
PERFORM check_input_data.
PERFORM get_sd_sa_data.
E N D - O F - S E L E C T I O N *
END-OF-SELECTION.
PERFORM process_data.
S U B - R O U T I N E S *
*& Form get_value
FORM get_value USING value(p_fieldname)
CHANGING value(p_fieldvalue).
IF v_repid IS INITIAL.
v_repid = syst-repid.
ENDIF.
REFRESH: tbl_dynpfields.
CLEAR: tbl_dynpfields.
tbl_dynpfields-fieldname = p_fieldname.
APPEND tbl_dynpfields.
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
dyname = v_repid
dynumb = '1000'
TABLES
dynpfields = tbl_dynpfields
EXCEPTIONS
invalid_abapworkarea = 1
invalid_dynprofield = 2
invalid_dynproname = 3
invalid_dynpronummer = 4
invalid_request = 5
no_fielddescription = 6
invalid_parameter = 7
undefind_error = 8
double_conversion = 9
stepl_not_found = 10
OTHERS = 11.
IF syst-subrc = 0.
READ TABLE tbl_dynpfields INDEX 1.
p_fieldvalue = tbl_dynpfields-fieldvalue.
ENDIF.
REFRESH: tbl_dynpfields.
ENDFORM. " get_value
FORM POPUP_UNIX_FILENAME *
Pops up dialog box to explore the unix filesystem and select a file *
--> VALUE(P_PATH) Path where to start exploring from *
--> VALUE(P_FILENAME) Default filename in the dialog box *
FORM popup_unix_filename CHANGING value(p_path) TYPE unixdir
value(p_filename) TYPE unixfile.
DATA: v_length TYPE i,
v_filename TYPE unixfile,
v_directory LIKE draw-filep,
v_file LIKE draw-filep.
IF p_filename(1) = '/' OR
p_path IS INITIAL.
v_filename = p_filename.
ELSE.
v_length = strlen( p_path ) - 1.
IF p_path+v_length(1) <> '/'.
CONCATENATE p_path '/' INTO p_path.
ENDIF.
CONCATENATE p_path p_filename INTO v_filename.
ENDIF.
CALL FUNCTION 'Z_UNIX_FILENAME_GET'
EXPORTING
def_filename = v_filename
mask = ',*.'
mode = 'G'
title = 'Get UNIX file...'
IMPORTING
filename = v_filename
EXCEPTIONS
inv_winsys = 1
no_batch = 2
selection_cancel = 3
selection_error = 4
OTHERS = 5.
CHECK syst-subrc = 0.
CALL FUNCTION 'CV120_SPLIT_PATH'
EXPORTING
pf_path = v_filename
IMPORTING
pfx_path = v_directory
pfx_file = v_file
EXCEPTIONS
OTHERS = 1.
CHECK syst-subrc = 0.
IF v_directory = p_path.
p_filename = v_file.
ELSE.
p_filename = v_filename.
ENDIF.
ENDFORM.
FORM SET_VALUE *
Sets the value of a field on the selection screen. *
--> VALUE(P_FIELDNAME) Name of the field on the selection screen*
--> VALUE(P_FIELDVALUE) Value of the field *
FORM set_value USING value(p_fieldname)
value(p_fieldvalue).
IF v_repid IS INITIAL.
v_repid = syst-repid.
ENDIF.
CLEAR: tbl_dynpfields.
tbl_dynpfields-fieldname = p_fieldname.
tbl_dynpfields-fieldvalue = p_fieldvalue.
APPEND tbl_dynpfields.
CALL FUNCTION 'DYNP_VALUES_UPDATE'
EXPORTING
dyname = v_repid
dynumb = '1000'
TABLES
dynpfields = tbl_dynpfields
EXCEPTIONS
invalid_abapworkarea = 1
invalid_dynprofield = 2
invalid_dynproname = 3
invalid_dynpronummer = 4
invalid_request = 5
no_fielddescription = 6
undefind_error = 7
OTHERS = 8.
ENDFORM.
*& Form upload_data_from_pc_files
This subroutine is used to upload the data from input files
FORM upload_data_from_pc_files.
REFRESH: tbl_matnr.
CLEAR: tbl_matnr.
Upload the data from Delphi Materials file
CALL FUNCTION 'WS_UPLOAD'
EXPORTING
filename = p_file1
filetype = 'DAT'
TABLES
data_tab = tbl_matnr
EXCEPTIONS
conversion_error = 1
file_open_error = 2
file_read_error = 3
invalid_type = 4
no_batch = 5
unknown_error = 6
invalid_table_width = 7
gui_refuse_filetransfer = 8
customer_error = 9
OTHERS = 10.
IF sy-subrc <> 0.
MESSAGE e008 WITH 'Materials file'.
Message shown as "Error while reading Materials file"
ENDIF.
IF sy-subrc = 0 AND tbl_matnr[] IS INITIAL.
MESSAGE e013 WITH 'Materials'.
Message shown as "No records found in Materials file"
ENDIF.
DELETE tbl_matnr WHERE matnr = ''.
CALL FUNCTION 'WS_UPLOAD'
EXPORTING
FILENAME = P_FILE6
filetype = 'DAT'
TABLES
DATA_TAB = TBL_CUST_SA
EXCEPTIONS
conversion_error = 1
file_open_error = 2
file_read_error = 3
invalid_type = 4
no_batch = 5
unknown_error = 6
invalid_table_width = 7
gui_refuse_filetransfer = 8
customer_error = 9
OTHERS = 10.
IF sy-subrc <> 0.
MESSAGE E008 WITH 'Customer/Sales Area Cross Reference file'.
Message shown as "Error while reading Materials file"
ENDIF.
ENDFORM. " upload_data_from_pc_files
*& Form upload_data_from_unix_files
This subroutine is used to upload the data from UNIX files
FORM upload_data_from_unix_files.
REFRESH: tbl_matnr.
CLEAR: tbl_matnr.
Get the complete filename for the Materials file
PERFORM get_full_filename USING pu_file1 CHANGING v_file1.
Open the Materials file
PERFORM open_dataset USING v_file1 'I' 'T' 1.
CHECK syst-subrc = 0.
Read the materials file
DO.
READ DATASET v_file1 INTO tbl_matnr.
IF syst-subrc <> 0.
EXIT.
ENDIF.
Populate the read data into the internal table
APPEND tbl_matnr.
ENDDO.
PERFORM close_dataset USING v_file1.
ENDFORM. " upload_data_from_unix_files
FORM GET_FULL_FILENAME *
Uses the logical path if necessary to get the full filename *
If the filename already has a directory specified, that itself will *
be the full filename *
Else the logical path for Conversions will be prefixed to the given *
filename *
FORM get_full_filename USING value(p_file) TYPE unixfile
CHANGING value(p_fullfile) TYPE unixfile.
DATA: v_length TYPE i.
IF p_file(1) = '/' OR
p_path1 IS INITIAL.
p_fullfile = p_file.
ELSE.
v_length = strlen( p_path1 ) - 1.
IF p_path1+v_length(1) = '/'.
CONCATENATE p_path1 p_file INTO p_fullfile.
ELSE.
CONCATENATE p_path1 '/' p_file INTO p_fullfile.
ENDIF.
ENDIF.
ENDFORM.
FORM OPEN_DATASET *
Opens dataset in the specified mode *
--> VALUE(P_FILE) Name of file to be opened *
--> VALUE(P_IOMODE) 'I' for Input / 'O' for Output *
--> VALUE(P_BTMODE) 'T' for Text / 'B' for Binary *
--> VALUE(P_LEVEL) If set to > 1, will write error message to *
list Else will supress the error message but *
will be available in SYST-MSGV1 *
FORM open_dataset USING value(p_file) TYPE unixfile
value(p_iomode) TYPE c
value(p_btmode) TYPE c
value(p_level) TYPE i.
DATA: v_rc LIKE syst-subrc,
v_msg(100),
v_listmsg(100).
IF p_iomode = 'O'.
IF p_btmode = 'B'.
OPEN DATASET p_file FOR OUTPUT IN BINARY MODE MESSAGE v_msg.
ELSE.
OPEN DATASET p_file FOR OUTPUT IN TEXT MODE MESSAGE v_msg.
ENDIF.
ELSE.
IF p_btmode = 'B'.
OPEN DATASET p_file FOR INPUT IN BINARY MODE MESSAGE v_msg.
ELSE.
OPEN DATASET p_file FOR INPUT IN TEXT MODE MESSAGE v_msg.
ENDIF.
ENDIF.
IF syst-subrc <> 0.
v_rc = syst-subrc.
syst-msgv1 = v_msg.
IF p_level > 0.
CONCATENATE 'Unable to open' p_file
INTO v_listmsg
SEPARATED BY space.
IF p_iomode = 'O'.
CONCATENATE v_listmsg 'for Output'
INTO v_listmsg
SEPARATED BY space.
ELSE.
CONCATENATE v_listmsg 'for Input'
INTO v_listmsg
SEPARATED BY space.
ENDIF.
IF p_iomode = 'B'.
CONCATENATE v_listmsg 'in Binary mode'
INTO v_listmsg
SEPARATED BY space.
ELSE.
CONCATENATE v_listmsg 'in Text mode'
INTO v_listmsg
SEPARATED BY space.
ENDIF.
WRITE: / v_listmsg.
WRITE: /3 '--', v_msg.
syst-subrc = v_rc.
ENDIF.
ENDIF.
ENDFORM.
FORM CLOSE_DATASET *
Closes dataset *
--> VALUE(P_FILE) Name of the file to be closed *
FORM close_dataset USING value(p_file) TYPE unixfile.
CLOSE DATASET p_file.
ENDFORM.
*& Form check_input_data
This subroutine is used to check the data from X Ref files
FORM check_input_data.
DESCRIBE TABLE tbl_matnr LINES v_count.
Use the material conversion routine to pad the material numbers
with zeroes
LOOP AT tbl_matnr.
CALL FUNCTION 'CONVERSION_EXIT_MATN1_INPUT'
EXPORTING
input = tbl_matnr-matnr
IMPORTING
output = tbl_matnr-matnr
EXCEPTIONS
length_error = 1
OTHERS = 2.
TRANSLATE tbl_matnr-matnr TO UPPER CASE.
MODIFY tbl_matnr.
ENDLOOP.
Get the materials from SAP database using the input materials
IF NOT tbl_matnr[] IS INITIAL.
SORT tbl_matnr BY matnr.
SELECT matnr FROM mara
INTO TABLE tbl_mara
FOR ALL ENTRIES IN tbl_matnr
WHERE matnr = tbl_matnr-matnr.
SORT tbl_mara BY matnr.
ENDIF.
Check the existence of input materials in SAP database
LOOP AT tbl_matnr.
READ TABLE tbl_mara WITH KEY matnr = tbl_matnr-matnr
BINARY SEARCH.
IF sy-subrc <> 0.
CONCATENATE 'Material' tbl_matnr-matnr 'does not exist'
INTO tbl_error-error_text
SEPARATED BY space.
APPEND tbl_error.
CLEAR tbl_error.
DELETE tbl_matnr.
ENDIF.
ENDLOOP.
ENDFORM. " check_input_data
*& Form get_sd_sa_data
This subroutine is used to get the SD Scheduling data from database
FORM get_sd_sa_data.
*begin of changes - DN3K923909
DATA: tbl_vbep LIKE tbl_vbep_forecast OCCURS 0 WITH HEADER LINE,
tbl_vblb LIKE tbl_vblb_forecast OCCURS 0 WITH HEADER LINE.
*end of changes - ND3K923909
REFRESH: tbl_vbap_vapma, tbl_vbpa, tbl_vblb_forecast,
tbl_vblb_jit, tbl_vbep_forecast, tbl_vbep_jit.
CLEAR: tbl_vbap_vapma, tbl_vbpa, tbl_vblb_forecast,
tbl_vblb_jit, tbl_vbep_forecast, tbl_vbep_jit.
Get the Scheduling Agreements
SELECT avbeln aposnr
a~vgbel
AAUART avkorg avtweg aspart a~kunnr
a~ablfz
A~MATNR
a~pstyv
a~werks
a~lgort
a~vstel
ATRVOG BVBTYP BVSBED BBSTNK B~KTEXT
FROM VAPMA AS A INNER JOIN VBAK AS B
ON bvbeln = avbeln
INTO TABLE tbl_vbap_vapma
FOR ALL ENTRIES IN tbl_mara
WHERE a~matnr = tbl_mara-matnr
Begin of Changes - TIR-40266
AND a~vkorg IN s_vkorg
AND a~werks IN s_werks
End of Changes - TIR-40266
AND A~TRVOG = '3'
AND B~VBTYP IN S_VBTYP. "Murali Poli
and a~abgru = ''
and b~gueen >= p_gueen.
SORT tbl_vbap_vapma BY vbeln posnr.
IF NOT tbl_vbap_vapma[] IS INITIAL.
SELECT VBELN POSNR VGBEL ABLFZ PSTYV LGORT VSTEL FROM VBAP
INTO TABLE TBL_VBAP FOR ALL ENTRIES IN TBL_VBAP_VAPMA
WHERE VBELN = TBL_VBAP_VAPMA-VBELN
AND POSNR = TBL_VBAP_VAPMA-POSNR.
LOOP AT TBL_VBAP_VAPMA.
READ TABLE TBL_VBAP WITH KEY VBELN = TBL_VBAP_VAPMA-VBELN
POSNR = TBL_VBAP_VAPMA-POSNR.
IF SY-SUBRC = 0 .
TBL_VBAP_VAPMA-VBELN = TBL_VBAP-VBELN.
TBL_VBAP_VAPMA-POSNR = TBL_VBAP-POSNR.
TBL_VBAP_VAPMA-VGBEL = TBL_VBAP-VGBEL.
TBL_VBAP_VAPMA-ABLFZ = TBL_VBAP-ABLFZ.
TBL_VBAP_VAPMA-PSTYV = TBL_VBAP-PSTYV.
TBL_VBAP_VAPMA-LGORT = TBL_VBAP-LGORT.
TBL_VBAP_VAPMA-VSTEL = TBL_VBAP-VSTEL.
MODIFY TBL_VBAP_VAPMA .
ENDIF.
ENDLOOP.
tbl_vbap_vapma_temp[] = tbl_vbap_vapma[].
*--Begin of UnCommentDIR-51476-DN3K932648
-------------- Begin of Comment ----------- CCR-50124 DN3K928457
SORT tbl_vbap_vapma_temp BY vbeln.
DELETE ADJACENT DUPLICATES FROM tbl_vbap_vapma COMPARING vbeln.
-------------- End of Comment ----------- CCR-50124 DN3K928457
*--End of UnCommentDIR-51476-DN3K932648
*--Begin of CommentDIR-51476-DN3K932648
-------------- Begin of Insert ----------- CCR-50124 DN3K928457
Duplicate Line Items are being deleted.
SORT tbl_vbap_vapma BY vbeln posnr.
DELETE ADJACENT DUPLICATES FROM tbl_vbap_vapma COMPARING vbeln posnr.
The field for contract in SA is being modified for uniqueness
loop at tbl_vbap_vapma.
clear: v_vgbel, v_posnr.
v_vgbel = tbl_vbap_vapma-vgbel.
v_posnr = tbl_vbap_vapma-posnr.
if not v_vgbel is initial .
shift v_vgbel left deleting leading v_zero.
shift v_posnr left deleting leading v_zero.
v_posnr = v_posnr / 10.
condense: v_vgbel, v_posnr.
if v_posnr le 9.
concatenate v_vgbel '0' v_posnr into v_vgbel.
else.
concatenate v_vgbel v_posnr into v_vgbel.
endif.
endif.
tbl_vbap_vapma-vgbel = v_vgbel.
modify tbl_vbap_vapma.
endloop.
-------------- End of Insert ----------- CCR-50124 DN3K928457
*--End of CommentDIR-51476-DN3K932648
Get the Partner details
select vbeln posnr parvw kunnr
*Start of Murali Poli
SELECT VBELN POSNR INCO1 INCO2
INTO TABLE TBL_VBKD
FROM VBKD
FOR ALL ENTRIES IN TBL_VBAP_VAPMA
WHERE VBELN = TBL_VBAP_VAPMA-VBELN.
and posnr = tbl_vbap_vapma-posnr.
*End of Murali Poli
SELECT vbeln posnr parvw kunnr lifnr "DN3K923909
INTO TABLE tbl_vbpa
FROM vbpa
FOR ALL ENTRIES IN tbl_vbap_vapma_temp
WHERE vbeln = tbl_vbap_vapma_temp-vbeln
AND parvw IN ('WE', 'SP').
*begin of changes - DN3K923909
select vbeln posnr abart abefz labnk abrdt gjkun vjkun
into table tbl_vblb_forecast
from vblb
for all entries in tbl_vbap_vapma
where vbeln = tbl_vbap_vapma-vbeln
and posnr = tbl_vbap_vapma-posnr
and abrli = '0000'
and abart = '1'.
SELECT vbeln posnr abart abefz labnk abrdt gjkun vjkun
INTO TABLE tbl_vblb
FROM vblb
FOR ALL ENTRIES IN tbl_vbap_vapma
WHERE vbeln = tbl_vbap_vapma-vbeln
AND posnr = tbl_vbap_vapma-posnr
AND abrli = '0000'
AND abart IN ('1','2').
SELECT vbeln posnr etenr edatu ezeit wmeng prgrs abart
INTO TABLE tbl_vbep
FROM vbep
FOR ALL ENTRIES IN tbl_vbap_vapma
WHERE vbeln = tbl_vbap_vapma-vbeln
AND posnr = tbl_vbap_vapma-posnr
AND abart IN ('1','2').
Get the current Forecast delivery schedule
tbl_vblb_forecast[] = tbl_vblb[].
DELETE tbl_vblb_forecast WHERE abart = '2'.
Get the current Forecast Schedule lines
tbl_vbep_forecast[] = tbl_vbep[].
DELETE tbl_vbep_forecast WHERE abart = '2'.
Get the current JIT delivery Schedule
select vbeln posnr abart abefz labnk abrdt gjkun vjkun
into table tbl_vblb_jit
from vblb
for all entries in tbl_vbap_vapma
where vbeln = tbl_vbap_vapma-vbeln
and posnr = tbl_vbap_vapma-posnr -
Need help with representing 2 bits of data in a column
I Need help representing only 2 bits of data in a column in order to save space.
Is that possible?CommitMan wrote:
I Need help representing only 2 bits of data in a column in order to save space.
Is that possible?Yes - using Assembler....
If you need to count bits to save space, then you must be on 70's, or early 80's, hardware. So using Assembler should not be a problem. Let me guess.. a 8051 microcontroller from the 1980?
Here's what the 8051 code and memory optimisation manual says:
>
The simplest and best way to get dramatic improvements
in efficiency is to look for all variables that will have only
binary values (0 and not 0), and define them as type 'bit‘:
bit myVar;With bit variables, the full set of 8051 bit-level assembler
instructions can be used to generate very fast and
compact code. For example, the following C code:
myVar = ~myVar;
if (!myVar)
}Generates only two lines of assembler:
B200 CPL myVar
200006 JB myvar,?C0002This example uses only 5 flash bytes and 8 CPU cycles.
When you use bit variables, you can implement a
nontrivial line of C code with just one assembler
instruction.
>
<i>PS. Yes, the above is really from a manual for a real 80s microcontroller. And yes, I'm poking fun at your question as saving bits were a problem in the 80s and prior. It should not be a problem in the 21st century information system and database.</i> -
Need help in fetching requested data from JSP
Hello,
I really need help in fecthing requested data from JSP to servlet. Can anyone assist me as soon
as possible because I must finish my program by today.....( 20/02/2002).
Thanks in advance.It is very likely that somebody can help you, if you say what your problem is. In fact somebody might already have helped you. What is your problem?
-
I need help to convert a string to date and time
Good aft,
1.How can i get a date from the user input thro' Frames?
2.How to parse it to the date object(I need to include java.util.Date but for the database i need to include java.sql.*,if i do so, i have error as
found:java.util.Date
Required:java.sql.Date)
3.How to insert into the database
The same i need help to insert time into database?
I need solution and explanation...
Reply me immediately...
If u send me the code, its better to me.Hello,
The best way is to use the HEX to decimal coversion VI in the string pallette. Then, write this decimal directly to your chart. If you are doing it a point at a time put it into a while loop.
Doug -
Need help using LabVIEW 7.1 and data socket to transfer images
I need help transferring images across a company network using: LV 7.1, IMAQ 3.0 and a PCI 1407 image aquisition card. I am trying to use datasocket to transfer video image across a company network. I have attached sample vis. Thanks in advance for your help.
I. Cyr
Attachments:
Vibration Chamber Vision_Cyr.llb 129 KBHello –
Something that you need to consider is the fact that when you are sending an image over Data Socket, it is not really the image what is being transferred but a pointer to the image. Please take a look into this Knowledgebase.
Also, you might find this Example Program useful.
Hope this helps.
S Vences
Applications Engineer
National Instruments -
Need help for the web based project
I am using netbeans 5.5 and Sql server for db.What is the full form for DAO and how is it going to help me in my project.U also talk about uml want ot know about it.
and how is it coming to help me.Its a very wast topic i serached.what will be helpful to me of the UML.
What should i start first --- jsp or db design.
What should i use for web based project --- only use jsp(presentation)+dao or jsp+servlet+dao.What would be best ?
provide some nice link based on dynamic fetching of values from the database and showing it at runtime.
Message was edited by:
java@maniAs stated in http://forum.java.sun.com/thread.jspa?threadID=5167752 start reading the Java EE tutorial to get insights in the material.
what will be helpful to me of the UML.UML generally visualizes the core functionality. See http://www.google.com/search?q=uml+tutorial for some tuts.
What should i start first --- jsp or db design.Start with both and end with the best balance between both.
What should i use for web based project --- only use
jsp(presentation)+dao or jsp+servlet+dao.Depends on the business needs. Generally 3-tier webapplications are the best: web, business and data.
provide some nice link based on dynamic fetching of values from the
database and showing it at runtime.Check some SQL and JDBC tutorials how to fetch and process the data:
http://www.google.com/search?q=sql+tutorial
http://www.google.com/search?q=jdbc+tutorial
How to process it in the business and web layer is stated in the Java EE tutorial I've linked in your former topic.
For applying the patterns, check the http://java.sun.com/blueprints/corej2eepatterns/ -
Need help with my usecase based on transient ViewObject
I am using 11.1.1.4.0 Jdev version. I need help with my usecase.Been trying it for 2 days but couldn't figure out the issue.
I have a transientVO . In this VO Rows will be populated programmatically. CountryId is an attribute of this VO. I have created a viewAccessor "CountriesVA" from Country VO of HR schema.
I have a LOV for the countryId which is based on this VA ,getting countries from CountryTable.
This is the model part which works fine.
Before the page load i have called a method to create a row for this transientVO.Once the row is created i can see the SOC in my page which i have created as below.
Now i want to insert a row in the transientVO if user selects a country and restrict duplicate entry . (As One row is already created 1st time there will be no rows created.after that rows will be inserted)
The issue is :: Suppose there are 2 countries. A & B .When user does the following actions :
Insert A . Done //as 1st entry
Insert B . Done //as 1st time entry
Insert A . duplicate not inserted
Insert B . getting inserted // the bug.
<af:selectOneChoice value="#{bindings.CountryId.inputValue}"
label="#{bindings.CountryId.label}"
required="#{bindings.CountryId.hints.mandatory}"
shortDesc="#{bindings.CountryId.hints.tooltip}" id="soc1"
immediate="true" autoSubmit="true"
valueChangeListener="#{pageFlowScope.managedBean.countryIdVC}">
public void countryIdVC(ValueChangeEvent valueChangeEvent) {
// Add event code here...
String oldValue=null;
setEL("#{bindings.CountryId.inputValue}", valueChangeEvent.getOldValue());
if(evaluateEL("#{bindings.CountryId.attributeValue}")!=null)
oldValue =evaluateEL("#{bindings.CountryId.attributeValue}").toString();
setEL("#{bindings.CountryId.inputValue}", valueChangeEvent.getNewValue());
String newValue=evaluateEL("#{bindings.CountryId.attributeValue}").toString();
BindingContainer bindings = BindingContext.getCurrent().getCurrentBindingsEntry();
DCIteratorBinding dciter = (DCIteratorBinding) bindings.get("ViewObj1Iterator");
//access the underlying RowSetIterator
RowSetIterator rsi = dciter.getRowSetIterator();
boolean duplicate=true;
if(oldValue!=null){
rsi.getCurrentRow().setAttribute("CountryId", oldValue);
// Row row= rsi.findByKey(new Key(new Object[] { newValue}), 1)[0];
Key key =new Key(new Object[] { newValue});
Row row=rsi.getRow(key);
if(row==null){
System.err.println(duplicate);
duplicate=false;
}else{
rsi.setCurrentRow(row);
if(!duplicate){
//get handle to the last row
Row lastRow = rsi.last();
//obtain the index of the last row
int lastRowIndex = rsi.getRangeIndexOf(lastRow);
//create a new row
Row newRow = rsi.createRow();
newRow.setAttribute("CountryId", newValue);
//initialize the row
newRow.setNewRowState(Row.STATUS_INITIALIZED);
//add row to last index + 1 so it becomes last in the range set
rsi.insertRowAtRangeIndex(lastRowIndex +1, newRow);
//make row the current row so it is displayed correctly
rsi.setCurrentRow(newRow);I read the reply from Andrejus Baranovskis and thought of studying and implementing that in my useCase.Well it worked . I implemented the same Logic but rowIteration was done in AppModule.
Con-Fusion, Bugs, Facts &amp; Workarounds: Iterating through View Object RowIterator Bug.(NOT ADF BUG, Development B…
http://docs.oracle.com/cd/E15523_01/web.1111/b31974/bcservices.htm#sm0206
9.7.6 What You May Need to Know About Programmatic Row Set Iteration
The problem is solved ,the above links helped me solve the problem.
what i did is i have created a method in appmodule to iterate rows and all the method y operation bindings and my logic works fine ....
MY Advice to all Adf developers ,though i am not an expert but i can assure you to follow the above process for rowIteration.If you use the iterator binding in the manage bean to navigate the rows u'll face issues which are unexpected.
In AppModule :::::
public boolean createRow(String oldValue,String newValue){
System.err.println(oldValue+""+newValue);
ViewObjectImpl vo=getViewObj1();
boolean duplicate=false;
if(oldValue!=null){
RowSetIterator iter = vo.createRowSetIterator(null);
System.err.println("iterating rows ");
while (iter.hasNext()) {
Row r = iter.next();
System.err.println(iter.getRangeIndexOf(r)+" row is "+r.getAttribute("CountryId"));
if(r.getAttribute("CountryId").toString().equals(newValue)){
duplicate=true;
break;
// Do something with the current row.
// close secondary row set iterator
iter.closeRowSetIterator();
return duplicate;
In ManageBean :::::
public void countryIdVC(ValueChangeEvent valueChangeEvent) {
// Add event code here...
String oldValue=null;
System.err.println("Old Value"+valueChangeEvent.getOldValue());
setEL("#{bindings.CountryId.inputValue}", valueChangeEvent.getOldValue());
if(evaluateEL("#{bindings.CountryId.attributeValue}")!=null)
oldValue =evaluateEL("#{bindings.CountryId.attributeValue}").toString();
setEL("#{bindings.CountryId.inputValue}", valueChangeEvent.getNewValue());
String newValue=evaluateEL("#{bindings.CountryId.attributeValue}").toString();
BindingContainer bindings = BindingContext.getCurrent().getCurrentBindingsEntry();
//access the name of the iterator the table is bound to. Its "allDepartmentsIterator"
//in this sample
DCIteratorBinding dciter = (DCIteratorBinding) bindings.get("ViewObj1Iterator");
//access the underlying RowSetIterator
RowSetIterator rsi = dciter.getRowSetIterator();
if(oldValue!=null){
rsi.getCurrentRow().setAttribute("CountryId", oldValue);
OperationBinding operation = bindings.getOperationBinding("createRow");
operation.getParamsMap().put("oldValue", oldValue);
operation.getParamsMap().put("newValue", newValue);
if(!(Boolean)operation.execute()){
//get handle to the last row
Row lastRow = rsi.last();
//obtain the index of the last row
int lastRowIndex = rsi.getRangeIndexOf(lastRow);
//create a new row
Row newRow = rsi.createRow();
newRow.setAttribute("CountryId", newValue);
//initialize the row
newRow.setNewRowState(Row.STATUS_INITIALIZED);
//add row to last index + 1 so it becomes last in the range set
System.err.println("Inserting row at index "+lastRowIndex+1);
rsi.insertRowAtRangeIndex(lastRowIndex +1, newRow);
//make row the current row so it is displayed correctly
rsi.setCurrentRow(newRow);
else{
System.err.println("Data found So not inserting,only setting current Row");
Key key =new Key(new Object[] { newValue});
rsi.setCurrentRow(rsi.getRow(key)); -
How to group data based on date
In my program the internal table is returning several values based on date.
for example for the first pernr in the image below there are four records. i need to delete the first record which is between the dates 20 and 30 .
and also i need to get the difference between the dates as the record 23 and 28 i need to get separate dates as 24, 25..28.I am not sure if I understood your question correctly.
From what I have understood, you can use the following logic.
This logic will move all the records from lt_fields2 to another table lt_fields1 with begda between 20 and 30 of any month, except for the first record. It will also move records for every date between begda and endda of each record.
You can alter the logic based on your exact requirement.
declare another table lt_fields1 like lt_fields2.
data del_flag.
data prev_month(2) type c.
sort lt_fields by pernr begda.
clear del_flag.
loop at lt_fields2 into wa_fields where begda+6(2) GE 20.
* Delete the first record having date greater than 20 in a month for each pernr.
at new pernr.
clear del_flag.
endat.
if begda+4(2) NE prev_month.
clear del_flag.
endif.
if del_flag is initial.
del_flag = 'X'.
continue. " This record will not be moved to the final internal table.
endif.
* Add records for each date between begda and endda.
append wa_fields to lt_fields1.
prev_month = begda+4(2)
while wa_fields-begda LT wa_fields-endda.
wa_fields-begda = wa_fields-begda+1.
append wa_fields to lt_fields1.
endwhile.
endloop. -
Restrict Query Data based on Date range and Users
Hi All,
I have a few web reports that I need do restrict data based on Users.
In all the queries i have an infoobject 0CALDAY, and a User Entry range variable on it. Because of performance issues I need to restrict the range of dates a User can see. Typically most of users could go to a max date range of 1 month back. But some others would need the ability to see data for much bigger range of dates.
Pls suggest how should i go about with this. Should I have to enforce this at Variable level(user exit).... but then i might have to maintain a table for the users.. Is there any other way of doing it.
thanks
RajAny thoughts ?
-
Getting aggregated data based on Date in Webi.
Hi,
I have a requirement to display last 6 Months Receviables Month Wise in Webi. And i am getting data based on clearing Date in Bex query. And data from Bex query will be like
Month Measure
01.01.2014 12
06.01.2014 15
15.01.2014 16
02.02.2014 8
05.02.2014 10
12.03.2014 4
14.03.2014 6
18.03.2014 10
21.03.2014 20
30.03.2014 30
03.04.2014 30
And i want aggregated data as
Month Measure
Jan 43
Feb 18
Mar 66
Apr 30Hi Satish,
Have you tried below:
Create Month1 object as =Month([Month]) and [total]as =Sum([Measure])
Then drag both Month1 and total objects in report block.
Regards,
Yuvraj -
Problem when sorting data based on date
I am trying to sort the following data based on the Transaction Receipt date column,unable to do it usi g the following syntax:
<?sort:TRANSACTION_RECEIPT_DATE;'ascending';data-type='date'?>
I have problem in converting the date in report to canonical date ,is there any other way to achieve the output without converting the date format.
<?xml version="1.0"?>
<!-- Generated by Oracle Reports version 6.0.8.27.0 -->
<RECDTREP>
<LIST_G_ASW_REC_DATE>
<G_ASW_REC_DATE>
<SNO_CREATED_BY>1433</SNO_CREATED_BY>
<SNO_REQUEST_ID>-1</SNO_REQUEST_ID>
<VENDOR_LOT_NUM>PO104</VENDOR_LOT_NUM>
<SNO_CREATION_DATE>07-APR-09</SNO_CREATION_DATE>
<SNO_ATTRIBUTE1></SNO_ATTRIBUTE1>
<OBJECT_ID>24636</OBJECT_ID>
<INITIALIZATION_DATE>07-APR-09</INITIALIZATION_DATE>
<ORGANIZATION_CODE>10</ORGANIZATION_CODE>
<ORGANISATION_NAME>NDC - PARTS</ORGANISATION_NAME>
<SERIAL_NUMBER>6510863063</SERIAL_NUMBER>
<ITEM_CODE>3000.006</ITEM_CODE>
<DESCRIPTION>ALLISON 3000 SERIES ON HWY TRANSMISSION E016392</DESCRIPTION>
<MANUFACTURER>ALLISON</MANUFACTURER>
<APPLICATION>On Highway</APPLICATION>
<ITEM_COST>8879.02</ITEM_COST>
<MATERIAL_COST>631.09</MATERIAL_COST>
<CURRENCY_CODE>AUD</CURRENCY_CODE>
<PO_UNIT_PRICE></PO_UNIT_PRICE>
<TRANSACTION_RECEIPT_DATE>07-Apr-09</TRANSACTION_RECEIPT_DATE>
<PO_NUMBER>982121</PO_NUMBER>
</G_ASW_REC_DATE>
<G_ASW_REC_DATE>
<SNO_CREATED_BY>1433</SNO_CREATED_BY>
<SNO_REQUEST_ID>-1</SNO_REQUEST_ID>
<VENDOR_LOT_NUM>PO107</VENDOR_LOT_NUM>
<SNO_CREATION_DATE>07-APR-09</SNO_CREATION_DATE>
<SNO_ATTRIBUTE1></SNO_ATTRIBUTE1>
<OBJECT_ID>24641</OBJECT_ID>
<INITIALIZATION_DATE>07-APR-09</INITIALIZATION_DATE>
<ORGANIZATION_CODE>10</ORGANIZATION_CODE>
<ORGANISATION_NAME>NDC - PARTS</ORGANISATION_NAME>
<SERIAL_NUMBER>6510863068</SERIAL_NUMBER>
<ITEM_CODE>3000.006</ITEM_CODE>
<DESCRIPTION>ALLISON 3000 SERIES ON HWY TRANSMISSION E016392</DESCRIPTION>
<MANUFACTURER>ALLISON</MANUFACTURER>
<APPLICATION>On Highway</APPLICATION>
<ITEM_COST>8879.02</ITEM_COST>
<MATERIAL_COST>631.09</MATERIAL_COST>
<CURRENCY_CODE>AUD</CURRENCY_CODE>
<PO_UNIT_PRICE></PO_UNIT_PRICE>
<TRANSACTION_RECEIPT_DATE>07-Apr-09</TRANSACTION_RECEIPT_DATE>
<PO_NUMBER>982121</PO_NUMBER>
</G_ASW_REC_DATE>
<G_ASW_REC_DATE>
<SNO_CREATED_BY>1433</SNO_CREATED_BY>
<SNO_REQUEST_ID>-1</SNO_REQUEST_ID>
<VENDOR_LOT_NUM>PO123</VENDOR_LOT_NUM>
<SNO_CREATION_DATE>07-APR-09</SNO_CREATION_DATE>
<SNO_ATTRIBUTE1>2008/06/11 00:00:00</SNO_ATTRIBUTE1>
<OBJECT_ID>24658</OBJECT_ID>
<INITIALIZATION_DATE>07-APR-09</INITIALIZATION_DATE>
<ORGANIZATION_CODE>10</ORGANIZATION_CODE>
<ORGANISATION_NAME>NDC - PARTS</ORGANISATION_NAME>
<SERIAL_NUMBER>6510863086</SERIAL_NUMBER>
<ITEM_CODE>3000.006</ITEM_CODE>
<DESCRIPTION>ALLISON 3000 SERIES ON HWY TRANSMISSION E016392</DESCRIPTION>
<MANUFACTURER>ALLISON</MANUFACTURER>
<APPLICATION>On Highway</APPLICATION>
<ITEM_COST>8879.02</ITEM_COST>
<MATERIAL_COST>631.09</MATERIAL_COST>
<CURRENCY_CODE>AUD</CURRENCY_CODE>
<PO_UNIT_PRICE></PO_UNIT_PRICE>
<TRANSACTION_RECEIPT_DATE>07-Apr-09</TRANSACTION_RECEIPT_DATE>
<PO_NUMBER>982121</PO_NUMBER>
</G_ASW_REC_DATE>
<G_ASW_REC_DATE>
<SNO_CREATED_BY>1433</SNO_CREATED_BY>
<SNO_REQUEST_ID>-1</SNO_REQUEST_ID>
<VENDOR_LOT_NUM>PO75</VENDOR_LOT_NUM>
<SNO_CREATION_DATE>31-MAR-09</SNO_CREATION_DATE>
<SNO_ATTRIBUTE1></SNO_ATTRIBUTE1>
<OBJECT_ID>22190</OBJECT_ID>
<INITIALIZATION_DATE>14-APR-09</INITIALIZATION_DATE>
<ORGANIZATION_CODE>10</ORGANIZATION_CODE>
<ORGANISATION_NAME>NDC - PARTS</ORGANISATION_NAME>
<SERIAL_NUMBER>6510860842</SERIAL_NUMBER>
<ITEM_CODE>3000.006</ITEM_CODE>
<DESCRIPTION>ALLISON 3000 SERIES ON HWY TRANSMISSION E016392</DESCRIPTION>
<MANUFACTURER>ALLISON</MANUFACTURER>
<APPLICATION>On Highway</APPLICATION>
<ITEM_COST>8879.02</ITEM_COST>
<MATERIAL_COST>631.09</MATERIAL_COST>
<CURRENCY_CODE>AUD</CURRENCY_CODE>
<PO_UNIT_PRICE></PO_UNIT_PRICE>
<TRANSACTION_RECEIPT_DATE>31-Mar-09</TRANSACTION_RECEIPT_DATE>
<PO_NUMBER>971515</PO_NUMBER>
</G_ASW_REC_DATE>
<G_ASW_REC_DATE>
<SNO_CREATED_BY>1433</SNO_CREATED_BY>
<SNO_REQUEST_ID>-1</SNO_REQUEST_ID>
<VENDOR_LOT_NUM>PO116</VENDOR_LOT_NUM>
<SNO_CREATION_DATE>25-JUN-09</SNO_CREATION_DATE>
<SNO_ATTRIBUTE1>2008/06/11 00:00:00</SNO_ATTRIBUTE1>
<OBJECT_ID>64271</OBJECT_ID>
<INITIALIZATION_DATE>30-JUN-09</INITIALIZATION_DATE>
<ORGANIZATION_CODE>10</ORGANIZATION_CODE>
<ORGANISATION_NAME>NDC - PARTS</ORGANISATION_NAME>
<SERIAL_NUMBER>6510863077</SERIAL_NUMBER>
<ITEM_CODE>3000.006</ITEM_CODE>
<DESCRIPTION>ALLISON 3000 SERIES ON HWY TRANSMISSION E016392</DESCRIPTION>
<MANUFACTURER>ALLISON</MANUFACTURER>
<APPLICATION>On Highway</APPLICATION>
<ITEM_COST>8879.02</ITEM_COST>
<MATERIAL_COST>631.09</MATERIAL_COST>
<CURRENCY_CODE>AUD</CURRENCY_CODE>
<PO_UNIT_PRICE></PO_UNIT_PRICE>
<TRANSACTION_RECEIPT_DATE>25-Jun-09</TRANSACTION_RECEIPT_DATE>
<PO_NUMBER>982121</PO_NUMBER>
</G_ASW_REC_DATE>
<G_ASW_REC_DATE>
<SNO_CREATED_BY>1433</SNO_CREATED_BY>
<SNO_REQUEST_ID>-1</SNO_REQUEST_ID>
<VENDOR_LOT_NUM>PO92</VENDOR_LOT_NUM>
<SNO_CREATION_DATE>31-MAR-09</SNO_CREATION_DATE>
<SNO_ATTRIBUTE1>2008/06/11 00:00:00</SNO_ATTRIBUTE1>
<OBJECT_ID>22253</OBJECT_ID>
<INITIALIZATION_DATE>14-APR-09</INITIALIZATION_DATE>
<ORGANIZATION_CODE>10</ORGANIZATION_CODE>
<ORGANISATION_NAME>NDC - PARTS</ORGANISATION_NAME>
<SERIAL_NUMBER>6510860890</SERIAL_NUMBER>
<ITEM_CODE>3000.006</ITEM_CODE>
<DESCRIPTION>ALLISON 3000 SERIES ON HWY TRANSMISSION E016392</DESCRIPTION>
<MANUFACTURER>ALLISON</MANUFACTURER>
<APPLICATION>On Highway</APPLICATION>
<ITEM_COST>8879.02</ITEM_COST>
<MATERIAL_COST>631.09</MATERIAL_COST>
<CURRENCY_CODE>AUD</CURRENCY_CODE>
<PO_UNIT_PRICE></PO_UNIT_PRICE>
<TRANSACTION_RECEIPT_DATE>31-Mar-09</TRANSACTION_RECEIPT_DATE>
<PO_NUMBER>971515</PO_NUMBER>
</G_ASW_REC_DATE>
<G_ASW_REC_DATE>
<SNO_CREATED_BY>1433</SNO_CREATED_BY>
<SNO_REQUEST_ID>-1</SNO_REQUEST_ID>
<VENDOR_LOT_NUM>PO99</VENDOR_LOT_NUM>
<SNO_CREATION_DATE>31-MAR-09</SNO_CREATION_DATE>
<SNO_ATTRIBUTE1></SNO_ATTRIBUTE1>
<OBJECT_ID>22263</OBJECT_ID>
<INITIALIZATION_DATE>14-APR-09</INITIALIZATION_DATE>
<ORGANIZATION_CODE>10</ORGANIZATION_CODE>
<ORGANISATION_NAME>NDC - PARTS</ORGANISATION_NAME>
<SERIAL_NUMBER>6510860899</SERIAL_NUMBER>
<ITEM_CODE>3000.006</ITEM_CODE>
<DESCRIPTION>ALLISON 3000 SERIES ON HWY TRANSMISSION E016392</DESCRIPTION>
<MANUFACTURER>ALLISON</MANUFACTURER>
<APPLICATION>On Highway</APPLICATION>
<ITEM_COST>8879.02</ITEM_COST>
<MATERIAL_COST>631.09</MATERIAL_COST>
<CURRENCY_CODE>AUD</CURRENCY_CODE>
<PO_UNIT_PRICE></PO_UNIT_PRICE>
<TRANSACTION_RECEIPT_DATE>31-Mar-09</TRANSACTION_RECEIPT_DATE>
<PO_NUMBER>971515</PO_NUMBER>
</G_ASW_REC_DATE>
<G_ASW_REC_DATE>
<SNO_CREATED_BY>1433</SNO_CREATED_BY>
<SNO_REQUEST_ID>-1</SNO_REQUEST_ID>
<VENDOR_LOT_NUM>PO109</VENDOR_LOT_NUM>
<SNO_CREATION_DATE>25-JUN-09</SNO_CREATION_DATE>
<SNO_ATTRIBUTE1></SNO_ATTRIBUTE1>
<OBJECT_ID>64204</OBJECT_ID>
<INITIALIZATION_DATE>30-JUN-09</INITIALIZATION_DATE>
<ORGANIZATION_CODE>10</ORGANIZATION_CODE>
<ORGANISATION_NAME>NDC - PARTS</ORGANISATION_NAME>
<SERIAL_NUMBER>6510863070</SERIAL_NUMBER>
<ITEM_CODE>3000.006</ITEM_CODE>
<DESCRIPTION>ALLISON 3000 SERIES ON HWY TRANSMISSION E016392</DESCRIPTION>
<MANUFACTURER>ALLISON</MANUFACTURER>
<APPLICATION>On Highway</APPLICATION>
<ITEM_COST>8879.02</ITEM_COST>
<MATERIAL_COST>631.09</MATERIAL_COST>
<CURRENCY_CODE>AUD</CURRENCY_CODE>
<PO_UNIT_PRICE></PO_UNIT_PRICE>
<TRANSACTION_RECEIPT_DATE>25-Jun-09</TRANSACTION_RECEIPT_DATE>
<PO_NUMBER>982121</PO_NUMBER>
</G_ASW_REC_DATE>
<G_ASW_REC_DATE>
<SNO_CREATED_BY>1433</SNO_CREATED_BY>
<SNO_REQUEST_ID>-1</SNO_REQUEST_ID>
<VENDOR_LOT_NUM>PO135</VENDOR_LOT_NUM>
<SNO_CREATION_DATE>25-JUN-09</SNO_CREATION_DATE>
<SNO_ATTRIBUTE1>2008/06/18 00:00:00</SNO_ATTRIBUTE1>
<OBJECT_ID>64296</OBJECT_ID>
<INITIALIZATION_DATE>30-JUN-09</INITIALIZATION_DATE>
<ORGANIZATION_CODE>10</ORGANIZATION_CODE>
<ORGANISATION_NAME>NDC - PARTS</ORGANISATION_NAME>
<SERIAL_NUMBER>6510875546</SERIAL_NUMBER>
<ITEM_CODE>3000.006</ITEM_CODE>
<DESCRIPTION>ALLISON 3000 SERIES ON HWY TRANSMISSION E016392</DESCRIPTION>
<MANUFACTURER>ALLISON</MANUFACTURER>
<APPLICATION>On Highway</APPLICATION>
<ITEM_COST>8879.02</ITEM_COST>
<MATERIAL_COST>631.09</MATERIAL_COST>
<CURRENCY_CODE>AUD</CURRENCY_CODE>
<PO_UNIT_PRICE></PO_UNIT_PRICE>
<TRANSACTION_RECEIPT_DATE>25-Jun-09</TRANSACTION_RECEIPT_DATE>
<PO_NUMBER>982121</PO_NUMBER>
</G_ASW_REC_DATE>
<G_ASW_REC_DATE>
<SNO_CREATED_BY>1433</SNO_CREATED_BY>
<SNO_REQUEST_ID>-1</SNO_REQUEST_ID>
<VENDOR_LOT_NUM>PO101</VENDOR_LOT_NUM>
<SNO_CREATION_DATE>07-APR-09</SNO_CREATION_DATE>
<SNO_ATTRIBUTE1></SNO_ATTRIBUTE1>
<OBJECT_ID>24618</OBJECT_ID>
<INITIALIZATION_DATE>07-APR-09</INITIALIZATION_DATE>
<ORGANIZATION_CODE>10</ORGANIZATION_CODE>
<ORGANISATION_NAME>NDC - PARTS</ORGANISATION_NAME>
<SERIAL_NUMBER>6510863046</SERIAL_NUMBER>
<ITEM_CODE>3000.006</ITEM_CODE>
<DESCRIPTION>ALLISON 3000 SERIES ON HWY TRANSMISSION E016392</DESCRIPTION>
<MANUFACTURER>ALLISON</MANUFACTURER>
<APPLICATION>On Highway</APPLICATION>
<ITEM_COST>8879.02</ITEM_COST>
<MATERIAL_COST>631.09</MATERIAL_COST>
<CURRENCY_CODE>AUD</CURRENCY_CODE>
<PO_UNIT_PRICE></PO_UNIT_PRICE>
<TRANSACTION_RECEIPT_DATE>07-Apr-09</TRANSACTION_RECEIPT_DATE>
<PO_NUMBER>982121</PO_NUMBER>
</G_ASW_REC_DATE>
<G_ASW_REC_DATE>
<SNO_CREATED_BY>1433</SNO_CREATED_BY>
<SNO_REQUEST_ID>-1</SNO_REQUEST_ID>
<VENDOR_LOT_NUM>PO120</VENDOR_LOT_NUM>
<SNO_CREATION_DATE>07-APR-09</SNO_CREATION_DATE>
<SNO_ATTRIBUTE1>2008/06/11 00:00:00</SNO_ATTRIBUTE1>
<OBJECT_ID>24653</OBJECT_ID>
<INITIALIZATION_DATE>07-APR-09</INITIALIZATION_DATE>
<ORGANIZATION_CODE>10</ORGANIZATION_CODE>
<ORGANISATION_NAME>NDC - PARTS</ORGANISATION_NAME>
<SERIAL_NUMBER>6510863081</SERIAL_NUMBER>
<ITEM_CODE>3000.006</ITEM_CODE>
<DESCRIPTION>ALLISON 3000 SERIES ON HWY TRANSMISSION E016392</DESCRIPTION>
<MANUFACTURER>ALLISON</MANUFACTURER>
<APPLICATION>On Highway</APPLICATION>
<ITEM_COST>8879.02</ITEM_COST>
<MATERIAL_COST>631.09</MATERIAL_COST>
<CURRENCY_CODE>AUD</CURRENCY_CODE>
<PO_UNIT_PRICE></PO_UNIT_PRICE>
<TRANSACTION_RECEIPT_DATE>07-Apr-09</TRANSACTION_RECEIPT_DATE>
<PO_NUMBER>982121</PO_NUMBER>
</G_ASW_REC_DATE>
<G_ASW_REC_DATE>
<SNO_CREATED_BY>1433</SNO_CREATED_BY>
<SNO_REQUEST_ID>-1</SNO_REQUEST_ID>
<VENDOR_LOT_NUM>PO122</VENDOR_LOT_NUM>
<SNO_CREATION_DATE>07-APR-09</SNO_CREATION_DATE>
<SNO_ATTRIBUTE1>2008/06/11 00:00:00</SNO_ATTRIBUTE1>
<OBJECT_ID>24657</OBJECT_ID>
<INITIALIZATION_DATE>07-APR-09</INITIALIZATION_DATE>
<ORGANIZATION_CODE>10</ORGANIZATION_CODE>
<ORGANISATION_NAME>NDC - PARTS</ORGANISATION_NAME>
<SERIAL_NUMBER>6510863085</SERIAL_NUMBER>
<ITEM_CODE>3000.006</ITEM_CODE>
<DESCRIPTION>ALLISON 3000 SERIES ON HWY TRANSMISSION E016392</DESCRIPTION>
<MANUFACTURER>ALLISON</MANUFACTURER>
<APPLICATION>On Highway</APPLICATION>
<ITEM_COST>8879.02</ITEM_COST>
<MATERIAL_COST>631.09</MATERIAL_COST>
<CURRENCY_CODE>AUD</CURRENCY_CODE>
<PO_UNIT_PRICE></PO_UNIT_PRICE>
<TRANSACTION_RECEIPT_DATE>07-Apr-09</TRANSACTION_RECEIPT_DATE>
<PO_NUMBER>982121</PO_NUMBER>
</G_ASW_REC_DATE>
<G_ASW_REC_DATE>
<SNO_CREATED_BY>1433</SNO_CREATED_BY>
<SNO_REQUEST_ID>-1</SNO_REQUEST_ID>
<VENDOR_LOT_NUM>PO127</VENDOR_LOT_NUM>
<SNO_CREATION_DATE>07-APR-09</SNO_CREATION_DATE>
<SNO_ATTRIBUTE1>2008/06/11 00:00:00</SNO_ATTRIBUTE1>
<OBJECT_ID>24662</OBJECT_ID>
<INITIALIZATION_DATE>07-APR-09</INITIALIZATION_DATE>
<ORGANIZATION_CODE>10</ORGANIZATION_CODE>
<ORGANISATION_NAME>NDC - PARTS</ORGANISATION_NAME>
<SERIAL_NUMBER>6510863090</SERIAL_NUMBER>
<ITEM_CODE>3000.006</ITEM_CODE>
<DESCRIPTION>ALLISON 3000 SERIES ON HWY TRANSMISSION E016392</DESCRIPTION>
<MANUFACTURER>ALLISON</MANUFACTURER>
<APPLICATION>On Highway</APPLICATION>
<ITEM_COST>8879.02</ITEM_COST>
<MATERIAL_COST>631.09</MATERIAL_COST>
<CURRENCY_CODE>AUD</CURRENCY_CODE>
<PO_UNIT_PRICE></PO_UNIT_PRICE>
<TRANSACTION_RECEIPT_DATE>07-Apr-09</TRANSACTION_RECEIPT_DATE>
<PO_NUMBER>982121</PO_NUMBER>
</G_ASW_REC_DATE>
<G_ASW_REC_DATE>
<SNO_CREATED_BY>1433</SNO_CREATED_BY>
<SNO_REQUEST_ID>-1</SNO_REQUEST_ID>
<VENDOR_LOT_NUM>PO100</VENDOR_LOT_NUM>
<SNO_CREATION_DATE>07-APR-09</SNO_CREATION_DATE>
<SNO_ATTRIBUTE1></SNO_ATTRIBUTE1>
<OBJECT_ID>24585</OBJECT_ID>
<INITIALIZATION_DATE>07-APR-09</INITIALIZATION_DATE>
<ORGANIZATION_CODE>10</ORGANIZATION_CODE>
<ORGANISATION_NAME>NDC - PARTS</ORGANISATION_NAME>
<SERIAL_NUMBER>6510863033</SERIAL_NUMBER>
<ITEM_CODE>3000.006</ITEM_CODE>
<DESCRIPTION>ALLISON 3000 SERIES ON HWY TRANSMISSION E016392</DESCRIPTION>
<MANUFACTURER>ALLISON</MANUFACTURER>
<APPLICATION>On Highway</APPLICATION>
<ITEM_COST>8879.02</ITEM_COST>
<MATERIAL_COST>631.09</MATERIAL_COST>
<CURRENCY_CODE>AUD</CURRENCY_CODE>
<PO_UNIT_PRICE></PO_UNIT_PRICE>
<TRANSACTION_RECEIPT_DATE>07-Apr-09</TRANSACTION_RECEIPT_DATE>
<PO_NUMBER>982121</PO_NUMBER>
</G_ASW_REC_DATE>
<G_ASW_REC_DATE>
<SNO_CREATED_BY>1433</SNO_CREATED_BY>
<SNO_REQUEST_ID>-1</SNO_REQUEST_ID>
<VENDOR_LOT_NUM>PO110</VENDOR_LOT_NUM>
<SNO_CREATION_DATE>25-JUN-09</SNO_CREATION_DATE>
<SNO_ATTRIBUTE1>2008/06/11 00:00:00</SNO_ATTRIBUTE1>
<OBJECT_ID>64265</OBJECT_ID>
<INITIALIZATION_DATE>30-JUN-09</INITIALIZATION_DATE>
<ORGANIZATION_CODE>10</ORGANIZATION_CODE>
<ORGANISATION_NAME>NDC - PARTS</ORGANISATION_NAME>
<SERIAL_NUMBER>6510863071</SERIAL_NUMBER>
<ITEM_CODE>3000.006</ITEM_CODE>
<DESCRIPTION>ALLISON 3000 SERIES ON HWY TRANSMISSION E016392</DESCRIPTION>
<MANUFACTURER>ALLISON</MANUFACTURER>
<APPLICATION>On Highway</APPLICATION>
<ITEM_COST>8879.02</ITEM_COST>
<MATERIAL_COST>631.09</MATERIAL_COST>
<CURRENCY_CODE>AUD</CURRENCY_CODE>
<PO_UNIT_PRICE></PO_UNIT_PRICE>
<TRANSACTION_RECEIPT_DATE>25-Jun-09</TRANSACTION_RECEIPT_DATE>
<PO_NUMBER>982121</PO_NUMBER>
</G_ASW_REC_DATE>
<G_ASW_REC_DATE>
<SNO_CREATED_BY>1433</SNO_CREATED_BY>
<SNO_REQUEST_ID>-1</SNO_REQUEST_ID>
<VENDOR_LOT_NUM>PO130</VENDOR_LOT_NUM>
<SNO_CREATION_DATE>25-JUN-09</SNO_CREATION_DATE>
<SNO_ATTRIBUTE1>2008/06/13 00:00:00</SNO_ATTRIBUTE1>
<OBJECT_ID>64275</OBJECT_ID>
<INITIALIZATION_DATE>30-JUN-09</INITIALIZATION_DATE>
<ORGANIZATION_CODE>10</ORGANIZATION_CODE>
<ORGANISATION_NAME>NDC - PARTS</ORGANISATION_NAME>
<SERIAL_NUMBER>6510875487</SERIAL_NUMBER>
<ITEM_CODE>3000.006</ITEM_CODE>
<DESCRIPTION>ALLISON 3000 SERIES ON HWY TRANSMISSION E016392</DESCRIPTION>
<MANUFACTURER>ALLISON</MANUFACTURER>
<APPLICATION>On Highway</APPLICATION>
<ITEM_COST>8879.02</ITEM_COST>
<MATERIAL_COST>631.09</MATERIAL_COST>
<CURRENCY_CODE>AUD</CURRENCY_CODE>
<PO_UNIT_PRICE></PO_UNIT_PRICE>
<TRANSACTION_RECEIPT_DATE>25-Jun-09</TRANSACTION_RECEIPT_DATE>
<PO_NUMBER>982121</PO_NUMBER>
</G_ASW_REC_DATE>
</LIST_G_ASW_REC_DATE>
<CF_SORT_BY>Manufacture,Receipt Date,Organization,Item Code</CF_SORT_BY>
<CF_SERIAL_WHERE></CF_SERIAL_WHERE>
</RECDTREP>HI Mahesh,
<TRANSACTION_RECEIPT_DATE>07-Apr-09</TRANSACTION_RECEIPT_DATE>
this is not a date,
so you should change the query to get you the format in xsd format : YYYY-MM-DDThh:mm:ss+HH:MM
otherwise, you have to write a custom sort function to decode and order it it.
if you dont do the custom order and use
<?sort:TRANSACTION_RECEIPT_DATE;'ascending';data-type='date'?>
the data will be treated as string and you will see the row is sorted on string. -
Read data based on date in internal tables
Hi Abapers,
In my zreport , i am retreving data from vbrk, vbrp into one internal table ( itab1) and retreiving data from customized table i nto internal table itab2.
itab1 contains following fields.
matnr - Material code
erdat - date ( billing date).
itab2 contains following fields.
matnr - material code.
zfromdate - from date
ztodate - to date
zstprs - material price
loop at itab1 .
endloop.
how to read particular record from itab2 ( which consists of material code with price maintaing with date range ) based on my billing document date i.e erdat
ex: material code fromdate todate price
10000 01.11.2008 20.11.2008 100.
10000 21.11.2008 30.11.2008 104
if for example in itab1 , erdat ( billing doc date is 15.11.2008 ) , how to read first record in itab2 which will fall under that date range.
please give me any suggestions, or provide sample code.
regards,
Hari priyaHi,
Please go in this way
while selecting fileds from table into itab2
select in this way
select * from <tablename> into tabel itab2 where
matnr = itab1-matnr and
zfromdate LE erdat and
ztodate GE erdat.
Loop at itab2.
read table itab1 with key matnr = itab2-matnr.
take ur fields into internal table
endloop. -
Getting the data based on dates
Hi All,
In my application i am not able to retrieve the data from database between two dates.
while entering the dates i am entring using :
+ "',to_date('+ fromdate+ "','DD-Mon-YYYY HH24:MI:SS'),"
as in database i have kept my fromdate type as "varchar2"
So while selecting data i have written the query as :
String sqlQuery =
"select SID,SERVER_NAME,DOWNTIMETYPE,FROMDATE,TODATE,FROMTIME,TOTIME,TIMETAKEN,DOWN_REASON from SS_UPDOWNTIME where (FROMDATE >='"
+ frmdate
+ "' OR (FROMDATE between '"
+ frmdate
+ "' and '"
+ todate
+ "')) ";
but i am not able to get the data between the two selected dates
Regards,
AnupamaHi Anupama,
'between' wont work because you have taken dates as varchar2.
Just try like this.
Take "Date" type in database and in java take java.sql.Date
java.sql.Date sqlDefaultDate = new java.sql.Date(System.currentTimeMillis());
System.out.println("sqlDate: "+sqlDefaultDate);
// this will be in the format 2008-11-13 , So we can pass sqlDefaultDate variable to backend
Regards,
Lakshmi Prasad. -
Need help in fetching data - 0CALDAY and 0FISCPER
Hi BW Gurus,
Have a doubt in creating a query in a multi provider..
The multi provider has three cubes.
Two of them have data at Calday level, while another has data at fiscper level..
fiscper is not maintained in the cubes having data at calday level ..
I have to create a query on the multiprovider pulling data from all three cubes .. And the data to be restricted on the basis of fisper level ..
Could anyone suggest me how to go about it ..
Regards.Hi saugata,
Both the selection will work.
But I was wrong when I said Fiscal period will be easy.
Because getting the date from fiscal period will be quite tricky in the case your user selection is range for Fiscal period As after user enters a fisacl period value you will always have to get the last date of the month for that fiscal period and which will require you to write the code to get last date of month as 30 or 31 . Also you will have to take care of the leap year in the case of feb to get 29
So that will requier you to write the complex code.
Better is you should go for the calendar day range for the user input as it will just require you get the fiscal period which can be just done by offset and concatenation
01.01.2006 can easily be converted to 001.2006
and 12.02.2006 can be converted 002.2006
There is one more solution
Check if your Cube contains 0CALMONTH/YEAR in your Cube where you have 0CALDAY or you can bring just by mappping your day with it.And check whether your fisacl variant is K4 coming up from R/3 it is always compounded with 0FISCYR then you can restrict your data with 0CALMONTH/YEAR only. and the conversion of 0CALMONTH/YEAR is pretty simple.
All these are options upon which you can work
I would say you should go for calmonth year as it will be a simple routine.
Hope it helps you understand better.
Thanks
Maybe you are looking for
-
ACR 8.8 is available - so far only via the manual-installer page
Camera Raw plug-in installer Notably, it includes support for the Olympus E-M5 Mark II Hopefully we'll get an DNG Converter 8.8 so Lightroom folks w/o CC can use it, although maybe that's the point, only CC users get to have it, and they can use Brid
-
Displaying previous FLV cue point during scrubbing
I have a single FLV that has 10 different scenes in it. I've been able to make a "credit" list for each scene by adding actionscript cue points in the FLV component, and displaying the info using dynamic text. It all works fine. Now I want the dynami
-
Anchor point tool doesn't work properly
When I use the anchor point tool and want to adjust a path line, Adobe Flash often doesn't react until the 2nd or 3nt try. Does anyone know a solution for this? I use Adobe Flash CS6. Thanks for help
-
Can't Print after Software Update
After completing an Apple software update which included Epson printer software update 2.7 I am unable to print. I get an error message; Error:/Library/Printers/EPSON/InkjetPrinter2Filter/rastertoescpll.app/Contents/ MacOS/rasertoescpll failed. Can y
-
Why does iOS not work with Blogger threaded discussions?
This has been an ongoing problem since they appeared, if you do anything in a comment entry block on a Blogger based blog threaded reply it will silently crash. No more text entry, no moving cursor, no cut or paste functions. You ask at Blogger supp