cancel
Showing results for 
Search instead for 
Did you mean: 

Error in End Routine

erdem_sephanelioglu
Participant
0 Kudos

Hello Everybody,

Below-written code has generating error like "E:"L_T_UCPREMISE" is a table without a header line and therefore has no component called "UC_POD"", which i am no sure the underlying error.

DATA: l_t_result_package LIKE result_package,

           l_s_result_package LIKE LINE OF l_t_result_package.

     TYPES: BEGIN OF ltype_work_area,

       ucinstalla  TYPE /bi0/oiucinstalla,

       ucpremise TYPE /bi0/oiucpremise,

       uc_connobj TYPE /bi0/oiuc_connobj,

       postcd_gis TYPE /bi0/oipostcd_gis,

       uc_pod_ext TYPE /bi0/oiuc_pod_ext,

       END OF ltype_work_area.

*    DATA: ls_work_area LIKE ltype_work_area,

           Data:

           l_t_ucinstalla type table of /bi0/pucinstalla,

           l_t_ucpremise type table of /bi0/pucpremise,

           l_t_uc_connobj type table of /bi0/puc_connobj,

           l_t_uc_pod type table of /bi0/muc_pod.

     DATA: l_s_ucinstalla LIKE LINE OF l_t_ucinstalla,

           l_s_ucpremise LIKE LINE OF l_t_ucpremise,

           l_s_uc_connobj LIKE LINE OF l_t_uc_connobj,

           l_s_uc_pod LIKE LINE OF l_t_uc_pod.

     SELECT * FROM /bi0/pucinstalla

       INTO CORRESPONDING FIELDS OF TABLE l_t_ucinstalla

       FOR ALL ENTRIES IN result_package

           WHERE ucinstalla result_package-ucinstalla

           AND objvers = 'A'

           AND soursystem = 'L1'.

     SELECT * FROM /bi0/mucpremise

      INTO CORRESPONDING FIELDS OF TABLE l_t_ucpremise

      FOR ALL ENTRIES IN result_package

          WHERE ucpremise = l_t_ucpremise-uc_pod

          AND objvers = 'A'

          AND soursystem = 'L1'.

     SELECT * FROM /bi0/puc_connobj

       INTO CORRESPONDING FIELDS OF TABLE l_t_uc_connobj

       FOR ALL ENTRIES IN result_package

           WHERE uc_connobj = l_t_uc_connobj-uc_connobj

           AND objvers = 'A'

           AND soursystem = 'L1'.

     SELECT * FROM /bi0/muc_pod

     INTO CORRESPONDING FIELDS OF TABLE l_t_uc_pod

     FOR ALL ENTRIES IN result_package

         WHERE uc_pod = l_t_uc_pod-uc_pod

         AND objvers = 'A'

         AND soursystem = 'L1'.

     LOOP AT l_t_result_package INTO l_s_result_package.

       READ TABLE l_t_ucinstalla WITH KEY

        ucinstalla = l_s_result_package-ucpinstalla

        soursystem = 'L1'

        objvers = 'A'.

       READ TABLE l_t_ucpremise WITH KEY

        ucpremise = l_s_result_package-ucpremise

        soursystem = 'L1'

        objvers = 'A'.

       READ TABLE l_t_uc_connobj WITH KEY

        uc_connobj = l_s_result_package-uc_connobj

        soursystem = 'L1'

        objvers = 'A'.

       READ TABLE l_t_uc_pod WITH KEY

        uc_pod = l_s_result_package-uc_pod

        soursystem = 'L1'

        objvers = 'A'.

       IF sy-subrc EQ 0.

         l_s_result_package-uc_installa = l_s_uc_istalla-uc_installa.

         l_s_result_package-uc_connobj = l_s_uc_connobj-uc_connobj.

         l_s_result_package-postcd_gis = l_s_uc_connobj-postcd_gis.

         l_s_result_package-uc_pod_ext = l_s_uc_pod-uc_pod_ext.

         APPEND l_s_result_package TO result_package.

       ENDLOOP.



I would kindly request your help on the relevant correction on the syntax.


Regards.


Eddy

Accepted Solutions (1)

Accepted Solutions (1)

karthik_vasudevan
Active Contributor
0 Kudos

Hi Eddy

In you below code, you should use result package instead of the internal table.

     SELECT * FROM /bi0/mucpremise

      INTO CORRESPONDING FIELDS OF TABLE l_t_ucpremise

      FOR ALL ENTRIES IN result_package

          WHERE ucpremise = result_package-uc_pod

          AND objvers = 'A'

          AND soursystem = 'L1'.

Try and let us know if it works.

Loed
Active Contributor
0 Kudos

Hi,

You may also do the same for the following SELECT statements which will also cause same error..

      SELECT * FROM /bi0/puc_connobj

       INTO CORRESPONDING FIELDS OF TABLE l_t_uc_connobj

       FOR ALL ENTRIES IN result_package

           WHERE uc_connobj = RESULT_PACKAGE-uc_connobj

           AND objvers = 'A'

           AND soursystem = 'L1'.

     SELECT * FROM /bi0/muc_pod

     INTO CORRESPONDING FIELDS OF TABLE l_t_uc_pod

     FOR ALL ENTRIES IN result_package

         WHERE uc_pod = RESULT_PACKAGE-uc_pod

         AND objvers = 'A'

         AND soursystem = 'L1'.

Regards,

Loed

former_member183519
Contributor
0 Kudos

Hello Eddy,

In addition to kartik's replay, you can optimize ur code using:

1) use required fields instead  of Select *

2) Use Field Symbol instead of Work area

3) Use Binary Search with Read table statement (make sure table should be sorted based )

Regards,

Hitesh

Answers (1)

Answers (1)

erdem_sephanelioglu
Participant
0 Kudos

Hello everybody,

As you mentioned right, those code parts should be replaced with RESULT_PACKAGE.

However I am receiving further below error for the same code.

I would like to ask for your little help.

E:Specify either "INTO wa", "ASSIGNING", "REFERENCE INTO", or "TRANSPORTING NO FIELDS" addition

Thanks

Regards.

Eddy

karthik_vasudevan
Active Contributor
0 Kudos

Hi Eddy

The error message is referred to your read table.

It should be assigned to a work area.

       READ TABLE l_t_ucinstalla INTO l_t_ucinstalla WITH KEY

        ucinstalla = l_s_result_package-ucpinstalla

        soursystem = 'L1'

        objvers = 'A'.

Do this for all read statements.

Regards

Karthik

erdem_sephanelioglu
Participant
0 Kudos

Hi Karthik,

I get the following issue if i change per the suggestion

E:"L_T_UCINSTALLA" cannot be converted to the line type of "L_T_UCINSTALLA"

Eddy

karthik_vasudevan
Active Contributor
0 Kudos

That was my mistake.

The work area for l_t_ucinstalla is ucinstalla. You should have proper naming convention. If its a work area, start it with wa. it will easier for understanding and future corrections.

Try this code now.

       READ TABLE l_t_ucinstalla INTO ucinstalla WITH KEY

        ucinstalla = l_s_result_package-ucpinstalla

        soursystem = 'L1'

        objvers = 'A'.

Regards

Karthik

Former Member
0 Kudos

Hi Eddy,

these are internal tables

l_t_ucinstalla type table of /bi0/pucinstalla,

l_t_ucpremise type table of /bi0/pucpremise,

l_t_uc_connobj type table of /bi0/puc_connobj,

l_t_uc_pod type table of /bi0/muc_pod.

these are work area

DATA: l_s_ucinstalla LIKE LINE OF l_t_ucinstalla,

           l_s_ucpremise LIKE LINE OF l_t_ucpremise,

           l_s_uc_connobj LIKE LINE OF l_t_uc_connobj,

           l_s_uc_pod LIKE LINE OF l_t_uc_pod.

so for internal table l_t_ucinstalla Work area is : l_s_uc_istalla

READ TABLE l_t_ucinstalla into l_s_uc_istalla WITH KEY

        ucinstalla = l_s_result_package-ucpinstalla

        soursystem = 'L1'

        objvers = 'A'.

similarly check your other Read statements.

erdem_sephanelioglu
Participant
0 Kudos

Thank you for the suggestion.

However still receiving error

E:The field "UCINSTALLA" is unknown, but there are the following fields with similar names: "L_T_UCINSTALLA" and "L_S_UCINSTALLA".

Eddy