Professional Documents
Culture Documents
中国网站上关于ABAP在BW中的应用
中国网站上关于ABAP在BW中的应用
SAP BW ABAP
BW ABAP ABAP
BW
R3 SAP BW
ABAP SAP ABAP
R3 R3 BW
ABAP
BW ABAP
SAP R3 BW ABAP
BW
ODS InfoCube
BW R3 BW ABAP
Technical Area
BEx User Exit
key figure
BEx
R3 CMOD
BW
BW Transfer rules
R3 BW BW
InSource
BW Update Rules
ODS InfoCube
BW Start Routines
BW Start routine
data element
R3 BW ABAP
1
ABAP
2
RSO2
ABAP function moduleuser exit
For 1
ABAP
BW
RSA6 Post Processing Datasources
BW R3
R3 BW CMOD BW project
display components F7
BW
User Exit
Description
SAPLRSAU_001
SAPLRSAU_002
SAPLRSAU_003
Optional
SAPLRSAU_004
Optional
R3
2LIS_02_ITM
BW SAPLRSAU_001
SAPLRSAU_001 ZZRSAU01
For 2
SE11 View, Z****
base table
view
view RSO2
RSA3
RSA3 view
select
Not recommended:Select * from /bi0/mcustomer.
Check : soursystem = I2P and objvers = 'A'.
Endselect.
ABAP
Not recommended
Maxamount = 0.
Select * from /bic/mzordods where soursystem = I2P.
Check mzordods-zamount>maxamount.
Maxamount = mzordods-zamount.
Endselect.
Recommended:Refresh : itab_cust_t
select *
from /bi0/tcustomer
into table itab_cust_t
Not Recommended
Read table itab_cust_t with key soursystem=I2P.
Recommended
Read table itab_cust_t with key soursystem=I2P binary search.
append
Not Recommended
Loop at itab_cust_t.
Recommended
Append lines of itab_cust_t to itab_cust_t1.
1 select distinct
2 select ... for update
3 Order by, group by, having clause
4 Joins
FOR ALL Entries outer join
1 select key
2 FOR ALL Entries
3 FOR ALL Entries
Not Recommended
Loop at itab_cust_t.
Select single * from /bi0/mcustomer into itab_cust_m
Where soursystem= itab_cust_t-soursystem.
Append itab_cust_m.
EndLoop.
where where
ABAP Order By
SE30 ABAP
ST05 SQL
franklmin
2013-5-7 11:26:13 |
.
ABAP ,. TYPES
.., ABAP .,
:
:.,
, .
.,.
Invertierungsroutine
,:
1. *$*$ ... *$*$ ..., 'CLASS-DA
.,,'DATA'.
,,,,
.
:
,,, 'CLASS,,.,
.
,,'CLASS-DATA' 'DATA'.
2. *$*$... *$*$...,.
SAP COMMIT ABAP COMMIT WORK.
. DB COMMIT DB_COMMIT
3. .
4. .
,.
..
...
REQEUST:
DATAPAKID:
MONITOR: . MONITOR_REC (
SOURCE_PACKAGE:
CX_RSROUT_ABORT: cx rsrout_abort ,
..,.
.,
,.'UNIT',
,, 'PC'.,.
REQEUST:
DATAPAKID:
SOURCE_FIELDS:
MONITOR:. MONITOR_REC (
RESULT: RESULT.
CURRENCY (): ,.
UNIT(): ,.
,:
CX_RSROUT_SKIP_RECORD:, cx_rsrou
.
CX_RSROUT_ABORT:, cx_rsrout_abort ,
,..,
:
ERP : (FI_GL_1) FIGL:(
/(0FI_DBCRIND),
1. ,, /(0FI
2. (UMSOL) (UMHAB),
.
3. ..
4. , D C :
*$*$ - *-*
... "
*
if SOURCE_FIELDS-umhab ne 0 and SOURCE_FIELDS-umsol eq 0.
RESULT = 'D'.
elseif SOURCE_FIELDS-umhab eq 0 and SOURCE_FIELDS-umsol ne 0.
RESULT = 'C'.
else.
monitor_rec-msgid = 'ZMESSAGE'.
monitor_rec-msgty = 'E'.
monitor_rec-msgno = '001'.
monitor_rec-msgv1 = 'ERROR, D/C Indicator'.
monitor_rec-msgv2 = SOURCE_FIELDS-umhab.
monitor_rec-msgv3 = SOURCE_FIELDS-umsol.
RAISE EXCEPTION TYPE CX_RSROUT_ABORT.
endif.
*$*$ - *-*
:
, D.
, C.
,,.
5. .
6. ,.
7. .
,.
.,.
REQEUST:
DATAPAKID:
MONITOR: . MONITOR_REC (
RESULT_PACKAGE:
CX_RSROUT_ABORT: cx rsrout_abort ,
..,
()
.,
, .
.,.
(Invertierungsroutine)
SAP
QQ QQ
franklmin
| 2013-5-7 11:26:33 |
*$*$ - *-*
CASE SOURCE_FIELDS-passform.
WHEN 'HERR'. RESULT = 'MR'.
WHEN 'FRAU'. RESULT = 'MRS'.
WHEN OTHERS. RESULT = space.
ENDCASE.
*$*$ - *-*
ENDMETHOD. "compute_0PASSFORM
*$*$ - *-*
DATA l_r_set TYPE REF TO cl_rsmds_set.
IF i_r_selset_outbound->is_universal( ) EQ rsmds_c_boolean-true.
* If query requests all values for characteristic 0PASSNAME
* request also all values from source field PASSNAME
c_r_selset_inbound = cl_rsmds_set=>get_universal_set( ).
c_exact = rs_c_true. "Inversion is exact
ELSE.
TRY.
IF me->p_r_set_mrs IS INITIAL.
* Create set for condition PASSFORM = 'FRAU'
me->p_r_set_mrs =i_r_universe_inbound->create_set_from_string( 'PASSFORM = ''FRA
ENDIF.
IF me->p_r_set_mr IS INITIAL.
* Create set for condition PASSFORM = 'HERR'
me->p_r_set_mr =i_r_universe_inbound->create_set_from_string( 'PASSFORM = ''HER
ENDIF.
IF me->p_r_set_space IS INITIAL.
* Create set for condition NOT ( PASSFORM = 'FRAU' OR PASSFORM= 'HERR' )
l_r_set = me->p_r_set_mr->unite( me- >p_r_set_mrs).
me->p_r_set_space = l_r_set->complement( ).
ENDIF.
*
c_r_selset_inbound = cl_rsmds_set=>get_empty_set( ).
* 'MR'
IF i_r_selset_outbound->contains( 'MR' ) EQrsmds_c_boolean-true.
c_r_selset_inbound = c_r_selset_inbound->unite(me>p_r_set_mr ).
ENDIF.
* 'MRS'
IF i_r_selset_outbound->contains( 'MRS' ) EQrsmds_c_boolean-true.
c_r_selset_inbound = c_r_selset_inbound->unite(me>p_r_set_mrs ).
ENDIF.
*
IF i_r_selset_outbound->contains( space ) EQrsmds_c_boolean-true.
c_r_selset_inbound = c_r_selset_inbound->unite(me>p_r_set_space ).
ENDIF.
c_exact = rs_c_true. "Inversion is exact
CATCH cx_rsmds_dimension_unknown
cx_rsmds_input_invalid
cx_rsmds_sets_not_compatible
cx_rsmds_syntax_error.
* Normally, this should not occur
* If the exception occurs request all values from source
* for this routine to be on the save side
c_r_selset_inbound = cl_rsmds_set=>get_universal_set( ).
c_exact = rs_c_false. "Inversion is no longer exact
ENDTRY.
ENDIF.
*
* 0PASSFORM PASSFORM
READ TABLE i_th_fields_outbound
WITH TABLE KEY segid = 1 "Primary segment
fieldname = 'PASSFORM'
TRANSPORTING NO FIELDS.
IF sy-subrc EQ 0.
BW:Start Routine
Start Routine 3.x Start Routine 7.0 End Routine
PSA Target
3.X 7.0
Start Routine
ENDCLASS.
PublicPrivateProtected
IMPLEMENTATION Method Method
CLASS class IMPLEMENTATION.
...
METHOD ...
...
ENDMETHOD.
...
ENDCLASS.
Method
PS
FIELD-SYMBOLS:
<SOURCE_FIELDS>
TYPE _ty_s_SC_1.
key
Loop Select
DATA:
Z_TEMP TYPE /BIC/OIZMAT3,
Z_DATA TYPE _ty_s_SC_1.
LOOP AT SOURCE_PACKAGE INTO Z_DATA.
SELECT SINGLE /BIC/ZMAT3
INTO Z_TEMP
FROM /BI0/PMATERIAL
WHERE OBJVERS = 'A' AND /BIC/ZMAT3 = Z_DATA-KEY1.
IF SY-SUBRC <> 0.
Loop...
Select Loop at where Select where
Start Routine
PSA SOURCE_PACKAGE
SOURCE_PACKAGE TR
1
End Routine
4
Routines in SD
Routines in SAP SD
Any Business requirement can be met through Standard Configuration or any customized
development.
Customized requirements in SD consists of Program, Routines, Exits, BAPI & BADI etc..
8. Enter the Routine Number, description and insert the Access Key
9. Now the ABAP Editor will open and required code can be copied from Standard SAP
Routine and Custom Code Can be developed.
10. Once the coding is completed we have to Activate the Routine
11. Select the Routine and Go to Edit - Activate
12. Ensure that Active check box is ticked upon Activation of the Routine.
13. Double click on the routine will enter into ABAP Editor, we have to generate the
Routine
14. Go to Program and select Generate
16 A screen pops up with the related Main Programs i.e.SAPLV61A and select all required
main programs wherever the Routine is being called.
17 Once the Routine is Generated and Activated, We can configure the Routine in the
config.
18 Configure the Routine in required applications and do the Testing
19 We have to transport the Workbench Request i.e. Routine first ,then only we have to
transport customizing request
20 We have to Activate and Generate the Routine in each and every client it got
transported.
http://sapdocs.info/2008/12/24/routines-in-sd/
SD Routines
SAP SD Routines
SD RoutineBAPI BADI
Routine
Routine
Routine Routine
Routine
VOFM Routine ()
1. VOFM
2. -
3. 600 999 Routine
4. Routine
5. BASIS
6. BASIS
7.
8. Routine
9. ABAP SAP Routine
10. Routine
11. Routine
12. Routine
13. Routine ABAP Routine
14.
16. SAPLV61A
Routine
17. Routine Routine
18. Routine
19. Routine
20. Client Routine