2009 Apr 14 11:22 AM
can we display contents of two internal table through single ALV list display?
can we display contents of two internal table through single ALV list display?
2009 Apr 14 11:24 AM
Hi,
Take a third internal table which comprises of all the fields of internal table 1 and 2.
Move the values into internal table 3 and use it to display data in alv.
Hope this helps you.
Regards,
Tarun
2009 Apr 14 11:25 AM
Hi,
Input for the ALV List should be a single internal table.
If the data is identical , then I would gather all the data into a single internal table and then use ALV to output list.
But your requirement seems to be strange.
Could you explain why you are trying to do that?
Regards,
Kiran
2009 Apr 14 11:26 AM
2009 Apr 14 11:28 AM
hi,
take one more internal table...
fill this third internal table with the two internal table which you alreay filled ok..
then build the field catalog by using this third internal table..
Hope this helps
Regards
Ritesh J
2009 Apr 14 12:58 PM
Hi R Pathak,
You create a one structure and internal table for two internal table fields.Then use Append lines of itab to itab1(final table).after then you pass the internal table(itab1) to the function module.
thank you,
Anupama.
2009 Apr 14 1:12 PM
Please refer to this coding by UWE
You could define the "structure" dependent methods as interface methods and create different implementations of this interface depending on the choosen option.
However, this appear to be an overkill to me. In order to simplify your class partially you could introduce two additional attributes:
DATA:
mdo_data TYPE REF TO data.
FIELD-SYMBOLS:
<lt_outtab> TYPE table.
The switch between the different structure should be imported into your class using the CONSTRUCTOR method.
METHOD constructor.
me->md_wbs = id_wbs. " e.g. you import the radio-button parameter for WBS
ENDMETHOD.
METHOD process. " NOTE: public method
IF ( me->md_wbs = 'X' ).
CALL METHOD me->process_wbs( ). " NOTE: private method
GET REFERENCE OF me->mt_wbs INTO me->mdo_data.
ELSE.
CALL METHOD me->process_kpi( ). " NOTE: private method
GET REFERENCE OF me->mt_wbs INTO me->mdo_data.
ENDIF.
ENDMETHOD.
METHOD write.
FIELD-SYMBOLS:
<lt_outtab> TYPE table.
ASSIGN me->mdo_data->* TO <lt_outtab>.
cl_salv_table=>factory(
EXPORTING
list_display = if_salv_c_bool_sap=>false
IMPORTING
r_salv_table = salv_table
CHANGING
t_table = <lt_outtab>
).
salv_table->display( ).
ENDMETHOD.
Now the coding of the main report looks like this:
START-OF-SELECTION.
CREATE OBJECT go_myclass
EXPORTING
id_wbs = p_wbs.
go_myclass->process( ).
go_myclass->write( ).
Regrds,
K.Sibi
Edited by: sibi k kanagaraj on Apr 14, 2009 2:12 PM
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |