Skip to Content
author's profile photo
Former Member

getting error when creating internal table

hi i m creating internal table giving erro like 'VBELN' must be flat structure.

DATA: BEGIN OF INT_VBAK,

VBELN LIKE VBELN-VBAK,

AUDAT LIKE AUDAT-VBAK,

KWMENGE LIKE KWMENGE-VBAP,

ARKTX LIKE ARKTX-VBAP,

WERKS LIKE WERKS-VBAP,

LFIMG LIKE LFIMG-VBAP.

END OF INT_VBAK.

thanks .

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

11 Answers

  • author's profile photo
    Former Member
    Posted on Aug 23, 2007 at 10:40 AM

    hi,

    put comma here.

    DATA: BEGIN OF INT_VBAK,

    VBELN LIKE VBAK-VBELN,

    AUDAT LIKE VBAK-AUDAT,

    KWMENGE LIKE VBAP-KWMENGE,

    ARKTX LIKE VBAP-ARKTX,

    WERKS LIKE VBAP-WERKS,

    LFIMG LIKE VBAP-LFIMG,

    END OF INT_VBAK.

    regards

    Azad.

    reward if helpful.

    Message was edited by:

    Azad

    Add comment
    10|10000 characters needed characters exceeded

  • Posted on Aug 23, 2007 at 10:41 AM

    Hii Laxman..

    DATA: BEGIN OF INT_VBAK,

    VBELN LIKE VBELN-VBAK,

    AUDAT LIKE AUDAT-VBAK,

    KWMENGE LIKE KWMENGE-VBAP,

    ARKTX LIKE ARKTX-VBAP,

    WERKS LIKE WERKS-VBAP,

    LFIMG LIKE LFIMG-VBAP.

    END OF INT_VBAK.

    This is Not itab declaration.. it will only Create a work area.

    So Declare like this

    DATA: BEGIN OF INT_VBAK <b>occurs 100,</b>

    VBELN LIKE VBELN-VBAK,

    AUDAT LIKE AUDAT-VBAK,

    KWMENGE LIKE KWMENGE-VBAP,

    ARKTX LIKE ARKTX-VBAP,

    WERKS LIKE WERKS-VBAP,

    LFIMG LIKE LFIMG-VBAP.

    END OF INT_VBAK.

    or

    DATA: BEGIN OF ST_VBAK ,

    VBELN LIKE VBELN-VBAK,

    AUDAT LIKE AUDAT-VBAK,

    KWMENGE LIKE KWMENGE-VBAP,

    ARKTX LIKE ARKTX-VBAP,

    WERKS LIKE WERKS-VBAP,

    LFIMG LIKE LFIMG-VBAP.

    END OF ST_VBAK.

    DATA : INT_VBAK LIKE TABLE OF ST_VBAK.

    Then it works.

    <b>Reward if Helpful</b>

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Posted on Aug 23, 2007 at 10:42 AM

    hi,

    declare like this,

    DATA: BEGIN OF INT_VBAK,

    VBELN LIKE VBAK-VBELN,

    AUDAT LIKE VBAK-AUDAT,

    KWMENGE LIKE VBAP-KWMENGE,

    ARKTX LIKE VBAP-ARKTX,

    WERKS LIKE VBAP-WERKS,

    LFIMG LIKE VBAP-LFIMG,

    END OF INT_VBAK.

    rEGARDS

    aZAD.

    reward if helpful.

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Posted on Aug 23, 2007 at 10:42 AM

    DATA: BEGIN OF INT_VBAK,

    VBELN LIKE VBAK-vbeln,

    AUDAT LIKE VBAK-audat,

    KWMENGE LIKE VBAP-kwmenge,

    ARKTX LIKE VBAP-arktx,

    WERKS LIKE VBAP-werks,

    LFIMG LIKE vbap-lFIMG,

    END OF INT_VBAK.

    Message was edited by:

    Rajesh

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Posted on Aug 23, 2007 at 10:52 AM

    Hi,

    Put comma instead of period on statement "LFIMG LIKE LFIMG-VBAP.".check the below code.

    DATA: BEGIN OF INT_VBAK occurs 0,

    VBELN LIKE VBELN-VBAK,

    AUDAT LIKE AUDAT-VBAK,

    KWMENGE LIKE KWMENGE-VBAP,

    ARKTX LIKE ARKTX-VBAP,

    WERKS LIKE WERKS-VBAP,

    LFIMG LIKE LFIMG-VBAP,

    END OF INT_VBAK.

    Regards,

    Nagaraj

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Posted on Aug 23, 2007 at 10:52 AM

    Use TYPES and DATA.

    TYPES:

    BEGIN OF typ_int_vbak,

    vbeln TYPE vbeln,

    audat TYPE audat,

    kwmenge TYPE kwmeng,

    arktx TYPE arktx,

    werks TYPE werks,

    lfimg TYPE lfimg,

    END OF typ_int_vbak.

    TYPES:

    typ_int_vbak_tab TYPE STANDARD TABLE OF typ_int_vbak WITH DEFAULT KEY.

    DATA:

    int_vbak TYPE typ_int_vbak_tab,

    wa_vbak TYPE typ_int_vbak.

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Posted on Aug 23, 2007 at 10:54 AM

    KWMENGE is wrong, use KWMENG

    😊

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Posted on Aug 23, 2007 at 10:56 AM

    Hi,

    DATA: BEGIN OF INT_VBAK,

    VBELN LIKE VBELN-VBAK,

    AUDAT LIKE AUDAT-VBAK,

    KWMENGE LIKE KWMENGE-VBAP,

    ARKTX LIKE ARKTX-VBAP,

    WERKS LIKE WERKS-VBAP,

    LFIMG LIKE LFIMG-VBAP.

    END OF INT_VBAK.

    In fact this declaration is not false however just a comma causes the error and the comma must just come before the end of...like the following:

    DATA: BEGIN OF INT_VBAK,

    VBELN LIKE VBELN-VBAK,

    AUDAT LIKE AUDAT-VBAK,

    KWMENGE LIKE KWMENGE-VBAP,

    ARKTX LIKE ARKTX-VBAP,

    WERKS LIKE WERKS-VBAP,

    LFIMG LIKE LFIMG-VBAP<b>,</b>

    END OF INT_VBAK.

    Hope helps.

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Posted on Aug 23, 2007 at 11:20 AM

    Hi Laxman,

    Here the data declaration is wrong :

    you have interchanged vbeln n vbak , audat n vbak and so on ...

    DATA: BEGIN OF INT_VBAK,

    VBELN LIKE VBELN-VBAK,

    AUDAT LIKE AUDAT-VBAK,

    KWMENGE LIKE KWMENGE-VBAP,

    ARKTX LIKE ARKTX-VBAP,

    WERKS LIKE WERKS-VBAP,

    LFIMG LIKE LFIMG-VBAP.

    END OF INT_VBAK.

    change the above code to this code :

    DATA: BEGIN OF INT_VBAK,

    VBELN LIKE VBAK-VBELN,

    AUDAT LIKE VBAK-AUDAT,

    KWMENGE LIKE VBAP-KWMENGE,

    ARKTX LIKE VBAP-ARKTX,

    WERKS LIKE VBAP-WERKS,

    LFIMG LIKE VBAP-LFIMG.

    END OF INT_VBAK.

    Happy coding 😊

    Regards,

    SJ

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Posted on Aug 23, 2007 at 11:33 AM

    Hi,

    You are making mistake in writing.

    Ex. VBELN LIKE VBELN-VBAK

    should be vbeln like vbak-vbenn

    correct all fields like this.

    Add comment
    10|10000 characters needed characters exceeded