Skip to Content
0
Former Member
Jan 03, 2012 at 11:34 AM

Transfer contents of itab attribute dynamically when object reference imp

71 Views

Hello,

I have one method which has an importing parameter containing reference to an object. The object has many internal tables.

I have one case endcase method in my method which checks for the table name ( all itabs refer to some table ). There are two cases: one which caters to header data and the second one is for others ( having multiple entries ). I have filled one internal table containing the tablename. In do loop , I am looping for each internal table. Then in case endcase I will do further processing. How will I concatenate the object along with tablename and transfer the contents dynamically. Also I need to loop endloop for each internal table. I want to also check whether those tables are not initial. How to do it dynamically without

putting cases for all the itabs.

For example IM_OBJ ( IMPORT PARAMETER) type ref to SOME CLASS.

CLASS has three internal tables:

1) header ( gs_header).

2) ITEM (gt_item)

3) partner (gt_partner)

Another internal table contains all the tables ( gt_tabname ).

DO.

READ TABLE gt_tabname into gs_tabname INDEX SY-INDEX.

IF SY-SUBRC NE 0.

EXIT.

ELSE.

CASE gs_tabname.

WHEN 'HEADER'.

WHEN others.

ENDIF.

Regards,

DPM

ENDDO.