Skip to Content

For all entries in ITAB - length mismatch

Hi All,

I want to map two fields of cost center in the transformation and need to delete the leading 0s too.

When I map these fields and write start routine to fetch data in the internal table, I get the following error.

"E:When you use the addition "FOR ALL ENTRIES IN itab", the fields "COSTCENTER" and "SOURCE_PACKAGE-/BIC/JBUSINESS" must have the same type and the same length."

Below is my code:

TYPES : BEGIN OF ST_BUC,

/BIC/JBUSINESS TYPE /BIC/OIJBUSINESS,

END OF ST_BUC.

DATA : ITAB_CCTR TYPE STANDARD TABLE OF /BI0/MCOSTCENTER,

WA_CCTR TYPE /BI0/MCOSTCENTER.

DATA : ITAB_BUC TYPE STANDARD TABLE OF ST_BUC,

WA_BUC TYPE ST_BUC.

IF SOURCE_PACKAGE IS NOT INITIAL.

REFRESH ITAB_CCTR.

REFRESH ITAB_BUC.

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'

EXPORTING INPUT = WA_BUC

IMPORTING OUTPUT = WA_BUC.

SELECT * FROM /BI0/MCOSTCENTER INTO TABLE ITAB_CCTR

FOR ALL ENTRIES IN SOURCE_PACKAGE

WHERE COSTCENTER = SOURCE_PACKAGE-/BIC/JBUSINESS.

SORT ITAB_CCTR BY COSTCENTER. ENDIF.

here, 0costcenter = 10 and jbusiness = 12.

I referred other threads. But couldn't find a solution to my problem.

Please let me know how to fix this issue.

Add comment
10|10000 characters needed characters exceeded

  • Hi,

    you declared internal table as

    DATA : ITAB_CCTR TYPE STANDARD TABLE OF /BI0/MCOSTCENTER,

    instead of this, define required fields under structure for ITAB_CCTR. and then define 0costcenter as:

    0costcenter type CHAR12.

    Hope it may resolve your problem.

    Regards,

    Bhupendra

  • Get RSS Feed

1 Answer

  • Best Answer
    Mar 25 at 07:10 AM

    you need to make sure that the fields in the where clause have the same type/lenght. Else you'll get an error message.

    M.

    Add comment
    10|10000 characters needed characters exceeded