Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

ALV Display

Former Member
0 Likes
714

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?

6 REPLIES 6
Read only

I355602
Product and Topic Expert
Product and Topic Expert
0 Likes
695

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

Read only

Former Member
0 Likes
695

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

Read only

Former Member
0 Likes
695

hi,

Yes we can display contents of two internal table

please refer this link

thanks

Read only

Former Member
0 Likes
695

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

Read only

Former Member
0 Likes
695

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.

Read only

Former Member
0 Likes
695

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