Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Data declaaration issue

Former Member
0 Likes
638

Hi,

I have to loop on a internal table and pass the value to the exporting parameters of another method. When I am doing that it gives me syntax error "lw_new image is not compatible with it_image."

Here is the code...


data:        lw_new_image         TYPE psoper.

  LOOP AT if_new_image INTO lw_new_image.
  IF lw_new_image-opera = 'D'.
*Push indirect time of delete entries.
  CALL METHOD mt_get_infty_data
    EXPORTING
      it_image = lw_new_image
      if_infty = if_infty
      if_opera = co_d
    CHANGING
      ct_pnnnn = <lt_ptable_new>.

and in the method mt_get_infty_data's method definition it_mage is defined as importing parameter type psoper_tab...

if_new_image is defined as importing parameter type psoper_tab in the current method.

please tell me how can I straighten this out.

Thank You,

SB.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
600

Hi,

Please declare your it_image as ..

DATA : it_image type psoper . <--- not psoper_tab...

Regards,

Srini.

4 REPLIES 4
Read only

Former Member
0 Likes
601

Hi,

Please declare your it_image as ..

DATA : it_image type psoper . <--- not psoper_tab...

Regards,

Srini.

Read only

0 Likes
600

Thank you Srini, that worked, but inside the get_infty_data I have to loop it_image into lw_prelp.

here is the code ... & doing the change you said I get this syntax error.


DATA: lw_prelp TYPE prelp

  LOOP AT it_image INTO  lw_prelp.
*  lw_prelp = it_image.
    IF NOT <lw_pnnn> IS ASSIGNED.
      ASSIGN lf_tabname TO <lw_pnnn>.
    ENDIF.

    CALL METHOD cl_hr_pnnnn_type_cast=>prelp_to_pnnnn
      EXPORTING
        prelp = lw_prelp
      IMPORTING
        pnnnn = <lw_pnnn>.

    APPEND <lw_pnnn> TO ct_pnnnn.
    CLEAR : lw_prelp.
  ENDLOOP.

it_image is declared in method definition as posper...

I get the syntax error as "IT_IMAGE" is neither specified under tables nor it is defined as an internal table....

Read only

0 Likes
600

Hi,

Make sure you have declared this inetrnal table and type is table typeif you have one. and work area is same as the line type of that table type.

Nabheet

Read only

rahul_mb
Active Participant
0 Likes
600

Hi SB,

In the method mt_get_infty_data the parameter it_image is of type psoper_tab (Table Type of psoper). So the actual problem is that you are trying to pass a work area to an internal table. So in order to avoid this issue, either you change the parameter of the method to the same structure of lw_new_image ie., psoper or pass the internal table if_new_image to the method.

Thanks and regards,

Rahul MB