cancel
Showing results for 
Search instead for 
Did you mean: 

Conversion Routine... plz help

Former Member
0 Kudos

Dear Gurus,

There is a text field in R3 called as SGTXT related to some finance table... some of the records in this field directly start with '#' character and then the details.. Well here is the problem.. I m loading to ODS 0FIAR_O04 and it ends up in error due to the above mentioned problem.. the infoobject which carry the data from SGTXT field is 0POSTXT...

I decided to go for a conversion routive in transfer rule for this field.. but i dont know how to write routines.. can you plz help me with the steps as well as the code to remove '#' from SGTXT.... Thanks.

For more help i m attaching the conversion routine with is automatically generated by system... only i hv to add code to remove '#' character... kindly go thru it and suggest me where to add and what to add...

here it is

PROGRAM CONVERSION_ROUTINE.

Type pools used by conversion program

TYPE-POOLS: RS, RSARC, RSARR, SBIWA, RSSM.

Declaration of transfer structure (selected fields only)

TYPES: BEGIN OF TRANSFER_STRUCTURE ,

InfoObject 0POSTXT: CHAR - 000050

SGTXT(000050) TYPE C,

END OF TRANSFER_STRUCTURE .

Global code used by conversion rules

$$ begin of global - insert your declaration only below this line -

TABLES: ...

DATA: ...

$$ end of global - insert your declaration only before this line -

-


FORM COMPUTE_POSTXT

-


Compute value of InfoObject 0POSTXT

in communication structure /BIC/CS0FI_AR_4

*

Technical properties:

field name = POSTXT

data element = /BI0/OIPOSTXT

data type = CHAR

length = 000060

decimals = 000000

ABAP type = C

ABAP length = 000120

reference field =

-


Parameters:

--> RECORD_NO Record number

--> TRAN_STRUCTURE Transfer structure

<-- RESULT Return value of InfoObject

<-> G_T_ERRORLOG Error log

<-- RETURNCODE Return code (to skip one record)

<-- ABORT Abort code (to skip whole data package)

-


FORM COMPUTE_POSTXT

USING RECORD_NO LIKE SY-TABIX

TRAN_STRUCTURE TYPE TRANSFER_STRUCTURE

G_S_MINFO TYPE RSSM_S_MINFO

CHANGING RESULT TYPE /BI0/OIPOSTXT

G_T_ERRORLOG TYPE rssm_t_errorlog_int

RETURNCODE LIKE SY-SUBRC

ABORT LIKE SY-SUBRC. "set ABORT 0 to cancel datapackage

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

DATA: l_s_errorlog TYPE rssm_s_errorlog_int.

RESULT = .

returncode 0 means skip this record

RETURNCODE = 0.

abort 0 means skip whole data package !!!

ABORT = 0.

$$ end of routine - insert your code only before this line -

ENDFORM.

-


FORM INVERT_POSTXT

-


Inversion of selection criteria for InfoObject 0POSTXT

*

This subroutine needs to be implemented only for SAP RemoteCubes

(for better performance) and for the Report/Report Interface

(drill through).

*

-


--> I_RT_CHAVL_CS Ranges table for current InfoObject

--> I_THX_SELECTION_CS Selection criteria for all other InfoObjects

<-- C_T_SELECTION Selection criteria for fields of

transfer structure

<-- E_EXACT Flag: Inversion was exact

-


FORM INVERT_POSTXT

USING I_RT_CHAVL_CS TYPE RSARC_RT_CHAVL

I_THX_SELECTION_CS TYPE RSARC_THX_SELCS

CHANGING C_T_SELECTION TYPE SBIWA_T_SELECT

E_EXACT TYPE RS_BOOL.

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

DATA:

L_S_SELECTION LIKE LINE OF C_T_SELECTION.

An empty selection means all values

CLEAR C_T_SELECTION.

L_S_SELECTION-FIELDNM = 'SGTXT'.

...

Selection of all values may be not exact

E_EXACT = RS_C_FALSE.

$$ end of inverse routine - insert your code only before this line -

ENDFORM.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

use the following:

result = tran_structure-sgtxt.

shift result left deleting leading '#' in character mode.

That should do the job.

regards

Siggi

Answers (1)

Answers (1)

Former Member
0 Kudos

It has been solved.. thanks everyone for inputs.. points awarded to concerened.. thanks.