Skip to Content
-1

Line structure of table s_werks is incorrect



FORM extraction  USING ut_werks1 TYPE tt_werks1

                       ut_werks2 type tt_werks2

                       ut_werks3 type tt_werks3

                       ut_werks4 type tt_werks4

                       ut_werks5 type tt_werks5

                       ut_werks6 type tt_werks6

                        ut_konh type tt_konh

                       ut_konp type tt_konp.





IF pa_A800 IS NOT INITIAL. "A800 table

    SELECT

        A800~mandt,

        A800~kappl,

        A800~kschl,

        A800~werks,

        A800~matnr,

        A800~DATBI,

         A800~DATAB,

        A800~KNUMH

      FROM A800

      left OUTER JOIN KONH

      ON KONH~Knumh = A800~Knumh



      INTO TABLE @DATA(lt_plants)

      FOR ALL ENTRIES IN @ut_werks1

      Where A800~werks in @s_werks.





      GET REFERENCE OF lt_plants INTO lr_data.

       PERFORM download USING lr_data



               ENDIF.

I am taking condition type based on plant from A800 and putting in KONH.
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    Dec 12, 2017 at 08:18 AM

    So the next thing you should check is if there really is a WERKS field in your A800 table. There is not in my system.

    Secondly, if there is, check wich datatype that is.

    The thing is that the data type WERKS is a structure. WERKS_D is the data element for the plant. It is commented out in your example code here, but you have declared lv_werks as WERKS, which will give precisely the error message that "The line structure of ... is incorrect".

    Add comment
    10|10000 characters needed characters exceeded

  • Dec 11, 2017 at 06:36 AM

    Can you show us the declaration of s_werks? What is the datatype?

    Also, you are using FOR ALL ENTRIES IN @ut_werks1, but that one is incomplete without comparing with at least one of the columns in ut_werks1. (also make sure there are entries in that internal table before selecting)

    Add comment
    10|10000 characters needed characters exceeded

    • Hi Jörgen, I did the changes like below and now it is showing the same line structure of the table s_werks

      IF pa_A800 IS NOT INITIAL.
      SELECT
      KONH~mandt,
      KONH~KNUMH

      INTO TABLE @DATA(lt_plants)
      FROM A800
      left JOIN KONH
      ON KONH~Knumh = A800~Knumh

      FOR ALL ENTRIES IN @ut_werks1
      WHERE A800~werks EQ @ut_werks1-werks+0(4)
      and a800~werks in @s_werks.

  • Dec 12, 2017 at 06:10 AM
    I did it as below,
    DATA:
    
    *      a800_werks TYPE a800-werks,
    
          lv_werks type werks,
    
          lr_data  TYPE REF TO data.
    
    TABLES : A800.
    
    SELECT-OPTIONS :s_werks for a800-werks.
    
    
    select MANDT, KNUMH
    INTO TABLE @DATA(lt_plants)
    
          FROM A800
    
       left JOIN KONH
    
          ON KONH~Knumh = A800~Knumh
    
    FOR ALL ENTRIES IN @ut_werks1
    
    WHERE A800~werks EQ @ut_werks1-werks+0(4)
    
      and A800~werks in @s_werks.
    Add comment
    10|10000 characters needed characters exceeded