‎2005 Jun 15 8:16 PM
Hi all,
I have to use a function CLAF_CLASSIFICTION_OF_OBJECTS'
inside a BADI called BATCH_Master.
Now the thing is that the data which I have to read gets fetched in one of the tables of function module.
Following CODE works fine if <b>I am not using BADI.</b>
Data: P_CLASS like SCLASS occurs 0 with header line,
P_OBJECTDATA like CLOBJDAT occurs 0 with header line.
*
*
Call Function 'CLaff_Classification_OF OBjects'
*
*
TABLES
T_CLASS = P_Class
T_OBJECTDATA = P_OBJECTDATA.
*
*
LOOP AT P_OBJECTDATA.
WRITE: / P_OBJECTDATA-AUSP1.
ENDLOOP.
<b>But if I am use BADI then I can't use header line.</b>
Data:
P_Class TYPE STANDARD TABLE OF SCLASS initial size 0,
P_Objectdata TYPE STANDARD TABLE OF CLOBJDAT initial size 0.
Now I can't print the values of P_Objectdata because I am not using header line since I am using BADI.
How can I print P_Objectdata because I can't use header line in BADI while declaring any table (Due to OO Concept) ?
‎2005 Jun 15 8:31 PM
Don't declare itabs with header line that will not work in OO context.
You should rather declare a work area and then loop into a work area ..
see the code below.
DATA : P_Class TYPE STANDARD TABLE OF SCLASS ,
P_Objectdata TYPE STANDARD TABLE OF CLOBJDAT .
DATA : wa_objdata type CLOBJDAT.
*
*
Call Function 'CLaff_Classification_OF OBjects'
*
*
TABLES
T_CLASS = P_Class
T_OBJECTDATA = P_OBJECTDATA.
*
*
LOOP AT P_OBJECTDATA into wa_objdata.
WRITE: / wa_objdata-AUSP1.
ENDLOOP.
‎2005 Jun 15 8:33 PM
> Hi all,
> I have to use a function
> CLAF_CLASSIFICTION_OF_OBJECTS'
> inside a BADI called BATCH_Master.
> Now the thing is that the data which I have to read
> gets fetched in one of the tables of function
> module.
>
> Following CODE works fine if <b>I am not using
> BADI.</b>
>
> Data: P_CLASS like SCLASS occurs 0 with header line,
> P_OBJECTDATA like CLOBJDAT occurs 0 with header
> line.
>
> *
> *
> Call Function 'CLaff_Classification_OF OBjects'
> *
> *
> TABLES
> T_CLASS = P_Class
> T_OBJECTDATA = P_OBJECTDATA.
> *
> *
>
> LOOP AT P_OBJECTDATA.
> WRITE: / P_OBJECTDATA-AUSP1.
> ENDLOOP.
>
> <b>But if I am use BADI then I can't use header
> line.</b>
> Data:
> P_Class TYPE STANDARD TABLE OF SCLASS initial size 0,
>
> P_Objectdata TYPE STANDARD TABLE OF CLOBJDAT initial
> size 0.
>
> Now I can't print the values of P_Objectdata because
> I am not using header line since I am using BADI.
>
> How can I print P_Objectdata because I can't use
> header line in BADI while declaring any table (Due to
> OO Concept) ?
If you declare your table without header line, make sure that the internal table is passed to a function call with the brackets
Call Function 'CLaff_Classification_OF OBjects'
TABLES
T_OBJECTDATA = itab[].
*
>
Also you need a workarea for your loop.
loop at itab into wa.
endloop.
Hope this helps
Christian
‎2005 Jun 15 8:38 PM
I don't think this is required?
since itab is defined without header line , any reference to internal table as itab means the body of table only and not the header.
Call Function 'CLaff_Classification_OF OBjects'
TABLES
T_OBJECTDATA = itab[].
Cheers,
Ram