Abap code in bw start routine
Hi
i need to reload the master data with out FM, i putted the comment on fm and relaod the data, now i having a problem, loading process is slow now as compair to before, when i was using with FM.
i checked the mange on data target, it is show 1123455 in transfer column and 0 in added column below is the start routine,
Please help me to fix that problem
IF NOT DATAPAK[] IS INITIAL.
LOOP AT DATAPAK INTO S_DATAPAK.
CLEAR V_INDEX.
V_INDEX = SY-TABIX.
IF S_DATAPAK-/BIC/ABRETPRI CO ' 0123456789.'.
CLEAR: V_AMOUNT, V_PRC.
V_AMOUNT = S_DATAPAK-/BIC/ABRETPRI.
CALL FUNCTION 'RSAR_CURRENCY_CONVERT'
EXPORTING
I_CURRENCY = S_DATAPAK-CURRENCY
CHANGING
C_AMOUNT = V_AMOUNT.
V_PRC = V_AMOUNT.
S_DATAPAK-/BIC/ABRETPRI = V_PRC.
ENDIF.
IF S_DATAPAK-/BIC/ABBLNKFLG IS INITIAL.
S_DATAPAK-/BIC/ABBLNKFLG = 'N'.
ENDIF.
TRANSLATE S_DATAPAK-/BIC/ABSZRANGE TO UPPER CASE
IF S_DATAPAK-CURRENCY IS INITIAL.
S_DATAPAK-CURRENCY = S_DATAPAK-WHLPRCCURR.
MODIFY DATAPAK FROM S_DATAPAK INDEX V_INDEX TRANSPORTING
/BIC/ABRETPRI /BIC/ABWHLPRCE /BIC/ABBLNKFLG
ENDIF.
*ENDLOOP.
ENDIF
Thanks
Hi Rob,
Requirement is not clear. please let us know which FM you are commented and why you are using that FM and what is your exact requirement.
Regards,
Ramakrishna kotha.
Similar Messages
-
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. -
Correct abap code - selectinf file by routine
Hi All,
Please correct my ABAP. I am selecting file by writing routine - BI7.0.
Following error I am getting:
When I clicked preview data i got "Fine Name wrong."
My file name. : 10042007.csv
Following code I wrote:
*TABLES: ...
DATA: str1(60) TYPE c,
str2(10) TYPE c,
str3(10) TYPE c.
str1 = 'C:\Documents and Settings\sun\Desktop/'.
str2 = SY-DATUM.
str3 = 'csv'.
$$ end of global - insert your declaration only before this line -
form compute_flat_file_filename
using p_infopackage type rslogdpid
p_datasource type rsoltpsourcer
p_logsys type rsslogsys
changing p_filename type RSFILENM
p_subrc like sy-subrc.
$$ begin of routine - insert your code only below this line -
This routine will be called by the adapter,
when the infopackage is executed.
concatenate str1 '\' str2 '.' str3 into p_filename.
p_subrc = 0.
When I click check button its giving me No systax error.
Thanks in advance1. if i were you, i will debugg your flat file determination code. put unconditional loop in your code (which should not end any more).
go to SM51, debugg the process from menu options.
or
try to keep file name without spaces i.e. Documents_settings like that.
Hope this helps.
Nagesh Ganisetti. -
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. -
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 -
How to write a start routine in the trasnformations ?
Hi Experts,
I am working on BI 7, As I want to write a start routine in transformations of 0FIGL_O02 DSO, to allow the GL accounts with cost center data. Already there is a delete statement please find.
*DELETE SOURCE_PACKAGE where BAL_FLAG = 'X'. I had made comment to allow the G/L accounts. since I have some GL Accounts which does'nt have the cost center data, so in this case I have to write a ABAP code to allow this G/L accounts with cost center data.
So Let me know if anyone can help me how to write the ABAP code in the start routine.
Thanks
sekharHi,
Yopu can write the below lines of code adn try
SORT source_package BY Receive nr Type ASCENDING.
DELETE ADJACENT DUPLICATES FROM source_package COMPARING Receive nr Type.
But you should make sure which record of the either rows need to deleted
i.e in
F9001;LU;J001;662;
F9001;LU;J002;662
You need to decide to eliminate 1st or 2nd one.(depends on your requirement) -
How to write the start routine in the transformations ?
Hi Experts,
I am working on BI 7, As I want to write a start routine in transformations of 0FIGL_O02 DSO, to allow the GL accounts with cost center data. Already there is a delete statement please find.
*DELETE SOURCE_PACKAGE where BAL_FLAG = 'X'. I had made comment to allow the G/L accounts. since I have some GL Accounts which does'nt have the cost center data, so in this case I have to write a ABAP code to allow this G/L accounts with cost center data.
So Let me know if anyone can help me how to write the ABAP code in the start routine.
Thanks
sekharHi Experts,
I am working on BI 7, As I want to write a start routine in transformations of 0FIGL_O02 DSO, to allow the GL accounts with cost center data. Already there is a delete statement please find.
*DELETE SOURCE_PACKAGE where BAL_FLAG = 'X'. I had made comment to allow the G/L accounts. since I have some GL Accounts which does'nt have the cost center data, so in this case I have to write a ABAP code to allow this G/L accounts with cost center data.
So Let me know if anyone can help me how to write the ABAP code in the start routine.
Thanks
sekhar -
Process for Debugging BW Start Routines
I need a detailed process for how to debug the ABAP code of a start routine, particuarly when one ODS is being loaded into another. I know that there is a way to do this with the ABAP debugger but cannot figure it out.
Are there any documents out there that can assist me? I did a search, but all of the examples were too specific to be useful for just general debugging.
Thanks!Hi,
It is not possible to debug in start routine through conventional way upto 3.5 version.
You need to put an endless loop in the start routine.
The program will keep running in the endless loop.
It can achieved by the following code.
data: true,
false.
true = 'X'.
do.
if true = false.
exit.
endif.
enddo.
And in transaction SM50, the endless loop program will visible.
select the program by clicking the check box on the left hand side,
then on the menu,
Program/Mode -> Program -> Debugging.
I hope this helps.
Thanks. -
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 -
ABAP Code in Start Routine to fill a field
Hello,
with the following code in the start routine in BW3.5 I am trying to fill Intercompany-Indicator based on Distribution Channel. The main code is marked bold.
Distribution Channel = DISTR_CHAN
InterCompany-Indicator = G_CWWR14
Pls help. Thanks.
SD
Intercompany Indicator
IF NOT wa_daten-customer IS INITIAL.
SELECT SINGLE /b05/s_rbkunde FROM /b05/mrbcust INTO l_rbcust
WHERE /b05/s_rbcust = wa_daten-customer
AND objvers = 'A'
AND datefrom <= l_date
AND dateto >= l_date.
IF sy-subrc EQ 0.
SELECT SINGLE g_cwwr14 FROM /b05/mrbkdbkrs INTO l_ii
WHERE comp_code = wa_daten-comp_code
AND /b05/s_rbkdbkrs = l_rbcust
AND objvers = 'A'
AND datefrom <= l_date
AND dateto >= l_date.
IF sy-subrc = 0.
wa_daten-g_cwwr14 = l_ii.
ELSE.
CLEAR wa_daten-g_cwwr14.
ENDIF.
ELSE.
CLEAR wa_daten-g_cwwr14.
ENDIF.
ELSE.
IF wa_daten-G_CWWR14 = ' '.
CASE wa_daten-DISTR_CHAN.
WHEN 'Y4'.
wa_daten-G_CWWR14 = '4'.
WHEN 'Y5'.
wa_daten-G_CWWR14 = '2'.
WHEN OTHERS.
wa_daten-G_CWWR14 = '0'.
ENDCASE.
ENDIF.
ENDIF. " NOT wa_daten-customer IS INITIAL
MODIFY DATA_PACKAGE FROM wa_daten.
ENDLOOP.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. -
How to debug start routine for the custom code?
Hi Experts,
Can anybody tell me how to debug the start routine? Also could you please guide me where to write the custom code in the start routine.
Thanks in advance.
Sharat.Rajkumar,
Thank you for your help. but the blog link that you send it to me does not mention anything about ABAP debugger screen.
What should I do once I get in to the ABAP debugger? the link only tells how to get to the ABAP debugger that I know.
Also it say that I have to use the infinite loop to debugg the start routine.
Can anybody tell me how to debugg start routine with the scren shots please. I don't know how to use infinite loop in the start routine. Is their any easy process step by step to see my particular record behavior in the start routine?
I will assing you the points. again thank you. -
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. -
Start routine error - infosource 2LIS_13_VDITM
Hello,
During the activation of the standard InfoCube 0SD_C03 (Sales: Overview), I have encountered a problem in a transformation between the infosource 2LIS_13_VDITM and the afrementioned Cube (this transformation has been transferred during the activation of Business Content).
The transformation is inactive after the installation (other dataflow structures, for other datasources attached to this Cube have been automatically activated). When I try to active it, an error message appers, informing that:
a) Initial update has been set for some of the key rules (e.g. for target field 0VERSION) - but that is a minor obstacle; the bigger problem is that
b) there is a syntax error in the start routine for this transformation
Checking that start routine results with the following error:
E:In PERFORM or CALL FUNCTION "ROUTINE_9998", the actual parameter
"SOURCE_PACKAGE" is incompatible with the formal parameter
"DATA_PACKAGE".
Since I'm not an ABAPer, that info is a bit vague to me.
I have tried to find an answer in the forums but with no success. So if anyone could provide a solution this problem or point me to a thread where it has been answered, I would be very grateful.
I can provide more details should those be needed.
Best Regards,
AlekThanks for the info Umesh,
Just to be sure - I should simply change "SOURCE_PACKAGE" to "DATA_PACKAGE" in the code of the start routine? "Source_Package" is present in two places in that code:
METHODS
start_routine
IMPORTING
request type rsrequest
datapackid type rsdatapid
EXPORTING
monitor type rstr_ty_t_monitors
CHANGING
SOURCE_PACKAGE type tyt_SC_1
RAISING
cx_rsrout_abort.
and then after that in:
Migrated update rule call
Perform routine_9998
TABLES
SOURCE_PACKAGE
CHANGING
l_abort.
Or should I revert to the 3.5 version? (as a side note, that Data Source (2LIS_13_VDITM) has been activated in 7.0 version by default, when I replicated data sources in BW).
Praveen, as to your remarks, I have the datasource 2LIS_13_VDITM (in version 7.0) active, along with the appropriate Infosource. Transformation between the DataSource and InfoSource is active, and only the transformation between the InforSource and the Cube poses problems.
BR,
Alek -
Start routine to update some fields of a ODS based on the another ODS
Hi I know i have to do abap coding at the start routine to update a ODS based on another ODS. I have tried doing the code for quite some time now and i have not been successful. I think I havenu2019t followed the definition required for this routine.
I have 2 ODS, ODS1 has 3 key fields and ODS2 has 1 key field
I have to map the ODS based on a 1:3 relation.
I am writing this start routine for the update rules from ODS2 to ODS1.
The logic is if the key field of ODS2 is equal to either Key field 1 or Key field 2 or Key field 3 of ODS1 then that record from ODS2 has to be updated to the corresponding matching record of ODS1, else no update. The 3 key fields of ODS1 have different character length and character types and the key field of ODS2 has a different character length and type when compared to the any of the key fields of ODS2 can match any of those.
Like key field 1 of ODS1 has length 10. Key field 2 of ODS1 has length 10 and key field 3 of ODS1 has length 20 and all these fields are not alpha converted, but the key field of ODS2 has length 60 and it is alpha converted.
Can anyone please help me in this code.
My Code is as below.
ITAB1-T_BOL = DATA_PACKAGE-/BIC/ZLBOL.
***********NISTEVO SELECT******************************
SELECT /BIC/ZLBOL FROM /BIC/AWLONST0100 INTO ITAB1-T_BOL
WHERE /BIC/ZLBOL = ITAB1-T_BOL .
**************R/3 SELECT*******************************
SELECT /BIC/ZLRDELNU /BIC/ZLRSHIPNU /BIC/ZLREXTID
FROM /BIC/AWLOR3O0400
INTO CORRESPONDING FIELDS OF ITAB1
WHERE
/BIC/ZLRDELNU = ITAB1-T_BOL OR
/BIC/ZLRSHIPNU = ITAB1-T_BOL OR
/BIC/ZLREXTID = ITAB1-T_BOL .
SORT ITAB1 BY T_DELNU T_SHIPNU T_EXTID .
LOOP AT DATA_PACKAGE.
READ TABLE ITAB1 WITH KEY T_DELNU = DATA_PACKAGE-/BIC/ZLBOL.
IF SY-SUBRC = 0.
EXIT.
ENDIF.
READ TABLE ITAB1 WITH KEY T_SHIPNU = DATA_PACKAGE-/BIC/ZLBOL.
IF SY-SUBRC = 0.
EXIT.
ENDIF.
READ TABLE ITAB1 WITH KEY T_EXTID = DATA_PACKAGE-/BIC/ZLBOL.
IF SY-SUBRC = 0.
EXIT.
ENDIF.
DELETE DATA_PACKAGE .
ENDLOOP.
ENDSELECT.
ENDSELECT.
Points will be awarded.
Edited by: satish rajaram on Nov 6, 2008 4:51 PM
Edited by: satish rajaram on Nov 7, 2008 11:40 AM
Edited by: satish rajaram on Nov 7, 2008 11:43 AMThe logic is if the key field of ODS2 is equal to either Key field 1 or Key field 2 or Key field 3 of ODS1 then that record from ODS2 has to be updated to the corresponding matching record of ODS1, else no update. The 3 key fields of ODS1 have different character length and character types and the key field of ODS2 has a different character length and type when compared to the any of the key fields of ODS2 can match any of those.
Can you try below logic :
Below is not code it needs to be manipulated as per requirement.
ODS2 ---> ODS1
SELECT <key fields of ODS1>
FROM /BIC/A<ODS1>00
INTO ITAB
FOR ALL ENTRIES IN DATA_PACKAGE
WHERE
keyfield1 = data_package-key1
or
keyfield2 = data_package-key2
or
keyfield3 = data_package-key3
**Now itab has all entries which neednot be deleted from data_package.****
if sy-subrc=0.
***Check Itab and delete only those records not present in itab from data_package****
endif.
Hope this helps. -
ABAP Code to Read Characteristic from Another DSO
Gurus and Experts,
Plain and simple, I need a piece of ABAP code that reads a characteristic value from a different DSO.
Here is the story. I have a data flow from DSO Delivery1 to DSO Delivery2. I need to write a code in the start routine of the transformation to read Sales_Doc_Type from DSO Sales1. The condition is, if Delivery1-Ref_Doc_Nr = Sales1-Sales_Nr then Delivery1-Sales_Doc_Type = Sales1_Sales_Doc_Type.
I am a beginner in SAP BI and know nothing about ABAP. But I do have experience in SQL and Java.
Any help or links or direction will be appriciated. Thanks in advance.
HerruHello,
I think there is a correction in your Ques. That there are two DSO Delivery1 and Sales1...... I Hope this is Ok.
Tables Required:---- Go To SE11 and *<DSO_NAME>00 You will get active table for your DSO. EG. /bic/Delivary100 and /bic/sales100
Logic In start Riutine:----
1. Define structure in Global Def. for Sales1 DSO.
2. Also Define Internal table in Global Def. (I hope you know the syntax)
3. now you will find that start writing code from below.
Inclue:------ Select Statement from Slaes1 DSO into itab for all entries in source package.
4. Loop source_package assigning <result_fields>.
read itab into wa where Sales1-Sales_Nr = <result_fields>-Ref_Doc_Nr.
<result_fields>-Sales_Doc_Type = wa-Sales1_Sales_Doc_Type.
endloop.
This logic will work..........
If still you are find it difficult then take some abaper help.
Regards,
Ankit.
Maybe you are looking for
-
HI all, we were using Oracle Report 6i on windows XP Service pack 2, Oracle Database 10.1.0.2.0 On AIX 5.2 and SEDCO Magina L2200c printer was being used to print the reports from report Builder 6i and it was working fine. but now just we change the
-
Idvd '08 revolution theme scrub bar
The revolution theme in idvd '08 has a scrub bar at the bottom of the image frame, with a check box at each end. I cannot quite figure out what the check box does, and what the hatched area that appears in the scrub bar does/ Anyone have a clue on th
-
Deploying Windows Azure Cloud Service to multiple instances
Hello folks, Currently, I have Windows Azure Cloud service on one instance, if I move to multiple instances, will Azure deploy it to all instances during the time of deployment? Basically, the fact that there are multiple instances behind the Cloud S
-
How Do You Download the January 2008 Upgrades to the IPHONE - Thanks Bob
Thanks.
-
I already asked a question i want to seach for any answers
I want to find out if I can ever retrieve my Favorites which disappeared when I downloaded Firefox 4. Also I hate 4 , I want Firefox 3.6 back what do i HAVE TO DO ? hOW CAN i SAVE MY BOOKMARKS or am I doomed to swiech to OPERA?