cancel
Showing results for 
Search instead for 
Did you mean: 

Invalid extract structure template &2 of datasource &1

Former Member
0 Kudos

Hi all,

I really need help in this one. I am trying to create a generic datasource and it gave me this error. I did little research and found that my key figures are pointing to the currency or unit which is in an include. and one of the note says that the currency and unit has to be in your field list. I am using notes 335342 and 202162.

I am copying a part which I am not able to understand since I am doing this for the first time so Please help.

"If the currency or the unit a key figure refers to is not located in a table but in a structure, the key figure has to be removed from the view and read via a customer exit (see below). Structures cannot be included in a view.

ATTENTION!! Often the key of the table in which the referenced unit is located, does not agree with the key in the table with the corresponding key figure. In this case, the join condition of both tables is not unique in the view definition, that means for each key line of the table with the key figure, several lines of the table with the unit may be read: the result is a multiplying of the number of lines in the view by a factor corresponding to the number of lines that fit the key figure, in the unit table. To be able to deliver consistent data to a BW system, check whether the unit of the key figure in question should always have a fixed value. If yes then you can determine that in the view definition via 'GoTo -> Selection conditions'. If no, then you must proceed as follows:

a) Remove the key figure from the view

b) Define the DataSource

c) Enhance the extract structure by key figure and unit for each append (Transaction RSA6)

d) Add the key figure and the unit in a customer exit

2. A view is already used for the extraction.

Thanks for all the help in advance.

Accepted Solutions (1)

Accepted Solutions (1)

edwin_harpino
Active Contributor
0 Kudos

hi Raj,

the notes suggestion is to remove some fields (keyfigure) of amount/quantity, seems due to the reference table field problem, extract structure that have quantity/amount field, should have reference table to itself,

so it suggest to remove these fields from your view,

can know how you create the view ? you can use se11 to maintain the view. and 'remove' these fields to 'append structure', and populate with user exit.

more about enhancement see

pdf 'enhancements in sap bw'

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/59069d90-0201-0010-fd81-d5e...

hope this helps.

Former Member
0 Kudos

HI AHP,

Thanks for the reply.

"you can only use the append structure itself as reference table, create 2 new fields ZZWAERS, and ZZMEINS with same component as T001-Waers and MARA-meins and use ZABIW_BIW_MARC_S for reference table and field for ZZWAERS and ZZMEINS as ref. field."

This is what you reply was in that link, i think so this is the answer for my problem but can you explain more about this, If you can be more specific it will be helpful as i am already confused a lot reading lots of things about this.

Appreciate all your help as usual.

edwin_harpino
Active Contributor
0 Kudos

hi Raj,

simply if in the table/view/structure used contains field that has data type 'quantitiy' or 'amount', where quantity will have 'unit of measurement' and amount will have 'currency', and these fields will have reference to some table that we have to fill in tab 'currency/quantity fields', there are column 'reference table' and 'ref. field', which only allow use to fill with the same name as the 'append structure', so if e.g you have append structure 'ZA...', you have to fill that column with ZA... also.

hope this helps.

Former Member
0 Kudos

Ok AHP,

I am sorry if I am making this all confusing. I am trying to create a datasource for table FAGLFLEXA and there is an include structure in that table which is not recogning the currency and unit of meausre field i guess thats why it is giving me this error. When i see the curr/quant filed tab and see to the refrence table for the key figure of currency and unit the name of that structure is in the refernce table so i dont know what to do. Some one suggested me that I can create an view for all the fields and add the curr and unit of measure in the view. Actually from the requirment I have to join this table and BKPF as the header table. So I am really all confused. CAn you suggest what should I do, Please explain step by step if possible.

Thanks a tons for all the help you have been always giving.

edwin_harpino
Active Contributor
0 Kudos

hi Raj,

no problem

you have create the view with fields needed and specify the reference table and fields ?

basically first we will try if we can enhance business content datasource (append structure and populate via user exit), if possible using datasource where populate from faglflexa, enhance it with add customize field(s) and populate from bkpf via user exit zxrsau01.

if not possible then generic extraction with option sap query, table/view, function module.

in case you can't achieve with view, mostly function module can do, check some threads,

i understand fm may need more effort...

now i have no access to system to check faglglexa and bkpf.

hope this helps.

Former Member
0 Kudos

Hi AHP,

Thanks for giving some advice. I am writing down how the dtructure is for the curr and unit. and how the curr/quan tab looks for key figures.

FAGLFLEX00_CUR_UNIT_INC

Component Comp.type data type

RTCUR RTCUR CUKY

RUNIT MEINS UNIT

and this is how the curr/quan tab looks for key figures

Field Dat.Ele Datty Ref.table ref.field

TSL VTCUR12 CURR FAGLFLEX00_CUR_UNIT_INC RTCUR

HSL VTCUR12 CURR T882G CURR1

KSL VGCUR12 CURR T882G CURR2

OSL VOCUR12 CURR T882G CURR3

MSL QUAN1_12 QUAN FAGLFLEX00_CUR_UNIT_INC RUNIT

WSL VTCUR12 CURR FAGLFLEX_SI_FIX_INC RWCUR

Can we go from here, as to what can be our first step?

Yes I have tried creating a view and have included all the fileds from this FAGL table but again what tables do i use to input the fields for curr and unit of measure?

thanks again for being with me,

Message was edited by: Raj M

edwin_harpino
Active Contributor
0 Kudos

hi Raj,

'... from this FAGL table but again what tables do i use to input the fields for curr and unit of measure ...'

-> FAGL itself should be used.

hope this helps.

Former Member
0 Kudos

Hi AHP,

It beats me as to how can I add those fileds from FAGL table in the view, I am just not getting it. Or is there any other table that I can add these views.Some times it gives me this error "Field TCURC-RTCUR does not exist in any of the base tables." or similar to that I dont know what does that mean, Can you let me know plz?

Also all the links that you have given are really great, I will doing the FM for first time so it took me time to sink in the process and concept. I am trying to use one of the code that Dinesh has given in one of that posts and just adding my table names in his tables just as starting point. I am not getting what exactly do I have to do in these two sections can you help me understand.

  • cursor

S_CURSOR TYPE CURSOR.

    • Select ranges

RANGES: L_R_ZYEAR FOR YSALES-ZYEAR,

L_R_ZMONTH FOR YSALES-ZMONTH.

why exactly is it zyear and zmonth can we change it? what criteria?

OPEN CURSOR WITH HOLD S_CURSOR FOR

    • SELECT (S_S_IF-T_FIELDS)

  • FROM YSALES .

select BUKRS

ZYEAR

ZMONTH

WERKS

MATNR

SLSCAT

KNDNR

SPART

MATKL

MENGE

DMBTR

VV702

VV703

VVADS

VV704

VV731

INTO CORRESPONDING FIELDS OF TABLE I_YSALES

FROM YSALES

WHERE ZYEAR IN L_R_ZYEAR

AND ZMONTH IN L_R_ZMONTH.

  • WHERE MATNR IN L_R_MATNR.

  • WHERE WERKS = WERKS

  • AND MATNR = MATNR

  • AND KNDNR = KNDNR

  • AND SPART = SPART.

IF SY-SUBRC = 0.

SORT I_YSALES BY WERKS MATNR .

ENDIF.

Do we have to add here all the fileds that we want from the table? and what does "WHERE KNDNR = KNDNR" means , how should i relate it to my table.??

Thanks again for all the help.

edwin_harpino
Active Contributor
0 Kudos

hi Raj,

-'Field TCURC-RTCUR does not exist in any of the base tables' means this field doesn't exist the table that you choose for create view (FAGL)

-ranges zyear and zmonth means for input screen, that user can specify from which year and month the data will be extracted

- just add the fields you needed, not all fields, "WHERE KNDNR = KNDNR" means only data that have value specified in KDNR will be retrieved.

will help if any abaper there.

Former Member
0 Kudos

Hi AHP,

Thanks a lot for helping me out. I am definately going to take some help from some abaper. I also went through couple of your other posts where in you have explained user exits very nicely. That helped me a lot as well, as per your suggestion in that other post I have already ordered abap in 21 days just to get some basic knowledge abut abap.

Thanks again,

have assigned you all the points.

edwin_harpino
Active Contributor
0 Kudos

hi Raj,

you are always welcome

abap 21 days is available free

http://cma.zdnet.com/book/abap/

and in system you can execute transaction ABAPDOCU,

for search keyword with ABAPHELP.

hope this helps.

Former Member
0 Kudos

Hi AHP,

That link doesnt seem to be working. It gives page not found all the time.

Thanks

Answers (0)