Skip to Content
0
Former Member
Jun 09, 2011 at 09:36 AM

Routine in transformation

18 Views

Hallo experts,

i created an infoobject (ZCO_CMDT) like 0comp_code, but with an file uplaod, so that we can create textes in an excel, uplaod them into ZCO_CMDT. After this we load that 'custom-text' from ZCO_CMDT via a routine into 0comp_code. So we have in 0Comp_code the ERP text and the custom text. This works really fine.

But my problem ist, that i want to use the same text from ZCO_CMDT via routine in 0customer, when the customer ID is smaller than 10.000, but it doesn't work.

Please have a look on that routine:

$$ begin of 2nd part global - insert your code only below this line *

... "insert your code here

$$ end of 2nd part global - insert your code only before this line *

----


  • CLASS routine IMPLEMENTATION

----


*

----


CLASS lcl_transform IMPLEMENTATION.

METHOD compute_0txtmd.

  • IMPORTING

  • request type rsrequest

  • datapackid type rsdatapid

  • SOURCE_FIELDS-KUNNR TYPE C LENGTH 000010

  • SOURCE_FIELDS-TXTMD TYPE C LENGTH 000035

  • EXPORTING

  • RESULT type tys_TG_1-TXTMD

DATA:

monitor_rec TYPE rsmonitor.

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

... "insert your code here

*-- fill table "MONITOR" with values of structure "MONITOR_REC"

*- to make monitor entries

... "to cancel the update process

  • raise exception type CX_RSROUT_ABORT.

... "to skip a record

  • raise exception type CX_RSROUT_SKIP_RECORD.

... "to clear target fields

  • raise exception type CX_RSROUT_SKIP_VAL.

FIELD-SYMBOLS: <l_ref1> TYPE ANY.

DATA: lt_text TYPE STANDARD TABLE OF /bic/tzco_cmdt.

DATA: ls_text LIKE LINE OF lt_text.

DATA: /bic/zco_cmdt(10) TYPE n.

SELECT * FROM /bic/tzco_cmdt INTO ls_text WHERE /bic/zco_cmdt =

source_fields-kunnr.

ENDSELECT.

IF ( source_fields-kunnr LT 10000 ) .

ASSIGN ls_text-txtmd TO <l_ref1> .

ELSE.

ASSIGN source_fields-txtmd TO <l_ref1> .

ENDIF.

result = <l_ref1>.

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

ENDMETHOD. "compute_0TXTMD

The problem is that only the text is filled when the custommer ID is bigger than 10.000.

I'm not sure but I thin the problem that ZCO_CMDT has the type CHAR with a lenght of 4 und 0Customer is the same type, but a lenght of 10.

Can anybody help me crate the routine.