on 03-25-2007 12:50 AM
Hi please confirm that you want to convey that i can write the actual code in CMOD exit_rsap_saplr_001 for transactional data?? if i put 20 data sources enhancement code in there is'nt that too bulky and will cause the failing all extractor if one code is wrong if you still suggest that i can go ahead with 20 similar codes as below . please see my code below which i have used for all 20 datasources with little modification
if you can recommend some changes in code to improve performance would be great
case i_datasource.
WHEN '0CUSTOMER_ATTR'.
loop at i_t_data into l_s_BIW_KNA1_S.
l_tabix = sy-tabix.
clear i_knvp.
select single * from KNVP into i_knvp where KUNNR = l_s_BIW_KNA1_S-KUNNR.
if sy-subrc = 0.
l_s_BIW_KNA1_S-ZZPARFN = i_knvp-PARVW.
l_s_BIW_KNA1_S-ZZCUSNOBP = i_knvp-KUNN2.
modify i_t_data from l_s_BIW_KNA1_S index l_tabix.
endif.
endloop.
endcase.
Thanks
Poonam
Hi,
As a performace improvement , you better to store all the required records from KNVP table into internal table as shown below.
and one more thing , there are different includes( and FM ) for MAster data and Transaction data enhancements respectively.
TYPES BEGIN OF TYPE_BIW_KNA1_S.
INCLUDE STRUCTURE BIW_KNA1_S.
TYPES END OF TYPE_BIW_KNA1_S.
TYPES BEGIN OF TYPE_KNVP.
TYPE: KUNNR LIKE KNVP-KUNNR,
PARVW LIKE KNVP-PARVW,
KUNN2 LIKE KNVP-KUNN2.
TYPES END OF TYPE_KNVP.
WHEN '0CUSTOMER_ATTR'.
DATA:
ITAB_BIW_KNA1_S TYPE STANDARD TABLE OF TYPE_BIW_KNA1_S
WITH HEADER LINE
WITH NON-UNIQUE DEFAULT KEY INITIAL SIZE 0.
DATA:
ITAB_KNVP TYPE STANDARD TABLE OF TYPE_KNVP
WITH HEADER LINE
WITH NON-UNIQUE DEFAULT KEY INITIAL SIZE 0.
ITAB_BIW_KNA1_S[] = I_T_DATA[].
SELECT KUNNR PARVW KUNN2 FROM KNVP INTO CORRESPONDING FIELDS OF TABLE ITAB_KNVP FOR ALL ENTRIES IN ITAB_BIW_KNA1_S
WHERE KUNNR = ITAB_BIW_KNA1_S-KUNNR.
LOOP AT ITAB_BIW_KNA1_S.
READ TABLE ITAB_KNVP WITH KEY KUNNR = ITAB_BIW_KNA1_S-KUNNR.
IF SY-SUBRC EQ 0.
ITAB_BIW_KNA1_S-ZZPARFN = ITAB_KNVP-PARVW.
ITAB_BIW_KNA1_S-ZZCUSNOBP = ITAB_KNVP-KUNN2.
MODIFY ITAB_BIW_KNA1_S.
ENDIF.
CLEAR ITAB_BIW_KNA1_S.
ENDLOOP.
I_T_DATA[] = ITAB_BIW_KNA1_S[].
With rgds,
Anil Kumar Sharma .P
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
25 | |
12 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.