cancel
Showing results for 
Search instead for 
Did you mean: 

Transformation Routine ABAP logic

Former Member
0 Kudos

Hi,

I am load data from a flatfile to BW.One of the field in flat file is Char 30  and free text.

In BW Transformation based conditions on the Free Text I need to populate another field as I am not expert in ABAP what is the logic I should use in the routine

In source field = *INVOICE* or *Invoice* or *invoice* then target field should be ‘I’

Thanks

Accepted Solutions (0)

Answers (2)

Answers (2)

RafkeMagic
Active Contributor
0 Kudos

IF   <source_field> CP '*INVOICE*'

OR <source_field> CP '*Invoice*'

OR <source_field> CP '*invoice*'.

    <target_field> = 'I'.

ENDIF.

Former Member
0 Kudos

Hi,

You can use BW Formula as LEFT(Source system field, 1) , it will pick the first character from the left. try this option also.

Thanks and Regards,

Mahesh

Former Member
0 Kudos

Thanks for the update.

Formula won't help me as Its not left chars or right chars we are looking for Invoice...It might be any where in the 30 Char free text.


Former Member
0 Kudos

Hi,

Try as below,

Result = <Source_Fields>-Invoice + 0(10) like this

Meaning it will read Invoice Field starting from first character to 10 characters. Please modify the code how much length you require.For example the above code can use to bring 3rd to 21 characters also +3(18) like that.

Thanks and Regards,

Mahesh

Former Member
0 Kudos

Hi SAP User,

I think as per your reuqirement you will have to do couple of things here:

1. Translate your source field to Uppercase.

2. Search for the string INVOICE

if yes then assign 'I' to result.

In code it could look like: (just an example)

----------------------------------------------------------------------

DATA: sf TYPE c LENGTH 30.

data: result TYPE c.

sf = 'asdfjinveoicekasdog134895'.

TRANSLATE sf TO UPPER CASE.

IF sf CS 'INVOICE'.

result = 'I'.

ENDIF.

----------------------------------------------------------------------

Thanks

Amit