Skip to Content
avatar image
Former Member

ABAP code in transformation

Hello,

I have a transformation routine as follows:

DATA:l_lifnr1 TYPE /BI0/MBATCH-VENDOR,

l_greybatch TYPE /BI0/MBATCH-BATCH,

oref TYPE REF TO cx_root,

l_num type i,

l_len type i,

l_len1(2) type c.

l_len = strlen( SOURCE_FIELDS-/BIC/ZBAT_SUP ).

l_len1 = ( l_len - 1 ).

try.

concatenate SOURCE_FIELDS-/BIC/ZBAT_SUP+0(l_len1) 'G' into

l_greybatch.

catch CX_SY_CONVERSION_NO_NUMBER INTO oref.

ENDTRY.

=============

this transformation is between a infosource and infoobject. When i run the DTP, it gives an error at the line "concatenate SOURCE_FIELDS-/BIC/ZBAT_SUP+0(l_len1) 'G' into l_greybatch."

This -/BIC/ZBAT_SUP is calculated using a routine in the transformation between the datasource and the infosource. The same DTP is used for both load across both these transformations.

what is wrong? any suggestions?

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    avatar image
    Former Member
    Aug 16, 2007 at 12:16 PM

    What error are you given ?

    You can replace with :

    move SOURCE_FIELDS-/BIC/ZBAT_SUP(l_len1) to l_greybatch.
    move 'G' to l_greybatch+l_len1(1).

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 16, 2007 at 01:27 PM

    Hi,

    check if -/BIC/ZBAT_SUP is already filled, may be you need to implement the logic for filling it here too. Additionally you might do it like this:

    if l_len1 > 0.

    concatenate.....

    endif.

    regards

    Siggi

    Add comment
    10|10000 characters needed characters exceeded