ABAP CODE ROUTINE
i want to calculate formula basing on the below information.
ZGR= GOODS RECEIPT STATUS.
below is the thing which i want.
let me know what codei need to write.
DSOTABLE NAME-ZT0007
i want GOODS RECEIPT STATUS.(it should finally give us goods receipt status)
A (not yet recepited)
B (Partially Recepited)
C (Completely Recepited)
what type of infoobject i need to create for Goods receipt status.
If 0GR_RE_IND='X'
read the internal table of DSO-ZT0007 and sum the total goods receipt quantity (GR QTY) for the purchase order schedule line item (PO receipt type=GR)
IF GR QTY=0
GRS=A
else if GR QTY<oorder_quan
GRS=B
ELSE
GOODS RECEIPT='C'
end if.
else.
Goods Receipt=' '
End if.
how can i write this in abap routine for charcterstic code..
thanks
Hi,
try the following :
CALL FUNCTION 'FIMA_VTBKOND_CALC_DATES'
EXPORTING
i_date = source_fields-/bic/ZSTRT_DTE
i_months = '6'
IMPORTING
e_date = result.
hope it helps...
regards,
Raju
Similar Messages
-
Needs sample ABAP code for field routine
Dear Expert,
There is a field "Pay Scale Group" in my DSO which stores the data in the format
AA1/B1/CCC2/DD2/EEE1, A1/BB2/CC2/DDD3/EE2 etc. These data has to be transferred to
InfoCube where "pay Scale Group" in the InfoCube will store the data like EEE1,EE2 etc.
I need to write a field routine on the transformation between DSO and Cube.
Can any one please help me with the sample ABAP code for this scenario.
Some more examples for better understanding of the requirement:-
Data in DSO(Source) Data in Cube(Target)
=================== ===================
AA1/B1/CCC2/DD2/EEE1 EEE1
AAA1/BB2/CC1/DDD3/EE2 EE2
A2/BBB2/CC2/DDD3/EEE5 EEE5
AA2/BB1/C1/DDD3/EE3 EE3
A3/B1/CC2/DDD1/EE4 EE4
Many thanks in advance.
Regards,
Prakash
Please do not dump your code requirements in SDN
Edited by: Pravender on May 18, 2011 11:37 AMHi,
You can use the following code :
Suppose the technical name of the field coming from DSO is ZPAY_SGRP.
And also for example let me take one record, that is ZPAY_SGRP = AA1/B1/CCC2/DD2/EEE1 .
My assumption is that there will always be 4 '/'.
In the field routine write the below code
data: V1(5) type c,
V2(5) type c,
V3(5) type c,
V4(5) type c,
V5(5) type c.
data : VAR1 TYPE /BIC/OIZPAY_SGRP.
split VAR 1 at '/' into V1 V2 V3 V4 V5.
result = V5.
V5 will be having the characters after the last '/' .That is V5 = EEE1.
Hope the above reply was helpful.
Kind Regards,
Ashutosh Singh
Edited by: Ashutosh Singh on May 17, 2011 3:53 PM
Edited by: Ashutosh Singh on May 17, 2011 4:17 PM -
ABAP code for BI 7.0 transformations start routine
Hi all,
I am trying to update data from DSO1 (Source1: transaction data) to Infocube(TARGET)
In the transformations Start routine, I have to read DSO2(Source2: Master data) for some fields.
DSO1 has CUSTOMER as part of key
DSO2 has CUSTOMER (key) and other fields....FIELD1, FILED2, FIELD3
Infocube to be updated with FIELDS1,2 & 3 WHILE READING DSO2.
WHERE DSO1 CUSTOMER matches with DSO2 CUSTOMER.
Also, data NOT TO BE UPLOADED into Infocube if FIELD1 in DSO2= NULL
Please give me the abap code for the above logic.
Appreciate any help in this regard.
Thanks.This is a doc from this site:
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/6090a621-c170-2910-c1ab-d9203321ee19
Ravi Thothadri -
Hi,
I am trying to write an update routine to calculate and populate fields in my ODS infoprovider.
one of the key figure field in my update rules is 'No. of Days'. Based on the 'No. of Days' range, I want to send a key figure(Infoobject:Due amount) value to another infoobject(Bucket1, Bucket2, Bucket3 ect.)in my ODS infoprovider. For example, let's say,
IF NO. OF DAYS = >0 AND <=30
THEN TAKE THE DUE AMOUNT PUT IN BUCKET1
ENDIF.
ELSE IF
NO. OF DAYS = >31 AND <=60
THEN TAKE THE DUE AMOUNT PUT IN BUCKET2
ENDIF.
ELSE IF
NO. OF DAYS = >61 AND <=90
THEN TAKE THE DUE AMOUNT PUT IN BUCKET3
ENDIF.
I think, I know the data flow logic but I don't know how to code in ABAP language. If someone can give me some psuedo like ABAP code, I would appreciate your help with points.Hi Roa,
I would do this in the start routine of the update rule.
Here is a sample on how do this. You could use a case statement for this code also.
Loop at Data_Packet.
IF NO. OF DAYS = >0 AND <=30
Data_Packet-BUCKET1 = DUE AMOUNT
ELSEIF
NO. OF DAYS = >31 AND <=60
Data_Packet-BUCKET2 = DUE AMOUNT
ENDIF.
ELSEIF
NO. OF DAYS = >61 AND <=90
Data_Packet-BUCKET3 = DUE AMOUNT
ENDIF.
modify data_packet.
endlloop.
Cheers! Bill -
ABAP Code Problem in Start Routine to Fill the value from Look-up Table ???
Hi all,
I am trying to fill the values of DOC_NUMBER & PLANT from look-up table /BIC/AZSD_O0700 (Billing Item ODS) for each BILL_NUM in Start Routine for Update Rules of Billing Header ODS and modify the data_package.
What is wrong with the below ABAP code, PLEASE ???
data: it_data type standard table of data_package_structure
with header line
with non-unique default key initial size 0.
types: begin of billing_item_type,
BILL_NUM like /BIC/AZSD_O0700-BILL_NUM,
DOC_NUMBER like /BIC/AZSD_O0700-DOC_NUMBER,
PLANT like /BIC/AZSD_O0700-PLANT,
end of billing_item_type.
refresh it_data.
clear it_data.
it_data[] = DATA_PACKAGE[].
refresh DATA_PACKAGE.
clear DATA_PACKAGE.
loop at it_data.
select DOC_NUMBER PLANT into (it_data-DOC_NUMBER, it_data-PLANT)
from /BIC/AZSD_O0700
where BILL_NUM = it_data-BILL_NUM
and FISCVARNT = it_data-fiscvarnt.
endselect.
if sy-subrc = 0.
move-corresponding it_data to DATA_PACKAGE.
endif.
endloop.
modify DATA_PACKAGE.
Thanks,
Venkat.Hi Venkat,
Two things -One is the performance and the other ... there is no Append within the loop.
Try moving the select statement ousdie the loop to improve performance and move the modify statement into the loop ... change modify to append. Code below.
Let me know if you need more help.
Best regards,
Kazmi
data: it_data type standard table of data_package_structure
with header line
with non-unique default key initial size 0.
types: begin of billing_item_type,
BILL_NUM like /BIC/AZSD_O0700-BILL_NUM,
DOC_NUMBER like /BIC/AZSD_O0700-DOC_NUMBER,
PLANT like /BIC/AZSD_O0700-PLANT,
end of billing_item_type.
refresh it_data.
clear it_data.
it_data] = DATA_PACKAGE[.
refresh DATA_PACKAGE.
clear DATA_PACKAGE.
loop at it_data.
select DOC_NUMBER PLANT into (it_data-DOC_NUMBER, it_data-PLANT)
from /BIC/AZSD_O0700
where BILL_NUM = it_data-BILL_NUM
and FISCVARNT = it_data-fiscvarnt.
endselect.
if sy-subrc = 0.
move-corresponding it_data to DATA_PACKAGE.
Append DATA_PACKAGE.
endif.
endloop. -
Execute ABAP code in Start Routine only once
I have ABAP code in a start routine that I only want to execute once. Is there a way to tell this is first execution of the start routine?
Also can I find out these value in the start routine ABAP:
1. How many data packets there are?
2. What data packet I am processing?
Regards,
Mike...Hi,
I've just setup a little test:
TRules, Start Routine Global Decl:
DATA: GVI TYPE I, GVN(5) TYPE N.
Start Routine:
IF GVI IS INITIAL.
GVI = 1.
ELSE.
ADD 1 TO GVI.
ENDIF.
MOVE GVI TO GVN.
This is basically counting the times the start routine is executed and populating the var GVN; I am posting GVN in a char ZTESTGV in the target cube. I am posting as well the datapakID in my cube.
I have loaded two requests (each 4 packets)
the first one first to PSA and then from the PSA to the target: this is Serially using one single process. Here's the result in the cube:
Request________________________________DATAPAKID_____ZTESTGV
REQU_8B5ASGQNYYNIV1OJN68HFH1SR____________1____________1
REQU_8B5ASGQNYYNIV1OJN68HFH1SR____________2____________2
REQU_8B5ASGQNYYNIV1OJN68HFH1SR____________3____________3
REQU_8B5ASGQNYYNIV1OJN68HFH1SR____________4____________4
In this case the global variable is persistent accross packets.
the second request is loaded in paralell: this is, multiple processes are executed at the time. Here's the result in the cube:
Request________________________________DATAPAKID_____ZTESTGV
REQU_14QVH21BSVH44FAJW94BD7N2H____________1____________1
REQU_14QVH21BSVH44FAJW94BD7N2H____________2____________1
REQU_14QVH21BSVH44FAJW94BD7N2H____________3____________1
REQU_14QVH21BSVH44FAJW94BD7N2H____________4____________1
In this case the global variable is always1 !!
This is logic since several a process cannot access the internal memory used by another one...
Conclusion; the global variable will work only if the load is serial...
hope this helps...
Olivier. -
ABAP Code in Start Routine for restricing the data records from ODS1 - ODS2
Hi
I need small ABAP Code in Start Routine Of Update rules Of ODS . Im in BW 3.5 .
I have records like below in first layer ODS and i want to restrict some records while going to second layer ODS ..
ODS1 :-
DocNO EventType Date
123 001 08/08/2008
123 003 08/08/2008
123 011 09/08/2008
I want one record in ODS2 for this document number whose EventType = 001 only and date of third record ... like below
Doc NO EventType From Date Todate
123 001 08/08/2008 09/08/2008
So how can i get like this record in the ODS2 which will get data from ODS1 . So i need to write the code in the start routine of the ODS2 .
So please give the me the code for start routine ....
Regards
SureshIts difficult in BW 3.5 to include this logic in START_ROUTINE as you cannot add the extra to_date field to the DATA_PACKAGE table.
You need to create a new global internal table with the same structure of DATA_PACKAGE with additional field to_date. then use the logic to fill in the global internal table
define a internal table new_data_package with the required structure like (docno, eventtype, fromdate todate)
data: l_w_datapkg_001 type data_package,
data: l_w_newdatapkg type new_data_package,
data: l_w_datapkg_011 type data_package
LOOP AT DATA_PACKAGE INTO l_w_datapkg_001 WHERE event_type = '001'.
l_w_newdatapkg-docno = l_w_datapkg_001-docno.
l_w_newdatapkg-event_type = l_w_datapkg_001-event_type.
l_w_newdatapkg-fromdate = l_w_datapkg_001-date.
MOVE CORRESPONDING FIELDS OF l_w_datapkg_001 INTO l_w_newdatapkg.
READ TABLE data_package INTO l_w_datapkg_011
WITH KEY docno = l_w_datapkg_001-docno
event_type = '011'.
l_w_newdatapkg-to_date = l_w_datapkg_011-date.
APPEND l_w_newdatapkg TO new_data_package
ENDLOOP.
Now the new datapackage contains the ODS2 data that u needed -
Routine (ABAP Code) in Transformation error
Hi Experts
Please correct the ABAP CODE written as Field routine in Transformations
Requirment
If ZB_AMT = '0.00'
then result should be '0.00'
If ZB_AMT <> '0.00' and
SOURCE_FIELDS-/BIC/ZB_TPE1 = 'AMOUNT'
the result should be
CONCATENATE '$' SOURCE_FIELDS-/BIC/ZB_AMT INTO RESULT.
If ZB_AMT <> '0.00' and
SOURCE_FIELDS-/BIC/ZB_TPE1 = 'PERCENTAGE'
the result should be
CONCATENATE SOURCE_FIELDS-/BIC/ZB_AMT '%' INTO RESULT.
The code below is not working as it should please update me where i went wrong
Source Fields
SOURCE_FIELDS-/BIC/ZB_AMT (CHAR)
SOURCE_FIELDS-/BIC/ZB_TPE1 (CHAR)
CODE
IF SOURCE_FIELDS-/BIC/ZB_AMT = '0.00'.
RESULT = '0.00'.
ELSE.
IF SOURCE_FIELDS-/BIC/ZB_TPE1 = 'AMOUNT' AND
SOURCE_FIELDS-/BIC/ZB_AMT <> '0.00'.
CONCATENATE '$' SOURCE_FIELDS-/BIC/ZBON_AMT INTO RESULT.
IF SOURCE_FIELDS-/BIC/ZB_TPE1 = 'PERCENTAGE' AND
SOURCE_FIELDS-/BIC/ZB_AMT <> '0.00'.
CONCATENATE SOURCE_FIELDS-/BIC/ZB_AMT '%' INTO RESULT.
ENDIF.
ENDIF.
ENDIF.Your logic will not work, if your first check on amount is 0.00 fails, the other checks fail as well. I am not sure of the requirement but..try this..
IF SOURCE_FIELDS-/BIC/ZB_TPE1 = 'AMOUNT' AND SOURCE_FIELDS-/BIC/ZB_AMT = '0.00'.
CONCATENATE '$' SOURCE_FIELDS-/BIC/ZBON_AMT INTO RESULT.
ELSEIF SOURCE_FIELDS-/BIC/ZB_TPE1 = 'PERCENTAGE' AND SOURCE_FIELDS-/BIC/ZB_AMT = '0.00'.
CONCATENATE SOURCE_FIELDS-/BIC/ZB_AMT '%' INTO RESULT.
ELSEIF SOURCE_FIELDS-/BIC/ZB_AMT = '0.00'.
RESULT = '0.00'.
ELSE.
Do nothing or throw any message
ENDIF. -
Hi,
I want to write a transfer routine, Can any one give me the ABAP Code...
Here is what I want to do:
1. Read by document Number at the Header level (identified by item = "#")
2. Read the Status of the Header
3. If the Status = deleted
4. Read all the line items related to the Header
5. Assign the Status of the line item = Status of the Header
Thanks
Edited by: tanu d on Aug 20, 2010 11:32 AMHi,
See the simple code.
IF SOURCE_FIELDS-N_WBSEOM = ' '.
RESULT = 'N'
ELSE.
RESULT = SOURCE_FIELDS-N_WBSEOM.
ENDIF.
OR
IF SOURCE_FIELDS-N_WBSEOM IS INITIAL.
RESULT = 'N'
ELSE.
RESULT = SOURCE_FIELDS-N_WBSEOM.
ENDIF.
Thanks
Reddy
Edited by: Surendra Reddy on Nov 25, 2009 5:38 AM -
Convert ABAP code in start routine/update rule to transform. start routine
Dear BW ABAPers,
I have created a custom purchasing info cube (YCP_PURC1) based on 0CP_PURC1 standard cube. I would like to convert this new data flow to BI7 (from 3.x), and convert the standard update rule to transformation. I would need to rewrite the below start routine from the standard update rule to a start routine ABAP code in the newly created transformation / start routine. My ABAP knowledge is limited. Will you please help?
*this is the start routine from the update rule. As a side note, the data source is 2LIS_02_SCL.
LOOP AT SOURCE_PACKAGE.
IF ( SOURCE_PACKAGE-cppvlc EQ 0
AND SOURCE_PACKAGE-cppvoc EQ 0
AND SOURCE_PACKAGE-cpquaou EQ 0 ).
DELETE SOURCE_PACKAGE.
CONTINUE.
ENDIF.
no_scl is initial ( e.g. for good receipts, billing)
value has to be set depending on storno
IF SOURCE_PACKAGE-no_scl IS INITIAL.
IF SOURCE_PACKAGE-storno = 'X'.
SOURCE_PACKAGE-no_scl = -1.
ELSE.
SOURCE_PACKAGE-no_scl = 1.
ENDIF.
MODIFY SOURCE_PACKAGE.
ENDIF.
ENDLOOP.
if abort is not equal zero, the update process will be canceled
ABORT = 0.
Many thanks and look forward to your kind feedback.
Kind regards,
CsabaDear All, Durgesh,
thanks to you all for your valuable input. Mainly the ABAP part was more interesting for me.
Durgesh, thanks for your input, it was useful. I just had to change the info objects to data source fields and add the lines before the loop:
DATA: I_PACKAGE TYPE TYT_SC_1.
FIELD-SYMBOLS <i_package> TYPE tys_sc_1.
I_PACKAGE[] = SOURCE_PACKAGE[].
LOOP AT SOURCE_PACKAGE assigning <i_package>.
IF ( <i_package>-BWGEO EQ 0
AND <i_package>-BWGEOO EQ 0
AND <i_package>-BWMNG EQ 0 ).
DELETE SOURCE_PACKAGE index sy-tabix.
CONTINUE.
ENDIF.
no_scl is initial ( e.g. for good receipts, billing)
value has to be set depending on storno
IF <i_package>-NOSCL IS INITIAL.
IF <i_package>-ROCANCEL = 'X'.
<i_package>-NOSCL = -1.
ELSE.
<i_package>-NOSCL = 1.
ENDIF.
ENDIF.
ENDLOOP.
Points have been assigned accordingly.
Thanks,
Csaba -
Append Duplicate entries in Start Routine through ABAP code
Hi Experts,
I need to write an ABAP code in the start routine for the following conditions.
For every record in fiscal period (FISCPER) which has non u2013quarter months eg if Jan/Feb ie (001.2007 or 002.2007) I need to create an additional duplicate record which keeps all the other values same but negates the key figures and replaces the month by a quarter ending month
Eg: if my records are
FISCPER COMP_CODE GLACCT BALANCE
001.2007 1000 6789090 70
002.2007 1000 6789090 80
I need to create/append duplicate entries by negating the Balance value and replacing the Fiscper with 003.2007
FISCPER COMP_CODE GLACCT BALANCE
003.2007 1000 6789090 -70
003.2007 1000 6789090 - 80
Hence the entire structure should now look like:
001.2007 1000 6789090 70
002.2007 1000 6789090 80
003.2007 1000 6789090 -70
003.2007 1000 6789090 - 80
Similarly, I need to append duplicate entries for all non quarter ending months and replacing the Fiscper with the quarter ending month and also negate the Key figure value.
Hence, similarly,
001.2007 1000 6789090 70
002.2007 1000 6789090 80
003.2007 1000 6789090 -70
003.2007 1000 6789090 - 80
004.2007 1000 6789090 30
005.2007 1000 6789090 90
006.2007 1000 6789090 -30
006.2007 1000 6789090 -90
I am very new to ABAP, can someone please provide the ABAP start routine code for this..
Regards,
DipaliHi,
Check the below code. Paste it in yr Start Routine.
'*'Begin of code
DATA : wa_Data_Package LIKE Data_Package.
DATA : t_Data_Package LIKE Data_Package.
DATA : wa_temp LIKE Data_Package-BALANCE.
Loop at Data_Package into wa_Data_Package.
IF ( wa_Data_Package-FISCPER EQ 001/2007 ) or
( wa_Data_Package-FISCPER EQ 002/2007 ).
wa_temp = wa_Data_Package-BALANCE.
t_Data_Package-FISCPER = 003/2007.
t_Data_Package-BALANCE = -wa_temp.
Clear : wa_temp.
ELSEIF ( wa_Data_Package-FISCPER EQ 004/2007 ) or
( wa_Data_Package-FISCPER EQ 005/2007 ).
wa_temp = wa_Data_Package-BALANCE.
t_Data_Package-FISCPER = 006/2007.
t_Data_Package-BALANCE = -wa_temp.
Clear : wa_temp.
ELSEIF ( wa_Data_Package-FISCPER EQ 007/2007 ) or
( wa_Data_Package-FISCPER EQ 008/2007 ).
wa_temp = wa_Data_Package-BALANCE.
t_Data_Package-FISCPER = 009/2007.
t_Data_Package-BALANCE = -wa_temp.
Clear : wa_temp.
ELSEIF ( wa_Data_Package-FISCPER EQ 010/2007 ) or
( wa_Data_Package-FISCPER EQ 011/2007 ).
wa_temp = wa_Data_Package-BALANCE.
t_Data_Package-FISCPER = 012/2007.
t_Data_Package-BALANCE = -wa_temp.
Clear : wa_temp.
ENDIF.
APPEND t_Data_Package to Data_Package
Endloop.
'*'End of code
Regards,
Balaji V -
Sample ABAP code for userexits, and calling bapi's
Hi,
Can someone please send me sample ABAP code
1) to do extractor enhancement using user exit.
2) ABAP program to call BAPI to read live cache order series data in SNP and write to Idocs through some ports.
3) ABAP routine to generate file name (based on date/country)in the infopackage to upload flatfiles.
Thank you very much in advance and appreciate any help.
Regards
Prasadhai ,
check this code...
*& Tables
tables : tstc, "SAP Transaction Codes
tadir, "Directory of Repository Objects
modsapt, "SAP Enhancements - Short Texts
modact, "Modifications
trdir, "System table TRDIR
tfdir, "Function Module
enlfdir, "Additional Attributes for Function Modules
tstct. "Transaction Code Texts
*& Variables
data : jtab like tadir occurs 0 with header line.
data : field1(30).
data : v_devclass like tadir-devclass.
*& Selection Screen Parameters
selection-screen begin of block a01 with frame title text-001.
selection-screen skip.
parameters : p_tcode like tstc-tcode obligatory.
selection-screen skip.
selection-screen end of block a01.
*& Start of main program
start-of-selection.
Validate Transaction Code
select single * from tstc
where tcode eq p_tcode.
Find Repository Objects for transaction code
if sy-subrc eq 0.
select single * from tadir
where pgmid = 'R3TR'
and object = 'PROG'
and obj_name = tstc-pgmna.
move : tadir-devclass to v_devclass.
if sy-subrc ne 0.
select single * from trdir
where name = tstc-pgmna.
if trdir-subc eq 'F'.
select single * from tfdir
where pname = tstc-pgmna.
select single * from enlfdir
where funcname = tfdir-funcname.
select single * from tadir
where pgmid = 'R3TR'
and object = 'FUGR'
and obj_name = enlfdir-area.
move : tadir-devclass to v_devclass.
endif.
endif.
Find SAP Modifactions
select * from tadir
into table jtab
where pgmid = 'R3TR'
and object = 'SMOD'
and devclass = v_devclass.
select single * from tstct
where sprsl eq sy-langu
and tcode eq p_tcode.
format color col_positive intensified off.
write:/(19) 'Transaction Code - ',
20(20) p_tcode,
45(50) tstct-ttext.
skip.
if not jtab[] is initial.
write:/(95) sy-uline.
format color col_heading intensified on.
write:/1 sy-vline,
2 'Exit Name',
21 sy-vline ,
22 'Description',
95 sy-vline.
write:/(95) sy-uline.
loop at jtab.
select single * from modsapt
where sprsl = sy-langu and
name = jtab-obj_name.
format color col_normal intensified off.
write:/1 sy-vline,
2 jtab-obj_name hotspot on,
21 sy-vline ,
22 modsapt-modtext,
95 sy-vline.
endloop.
write:/(95) sy-uline.
describe table jtab.
skip.
format color col_total intensified on.
write:/ 'No of Exits:' , sy-tfill.
else.
format color col_negative intensified on.
write:/(95) 'No User Exit exists'.
endif.
else.
format color col_negative intensified on.
write:/(95) 'Transaction Code Does Not Exist'.
endif.
Take the user to SMOD for the Exit that was selected.
at line-selection.
get cursor field field1.
check field1(4) eq 'JTAB'.
set parameter id 'MON' field sy-lisel+1(10).
call transaction 'SMOD' and skip first screen. -
ABAP code needed to convert from 0calmonth2 & 0calyear to 0calmonth
Hi SAP GURUS,
Can anybody give me the ABAP code to convert from 0calmonth2 and 0calyear to 0calmonth.and please suggest me whether i have to write start routine or end routine in transformations.
Thanks ALL.hi,
in the transformation map 0calmonth2 and 0calyear to the 0calmonth field, and from drop down choose routine.
there will be an area where it will be mentioned write your piece of code below this line.
paste the below code:
Concatenate source_fields-0calmonth2 source_fields-0calyear into result.
also delete the line result = .
save the routine and execute the package.
regards,
Arvind. -
ABAP Code for summation of key figure
Hi Guys,
I am new to ABAP and my requirement is as follows-
I have an infocube containing data like
Location Item Amount Month
India TV 10 Jan
India DVD 10 Jan
India XBOX 10 Jan
US TV 10 Jan
US XBOX 15 Jan
US DVD 20 Jan
UK XBOX 30 Jan
UK TV 20 Jan
UK DVD 15 Jan
India TV 20 Feb
US DVD 20 Feb
UK XBOX 10 Feb
India TV 20 Mar
Now by using open hub, I want to extract a file which would display report as -
Output file
15-Oct-2010
Location Item Amount
India TV 50
India DVD 10
India XBOX 10
US TV 10
US DVD 40
US XBOX 15
UK TV 20
UK DVD 15
UK XBOX 40
which means it should sum based on combination of location and item and create one single row.
I need some ABAP code which could be written in expert routine so as to to calculate single rows of amount for all data packets of infocube.
Kindly suggest on how to proceed on it.
Thanks in advance
Moderator Message: Even if you are new-to-ABAP, it does not imply that you can expect others to do your work. If you are a BI consultant, take the help of an ABAP consultant or self-learn the basic concepts of ABAP. If you are an ABAPer, go back to the training center.
Edited by: kishan P on Oct 15, 2010 10:34 AMFollow this white paper .... called, "How to .... Calculate with Attributes":
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/72f4a790-0201-0010-5b89-a42a32223ffc
Brian -
ABAP code which will use function module during field mapping in LSMW
Hi,
During field mapping in LSMW, for one of the field called field, I want to use a function module 'QF05_RANDOM_INTEGER', which will generate random numbers and map that random number to that field.
How do I write ABAP code which uses function module, during filed mapping for a particluar field in LSMW ?
Please help...
Regards,
Tushar.Hi Tushar,
You can write in FORM ROUTINE and LSMW.
I hope you know how to write ABAP code at field level.
If not ...
Come to change mode->select the field->Rule->ABAP Code
write a perform statement in ABAP code at field level.
<b>PERFORM test</b> using val
changing valu.
Go to Utilities(at menu)->switch layout-> extras ->select Layout->check Form routine-> it will display a FORM Routine... at bottom
this is the place where you can write some code for
<b> FORM test</b> using value
changing value1
FM call....
.ENDFORM
Get the value1 returned and use for the Field population.
Reward points if this Helps.
Manish
Message was edited by:
Manish Kumar
Maybe you are looking for
-
Programming a select option in abap webdynpro
Dear Gurus, I have used a select option in a specific webdynpro, but this select option does not enable the same functionalities as select option in SAP GUI. As an example, the possibility to upload a file or the clipboard in the multiple selection f
-
Hi all! I am trying to set up a room iView which points to a content store. My requirement is that the end-user will be able to create content on this store but won't see it until the room admin approves. So i did the following: 1) Created a reposito
-
Third Party Tools for Database Migration of 10g between Cross Platform?
Hi, Like to know any is there any third party tool available in the market for cross platform EASY database migration between AIX - 10g R2 to Windows - 10g R2. Before there used be a third party tool called DBPUT which is no longer available now.Look
-
I want to know the whole process flow for creating cost collectors for materials so that i could perform month end transactions for a plant that uses repetitive manufacturing. I know the month end transactions like CON2;CO43;KKS5 and C088 but i am no
-
DCIteratorBinding Looping Example - jdev 11.1.2
Hello: Thanks for looking at this post. In the HR schema, I drag the departments data control to a page with a backing bean. I use the following code to get a reference to the DCIteratorBinding in bean. BindingContext bctx = BindingContext.getCurrent