lunes, 6 de julio de 2015

Formatos de Fecha BO

In Webi there are multiple way in which you can change the format of the displayed date and time field according to requirement . There are some date format which are available in Webi . Please note that it is case sensitive so it will make a difference if you write Ddd and DDD. Please see the below usage of Format for more understanding :
  Input date String date format formula output
25/09/2013 d FormatDate(datefield(); "d" )
25 25/09/2014 dd FormatDate(datefield(); "dd" )
25 25/09/2015 Ddd FormatDate(datefield(); "Ddd" ) Wed
25/09/2016 DDD FormatDate(datefield(); "DDD" ) WED
25/09/2017 Dddd FormatDate(datefield(); "Dddd" ) Wednesday
25/09/2018 DDDD FormatDate(datefield(); "DDDD" ) WEDNESDAY
25/09/2019 Dddd dd FormatDate(datefield(); "Dddd dd" ) Wednesday
25 25/09/2020 M FormatDate(datefield(); "M" )
9 25/09/2021 MM FormatDate(datefield(); "MM" )
09 25/09/2022 Mmm FormatDate(datefield(); "Mmm" ) Sep
25/09/2023 Mmmm FormatDate(datefield(); "Mmmm" ) September
25/09/2024 yy FormatDate(datefield(); "yy" )
13 25/09/2025 yyyy FormatDate(datefield(); "yyyy" )
2013 25/09/2026 Dddd dd Mmmm yyyy FormatDate(datefield(); "Dddd dd Mmmm yyyy" ) Wednesday 25 september 2013 25/09/2027 h:mm:ss FormatDate(datefield(); "h:mm:ss" ) 11:09:08 25/09/2028 hh:mm FormatDate(datefield(); "hh:mm" ) 11:09 25/09/2029 hh:mm:ss FormatDate(datefield(); "hh:mm:ss" ) 11:09:08 25/09/2030 dd/mm/yyyy hh:mm:ss FormatDate(datefield(); "dd/mm/yyyy hh:mm:ss" ) 25/09/2013 11:09:08 These are some standard formula which we can use to get the desire format. Apart form this we may have date and time functions in formula editor which we can use according to usage to achieve desire format. like in formula editor you will find in "Year" which will return year in a Date , "MonthNumberOfYear" it will return the number in a date , "DayNumberOfYear" returns the day number in a year etc. Problem statement : I have requirement to provide to provide the report in up-loadable date and time format . That mean date in yyyymmdd format and time in hhmmss format. To achieve the requirement of date format we can use the following formula in Webi : FormatNumber(Year(Date field()); "0000")+FormatNumber(MonthNumberOfYear([Planned Call Date]);"00" )+FormatNumber(DayNumberOfYear([Planned Call Date]); "00") . so the for the input date for eg :"25/09/2013" the formula gives the output as "20130925". Now to for the time format i went on the logic to convert it to date using function "ToDate" and then use "FormatDate" function. Below is the output which i got : 1st filed is the time field , 2nd is after applying formula to convert to date field and the 3rd one is after formatting of date field : formating of time.PNG So formula will throw error for the time 15:25:23 , because it is unable to convert it to date format. For the other time its working fine and formatting is done accordingly. Now if you see the time filed format (HH:MM:SS) and require format of time (HHMMSS) , we can achieve this by removing the colon(:) from the time field. There is function in BO formula editor called "Replace" which replaces the part of string with another string. so fromula = Replace([Time field] ; ":";"" ) will replace the ":" with blank . There are so many functions in the formula editor to make the job easy , we have to be aware of working and functionality of formula.

martes, 17 de marzo de 2015

SQ00

http://scn.sap.com/thread/1554611 To move your query from global area to standard area please follow below steps: 1. Goto SQ02 and click on 'Transports' button (ctrl+F3). 2. Now as your query is in global area , please select Transport Action as ' Copy Global Area -->Standard Area'. 3. Select 3rd option button i.e. Transport Infosets and Queris' from ' 'Transport option selection '. 4. Enter name of your infoset query and execute . Your query and infoset is now there in standard area too. Please ensure that your user group is also there in standard area before doing this else first copy your user group from global to standrad by using first option i.e. 'Transport User Group'.

viernes, 28 de junio de 2013

Programas de activación

RSDG_TRFN_ACTIVATE (Transformações e DTP's)
RSBKDTPREPAIR (DTP)
RSDG_CUBE_ACTIVATE (InfoCube)
RSDG_IOBJ_ACTIVATE (InfoObject)
RSDG_MPRO_ACTIVATE (MultiProvider)
RSDG_ODSO_ACTIVATE (DSO)
RSQ_ISET_MASS_OPERATIONS (InfoSet )
RSDS_DATASOURCE_ACTIVATE_ALL (DataSource)
RSDS_TRANSTU_ACTIVATE_ALL  (Transfer Structures).

ANALYZE_RSZ_TABLES (Repair queries)


Requires client to be opened

Delete Data Package - limpiar Data Package

DATA: L_T_DATA TYPE _TY_T_SC_1.
LOOP AT SOURCE_PACKAGE ASSIGNING .
L_DAYS_BETWEEN = SY-DATUM - -REQ_DATE.
IF L_DAYS_BETWEEN > 0 OR
-COMPL_DEL NE 'X' OR
-BO_QTY > 0.
APPEND TO L_T_DATA.
ENDIF.
ENDLOOP.

Exit SAP Variables BW

&---------------------------------------------------------------------*

*& Include ZXRSRU01
*&---------------------------------------------------------------------*
*I_STEP = 1 Call takes place directly before variable entry
*I_STEP = 2 Call takes place directly after variable entry. This step is only started up when the same
*variable is not input ready and could not be filled at I_STEP=1.
*I_STEP = 3 In this call, you can check the values of the variables. Triggering an exception (RAISE)
*causes the variable screen to appear once more. Afterwards, I_STEP=2 is also called again.
*I_STEP = 0 The enhancement is not called from the variable screen. The call can come from
*the authorization check or from the Monitor.

DATA: L_S_RANGE TYPE RSR_S_RANGESID.
DATA: L_S_VAR_RANGE TYPE RRRANGEEXIT.
*******************************
if I_STEP = 0.
* CASE I_VNAM.
* WHEN......
* ENDCASE.
******************************

elseif I_STEP = 1.
* CASE I_VNAM.
* WHEN......
* ENDCASE.
******************************
elseif I_STEP = 2.
CASE I_VNAM.
WHEN 'ZV_CALDAY_TODAY'.
CLEAR L_S_RANGE.
L_S_RANGE-LOW = SY-DATUM.
L_S_RANGE-SIGN = 'I'.
L_S_RANGE-OPT = 'EQ'.
APPEND L_S_RANGE TO E_T_RANGE.
ENDCASE.
******************************
elseif I_STEP = 3.
* CASE I_VNAM.
* WHEN......
* ENDCASE.
******************************

ENDIF.

miércoles, 15 de mayo de 2013

0HR_PA_1: BEGDAT-1 para salidas, status empleado ='0'


Un empleado cesado el  1.4.2011 en la  PA20,  va a tener en el extractor una fecha de inicio para la salida de la empresa de 31.03.2011:

 En la página Help de SAP se indica: “A special date calculation takes place for leaving actions. Actions are only identified as leaving actions if the employment status of the action is changed to the value withdrawn (STAT2 = o). For these actions, one day is subtracted from the start date of the action” http://help.sap.com/saphelp_nw04/helpdata/en/29/02b43947f80c74e10000000a114084/content.htm

Notas: Note 381239 - HR BW: Counting leavings using actions

Si queremos que en el BW sea de 1.4.2011 tenemos que Incluir este código en la transformación:


Para dia:
* ABB 15.05.2013
* 0HR_PA_1 extractor returns in BW day -1 compared with that of
* ECC whenever the Employee Status change on incative (=0)  and the
* action type ( "10") .
* To avoid this in BW you may insert in the trasformation sample code:
* Note 381239 - HR BW: Counting leavings using actions
    if SOURCE_FIELDS-STAT2 = '0' and SOURCE_FIELDS-MASSN = '10'.
      RESULT = SOURCE_FIELDS-CALDAY + 1.
else.
      RESULT = SOURCE_FIELDS-CALDAY.
    endif.

* ABB 15.05.2013
Para mes:
    data: aux_day TYPE D.
    clear aux_day.
    if SOURCE_FIELDS-STAT2 = '0' and SOURCE_FIELDS-MASSN = '10'.
      aux_day = SOURCE_FIELDS-CALDAY + 1.
      RESULT = aux_day(6).
    else.
      RESULT = SOURCE_FIELDS-CALDAY(6).
    endif.

jueves, 9 de mayo de 2013

INFOPROVIDER_VARIABLE


*** Enhancement: MultiProvider using InfoProvider Variable
include YBW_INFOPROVIDER_VARIABLE.
*&---------------------------------------------------------------------*
*& Include YBW_INFOPROVIDER_VARIABLE *
*&---------------------------------------------------------------------*
DATA:
ls_var TYPE rrs0_s_var_range,
ls_range TYPE rsr_s_rangesid,
l_contained TYPE c,
ls_mapping TYPE ybw_mapping,
lt_mapping TYPE TABLE OF ybw_mapping.


* Called after variable popup
IF i_step = 2 AND i_vnam = 'INFOPROV'.
* Read mapping table

REFRESH lt_mapping.
SELECT * FROM ybw_mapping INTO TABLE lt_mapping.
* Process all selection for country variable
REFRESH e_t_range.
LOOP AT i_t_var_range INTO ls_var WHERE vnam = 'S_COUNT'.
* Process all mapping rules
LOOP AT lt_mapping INTO ls_mapping.
* Always fill LOW and HIGH, Otherwise logic below will not work
IF ls_mapping-high IS INITIAL.
ls_mapping-high = ls_mapping-low.
ENDIF.
* Check if selection is contained in the defined InfoProvider
CLEAR l_contained.
CASE ls_var-opt.
WHEN 'EQ'.
IF ls_var-low BETWEEN ls_mapping-low AND ls_mapping-high.
l_contained = 'X'.
ENDIF.
WHEN 'BT'.
IF ls_var-low <= ls_mapping-high AND
ls_var-high => ls_mapping-low.
l_contained = 'X'.
ENDIF.
ENDCASE.
* Add InfoProvider to return table
* Note: Use COLLECT to avoid duplicates
IF l_contained = 'X'.
CLEAR ls_range.
ls_range-sign = 'I'.
ls_range-opt = 'EQ'.
ls_range-low = ls_mapping-infoprov.
COLLECT ls_range INTO e_t_range.
ENDIF.
ENDLOOP. " lt_mapping
ENDLOOP. " i_t_var_range
EXIT.
ENDIF.