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
Similar Messages
-
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 -
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 SAP exit varaibles?
Hi,
i) Where can I find the abap code for SAP exit variables
OP_KEYDT used for the net due date
OP_KEYD2 used for the posting date
OP_KEYD3 used for the clearing date, which are used in FI AR aging report(0FIAR_C03).
Based on the Net Due Date, which is key date(0NETDUEDATE), entered by the user at runtime, the posting date and celaring date are populated.
II) The problem is we want to simulate a similar scenario, but with key date, which user enters is based on the custom Net Due Date(ZNETDUEDATE).And this date is populated to posting date and clearing date variables.
How do we acheive that.
Thanks.Hi Kumar,
Try this below mentioned example where default date is current date.
Step1: Create a variable(ex: cur_date) on requrired characteristic with Processing type "Customer Eixt" and check the check box for ready for input(if this variable need in selection screen).
Step 2: Goto T Code : CMOD and provide appropriate Project and choose components and click on display.
Step3: Double click on exit "EXIT_SAPLRRS0_001" you can see include "ZXRSRU01", double click on include.
Step4: Sample code to populate.
WHEN 'CUR_DATE'.
Data : l_p_range_SSS TYPE rrrangesid.
IF I_STEP = 1.
l_p_range_SSS-Low = sy-datum.
l_p_range_SSS-Sign = 'I'.
l_p_range_SSS-Opt = 'EQ'.
APPEND l_p_range_SSS TO e_t_range.
Endif.
The following values are valid for I_STEP:
· I_STEP = 1
Call up takes place directly before variable entry
· I_STEP = 2
Call up takes place directly after variable entry. This step is only started up when the same variable could not be filled at I_STEP=1.
· I_STEP = 3
In this call up, you can check the values of the variables. Triggering an exception (RAISE) causes the variable screen to appear once more. Afterwards, I_STEP=2 is also called up again.
· I_STEP = 0
The enhancement is not called from the variable screen. The call up can come from the authorization check or from the Monitor.
Also, refer this link..
http://help.sap.com/saphelp_bw320/helpdata/en/1d/ca10d858c2e949ba4a152c44f8128a/content.htm
Cheers,
Allen -
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 -
How To Create ABAP Code For HR Context Sensitive Structural Authorization
Hello,
We have created a HR Custom Program which IS NOT built off the PCH or PNP Logical Database. As a result, we need to manually create ABAP code for HR Context Sensitive Structural Authorization Check in our custom HR program. Via HR Context Sensitive Structural Authorizations, we are restricting access to personnel numbers and the underlying HRP* tables.
Any assistance would be greatly appreciated with the identification of the SAP standard function modules (Ex. RH_STRU_AUTHORITY_CHECK, HR_CHECK_AUTHORITY_INFTY, HR_CHECK_AUTHORITY_INFTY , etc) used in HR Context Sensitive Structural Authorization Check, how they are used to control HR Structural authorization (P_ORGINCON), and some sample code.
Thank you in advance for all your assistance,
Ken BowersHello Ken
You can use the interface methods IF_EX_HRPAD00AUTH_CHECK to get the same structural authorization as you can see in PA20/PA30. You need to use the methods set_org_assignment and check_authorization for this purpose. For more information you can refer to include FP50PE21 from line 237 onwards till 270.
Regards
Ranganath -
Need ABAP code for the below Services requirement
Hi,
We have a requirement to show all the services for a particular Purchase order number.For this I built a view on 2 tables ESLL and EKPO.Now based on the below logic I need to bring the services for the Purchase order..
1.Enter PO number,item no. and Doc category in EKPO and find the Pack no.
2.Now take the Pack no. of EKPO and give in ESLL and find the Sub pack no.
3.Now take this Subpack no. and Give this sub pack as Pack no. in ESLL
4.This will be the Service entry record for that PO number.
Can any one Please suggest me to how to write the ABAP code for the above logic.
Thanks & Regards,
DinakarHi Dinaker,
Did you find any solution for this issue. I too have a similar requirement of pulling all the service orders for a specific Purchase Order in the BW report.
Thanks,
SAPBWI -
GRR2- 4FM-RepPaint(put ABAP code for convert data in field)
Hi,
If somebody know how possible add ABAP code for convert data in some column-field of report (by RepWriter,UserExit,BADI)?
Thanks a lot.Elaborate your question. Not clear ??
-
ABAP code for wrting a file to application server
<Moderator Message: We are not here to do your job for you>
Hi All,
i have a requirement to get the data from some other ABAP program and this data has to be written in one of the files present in application server.
please provide me the exact ABAP code for this...
Edited by: Siegfried Szameitat on Dec 17, 2008 10:40 AMthis has to be done using a process chain
-
Hi Friends,
I have created BI objects like infocubes, infoobjects, DTP, Datasource to transfer data from a flat file to BI system using SAP GUI... All data from flat file are transfered to BI successfully... i dont have any knowledge in ABAP... So i need to see the ABAP code for the BI objects i created above in my project... how can i see the coding for that?
thanks in advance
sasiHi Sasi,
All the objects which you create in BI will be stored in some standad tables,it only fetch details accordingly from those tables.For MasterData you can find the option as Display Routines in Extras.If you want to get more infomation about the STD Table and the Program involed in BI objects,just enter in (/h) mode.
Regards,
Prem -
Abap code for sap exit variables?
Hi,
i) Where can I find the abap code for SAP exit variables
OP_KEYDT used for the net due date
OP_KEYD2 used for the posting date
OP_KEYD3 used for the clearing date, which are used in FI AR aging report(0FIAR_C03).
Based on the Net Due Date, which is key date(0NETDUEDATE), entered by the user at runtime, the posting date and celaring date are populated.
II) The problem is we want to simulate a similar scenario, but with key date, which user enters is based on the custom Net Due Date(ZNETDUEDATE).And this date is populated to posting date and clearing date variables.
How do we acheive that.
Thanks.Please tell how u solved ur issue i have the same scenario to be do.
-
ABAP code for Hierarchy Loading from Flat File
Hi,
Can anyone give me some idea / ABAP code for generating parent - child relationships (NODEIDS) from a flat file and load into BW.
Best regards
Any insight into this development is highly appreciatedHi,
also have a look at this how to to get informations about the file structure:
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/0403a990-0201-0010-38b3-e1fc442848cb
/manfred -
Hi All,
I have requirement to write code for date range.
Characterstic = Run-Out Date, it was created reference to 0Date.
Requirement is data should load depends on Run-Out Date 7 days old and 14 days future.
Logic is -7 days old >= Run_out date <= 14 days future.
please let me know how I need to proceed with ABAP code for this requirement.
Thanks.
Please do not ask for ABAP code here. Its not a training forum
Edited by: Pravender on Aug 18, 2011 1:46 AM>
Sree vignesh wrote:
> Hi,
> In the select option we have a field month range as
> SELECT-OPTION : FROM 01.2007 TO 01.2009 " Let say Ur Selection option is SO_MONTH
> but now i need to add the DMBTR field considering the month range in the SELECT OPTION i.e., only FROM 01.2007 TO 01.2009 i mean without 2006 data.
>
> LOOP AT LT_DATA WHERE month in SO_MONTH. " Here add a Where condition
> ls_output-matnr = lt_data-belnr.
> ls_output-werks = lt_data-bukrs.
> ls_output-lgort = lt_data-dmbtr.
>
> COLLECT ls_output INTO lt_output .
>
> ENDLOOP.
>
> please help with code .
>
> thanks in advance.
Regards,
Suneel G -
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. -
Hi Gurus My requirement goes like this.
I need to write the routine in Transformation from DSO to DSO
Source table
Doc Amt Netduedate Reference Doc
1000 10000 01.01.2010
1500 5000 30.01.2010 1000
1700 3000 02.02.2010 1000
In the Above table 1st document is Invoice Document, 2nd and 3rd are Partial Payment Document.
My requirement is 2nd and 3rd record Netduedate value should have 01.01.2010 by referring reference Doc field, for the above Ex We should have the output like this
Target table
Doc Amt Netduedate Reference Doc
1000 10000 01.01.2010
1500 5000 01.01.2010 1000
1700 3000 01.01.2010 1000
Please give me the syntax code and where to write the code ie in the start routine or in the field routine. the dataflow is between one DSO to Another DSO
Please Provide me the solution ASAP as this is very Urgency.
Thanks in AdvanceIf suppose your documents are being loaded in same load,
1. start routine - create internal table like SOURCE_PACKAGE
DATA IT_SOURCE_PACKAGE TYPE TABLE OF SOURCE_PACKAGE.
DATA WA_SOURCE_PACKAGE LIKE LINE OF SOURCE_PACKAGE.
2. copy all records to new internal table, IT_SOURCE_PACKAGE[] = SOURCE_PACKAGE[]
3. delete partial docs, DELETE IT_SOURCE_PACKAGE WHERE REF_DOC IS NOT INITIAL.
4. Sort internal table SORT IT_SOURCE_PACKAGE BY DOC
5. Look for original doc inside loop.
LOOP AT SOURCE_PACKAGE ASSIGNING <SOURCE_FIELDS> WHERE REF_DOC IS NOT INITIAL.
READ TABLE IT_SOURCE_PACKAGE
INTO WA_SOURCE_PACKAGE
WITH KEY DOC = <SOURCE_FIELDS>-REF_DOC BINARY SEARCH.
IF SYSUBRC EQ 0.
<SOURCE_FIELDS>-NDUEDATE = WA_SOURCE_PACKAGE -NDUEDATE.
ENDIF.
ENDLOOP.
If the original documents are found in different loads in the source DSO, we need to pull the records from active table of the target DSO after step 2.
-Jijo
Maybe you are looking for
-
6500 classic-codec specification ranges
Hello.I have NOKIA 6500 classic and i am very happy with it.I have tvwo questions. 1.is it truth that this model have screen crack problems 2.i want to convert some of my videos to this phone but i dont know what are the codec ranges for audio and vi
-
Can anybody help me out with this problem? I go to my contacts, and if a contact has 2 numbers I go to the 'open' option, however the screen returns to the home screen and won't open the contact for editing or calling. I have downloaded the latest so
-
Trying to authorize my iTunes to play music from another account
I was trying to play music from another account in my iTunes. I got the message that my computer isn't authorized. I entered the email address and password of the account with which the music purchased and got another message that says "This compute
-
Hi Experts Good day, In MB51 doc list, in a particular document, in details , quantity tab- there is a tab amount in lc. I have a paculiar issue. For a same material there was a value for one and no value in another transaction. When I take MB51 doc
-
Submit / Enter Forms From Acrobat Pro X
I have a client who has acrobat pro x installed. He is looking to use only Acrobat Pro X to enter information onto PDF forms. These forms are already created, he is strictly looking to use them as templates. He does not want to edit the form itself,