06-01-2011 1:15 PM
hi,
i am getting dump after executing a method in which i want to export an internal table which will hold all the states name along with its code on the basis of the country name which is my importing parameter.
for the above i am using importing parameter named as country of type too5u-land1 and the exporting parameter named as itab of type table and below is my code for the requirement.
method PROCESS.
select BLAND BEZEI from T005U
INTO TABLE ITAB WHERE
LAND1 = COUNTRY.
endmethod.
06-01-2011 1:41 PM
Hi,
Please check the below code
parameters country type land1.
*Refer the class which we are using like below
data: a type ref to ZCL_TX_SERVICE_01.
data itab type ycountry.
*ycountry is a table type defined in dictionary with fields BLAND and BEZEI
data wa like line of itab.
*If we are using instance method we need to create the instance like below
create object a.
*In the method process define exporting parameter itab as type ycountry which is a table type already defined
CALL METHOD a->PROCESS
EXPORTING
COUNTRY = country
IMPORTING
ITAB = itab.
.
loop at itab into wa.
write:/ wa-bland.
endloop.
Regards
Dande
06-02-2011 8:14 AM