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.
lunes, 6 de julio de 2015
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)
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
Botanita, Botana, SAP, BW, Ponte Carreira
Activar,
Truquis BW
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.
LOOP AT SOURCE_PACKAGE ASSIGNING
L_DAYS_BETWEEN = SY-DATUM -
IF L_DAYS_BETWEEN > 0 OR
APPEND
ENDIF.
ENDLOOP.
Botanita, Botana, SAP, BW, Ponte Carreira
ABAP BW
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.
*& 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.
Botanita, Botana, SAP, BW, Ponte Carreira
CMOD BW,
Exit Variables BW
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.
Botanita, Botana, SAP, BW, Ponte Carreira
Exit Variables BW
R3: EXIT_SAPLRSAP_004: Modify DataSource 0GLACCEXT_T011_HIER, 0PROFIT_CTR_0106_HIER, 0ACCOUNT_0109_HIER
CASE i_datasource.
WHEN '0GLACCEXT_T011_HIER'.
PERFORM jerarquia_balance TABLES c_t_hienode c_t_hienode3.
PERFORM jerarquia_carpetas TABLES C_T_FOLDERT.
WHEN '0PROFIT_CTR_0106_HIER'.
PERFORM profit_carpetas TABLES C_T_FOLDERT.
WHEN '0ACCOUNT_0109_HIER'.
PERFORM cuenta_carpetas TABLES C_T_FOLDERT.
ENDCASE.
*****************************
*&---------------------------------------------------------------------*
*& Form jerarquia_balance
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->P_I_T_DATA text
*----------------------------------------------------------------------*
TYPE-POOLS: rsap.
TYPES: BEGIN OF s_reorg,
nodo TYPE rshienodid,
nodo_n TYPE rshienodid,
END OF s_reorg.
TYPES t_reorg TYPE TABLE OF s_reorg.
TYPES: BEGIN OF s_node3,
nodeid(8) TYPE n,
iobjnm(30) TYPE c,
nodename(32) TYPE c,
tlevel(2) TYPE n,
link TYPE c,
parentid(8) TYPE n,
childid(8) TYPE n,
nextid(8) TYPE n,
datefrom TYPE d,
dateto TYPE d,
intervl TYPE c,
fieldnm(30) TYPE c,
glaccext(18) TYPE c,
rsign TYPE c,
plumi TYPE c,
END OF s_node3.
*&---------------------------------------------------------------------*
*& Form jerarquia_balance
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->I_T_DATA text
*----------------------------------------------------------------------*
FORM jerarquia_balance TABLES i_t_data TYPE rsap_t_hienode
i_t_data3.
DATA it_nodos TYPE rsap_t_hienode.
DATA wa_nodos TYPE rsap_s_hienode.
DATA wa_nodos_companyb33 TYPE rsap_s_hienode.
DATA wa_nodos_companyb195 TYPE rsap_s_hienode.
DATA lineas TYPE i.
DATA nod_piv TYPE rshienodid.
DATA ztab LIKE sy-tabix.
DATA ztab_companyb33 LIKE sy-tabix.
DATA ztab_companyb195 LIKE sy-tabix.
DATA nodo_companyb126 TYPE rshienodid.
DATA nodo_companyb138 TYPE rshienodid.
DATA nodo_companybobsnotes TYPE rshienodid.
* DATA nodo_companyb2 TYPE rshienodid.
DATA nodo_companyb26 TYPE rshienodid.
*
*
READ TABLE i_t_data INTO wa_nodos
WITH KEY nodename = 'companyB126'.
IF sy-subrc EQ 0.
nodo_companyb126 = wa_nodos-nodeid.
ENDIF.
READ TABLE i_t_data INTO wa_nodos
WITH KEY nodename = 'companyB138'.
IF sy-subrc EQ 0.
nodo_companyb138 = wa_nodos-nodeid.
ENDIF.
READ TABLE i_t_data INTO wa_nodos
WITH KEY nodename = 'companyB26'.
IF sy-subrc EQ 0.
nodo_companyb26 = wa_nodos-nodeid.
ENDIF.
READ TABLE i_t_data INTO wa_nodos
WITH KEY nodename = 'companyB0BSNOTES'.
IF sy-subrc EQ 0.
nodo_companybobsnotes = wa_nodos-nodeid.
ENDIF.
* READ TABLE i_t_data INTO wa_nodos
* WITH KEY nodename = 'companyB2'.
*
* IF sy-subrc EQ 0.
* nodo_companyb2 = wa_nodos-nodeid.
* ENDIF.
* En esta extraccion tenemos que colocar
* el nodo companyB138-Resultado del ejercicio
* entre los nodos companyB33 y companyB195
* Así el nodo companyB138 tiene que ser nodo HIJO del nodo companyB26
DATA it_reorg TYPE t_reorg.
DATA wa_reorg TYPE s_reorg.
DESCRIBE TABLE i_t_data LINES lineas.
READ TABLE i_t_data INTO wa_nodos INDEX lineas.
IF sy-subrc EQ 0.
nod_piv = wa_nodos-nodeid.
ENDIF.
LOOP AT i_t_data INTO wa_nodos.
IF wa_nodos-nodeid > nodo_companyb126. "1277
EXIT.
ENDIF.
IF wa_nodos-nodeid >= nodo_companyb138. "875
DELETE i_t_data INDEX sy-tabix.
ADD 1 TO nod_piv.
wa_reorg-nodo = wa_nodos-nodeid.
wa_reorg-nodo_n = nod_piv.
APPEND wa_reorg TO it_reorg.
ADD 2 TO wa_nodos-tlevel.
APPEND wa_nodos TO it_nodos.
ENDIF.
ENDLOOP.
LOOP AT it_nodos INTO wa_nodos.
IF wa_nodos-nodeid <> nodo_companyb138. "875
ztab = sy-tabix.
PERFORM dame_nuevo_nodo
TABLES
it_reorg
USING
wa_nodos-nodeid.
PERFORM dame_nuevo_nodo
TABLES
it_reorg
USING
wa_nodos-parentid.
PERFORM dame_nuevo_nodo
TABLES
it_reorg
USING
wa_nodos-childid.
PERFORM dame_nuevo_nodo
TABLES
it_reorg
USING
wa_nodos-nextid.
MODIFY it_nodos FROM wa_nodos INDEX ztab.
ENDIF.
ENDLOOP.
*------------------------------
LOOP AT it_nodos INTO wa_nodos WHERE nodeid = nodo_companyb138. "875
ztab = sy-tabix.
PERFORM dame_nuevo_nodo
TABLES
it_reorg
USING
wa_nodos-nodeid.
PERFORM dame_nuevo_nodo
TABLES
it_reorg
USING
wa_nodos-childid.
READ TABLE i_t_data INTO wa_nodos_companyb33
WITH KEY nodename = 'companyB33'.
IF sy-subrc EQ 0.
ztab_companyb33 = sy-tabix.
wa_nodos_companyb33-nextid = wa_nodos-nodeid.
MODIFY i_t_data FROM wa_nodos_companyb33 INDEX ztab_companyb33.
ENDIF.
READ TABLE i_t_data INTO wa_nodos_companyb195
WITH KEY nodename = 'companyB195'.
IF sy-subrc EQ 0.
ztab_companyb195 = sy-tabix.
wa_nodos-nextid = wa_nodos_companyb195-nodeid.
ENDIF.
MODIFY it_nodos FROM wa_nodos INDEX ztab.
ENDLOOP.
*****************
* DATA ztab_companyb180 LIKE sy-tabix.
* DATA wa_nodos_companyb180 TYPE rsap_s_hienode.
*
*
*
* READ TABLE i_t_data INTO wa_nodos_companyb180
* WITH KEY nodename = 'companyB180'.
*
* IF sy-subrc EQ 0.
* ztab_companyb180 = sy-tabix.
* wa_nodos_companyb180-nextid = nodo_companybobsnotes. "1278
* MODIFY i_t_data FROM wa_nodos_companyb180 INDEX ztab_companyb180.
* ENDIF.
**********************************************
DATA ztab_companyb0bsnotes LIKE sy-tabix.
DATA wa_nodos_companyb0bsnotes TYPE rsap_s_hienode.
READ TABLE i_t_data INTO wa_nodos_companyb0bsnotes
WITH KEY nodename = 'companyB0BSNOTES'.
IF sy-subrc EQ 0.
ztab_companyb0bsnotes = sy-tabix.
CLEAR wa_nodos_companyb0bsnotes-childid.
MODIFY i_t_data
FROM wa_nodos_companyb0bsnotes INDEX ztab_companyb0bsnotes.
ENDIF.
*******************************
DATA ztab_companyb138 LIKE sy-tabix.
DATA wa_nodos_companyb138 TYPE rsap_s_hienode.
READ TABLE it_nodos INTO wa_nodos_companyb138
WITH KEY nodename = 'companyB138'.
IF sy-subrc EQ 0.
ztab_companyb138 = sy-tabix.
wa_nodos_companyb138-parentid = nodo_companyb26. "483
wa_nodos_companyb138-tlevel = 5.
MODIFY it_nodos FROM wa_nodos_companyb138 INDEX ztab_companyb138.
ENDIF.
********************************************
DATA ztab_companyb125 LIKE sy-tabix.
DATA wa_nodos_companyb125 TYPE rsap_s_hienode.
READ TABLE it_nodos INTO wa_nodos_companyb125
WITH KEY nodename = 'companyB125'.
IF sy-subrc EQ 0.
ztab_companyb125 = sy-tabix.
wa_nodos_companyb125-tlevel = 6.
MODIFY it_nodos FROM wa_nodos_companyb125 INDEX ztab_companyb125.
ENDIF.
********************************************
DATA ztab_companyb126 LIKE sy-tabix.
DATA wa_nodos_companyb126 TYPE rsap_s_hienode.
READ TABLE it_nodos INTO wa_nodos_companyb126
WITH KEY nodename = 'companyB126'.
IF sy-subrc EQ 0.
ztab_companyb126 = sy-tabix.
wa_nodos_companyb126-tlevel = 6.
MODIFY it_nodos FROM wa_nodos_companyb126 INDEX ztab_companyb126.
ENDIF.
*******************************
APPEND LINES OF it_nodos TO i_t_data.
* sincroniza
i_t_data3[] = i_t_data[].
FIELD-SYMBOLS
DATA long TYPE i.
LOOP AT i_t_data3 ASSIGNING
IF
ENDIF.
IF
long = STRLEN(
long = long - 2.
IF
ENDIF.
IF
ENDIF.
ENDIF.
ENDLOOP.
ENDFORM. " jerarquia_balance
*&---------------------------------------------------------------------*
*& Form dame_nuevo_nodo
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
* -->T_REORG text
* -->NODO text
*----------------------------------------------------------------------*
FORM dame_nuevo_nodo TABLES it_reorg TYPE t_reorg
USING nodo TYPE rshienodid.
DATA wa_reorg TYPE s_reorg.
IF NOT nodo IS INITIAL.
READ TABLE it_reorg INTO wa_reorg
WITH KEY nodo = nodo.
IF sy-subrc EQ 0.
nodo = wa_reorg-nodo_n.
ELSE.
BREAK-POINT.
ENDIF.
ENDIF.
ENDFORM. "dame_nuevo_nodo
*----------------------------------------------------------------------*
FORM jerarquia_carpetas TABLES C_T_FOLDERT TYPE RSAP_T_FOLDERT.
* LOOP at C_T_FOLDERT..
* C_T_FOLDERT-LANGU = 'EN'.
* MODIFY C_T_FOLDERT.
* ENDLOOP.
ENDFORM. "jerarquia_carpetas
*----------------------------------------------------------------------*
FORM profit_carpetas TABLES C_T_FOLDERT TYPE RSAP_T_FOLDERT.
LOOP at C_T_FOLDERT..
IF C_T_FOLDERT-LANGU = 'E'.
select single DESCRIPT into C_T_FOLDERT-TXTLG
from SETHEADERT where
LANGU = 'S' and
SUBCLASS = C_T_FOLDERT-NODENAME(4) and
SETCLASS = '0106' and
SETNAME = C_T_FOLDERT-NODENAME+4(24).
C_T_FOLDERT-TXTSH = C_T_FOLDERT-TXTLG.
C_T_FOLDERT-TXTMD = C_T_FOLDERT-TXTLG.
ENDIF.
MODIFY C_T_FOLDERT.
ENDLOOP..
ENDFORM. "profit_carpetas
*----------------------------------------------------------------------*
FORM cuenta_carpetas TABLES C_T_FOLDERT TYPE RSAP_T_FOLDERT.
LOOP at C_T_FOLDERT..
IF C_T_FOLDERT-LANGU = 'E'.
select single DESCRIPT into C_T_FOLDERT-TXTLG
from SETHEADERT where
LANGU = 'S' and
SUBCLASS = C_T_FOLDERT-NODENAME(4) and
* SETCLASS = '0106' and
SETNAME = C_T_FOLDERT-NODENAME+4(10).
C_T_FOLDERT-TXTSH = C_T_FOLDERT-TXTLG.
C_T_FOLDERT-TXTMD = C_T_FOLDERT-TXTLG.
ENDIF.
MODIFY C_T_FOLDERT.
ENDLOOP..
ENDFORM. "cuenta_carpetas
martes, 7 de mayo de 2013
Ficheros para SAP LOGON
saplogon.ini
SapLogonTree.xml
saprules.xml
sapshortcut.ini
SapLogonTree.xml
saprules.xml
sapshortcut.ini
Botanita, Botana, SAP, BW, Ponte Carreira
SAP Logon
viernes, 26 de abril de 2013
Z_SET_BEX_USER_TEMPLATE
Z_SET_BEX_USER_TEMPLATE
*&---------------------------------------------------------------------*
*& Report Z_SET_BEX_USER_TEMPLATE
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
REPORT Z_SET_BEX_USER_TEMPLATE.
**************************************************************************
* Type Pools
**************************************************************************
type-pools:
rs, rsr, rspar, rssg.
**************************************************************************
selection-screen begin of block rad2 with frame title text-001.
parameters:
p_usr like usr01-BNAME,
wbid like rsrwbindex-workbookid,
version(2) type c,
p_vers as checkbox default rs_c_true.
selection-screen end of block rad2.
tables: rsrwbtemplate, usr01.
select * from usr01
where bname = p_usr.
rsrwbtemplate-templateuser = usr01-bname.
rsrwbtemplate-workbookid = wbid.
if p_vers = rs_c_true.
rsrwbtemplate-LEAST_BEX_VERSIO = version.
endif.
update rsrwbtemplate.
if sy-subrc <> 0. insert rsrwbtemplate. endif.
endselect.
Botanita, Botana, SAP, BW, Ponte Carreira
BEX
Valor TAM y Aculumado: Variables e valor para Update Rules
**************Variables*****************************************
ACUMULADO
Clear: mes_ini, mes_fin, year_ini, year_fin, mes_year_ini, mes_year_fin.
mes_fin = COMM_STRUCTURE-CALMONTH+4(2).
year_fin = COMM_STRUCTURE-CALMONTH(4).
mes_ini = '01'.
year_ini = COMM_STRUCTURE-CALMONTH(4).
concatenate year_ini mes_ini into mes_year_ini.
concatenate year_fin mes_fin into mes_year_fin.
SELECT SUM( /BIC/ZHIG_080 )
FROM /BIC/AZOHIG_0100
INTO RESULT
WHERE COMP_CODE = COMM_STRUCTURE-COMP_CODE
AND ( CALMONTH => mes_year_ini and CALMONTH =< mes_year_fin ).
TAM
Clear: mes_ini, mes_fin, year_ini, year_fin, mes_year_ini, mes_year_fin.
mes_fin = COMM_STRUCTURE-CALMONTH+4(2).
year_fin = COMM_STRUCTURE-CALMONTH(4).
mes_ini = mes_fin + 1.
year_ini = year_fin - 1.
concatenate year_ini mes_ini into mes_year_ini.
concatenate year_fin mes_fin into mes_year_fin.
if mes_fin eq 13.
concatenate year_ini '01' into mes_year_fin.
endif.
SELECT SUM( /BIC/ZHIG_080 )
FROM /BIC/AZOHIG_0100
INTO RESULT
WHERE COMP_CODE = COMM_STRUCTURE-COMP_CODE
AND ( CALMONTH => mes_year_ini and CALMONTH =< mes_year_fin ).
*****************************************************************************
ACUMULADO
Clear: mes_ini, mes_fin, year_ini, year_fin, mes_year_ini, mes_year_fin.
mes_fin = COMM_STRUCTURE-CALMONTH+4(2).
year_fin = COMM_STRUCTURE-CALMONTH(4).
mes_ini = '01'.
year_ini = COMM_STRUCTURE-CALMONTH(4).
concatenate year_ini mes_ini into mes_year_ini.
concatenate year_fin mes_fin into mes_year_fin.
SELECT SUM( /BIC/ZHIG_080 )
FROM /BIC/AZOHIG_0100
INTO RESULT
WHERE COMP_CODE = COMM_STRUCTURE-COMP_CODE
AND ( CALMONTH => mes_year_ini and CALMONTH =< mes_year_fin ).
TAM
Clear: mes_ini, mes_fin, year_ini, year_fin, mes_year_ini, mes_year_fin.
mes_fin = COMM_STRUCTURE-CALMONTH+4(2).
year_fin = COMM_STRUCTURE-CALMONTH(4).
mes_ini = mes_fin + 1.
year_ini = year_fin - 1.
concatenate year_ini mes_ini into mes_year_ini.
concatenate year_fin mes_fin into mes_year_fin.
if mes_fin eq 13.
concatenate year_ini '01' into mes_year_fin.
endif.
SELECT SUM( /BIC/ZHIG_080 )
FROM /BIC/AZOHIG_0100
INTO RESULT
WHERE COMP_CODE = COMM_STRUCTURE-COMP_CODE
AND ( CALMONTH => mes_year_ini and CALMONTH =< mes_year_fin ).
*****************************************************************************
R3: EXIT_SAPLRSAP_004: 4R_SAKNR_0000_HIER
* In this
example, Sets are extracted for DataSource 4R_SAKNR_0000_HIER
* they are
compounded by a value of 'TEST' (for compound 0CHRT_ACCTS)
* The exit
is called for any hierarchy extracted from OLTP to BW,
* therefore
we have to make sure only desired FI-SL-Sets are modified.
* This
information is available in I_DATASOURCE and I_S_HIEBAS.
*
IF
I_DATASOURCE = '4R_SAKNR_0000_HIER'
"<--- datasource="" o:p="" your="">--->
AND I_S_HIEBAS-HCLASS = '0000'. "Hierarchy class of FI-SL-Sets
* Add
compound value to hierarchy leaves
LOOP AT C_T_HIENODE WHERE IOBJNM <>
'0HIER_NODE'.
* Shift nodename right to get space for
compound characteristic
SHIFT C_T_HIENODE-NODENAME RIGHT BY 4
PLACES.
* Put chart of accounts into first 4 places
C_T_HIENODE-NODENAME(4) = 'TEST'. "<-- compound="" o:p="" value="" your="">-->
MODIFY C_T_HIENODE.
ENDLOOP.
* Add
compound value to intervals in the same fashion
LOOP AT C_T_HIEINTV.
SHIFT C_T_HIEINTV-LEAFFROM RIGHT BY 4
PLACES.
C_T_HIEINTV-LEAFFROM(4) = 'TEST'. "<-- compound="" o:p="" value="" your="">-->
SHIFT C_T_HIEINTV-LEAFTO RIGHT BY 4 PLACES.
C_T_HIEINTV-LEAFTO(4) = 'TEST'. "<-- compound="" o:p="" value="" your="">-->
MODIFY C_T_HIEINTV.
ENDLOOP.
ENDIF.
Carga en masa de fotos
REPORT ZHR_BDC_UPLOADPIC
NO STANDARD PAGE HEADING LINE-SIZE 255.
INCLUDE
INCLUDE BDCRECX1.
I N T E R N A L T A B L E S
DATA : BEGIN OF IT_DATA OCCURS 0,
RP50G-PERNR(8), " LIKE RP50G-PERNR,
RLGRAP-FILENAME(128),
END OF IT_DATA.
S T A R T - O F - S E L E C T I O N
START-OF-SELECTION.
PERFORM OPEN_GROUP.
CALL FUNCTION 'UPLOAD'
EXPORTING
FILENAME = 'C:\PICTURE.TXT'
FILETYPE = 'DAT'
TABLES
DATA_TAB = IT_DATA
EXCEPTIONS
CONVERSION_ERROR = 1
INVALID_TABLE_WIDTH = 2
INVALID_TYPE = 3
NO_BATCH = 4
UNKNOWN_ERROR = 5
GUI_REFUSE_FILETRANSFER = 6
OTHERS = 7.
IF SY-SUBRC NE 0.
WRITE : / 'Unable to upload data'.
STOP.
ENDIF.
LOOP AT IT_DATA.
PERFORM BDC_DYNPRO USING 'OANEWCON' '0100'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'TOAOM-AR_OBJECT'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=NEW'.
PERFORM BDC_FIELD USING 'TOAOM-SAP_OBJECT'
'PREL'.
PERFORM BDC_FIELD USING 'TOAOM-AR_OBJECT'
'HRICOLFOTO'.
PERFORM BDC_DYNPRO USING 'SAPLSJ01' '0200'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'FIELD_VALUES-INPUT(02)'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=OK'.
PERFORM BDC_FIELD USING 'FIELD_VALUES-INPUT(01)'
IT_DATA-RP50G-PERNR. "'10002'.
PERFORM BDC_FIELD USING 'FIELD_VALUES-INPUT(02)'
'0002'.
PERFORM BDC_DYNPRO USING 'SAPLOPTM' '0105'.
PERFORM BDC_FIELD USING 'BDC_CURSOR'
'SAPB-SAPPOOLINF'.
PERFORM BDC_FIELD USING 'BDC_OKCODE'
'=OKAY'.
PERFORM BDC_FIELD USING 'SAPB-SAPPOOLINF'
IT_DATA-RLGRAP-FILENAME. "JPG'.
PERFORM BDC_TRANSACTION USING 'OAOH'.
clear IT_DATA-RLGRAP-FILENAME.
ENDLOOP.
PERFORM CLOSE_GROUP.
Botanita, Botana, SAP, BW, Ponte Carreira
ABAP
Infopaquete ABAP ejemplos
**********30 dias hacia atras**************************************+
program
conversion_routine.
* Type
pools used by conversion program
type-pools:
rsarc, rsarr, rssm.
tables:
rssdlrange.
* Global
code used by conversion rules
*$*$ begin
of global - insert your declaration only below this line *-*
* TABLES:
...
* DATA: ...
*$*$ end of
global - insert your declaration only before this line *-*
*
-------------------------------------------------------------------
* InfoObject = Z_BUDAT
* Fieldname = BUDAT
* data type = DATS
* length = 000008
* convexit =
*
-------------------------------------------------------------------
form
compute_BUDAT
tables l_t_range structure rssdlrange
changing p_subrc like sy-subrc.
* Insert source code to current selection field
*$*$ begin
of routine - insert your code only below this line *-*
data: l_idx
like sy-tabix, l_budat_low like sy-datum.
read table l_t_range with key fieldname =
'BUDAT'.
l_idx = sy-tabix.
* Se calcula la fecha de dos día hacia atras
* clear l_budat_low.
l_budat_low = sy-datum.
l_budat_low = ( l_budat_low - 29 ).
* Se pone la fecha de dos días hacia atras
como límite inferior del
* rango de fechas, el límite superior la fecha
que venía y el
* signo de igual se pasa a between.
* clear l_t_range-high.
l_t_range-high = sy-datum.
l_t_range-low = l_budat_low.
l_t_range-option = 'BT'.
l_t_range-sign = 'I'.
modify l_t_range index l_idx.
p_subrc = 0.
*$*$ end of
routine - insert your code only before this line *-*
endform.
*****************************************************************+
*********ultimo dia del mes******************************************
data: l_idx like sy-tabix.
read table l_t_range with key
fieldname = 'STIDA'.
l_idx = sy-tabix.
*....
data: u_fecha like sy-datum.
* Se calcula la fecha
u_fecha = sy-datum.
* Ultimo dia do mes
CALL FUNCTION 'SLS_MISC_GET_LAST_DAY_OF_MONTH'
EXPORTING
DAY_IN = u_fecha
IMPORTING
LAST_DAY_OF_MONTH = u_fecha
EXCEPTIONS
DAY_IN_NOT_VALID = 1
OTHERS = 2.
* rango de fechas
l_t_range-high = u_fecha.
l_t_range-low = u_fecha.
l_t_range-option = 'BT'.
l_t_range-sign = 'I'.
modify l_t_range index l_idx.
Botanita, Botana, SAP, BW, Ponte Carreira
ABAP
TEVEN: infotipo IT2011
Detallo un poco mas como tratar el Infotipo 2011.
Los registros del IT2011 no se almacenan en una tabla tipo PANNNN, con NNNN = Nº Infotipo, sino en la tabla TEVEN, por lo que funciones como HR_READ_INFOTYPE, no sirven para leer los datos del IT2011, entonces un ejemplo de lectura del IT2011 es como el siguiente:
Código:
SELECT * FROM teven APPENDING TABLE it_teven
WHERE pernr EQ gt_pernr-pernr
AND ldate EQ gf_fecha
AND stokz EQ space.
A su vez, para borrar un registro es aconsejable hacerlo de la siguiente manera:
Código:
IF teven-stokz EQ space.
teven-stokz = 'X'.
teven-uname = sy-uname.
teven-aedtm = sy-datum.
UPDATE teven.
ENDIF.
BAPI_CC1_UPLOAD_TIMEEVENT.
2 - Exit Variables (step_2): ultimo dia del mes
*======================================================================
** A partir de la referencia 1 obtiene el intervalo mes/año 1
*====================================================================
WHEN 'V_CFPA'.
CLEAR L_S_RANGE.
CLEAR: L_MONTH_LOW, L_MONTH_HIGH, L_YEAR_LOW, L_YEAR_HIGH.
LOOP AT i_t_var_range INTO loc_var_range WHERE vnam = '0P_FPER'.
L_MONTH_LOW = '001'.
*L_MONTH_HIGH = LOC_VAR_RANGE-LOW+24(2).
L_YEAR_LOW = LOC_VAR_RANGE-LOW+3(4).
*L_YEAR_HIGH = LOC_VAR_RANGE-LOW+20(4).
CONCATENATE L_YEAR_LOW L_MONTH_LOW INTO L_S_RANGE-LOW.
*CONCATENATE L_YEAR_HIGH '0' L_MONTH_HIGH INTO L_S_RANGE-HIGH.
L_S_RANGE-SIGN = 'I'.
L_S_RANGE-OPT = 'E'.
APPEND L_S_RANGE TO E_T_RANGE.
EXIT.
ENDLOOP.
WHEN 'ZV_DUM'.
CLEAR L_S_RANGE.
data u_fecha type dats.
LOOP AT i_t_var_range INTO loc_var_range WHERE vnam = '0PCALMON'.
concatenate loc_var_range-low '01' into u_fecha.
ENDLOOP.
CALL FUNCTION 'SLS_MISC_GET_LAST_DAY_OF_MONTH'
EXPORTING
DAY_IN = u_fecha
IMPORTING
LAST_DAY_OF_MONTH = u_fecha
EXCEPTIONS
DAY_IN_NOT_VALID = 1
OTHERS = 2.
L_S_RANGE-SIGN = 'I'.
L_S_RANGE-OPT = 'EQ'.
L_S_RANGE-LOW = u_fecha.
APPEND L_S_RANGE TO E_T_RANGE.
Botanita, Botana, SAP, BW, Ponte Carreira
CMOD BW,
Exit Variables BW
Template for the Adhoc Web Application

href="
href="
href="
href="
Botanita, Botana, SAP, BW, Ponte Carreira
BEX WEB
Suscribirse a:
Entradas (Atom)