on 04-11-2006 3:22 PM
Hello,
I need to add a field (MATNR) to the extract structure of data source 0EC_PCA_1. How should the user exit code look for this?
Thanks a lot!!
BR,
Fredrik
hi Fredrik,
yes, you are right GLPCT
- 0EC_PCA_1 extract from and
- there is material number REP_MATNR
checking sap help for datasource 0EC_PCA_1
http://help.sap.com/saphelp_bw33/helpdata/en/de/46663758459166e10000009b38f8cf/frameset.htm
found there is material number GLPCT-REP_MATNR - Representative material which mapped to infoobject 0REP_MATL and 0REP_MATL is reference to 0mat_plant - material plant.
so, you may no need to write user exit, you can use 0rep_matl.
hope this helps.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
Unfortunately they do not post actual PCA postings to REP_MATNR (in R/3). Insted they use MATNR. So I don't think I will get the data into the extractor without adding the MATNR field.
If I should add it in the extractor structure and populate it, there is a problem since GLPCT doesn't include the field either...
Do you agree? How should this be handled?
I appreciate your help!
Regards,
Fredrik
Hello,
The problem is that the source table for the data source (GLPCT), doesn't include the field either. GLPCT is an aggregated table populated from tables GLPCA (actuals) and GLPCP (budget) and the MATNR field is not inculded in the transfer structure GLPCA --> GLPCT.
Is it impossible to report both plan and actuals in PCA on material number? How would you solve it? I have tried the multi cube path as well, but I'm not sure this would work..
Best regards,
Fredrik
hi,
GLPCA has MATNR,
use some of fields from GLPCT (RLDNR RRCTY RVERS RYEAR DRCRK RPMAX RBUKRS RPRCTR ?) to match GLPCA ?
data: l_s_ISPCACST like ISPCACST,
l_tabix like sy-tabix,
lv_matnr like glpca-matnr.
tables : GLPCA.
case i_datasource.
when '0EC_PCA_1'.
loop at c_t_data into l_s_ISPCACST.
select single matnr into lv_matnr
from GLPCA
where RLDNR = l_s_ISPCACST-RLDNR
and RRCTY = l_s_ISPCACST-RRCTY
and ...
if sy-subrc = 0.
l_s_ISPCACST-zzmatnr = lv_matnr.
endif.
modify c_t_data from l_s_ISPCACST index l_tabix.
endloop.
hope this helps.
This seems like a very good idea! Thanks!
I'm a bit concerned though, becasuse I don't want to mess up the other reports which are already created using this extractor. If the figures will be wrong, is all I have to do to delete the code in the user exit and things will be back to normal?
BR,
Fredrik
If u later find that something is wrong with the data,after the user-exit is configured,u can comment out the user exit code(rather than deleting it).
Comment the code at the step where u say..
When datasource is 'ABC' then run include program <include program for that datasource>
Anyway the user-exit will populate data only for the enhanced fields,and will not effect data in std delivered fields.
cheers,
Vishvesh
Hello friends,
Do I need to specify the select statement more detailed than below? I assume I also need the FISCPER? How can I do this?
Thankx,
Fredrik
&----
*& Include ZXRSAU01
&----
data: l_s_ISPCACST like ISPCACST,
l_tabix like sy-tabix,
lv_matnr like glpca-matnr.
tables : GLPCA.
case i_datasource.
when '0EC_PCA_1'.
loop at c_t_data into l_s_ISPCACST.
select single matnr into lv_matnr
from GLPCA
where RPRCTR = l_s_ISPCACST-RPRCTR *profit center
and RACCT = l_s_ISPCACST-RACCT *account
and RMVCT = l_s_ISPCACST-RMVCT *transaction type
if sy-subrc = 0.
l_s_ISPCACST-zzmatnr = lv_matnr.
endif.
modify c_t_data from l_s_ISPCACST index l_tabix.
endloop.
I think RYEAR will have values like '2006' and POPER like '01'.
FISCPER must be internally valuating as '2006001',or is it '01.2006'(most probably first one)
Irrespective of format,u can write a statement like..
ext structure field FISCPER = work area field-RYEAR + '0' + work area field-POPER.
or
ext structure field FISCPER = work area field-POPER + '.' + work area field-RYEAR
(here selected record once matched,comes into work area's record).
cheers,
Vishvesh
Hi Fredrik,
See the documents below,
1. User Exits in SAP BW (ppt)
https://websmp104.sap-ag.de/~sapidb/011000358700005475091999
2. User Exits Examples (doc)
https://websmp104.sap-ag.de/~sapidb/011000358700005475101999
Hope it Helps
Srini
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Go through this link
/message/124151#124151 [original link is broken]
Assign some points if it helps.
Regards,
Ravi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi Fredrik,
the user exit may look like
data: l_s_pca1 like [extract structure of 0EC_PCA_1],
l_tabix like sy-tabix,
lv_matnr like mara-matnr.
tables : [tablename that matnr will take data].
case i_datasource.
when '0EC_PCA_1'.
loop at c_t_data into l_s_pca1.
select single matnr into lv_matnr
from [table]
where field = l_s_pca1-field.
if sy-subrc = 0.
l_s_pca1-zzmatnr = lv_matnr.
endif.
modify c_t_data from l_s_pca1 index l_tabix.
endloop.
hope this helps.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
If I look into the function module ECPCA_BIW_GET_DATA which pouplates data source 0EC_PCA_1, it looks to me as if it takes the data from source table GLPCT. Is this correct? In this table, I can't see the MATNR field... However, the same function module also populates ds 0EC_PCA_3 and in this one, the matnr exists, so I guess that the MATNR-field is somehow available in table GLPCT. Or am I wrong? How does this work?
The field name I've added in an append is zzmatnr and here I need to add the MATNR which originally is entered in PCA table GLPCA.
Could you please help me with the code details? I don't know ABAP and I'm not really sure of which source table to use. Is it GLPCT?
data: l_s_ISPCACST like ISPCACST,
l_tabix like sy-tabix,
lv_matnr like glpct-matnr.
tables : GLPCT.
case i_datasource.
when '0EC_PCA_1'.
loop at c_t_data into l_s_ISPCACST.
select single matnr into lv_matnr
from GLPCT
where field = l_s_ISPCACST-zzmatnr.
if sy-subrc = 0.
l_s_ISPCACST-zzmatnr = lv_matnr.
endif.
modify c_t_data from l_s_ISPCACST index l_tabix.
endloop.
Best regards,
Fredrik
User | Count |
---|---|
91 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.