cancel
Showing results for 
Search instead for 
Did you mean: 

Parsing value

Former Member
0 Kudos

Hi

I have a req where i have to parse a text(data format 1234-12) 1234 represents a feild (Suppose FID )and 12 represents another feild(Suppose tid) . now using this text how can i parse the values to there respective feilds(fid and tid) in reporting.

Thanks

Imran

Accepted Solutions (1)

Accepted Solutions (1)

former_member184494
Active Contributor
0 Kudos

use a split at command for the field in your routine...

Former Member
0 Kudos

can you explain in detail

Edited by: imranmoh123 on Jun 2, 2009 10:51 PM

dennis_scoville4
Active Contributor
0 Kudos

Since you're parsing the data at the time of query, you will have to use virtual characteristics and create an exit in the query that performs the split, or substring, of the data to parse it out into its component parts.

[Using Customer Exit Variables in BW/BI Reports Part - 1|https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/20f119d9-922d-2c10-88af-8c016638bd90]

Edited by: Dennis Scoville on Jun 2, 2009 3:40 PM

Former Member
0 Kudos

I appreciate your response dennis. It was helpful, but i am unable to create text variable because i dont have the option to select characterstic as text variable. It just shows the characterstic value.

and the other thing is that the text i am trying to split is a master data text.

So what should be done now.

Thanks

Imran

Edited by: imranmoh123 on Jun 3, 2009 5:28 AM

dennis_scoville4
Active Contributor
0 Kudos

Hmmu2026I see the dilemma now. The only other thing that I can think of is to add two new InfoObjects (one for TID and one for FID) to the InfoCube(s) and/or DSO(s) that source your report. In the transformation, do a lookup on the Master Data Text and split out the data into these InfoObjects.

Former Member
0 Kudos

Ok, can you please give me a sample code. I am not good at abap.

one more thing is that the two data feilds(which we are going to split) are master data characterstics in the infoprovider.

Imran

dennis_scoville4
Active Contributor
0 Kudos

This is fairly generic code, but can be used as a baseline for what you're trying to do:

Global Data Declarations Area


types: begin of t_tmaster,
  master_data_key type /bi0/oimaster_data_key,
  aaa type /bi0/oiaaa,     *represents the Master Data Text field you want to parse
end of t_tmaster.

data: t_i_tmaster type hashed table of t_tmaster
        with unique key master_data_key.

data: t_s_tmaster type t_master.

Start Routine

This would need to be done before any LOOP statements in your Start Routine.


select
  master_data_key
  aaa
from
  /bic/tmaster      *Master Data Text table
into table
  t_i_tmaster
for all entries in source_package
where
  master_data_key = source_package-master_data_key.

End Routine


loop at result_package assigning <result_fields>.
  read table
    t_i_tmaster
  into
    t_s_tmaster
  with key
    master_data_key = <result_fields>-master_data_key.

  if sy-subrc eq 0.
    <result_fields>-fid = t_s_tmaster-aaa+0(4).
    <result_fields>-tid = t_s_tmaster-aaa+5(2).
  endif.

endloop.

Former Member
0 Kudos

Thanks dennis . i will try this and let you know. By the way the code you typed is in 7.0 version right. we are still using 3.x

dennis_scoville4
Active Contributor
0 Kudos

You're correct. The code that I typed is for BI 7.0.

Answers (1)

Answers (1)

Former Member
0 Kudos

dint work