cancel
Showing results for 
Search instead for 
Did you mean: 

BW transformation routine to filter data

Former Member
0 Kudos

Hi,

I need to load data to DSO from Sales Document (attributes) where PO number from sales starts with either 0002* or 2* and I have created a filter on DTP for PO Number from sales for value 0002*.

this filter on DTP is working fine but the only problem is that it ignores all the PO number which does not have prefix 000.  maximum lenght of the PO number is 13 and if the 000 are there then it is ok but user puts different combination of PO numbers like below

2000000000-re

211-steam Br

2111111111-WE

due to this my DSO activation fails.

How do I make sure that if the PO number starts from 2* then it also gets updated to the dso but without invalid characters.

e.g from above PO order 2000000000-re then we should only transfer 2000000000

                         PO order 2111111111-WE  then only transfer 2111111111

and we should ignore 211-steam Br

I do not have a ABAP knowlege so any help is appreciated.

regards,

Dar Vad

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi All

thank you for your responses.

I tried different solution and it worked.

1st i put 2 ranges in DTP filter as below

000200000000 to 299999999999

200000000000 to 299999999999

and then I created a field level routine to convert source data from lower case to upper case and it worked.

thanks again for your valuable input.

regards,

Dar

Loed
Active Contributor
0 Kudos

Hi,

That's good..You may now close your thread by clicking the CORRECT ANSWER..

Regards,

Loed

Answers (3)

Answers (3)

former_member186445
Active Contributor
0 Kudos

just out of curiosity: if users put things like

2000000000-re

211-steam Br

2111111111-WE

as po number in their system, you would suppose that's what they would like to see in a report, no?

so basically this is a case of bull***t in --> bull***t out.

swati_gawade
Contributor
0 Kudos

Hi Dar,

i think the characters coming at the end of the string are incorrect and this needs to be fixed at source system itself.

but if its not possible to fix at source then, you will need to modify the PO no's in your start routine.

the pseudo logic for your code can be as follows.

loop at source_package assigning <source_fields>.

IF <source-fields>-Po_number CN '-'.

Clear: string1, string2.

split <source-fields>-Po_number at '-' into string1 and staring 2.

<source-fields>-Po_number = string1.

Endif.

Endloop.

Hope this helps.

-Swati.

Former Member
0 Kudos

Hi Swati,

thank you for your reply, I will check this and come back to you.

regards,

Dar

RafkeMagic
Active Contributor
0 Kudos

you "assume" here that the non-numerical PO numbers always have a '-' in them...

Loed
Active Contributor
0 Kudos

Hi,

Can you verify the statement of Raf below? Because the code Swati will ONLY work if the separator of numbers and characters is really "-"..

Regards,

Loed

Former Member
0 Kudos

Hi Raf,

you are correct code is not working properly.

any suggestions

thanks,

Dar

Former Member
0 Kudos

Hi Swati,

code is not working properly as there are document numbers without '-'

any futher suggestions?

thanks,

RafkeMagic
Active Contributor
0 Kudos

you'll need to work with 'CO', SY-FDPOS & '0123456789'

swati_gawade
Contributor
0 Kudos

Hi Dar,

For this to work them you will have to create condition for all the characters that apear in your input field or else you can try this. Define your target object as NUMC for NUMC shall only allow numeric characters and not others.

Try this and let me knoe if it works.

Hope this helps.

-Swati.

former_member186445
Active Contributor
0 Kudos

you need to this in a start routine. pretty sure you can't get it merely with a dtp filter.

search the net for examples of start routines. there are plenty. and you requirements are not that complicated, should be feasible

M..