cancel
Showing results for 
Search instead for 
Did you mean: 

filtering random material types

Former Member
0 Kudos

Hii friends,

  

I did a read master data and got material type field from material. We have around 50 Materail type now client wants to see only 20 .I cant filter them at dtp as material type is not available in source.i can write a routine and filter them manually but i was told that we create ranges in transformations and filter those material type which are not recquired ..plz explain me how to create ranges for material types as they are random.

Accepted Solutions (0)

Answers (2)

Answers (2)

ccc_ccc
Active Contributor
0 Kudos

Hi Ramarao,

If I understand your requirement correctly here is the procedure to filter material types randomly.

  1. Create one one customer table at SE11 with below fields let say table name ZMAT_EX_RANGE-->(Exclude Values)
FIELDDATAELEMENT
IOBJNMRSIOBJNM
SIGNRALDB_SIGN
OPTRSZ_OPERATOR
LOWRSCHAVL
HIGHRSCHAVL

  1. Take permission from BASIS team to provide authorization to maintain values for this table like to enter material type value values for excluding
  2. And maintain values
  3. In DTP for material type infoobject write ROUTINE to read values from ZMAT_EX_RANGE and fill the RANGE table values. as like below


   l_t_range-fieldname = 'MAT_TYPE'.

   l_t_range-low = 'MAT_TYPE01'.

   l_t_range-low = 'MAT_TYPE10'.

   l_t_range-option = 'BT'.

   l_t_range-option = 'E'. E --> Exclude, I-Include

   APPEND l_t_range.

Please do like this.

you may find more information on google about this.

Thank you,

Nanda

Former Member
0 Kudos

Hi Nanda,

Thanks a ton for the response. This was what I was expecting.  Lets take Storage location instead of material type.

Let me tell what I have understood and please clear my doubts as I am new to this procedure. My doubt is written in Bold.

1) I need to filter this infoobject ZSTORAGELOC which is an attribute of material and which I have loaded to target via Read master data. So I have to create a table say ZSTORAGE_EX_RANGE in se11 and add these values.

Field                 Dataelement

IOBJNAME         RSIOBJNM

SIGN                       RALDB_SIGN

OPT                        RSZ_OPERATOR

LOW                         RSCHAVL

HIGH                       RSCHAVL

I will add values like this.

Field                 Data Element

ZSTORAGELOC      /BIC/OIZSTORAGELOC

SIGN                       (What should I fill here as storage locations are random)

OPT                       E

LOW                        .......( Iam having a doubt here what should I fill, as STORAGE LOCATIONS are random and they cannot be filled in low and high as they are not in row and even I cannot use a BT operator also.)

High                       .......

Thanks

Karthik

former_member185132
Active Contributor
0 Kudos

Is this a real actual business requirement? Why would anybody want to see random storage locations in a report? How would they make sense of a report that contains randomly chosen storage locations?

I'm getting the feeling that this is a requirement that needs to be clarified.

ccc_ccc
Active Contributor
0 Kudos

Create Table in SE11


Table Tech Name  : ZSTORAGE_EX_RANGE

FieldData element
IOBJNAMERSIOBJNM
SIGNRALDB_SIGN
OPTRSZ_OPERATOR
LOWRSCHAVL
HIGHRSCHAVL

Values in table

FieldValue
IOBJNAMEZSTORAGELOC
SIGNE (Exclude),
OPTEQ
LOWSTOR1,
HIGH

In above table,  i just entered one record i.e STOR1 which is going to be read in DTP routine and exclude because SING is E(exclude) I(include).

Thank you,

Nanda

Former Member
0 Kudos

Nanda,

Thanks a lot for the response. So i will be adding as many storage locations required in the table and read them in the DTP that table right?

           If possible can you just tell me the sample code required for the situation after adding the values in the se11 table so that it will be a very good learning for me regarding this as i've never worked on filter routines. I searched in net and found something but i am not sure about them.

Thanks,

Karthik

ccc_ccc
Active Contributor
0 Kudos

   *Table declaration

data: t_ stor_RANGE  type STANDARD TABLE OF ZSTORAGE_EX_RANGE .

*Work areas Declaration

  data:wa_stor_range   type ZSTORAGE_EX_RANGE .

select * into table t_stor_range  from

ZSTORAGE_EX_RANGE   where IOBJNAME = 'your infoobject"

loop at t_stor_range  into wa_stor_range .

l_t_range-FIELDNAME = 'your infoobject'.

l_t_range-SIGN = wa_stor_range-sign.

l_t_range-OPTION = wa_stor_range-opt.

l_t_range-LOW = wa_stor_range-opt-LOW.

append l_t_range.

endloop.



Please change code as per your requirement.


Thank you,

Nanda


Former Member
0 Kudos

Thanks Nanda,

    One last doubt.

1) So if i have 10 storage locations to be excluded, then I have to write this 10 times  like this?

2) And as i am getting this storage location as read master data, i cannot write this code in dtp as this field will not be available at datasource level. So can i write the same code in Transformations (reading from that se11 table) . Sorry if i am asking you a lot of doubts on this. Just want to clear this out.

l_t_range-FIELDNAME = 'ZSTORLOC'.

l_t_range-SIGN = wa_stor_range-E.

l_t_range-OPTION = wa_stor_range-EQ.

l_t_range-LOW = wa_stor_range-opt-STOR1.

append l_t_range.



l_t_range-FIELDNAME = 'ZSTORLOC'.

l_t_range-SIGN = wa_stor_range-E.

l_t_range-OPTION = wa_stor_range-EQ.

l_t_range-LOW = wa_stor_range-opt-STOR5.

append l_t_range.


l_t_range-FIELDNAME = 'ZSTORLOC'.

l_t_range-SIGN = wa_stor_range-E.

l_t_range-OPTION = wa_stor_range-EQ.

l_t_range-LOW = wa_stor_range-opt-STOR9.

append l_t_range.

Thanks,

Ramararo

ccc_ccc
Active Contributor
0 Kudos

Hi Ramarao,

It seems requirement is not much clear.

Could you please let me know what are you doing after reading storage locations from "Read master data option"

Please explain in detail your requirement, the above code which you written is not correct.

Thank you,

Nanda

Former Member
0 Kudos

Hi Nanda,

Sorry for the late response. I was out on Leave.

We have around 50 Storage locations and client wants to see only 10 as of now. The storage location is coming to my target as read master data. So i can filter those storage locations only through Endroutine and when i am trying to hardcode it with the Storage location id's, my TL asked me to do it in the above fashion that you said by creating the storage location values in se11 custom table and appending those values in our internal table. I am not sure how to do it that way. I hope you got the issue here.

Thanks,

Ramarao.

ccc_ccc
Active Contributor
0 Kudos

Hi Ramarao,

  1. Follow same steps for creating table in SE11
  2. In END ROUTINE : create internal table(range table) similar to table (which is created in step 1) and read values
  3. Delete entries in RESULT_PACKAGE by comparing storage location.

Regards

Nanda

Former Member
0 Kudos

So Nanda, do we need to create 10 range tables as i need 10 storage locations out of 30? and those storage locations are random. Is it possible if you give me a code for this to write it in endroutine? Please dont mind if i am bothering you. I am learning this wayout to do this.

Thanks,

Ramarao.

former_member223480
Active Contributor
0 Kudos

Hi there

Is not very clear what you are looking for, who told you that you can create ranges in transformations a BW consultant? You have to clear that. In routine you can do it.

The only range i can think about is to use DTP filter for material.

If you have material types to specific range of material numbers then you can do that.

Thank you

Yiannis

Former Member
0 Kudos

Hi Yiannis,

I was told to create table types with 'Sign'  'option'  'low'  'high' and move the material types into those internal tables refering that table type and append. I dont know anything about this process. All i know is we can delete the result-package with some criteria. Please put some light into this. How to delete random material types other than deleting the result-package. Mainly using this procedure.

Thanks,

Karthik.

former_member223480
Active Contributor
0 Kudos

ok

But as i understand that has to be done with coding, i cannot think any other solution.

To create and read a table without abap is not possible.

So you want to achieve the update with a different abap method or without coding at all?

BW is an open system and you can achieve the same update with many different ways, if you want to use a specific way the person who told you that, he must give you more information.

Thank you

Yiannis