End Routine Implementation Issue
Hi Colleagues,
I want to implemente an end routine in order to populate the material type from the material master data.
The source structure of my transformation contain the material.
The target structure of my transformation contain the material and material type infoobject.
I have implemented the following source code in the end routine based on the sdn doc below :
http://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/e73bfc19-0e01-0010-23bc-ef0ad53f2fab
My source code is :
Global data declaration
List of all Employees and corresponding sales organisation
DATA: BEGIN OF I_S_MATERIAL_TYPE,
MATERIAL TYPE /BI0/PMATERIAL-MATERIAL,
MATERIAL_TYPE TYPE /BI0/PMATERIAL-MATL_TYPE,
END OF I_S_MATERIAL_TYPE.
DATA: i_t_material_type like table of I_S_material_type.
METHOD end_routine.
*=== Segments ===
FIELD-SYMBOLS:
<RESULT_FIELDS> TYPE tys_TG_1.
DATA:
MONITOR_REC TYPE rstmonitor.
$$ begin of routine - insert your code only below this line -
local data declaration
data: e_s_result type tys_TG_1.
data: e_t_result type tyt_TG_1.
data: material_type like e_s_result-matl_type.
read master data in local table once
SELECT MATERIAL MATL_TYPE FROM /BI0/PMATERIAL
into corresponding fields of table i_t_material_type
WHERE MATERIAL = <RESULT_FIELDS>-material
AND objvers = 'A'.
Do the calculation and add the new rows
*>>
loop over the input result data package
loop at RESULT_PACKAGE into e_s_result.
get Counter
read table i_t_material_type into e_t_result with key
material = e_s_result-material.
move material_type to e_s_result-matl_type.
append e_s_result to e_t_result.
endloop.
add the lines to the output package
refresh RESULT_PACKAGE.
move e_t_result[] to RESULT_PACKAGE[].
$$ end of routine - insert your code only before this line -
ENDMETHOD. "end_routine
$$ end of routine - insert your code only before this line -
ENDMETHOD. "end_routine
I have the following error message :
E:"E_T_RESULT" cannot e converted to the line type of
"ME->I_T_MATERIAL_TYPE"
Question :
Can someone explain me what is the issue in my source code ?
Cheers,
Hi Vijay,
Thanks for your precious answer !
I have modified the matl_type - but I still have the same error message on the read table coding part.
Error message: E:"E_T_RESULT" cannot be converted to the line type of
"ME->I_T_MATL_TYPE".
Global data declaration
List of all Employees and corresponding sales organisation
DATA:
BEGIN OF I_S_MATL_TYPE,
MATERIAL TYPE /BI0/PMATERIAL-MATERIAL,
MATL_TYPE TYPE /BI0/PMATERIAL-MATL_TYPE,
END OF I_S_MATL_TYPE.
DATA: i_t_matl_type like table of I_S_matl_type.
local data declaration
data: e_s_result type tys_TG_1.
data: e_t_result type tyt_TG_1.
data: matl_type like e_s_result-matl_type.
read master data in local table once
SELECT MATERIAL MATL_TYPE FROM /BI0/PMATERIAL
into corresponding fields of table i_t_matl_type
WHERE MATERIAL = <RESULT_FIELDS>-material
AND objvers = 'A'.
Do the calculation and add the new rows
loop over the input result data package
loop at RESULT_PACKAGE assigning <result_fields>.
Error message: E:"E_T_RESULT" cannot be converted to the line type of*
"ME->I_T_MATL_TYPE".*
read table i_t_matl_type into e_t_result with key
material = e_s_result-material.
<RESULT_FIELDS>-matl_type = i_t_matl_type-matl_type
Modify result_pacakage from <result_fields>
endloop.
Similar Messages
-
I am adding new records to the result_package in the end routine.
How will I populate the SID and datapakid values to my new records?
I am not able to code these fields in the end routine as they are not available and they get filled dynamically.
Are there any system fields that hold SID value and data package value?
Please help.
Thanks.I have added move-corresponding code from result_package and it has solved my issue.
Thanks. -
End Routine Data updation Issue
Hi all,
We are trying to do some look ups in the end routine to populate some fields.
We can see the data selected in the debugging but in the actual DSO the fields are not populating.
we suspect that the modify statement
MODIFY RESULT_PACKAGE from e_s_result.
might be having some issues.
If anybody have any suggestions please help us out.
Appreciate it.
Thanks,
HMNo it is not the issue with modify statement.
Whatever fields you are updating in modify statement , you need to have rule type assigned as constant with no value..
As in BI 7.0 the individual rule needs to be defined to enable it to get populated otherwise it doesnt think that the field needs to be updated. -
End Routine Issue - It does not move data from E_T_RESULT to RESULT_PACKAGE
Hi,
I am facing an issue with end routine. I have gone through previous posts on, how to write end routine and all.I wrote the end routine accordingly.
Here is my scenario,
I have 0CUST_SALES master data , which has all the Sales Org, Distribution Channel and Division, Sold to Party, Sales Grp and Sales Dist.
I am getting , Sold to party and Distribution channel at the field routine.
I am using, Sold to Party and Dist Channel and Division = '01'- whatever i populated using a field routine and trying to get the Sales Org, Sales Grp and Sales Dist at the end routine.
It looks like, all the code that i wrote seems correct but it does not populate any values into RESULT_PACKAGE.
Here is the code I wote at the end routine. I am not sure, whats wrong in it. I used, this link to write this routine :
http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/203eb778-461d-2c10-60b3-8a94ee91cbfc&overridelayout=true
Global Declaration----
DATA : BEGIN OF IT_CUST_SALES,
DIV TYPE /bi0/pcust_sales-DIVISION,
DIST_CH TYPE /bi0/pcust_sales-DISTR_CHAN,
SALES_ORG TYPE /bi0/pcust_sales-SALESORG,
CUST_SAL TYPE /bi0/pcust_sales-CUST_SALES,
SALESDIST TYPE /bi0/pcust_sales-SALES_DIST,
SALESGRP TYPE /bi0/pcust_sales-SALES_GRP,
END OF IT_CUST_SALES.
DATA: T_CUST_SALES LIKE TABLE OF IT_CUST_SALES.
Start of End Routine
SELECT DIVISION DISTR_CHAN SALESORG CUST_SALES SALES_DIST SALES_GRP
from
/bi0/pcust_sales INTO TABLE T_CUST_SALES for all entries in
RESULT_PACKAGE
where CUST_SALES = RESULT_PACKAGE-SOLD_TO
AND DISTR_CHAN = RESULT_PACKAGE-DISTR_CHAN
AND DIVISION = '01'.
LOOP AT RESULT_PACKAGE INTO e_s_result.
READ TABLE T_CUST_SALES INTO IT_CUST_SALES
WITH KEY CUST_SAL = e_s_result-SOLD_TO
DIST_CH = e_s_result-DISTR_CHAN
DIV = '01'.
IF SY-SUBRC EQ 0 .
MOVE IT_CUST_SALES-SALES_ORG TO E_S_RESULT-SALESORG.
MOVE IT_CUST_SALES-SALESDIST TO E_S_RESULT-SALES_DIST.
MOVE IT_CUST_SALES-SALESGRP TO E_S_RESULT-SALES_GRP.
APPEND E_S_RESULT TO E_T_RESULT .
ENDIF.
ENDLOOP.
REFRESH RESULT_PACKAGE.
MOVE E_T_RESULT[] TO RESULT_PACKAGE[] .
End End Routine
Data comes into E_T_RESULT but it does not move to RESULT_PACKAGE. Any inputs will be helpful.
Regards,
KumarHi Hegde,
Declaration is same , its like this.
datA: e_s_result type tys_TG_1.
data: e_t_result type tyt_TG_1.
I don't know, when i inserted this code in this post, initially it was OK but once i post i also saw , its not that read friendly.
FYI, i am trying to put the code again, lets see if it works.
SELECT DIVISION DISTR_CHAN SALESORG CUST_SALES SALES_DIST SALES_GRP
from /bi0/pcust_sales INTO TABLE T_CUST_SALES for all entries in
RESULT_PACKAGE where CUST_SALES = RESULT_PACKAGE-SOLD_TO
AND DISTR_CHAN = RESULT_PACKAGE-DISTR_CHAN
AND DIVISION = '01'.
LOOP AT RESULT_PACKAGE INTO e_s_result.
READ TABLE T_CUST_SALES INTO IT_CUST_SALES
WITH KEY CUST_SAL = e_s_result-SOLD_TO
DIST_CH = e_s_result-DISTR_CHAN
DIV = '01'.
IF SY-SUBRC EQ 0 .
MOVE IT_CUST_SALES-SALES_ORG TO E_S_RESULT-SALESORG.
MOVE IT_CUST_SALES-SALESDIST TO E_S_RESULT-SALES_DIST.
MOVE IT_CUST_SALES-SALESGRP TO E_S_RESULT-SALES_GRP.
APPEND E_S_RESULT TO E_T_RESULT .
ENDIF.
ENDLOOP.
REFRESH RESULT_PACKAGE.
MOVE E_T_RESULT[] TO RESULT_PACKAGE[] .
Regards,
Kumar -
End Routine and test on a field not present in target system
Hello,
I find an issue in testing a field present in the ODS source system, using a Transformation.
More exactly, I do not have a field that I need to test in my end routine because I can't find it in the RESULT_PACKAGE structure (because it is not present in the target Cube). In BW 3.x I solved this problem with an enhancement in the communication structure of my ODS and using a start routine.
Any idea for a Transformation?
Many thanks in advance for your kind support.
Regards,
GiovanniHello and thanks for your reply.
I have two conditions to implement.
1) Fill some fields of the Cube, NON present in my ODS.
2) Condition on one filed of my ODS (filed NON present in the Cube) for filling some field of the Cube.
In my tys_SC_1 structure of the start routine I find all fields of my ODS and the fields that I need to check but I need to check this filed in one point of my process and set a filed in my Cube (filed not present in my ODS), not present in the tys_SC_1 structure of the start routine.
I hope to have described in a better way may issue.
Any idea?
Thanks.
Giovanni -
End Routine - populating Target Field based on Master Data
Hi,
I have an issue with my End Routine in BI 7.0. The scenario is as follows....
The Target-Fields ZSALES_OFFICE , 0SALES_CHANNEL etc. are being mapped 1:1 from their respective source fields. In addition to these target fields I have a target field 0SALESORG which I need to populate based on the values from 0COMP_CODE which is an attribute of ZSALES_OFFICE. The values of 0COMP_CODE are 9000, 9001, 9002 and 9003 respectively. The end routine condition needs to be implemented as follows...
For every 0COMP_CODE which has value 9000, 0SALESORG should be populated with the value "EAST". Similarly for every 0COMP_CODE which has value 9001, 0SALESORG should be populated with the value "WEST", for every 0COMP_CODE which has value 9002, 0SALESORG should be populated with the value "NORTH" and for every 0COMP_CODE which has value 9003, 0SALESORG should be populated with the value "SOUTH". I tried the following code but it doesnt seem to work. Could you pls help!!
Thanks,
SD
DATA: it_tab4 TYPE TABLE OF /BIC/PZF31SALOFF,
wa_tab4 TYPE /BIC/PZF31SALOFF.
SELECT *
FROM /BIC/PZF31SALOFF
INTO CORRESPONDING FIELDS OF TABLE it_tab4.
sort it_tab4 by /BIC/ZF31SALOFF.
LOOP AT RESULT_PACKAGE
INTO <result_fields>.
read table it_tab4
with key /BIC/ZF31SALOFF = <result_fields>-/BIC/ZF31SALOFF
into wa_tab4
binary search.
if sy-subrc eq 0.
CASE wa_tab4-comp_code.
WHEN '9000'.
<result_fields>-salesorg = 'EAST'.
WHEN '9100'.
<result_fields>-salesorg = 'WEST'.
WHEN '9200'.
<result_fields>-salesorg = 'NORTH'.
WHEN '9300'.
<result_fields>-salesorg = 'SOUTH'.
MODIFY it_tab4 FROM wa_tab4.
ENDCASE.
endif.
ENDLOOP.Replace your select statement ,
SELECT *
FROM /BIC/PZF31SALOFF
INTO CORRESPONDING FIELDS OF TABLE it_tab4.
instead of selecting all the fields , pick only the fields which are required.(one good performance improvement)
SELECT /BIC/PZF31SALOFF comp_code
FROM /BIC/PZF31SALOFF
INTO CORRESPONDING FIELDS OF TABLE it_tab4.
Remove the line below , this is not required
MODIFY it_tab4 FROM wa_tab4. -
No data in Active table of DSO for fields populated by End Routine
Hi,
I have a Standard DSO where we are populating few fields by using End Routine.
Last week we added 5 more fields to DSO and wrote a logic in End ROutine to populate the DSO. These new fields dont have any mapping and these are just populated by end routine only.
When I loaded the data from Data Source TO DSO, Data is loaded correctly into NEW DATA Table of DSO for all the fields. I could see correct data as per the logic in NEW Table including old and new fields.
However, when I activate the DSO, I could not find the data for new fields which I added last week. Remaining fields are getting data as per the logic. Only these five fields are not having any data.
Can you please let me know if any one had similar issue. I was under impression that all the data in the new table will go to Active table when we activate the DSO.
Your inputs are highly appreciated.
Thanks
KrishnaWhat version of BW are you using? When editing your end-routine, a pop-up should display saying which fields you want populated/transferred from the end routine. This pop-up will not display if you are using a lower version of BW 7.x. To get around this, make sure that your newly added fields have a transformation rule type set to constant. This will make sure that the fields get populated when transferring from new to active tables.
-
Hi gurus,
I have written end routine for a cube for getting the data for fields net due date and discount date from other cube.
The code was fine and im able to see the data for those fields in the new table of DSO and once the request is activated the data for those 2 fields is not getting populated..
can any one give me a solution for this issue
Regards,
RaviRavi,
In the toolbar beside the End Routine button there is a button called "Update Behaviour of end routine display". Select the second option "All target Fields".
I am assuming that you are populating the two date fields in the end routine.
Hope this helps... -
End-Routine in BI 7.0 :
I implemented an end-routine to populate a field in a DSO.
After a load, when I check the New Data table of DSO, I can see the field populated.
But when I activate the request, I dont see the same field populated in DSO contents.
What could I be missing?
Below is the End-Routine I wrote with the help of SDN:
DATA: WA_result_package LIKE LINE OF RESULT_PACKAGE.
DATA: GI_ZSD_O01 TYPE TABLE OF /BIC/AZSD_O0100.
DATA: WA_ZSD_O01 LIKE LINE OF GI_ZSD_O01.
SELECT * FROM /BIC/AZSD_O0100 INTO CORRESPONDING FIELDS OF TABLE
GI_ZSD_O01.
LOOP AT RESULT_PACKAGE INTO WA_RESULT_PACKAGE.
read table GI_ZSD_O01 with key DOC_NUMBER =
WA_result_package-DOC_NUMBER
into WA_ZSD_O01.
WA_result_package-DOC_TYPE = WA_ZSD_O01-DOC_TYPE.
MODIFY RESULT_PACKAGE FROM WA_RESULT_PACKAGE.
ENDLOOP.Hi,
Check this .
http://help.sap.com/saphelp_nw70/helpdata/EN/f8/7913426e48db2ce10000000a1550b0/frameset.htm
http://sapbwinfo.blogspot.com/search/label/BI%20Creating%20Routines
http://www.apentia-online.at/UP/Apentia/files/Article/SAP_BW_User_Exits_and_BAdIs.pdf
Thanks .
Hema -
End routine error upon trying to transport
Hello folks,
Getting a RC 8 upon trying to transport an end routine piece to our QA environment.
No syntax error upon trying to check the code in the end routine. The custom infoobject that i m trying to populate in this code is set to 'Initial' in the transformational rules. Plz can you share any clues there. This transformation is attached to an Infocube.
Here is the code:
data: v_fiscper(3) type n.
loop at RESULT_PACKAGE assigning <result_fields>.
clear v_fiscper.
v_fiscper = <result_fields>-fiscper+4(3).
case v_fiscper.
when '001' or '002' or '003'.
concatenate 'Q1,' <result_fields>-fiscyear
into <result_fields>-/bic/zfiscqtr.
when '004' or '005' or '006'.
concatenate 'Q2,' <result_fields>-fiscyear
into <result_fields>-/bic/zfiscqtr.
when '007' or '008' or '009'.
concatenate 'Q3,' <result_fields>-fiscyear
into <result_fields>-/bic/zfiscqtr.
when '010' or '011' or '012'.
concatenate 'Q4,' <result_fields>-fiscyear
into <result_fields>-/bic/zfiscqtr.
endcase.
endloop.
Appreciate help on this one.
Cheers !!How is InofObject zfiscqtr implemented?
Additional:
Try to use RSA1 transport connection.
Select your transformation, cube and so on and collect all necessary objects.
Regards
Andreas
Edited by: Andreas Schindler on Nov 26, 2009 10:24 AM -
End routine Works fine but missing some records while updating to cube.
Hi All
I have an issue here... My End routine works fine and I even debugged by putting the breakpoint and It fetches data from dso. strangely when I run my DTP the load is successful but I can see some of the records are missing. but there is data in dso and also when i debug the code it fetches the values for particular fields.
My requirement is I have a cube 'A' and under it DSO1 and I need six more fields from dso2. Now I made a look up for these six fields in End routine. My routine works fine and so the DTP Is Green. My issue is I cant see these six fields updated for some of the records.
PLZ put some light on it!!!!!!!!!!!!!!!!!Hi Naveen & Jaya
Thanks for your quick response. Below is my code logic in end routine.
METHOD end_routine.
*=== Segments ===
FIELD-SYMBOLS:
<RESULT_FIELDS> TYPE tys_TG_1.
DATA:
MONITOR_REC TYPE rstmonitor.
$$ begin of routine - insert your code only below this line -
... "insert your code here
data: lv_result_package like line of RESULT_PACKAGE,
l_tabix type sy-tabix.
loop at RESULT_PACKAGE into lv_RESULT_PACKAGE.
l_tabix = sy-tabix.
Update lot/decision attributes Lot/Decision ( ZQM_O04 ) DSO
read table itab_qm_o04 into itab_qm_o04_wa
with key insp_lot = lv_result_package-insp_lot.
if sy-subrc = 0.
lv_result_package-ivaluation = itab_qm_o04_wa-ivaluation.
lv_result_package-catcode_ud = itab_qm_o04_wa-catcode_ud.
lv_result_package-catgrp_ud = itab_qm_o04_wa-catgrp_ud.
lv_result_package-/bic/zcattp_ud = itab_qm_o04_wa-/bic/zcattp_ud.
lv_result_package-/b41/s_usuddate = itab_qm_o04_wa-/bic/gqmuddat.
lv_result_package-/b41/s_usudcdate = itab_qm_o04_wa-/bic/gqmudcdt.
endif.
modify RESULT_PACKAGE FROM lv_RESULT_PACKAGE INDEX l_tabix.
endloop.
Well based on the insp_lot in ZQM_O03( DSO1) the logic above gets the six fields from ZQM_O04(DSO2) and feeds the cube.
The Insp_lot has multiple records in DSO1 based on specific characteristic and so the cube. This Logic gets all these six fields
from DSO2 which has single record per insp_lot and feeds the cube which has multiple records on insp_lot based on a specific characteristic. For some reason some of the records are not been updated to cube.
waiting for your valuable response.....
Thank You,
Abhishek Yeachni -
How to create duplicate records in end routines
Hi
Key fields in DSO are:
Plant
Storage Location
MRP Area
Material
Changed Date
Data Fields:
Safety Stocky
Service Level
MRP Type
Counter_1 (In flow Key figure)
Counter_2 (Out flow Key Figure)
n_ctr (Non Cumulative Key Figure)
For every record that comes in, we need to create a dupicate record. For the original record, we need to make the Counter_1 as 1 and Counter_2 as 0. For the duplicate record, we need to update Changed_Date to today's date and rest of the values will remain as is and update the counter_1 as 0 and counter_2 as -1. Where is the best place to write this code in DSO. IS it End
routine?
please let me know some bais cidea of code.Hi Uday,
I have same situation like Suneel and have written your logic in End routine DSO as follows:
DATA: l_t_duplicate_records TYPE TABLE OF TYS_TG_1,
l_w_duplicate_record TYPE TYS_TG_1.
LOOP AT RESULT_PACKAGE ASSIGNING <result_fields>.
MOVE-CORRESPONDING <result_fields> TO l_w_duplicate_record.
<result_fields>-/BIC/ZPP_ICNT = 1.
<result_fields>-/BIC/ZPP_OCNT = 0.
l_w_duplicate_record-CH_ON = sy-datum.
l_w_duplicate_record-/BIC/ZPP_ICNT = 0.
l_w_duplicate_record-/BIC/ZPP_OCNT = -1.
APPEND l_w_duplicate_record TO l_t_duplicate_records.
ENDLOOP.
APPEND LINES OF l_t_duplicate_records TO RESULT_PACKAGE.
I am getting below error:
Duplicate data record detected (DS ZPP_O01 , data package: 000001 , data record: 4 ) RSODSO_UPDATE 19
i have different requirement for date. Actually my requirement is to populate the CH_ON date as mentioned below:
sort the records based on the key and get the latest CH_ON value with unique Plant,sloc, material combination and populate
that CH_ON value for duplicate record.
Please help me to resolve this issue.
Thanks,
Ganga -
End routine to populate Info-cube.
Hi ,
Is it possible to load fileds of a Info-cube using End routines in the following scenairos.
1.Loading fields of info-cube by referencing/using a master data table in End routine.
2.Loading fields of info-cube by referencing/using a DSO fields in End routine.
3.Loading fields of info-cube by referencing/using a fields of another info-cube in End routine.
Please advise.Hi Stalin,
Before answering your question you need to understand something about "End routine" and "Expert routine".
End Routine:
- Result_fields and Result_package are available
- End routine contains only those fields available in Data target.
Start Routine:
- Source_fields and Source_package are available
- Start routine contains only those fields coming from source.
Expert Routine:
- Source_fields, Source_package, Result_fields and Result_package are available
So Now if you want write code to look up into some other cube, in look up you may need to test condition using source fields, in that case " Expert Routine" is only the option.
For Ex
my data target contains : x,y and z fields (it becomes result_field)
source contains : a field ( it becomes source_field)
now if i want to write look up code like this " select x,y and z fields from other cube where my a field value = other cube a field value. here u r accessing both S_F as well as R_F. So only the option is "EXPERT ROUTINE"
or else u want to write code only with R_F then "End routine " is enough.
Thanks,
Gowd -
End Routine ABAP to read from Internal table and do calculation.
Hi All...
I have completed some coding in a start routine to extract some fields from a DSO containing Master Data (Stock Age) into an internal table (the internal table has been defined in the global declarations area) which will then be read in the end routine.
(the internal table will be read) at loadtime in the end routine and used in a calculation as described below.
I.E
GLOBAL DATA DECLARATION
Data: ITAB1 TYPE TABLE OF /BIC/DSOTAB
(DSOTAB has 3 fields PLANT, STYLE, 1STDATE (1STDATE IS A DATE FIELD)
The start routine has the following code:
IF ITAB1 IS INITIAL.
SELECT /BIC/PLANT /BIC/STYLE /BIC/1STDATE
FROM /BIC/DSOTAB
INTO CORRESPONDING FIELDS OF TABLE ITAB1.
This is working fine when run under simulation i.e ITAB1 is filled no problem.
I then need to do a calculation in the end routine.
1. First I have to find the record in the internal table using the key of PLANT AND STYLE from the RESULT_PACKAGE.
The code i am using now is as follows....
READ TABLE ITAB1 TRANSPORTING NO FIELDS WITH KEY
/BIC/PLANT = <result_fields>-/BIC/PLANT /BIC/STYLE =
<result_fields>-/BIC/STYLE.
Once this record has been read I then have to perform the following calculation using the following additional fields
<result_fields>-/BIC/DYS1ST is a NUMC field in the <result_fields> that will be be filled by the result of the calculation described below.
<result_fields>-CALDAY is a date field which is already populated in the <result-fields> which is used in the calculation below.
The Calculation required is a difference in days between two dates
DYS1ST = CALDAY - 1STRED.
The code i am using is
If sy-subrc = 0.
<result_fields>-/BIC/DYS1ST = <result_fields>-CALDAY -
i_t_1stred_dso-/BIC/1STRED.
So the whole section of code inside the LOOP at RESULT PACKAGE looks like this in the end routine
READ TABLE ITAB1 TRANSPORTING NO FIELDS WITH KEY
/BIC/PLANT = <result_fields>-/BIC/PLANT /BIC/STYLE =
<result_fields>-/BIC/STYLE.
IF sy-subrc = 0.
<result_fields>-/BIC/DYS1ST = <result_fields>-CALDAY -
i_t_1stred_dso-/BIC/1STRED.
Im getting the error
"ITAB1 " is a table without a header line and therefore has no component called "/BIC/1STRED
Please can someone advise as to what I need to do to get this fixed please.
Thanks in advance
Stevo:)Hi,
You will have to do few changes in your code as below,
GLOBAL DATA DECLARATION
Data: ITAB1 TYPE standard TABLE OF /BIC/DSOTAB.
After that declare a workarea to read the values.
DATA: i_wa_itab1 type /bic/dsotab.
(DSOTAB has 3 fields PLANT, STYLE, 1STDATE (1STDATE IS A DATE FIELD)
The start routine has the following code:
IF ITAB1 IS INITIAL.
SELECT /BIC/PLANT /BIC/STYLE /BIC/1STDATE
FROM /BIC/DSOTAB
INTO CORRESPONDING FIELDS OF TABLE ITAB1.
This is working fine when run under simulation i.e ITAB1 is filled no problem.
I then need to do a calculation in the end routine.
1. First I have to find the record in the internal table using the key of PLANT AND STYLE from the RESULT_PACKAGE.
The code i am using now is as follows....
READ TABLE ITAB1 TRANSPORTING NO FIELDS WITH KEY
/BIC/PLANT = <result_fields>-/BIC/PLANT /BIC/STYLE =
<result_fields>-/BIC/STYLE.
Once this record has been read I then have to perform the following calculation using the following additional fields
<result_fields>-/BIC/DYS1ST is a NUMC field in the <result_fields> that will be be filled by the result of the calculation described below.
<result_fields>-CALDAY is a date field which is already populated in the <result-fields> which is used in the calculation below.
The Calculation required is a difference in days between two dates
DYS1ST = CALDAY - 1STRED.
The code i am using is
If sy-subrc = 0.
<result_fields>-/BIC/DYS1ST = <result_fields>-CALDAY -
i_t_1stred_dso-/BIC/1STRED.
So the whole section of code inside the LOOP at RESULT PACKAGE looks like this in the end routine
READ TABLE ITAB1 into i_wa_itab1 WITH KEY
/BIC/PLANT = <result_fields>-/BIC/PLANT /BIC/STYLE =
<result_fields>-/BIC/STYLE.
IF sy-subrc = 0.
<result_fields>-/BIC/DYS1ST = <result_fields>-CALDAY -
i_wa_itab1-/BIC/1STRED.
Once you do this changes, your code will work fine.
Regards,
Durgesh. -
Hi experts,
i have requirement to write end routine to read a DSO for last 12 months sales quantity for each month and sum value pass to keyfigure
not interested using bex variable, while data loading from source to target dso in end routine i am trying to read another DSO which is same as my
target dso where information is stored by fiscal period, year material etc. finally there is a keyfigure in target whih needs to be filled with sum of 12
months sales quantity, for each record form sourc to target maximum of 12 records will be in read dso (for 12 months) my routine is like below.
i am not expert in abap please kindly gothrough and guide me in this
TYPES: BEGIN OF s_/BIC/AZOSLS00,
FISCPER type /BI0/OIFISCPER,
FISCVARNT type /BI0/OIFISCVARNT,
PLANT type /BI0/OIPLANT,
STOR_LOC type /BI0/OISTOR_LOC,
/BIC/MATERIAL type /BIC/OIMATERIAL,
VTYPE type /BI0/OIVTYPE,
BILL_QTY type /BI0/OIBILL_QTY,
END OF s_/BIC/AZOSLS00.
DATA: it_/BIC/AZOSLS00 TYPE TABLE OF s_/BIC/AZOSLS00,
wa_/BIC/AZOSLS00 TYPE s_/BIC/AZOSLS00.
SELECT
FISCPER
FISCVARNT
PLANT
STOR_LOC
/BIC/MATERIAL
VTYPE
BILL_QTY
FROM /BIC/AZOSLS00 INTO TABLE it_/BIC/AZOSLS00
FOR ALL
ENTRIES IN RESULT_PACKAGE
WHERE
below field is from value of fiscal period (which is fiscal period -999 ex: for 001.2014 this
value will be 002.2013 so 12 months including current period)
FISCPER >= RESULT_PACKAGE-/BIC/ZFISCPERF
below is result filed fiscal period (here i dont know which keyword or statement to be used to select
interval values this between statement giving syntax error that can not be used in where for for all entries
between RESULT_PACKAGE-FISCPER
AND
FISCVARNT = RESULT_PACKAGE-FISCVARNT AND
PLANT = RESULT_PACKAGE-PLANT AND
STOR_LOC = RESULT_PACKAGE-STOR_LOC and
/BIC/MATERIAL = RESULT_PACKAGE-/BIC/MATERIAL .
SORT it_/BIC/AZOSLS00 BY FISCPER FISCVARNT PLANT STOR_LOC
/BIC/MATERIAL .
LOOP AT RESULT_PACKAGE ASSIGNING <result_fields>.
READ TABLE it_/BIC/AZOSLS00 INTO wa_/BIC/AZOSLS00 WITH KEY
below dont know what statement i need to use in read statement for interval of fiscal periods
giving error that >= can not be used
FISCPER >= <result_fields>-/BIC/ZFISCPERF
FISCPER = <result_fields>-FISCPER
FISCVARNT = <result_fields>-FISCVARNT
PLANT = <result_fields>-PLANT
STOR_LOC = <result_fields>-STOR_LOC
/BIC/MATERIAL = <result_fields>-/BIC/MATERIAL
BINARY SEARCH.
BREAK-POINT.
IF sy-subrc = 0.
below for each record there will be 12 records in read so sume of 12 records quantity i need to pass to result again dont know what to say here
sum statement giving error
<result_fields>-/BIC/ZLSTSLS12 =
sum(wa_/BIC/AZOSLS00-BILL_QTY).
ENDIF.
ENDLOOP.
friends please help me in this.
Thanks
Chandra.Hiii,
If you only want to store last 12 months data in Target ODS .
Then Create filter in DTP and write routine in filter for calmonth or fiscal period.
Refer the below link to create filter routine :
http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/80b2db87-639b-2e10-a8b9-c1ac0a44a7a6?QuickLink=index&…
Regards,
Akshay
Maybe you are looking for
-
DBlink and Tns could not resolve connect identifier specified
We are encountering a strange issue with DB link(may be new to me) We have Oracle 9.2.0.8 and 10.2.0.3 in Solrais 10 We are accesing both servers from the 10g We are able to connect to both the database through SQLplus We created a DBLink in oracle 9
-
Managed server is stuck in STARTING
Hi All, I have managed severs on weblogic consol. These servers are linked to the windows services on my prodcution server. to start and stop the managed servers we used to simply restart the respective services on the production server. Now the situ
-
Credit card processing in Business One
Where can I find a list of supported payments platforms in Business One? Thanks, Jocelyn Erickson (SAP employee)
-
Workspace-Manager Error-numbers
Hi everybody, i have an oracle forms-application using Workspace-manager-enabled table. My problem is that i can not handle the WM-errors directly as Exceptions for they are all treated as ORA-06510-exceptions in forms. So i have to go with the error
-
Newest flashplayer not compatible with my computer..
Mac 10.5.8 with Safari 5.0.6 newest flashplayer not compatable with my computer.. can i download a new browser to solve my problem or am i stuck with this forever? why arent they compatible? is this adobe's fault or apple's fault? please help! thanks