2010 Nov 03 3:28 AM
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.
2010 Nov 03 4:08 AM
Hi,
Please declare your it_image as ..
DATA : it_image type psoper . <--- not psoper_tab...
Regards,
Srini.
Hi,
Please declare your it_image as ..
DATA : it_image type psoper . <--- not psoper_tab...
Regards,
Srini.
2010 Nov 03 4:08 AM
Hi,
Please declare your it_image as ..
DATA : it_image type psoper . <--- not psoper_tab...
Regards,
Srini.
2010 Nov 03 5:04 AM
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....
2010 Nov 03 5:07 AM
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
2010 Nov 03 4:51 AM
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
| User | Count |
|---|---|
| 6 | |
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |