cancel
Showing results for 
Search instead for 
Did you mean: 

Transfer Routine in InfoObject General tab

Former Member
0 Kudos

Hello experts,

I need to write a transfer/conversion routine at InfoObject level. For example I need to concatenate something to the incoming data.

Is it possible to do at InfoObject Transfer Routine level? If yes, possibly some sample code please...

Thanks

Sri

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi srivani

Yes it is possible to write transfer routine at Infoobject level. Then it will be a global TR.

It will affect all the Infosources.

sample code to concatenate.

data: abcd type c(20).

abcd = 'abcdefg'.

conactenate "infoobject name" abcd into result.

Cheers

Shiva

Former Member
0 Kudos

Shiva,

I did similar to that, but when I check the syntax I am getting error. For example the InfoObject name is: Z_IO1

Here is the code:

data: z_ABC(18) type c.

concatenate Z_IO19(7) Z_IO116(2)

into z_ABC separated by '-'.

RESULT = Z_ABC.

When I Check the systax I am getting the following error:

"Z_IO1" is unknown. It is neither in one of the specified tables nor defined by a "DATA" statement. "DATA" statement.

Please let me know what I am missing..

Thanks

Sri

Former Member
0 Kudos

hi srivani

Use infoobject name as iobj_name.

Cheers

Shiva

Former Member
0 Kudos

Shiva,

I didnt get what you are saying. I see IOBJ_Name in Form Convert like below

FORM CONVERT_Z_IO1 USING RECORD_NO LIKE SY-TABIX

SOURCE_SYSTEM TYPE RSA_LOGSYS

IOBJ_NAME TYPE RSIOBJNM

Can you please explain me in more detail.

Thanks

Sri

Former Member
0 Kudos

Hi srivani

I am saying instead of Z_IO1 try using iobj_name.

Here is the code:

data: z_ABC(18) type c.

concatenate iobj_name9(7) iobj_name16(2)

into z_ABC separated by '-'.

RESULT = Z_ABC.

Cheers

Shiva

Former Member
0 Kudos

HI Sri

In the From you have a changing parameter

Result RESULT TYPE DE_Z_IO1

U have to use this result to do the manipulation

IOBJ_NAME TYPE RSIOBJNM this hold only the obj name not the value.

for example if U have a custom defined COSTCENTER lenth 13 instead of CHAR 10 as provided by standard SAP

suppose U want to append the sourse system ID to it to the valuse commping from R3 this example illustrates it.

PROGRAM CONVERSION_ROUTINE.

  • Type pools used by conversion program

TYPE-POOLS: RSD, RSARC, RSARR.

TYPES: DE_COSTC91(000013) TYPE C.

  • Conversion rule for InfoObject COSTC91

  • Data type = CHAR

  • ABAP type = C

  • ABAP length = 000013

FORM CONVERT_COSTC91

USING RECORD_NO LIKE SY-TABIX

SOURCE_SYSTEM TYPE RSA_LOGSYS

IOBJ_NAME TYPE RSIOBJNM

CHANGING RESULT TYPE DE_COSTC91 " InfoObject value

RETURNCODE LIKE SY-SUBRC.

$$ begin of routine - insert your code only below this line -

<b>shift RESULT right by 3 places.

RESULT(3) = SOURCE_SYSTEM.

RESULT = RESULT .

RETURNCODE = 0.</b>$$ end of routine - insert your code only before this line -

ENDFORM.

Hope it help U

Regards

AJAY

Former Member
0 Kudos

Hi Sri,

Is the routine going to be used in all the Infosources where the Info-object exists or only for partuclar datasurces. If it is for particular datasources then you can write the routine in the transfer rules for that datasource.

Bye

Dinesh

Former Member
0 Kudos

Dinesh,

The routine will be used whereever the infoObject is used. In Other words the routine has to be at InfoObject level, so that I dont need to duplicate the code in all the InfoSources.

Thanks

Sri