2013 Oct 30 5:39 PM
Dear All,
I have a scenario in BI to implement ABAP.
Master data table:
GL Account Cost Center
111 ???315*
222 ?????315**
333 ?315*****
As we see that the cost center is stored in strange manner.
Now we have Transaction data coming as below:
Cost center
9993150
8153150
93150
Now as we see the pattern '315' is what we have to focus. For Cost center ???315* matches with the 9993150 and 8153150 so 111 will be picked for these two Transaction CCs. The CC ?315* matches with 93150 so 333 will be picked from master data.
I am not able to conclude how to apply routine here. its complex scenario i know. Not sure if i can use 'Contain Pattern' or what abap statement.
Please suggest.
Zabi
2013 Oct 31 6:20 AM
Hi Syed,
I think, it's better you find why the cost center is stored that way ??Is it stored that way or there is something wrong that is why the values or coming like that,,
And please elaborate the question by giving a larger scene of your problem.
Regards,
Ajit
2013 Oct 31 6:25 AM
Hi Ajit,
you can use Contain string operator i.e CS. It will work.
Regards
Sachin
2013 Oct 31 6:34 AM
Hello Syed,
There are some string comparing operators in SAP. Please try those to implement according to your requirement... Here you can find those ..Comparing Strings (SAP Library - ABAP Programming (BC-ABA))
you need to pass your data in some string type variable then try those operators.
2013 Oct 31 6:49 AM
Hi,
Ask your BW Consultant as to why the data of costcenter is not loaded correctly into the masterdata .
you need to investigate this along with the BW consultant.
1. See how the data is stored in Costcenter infoobject master table.
2. If data is stored like '???' then test the dataSource which loads the master data in ECC system via tcode RSA3.
Regards
Shaik
2013 Oct 31 7:06 AM
Hello Syed,
Please try out with CP (Contains Pattern operator). Here you have to convert "?" to "+" for the pattern. You can copy paste the code and then do a debug. You will get to understand.
DATA: BEGIN OF i_master OCCURS 0,
gl_account TYPE string,
cost_center TYPE string,
END OF i_master.
PARAMETERS: srch_str TYPE string.
i_master-gl_account = '111'.
i_master-cost_center = '???315*'.
APPEND i_master.
i_master-gl_account = '222'.
i_master-cost_center = '?????315**'.
APPEND i_master.
i_master-gl_account = '333'.
i_master-cost_center = '?315*****'.
APPEND i_master.
LOOP AT i_master.
REPLACE ALL OCCURRENCES OF '?' IN i_master-cost_center WITH '+'.
IF srch_str CP i_master-cost_center.
WRITE: i_master-gl_account.
ENDIF.
ENDLOOP.