‎2007 Sep 21 11:57 AM
Hi ,
I have got a requirement in which i need to add 5 new fields to the standard program RMCB0300. The present program is written in ALV classes . Our requiement is to make that program in to totally to ALV grid. I need the code if any one send me the code for this.We need to add 5 new fields apart from the old strategy. Please send me the code . I am new to this ABAP-Object oriented approach. Definetely this is a very cruicial issue for me in the project. Nothing more than that is to be changed.
Want more details i will send you.
Thanks & Regards...
Satish
‎2007 Sep 26 3:01 PM
Hi,
there is a perform routine AUSTAB_AUSGEBEN in the program RMCS0LIS, if you go thru the following piece of code in that Perform routine (at line number 378)
LOOP AT AUS_S000.
CHECK <AUSTAB_GLOBAL>-FLG_AUSBLENDEN = FALSE.
AUSTAB_TABIX = SY-TABIX.
PERFORM COLOR_TAB_LESEN USING <AUSTAB_GLOBAL>-COLOR_ID.
PERFORM SPALTENANFANG_AUSGEBEN USING TRUE.
PERFORM KENNZAHLENZEILE_AUSGEBEN.
ENDLOOP.This table is used for ur output.
After that its simple u have to do replace the loop with the following piece of code:
data: wa_layout type lvc_s_layo.
** Create the Container
create object wl_ref_container
exporting
container_name = w_container.
** Create the Grid object
create object w_grid
exporting
i_parent = wl_ref_container
exceptions
error_cntl_create = 1
error_cntl_init = 2
error_cntl_link = 3
error_dp_create = 4
others = 5.
check sy-subrc = 0.
** Layout
wa_layout-zebra = c_check.
wa_layout-stylefname = 'STYLO'.
** display ALV
if w_sale = c_check.
call method w_grid->set_table_for_first_display
exporting
is_layout = wa_layout
changing
it_outtab = <b>AUS_S000</b>
it_fieldcatalog = t_fcat
exceptions
invalid_parameter_combination = 1
program_error = 2
too_many_lines = 3
others = 4.
if sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
else.
call method w_grid->set_table_for_first_display
exporting
is_layout = wa_layout
changing
it_outtab = t_likp
it_fieldcatalog = t_fcat
exceptions
invalid_parameter_combination = 1
program_error = 2
too_many_lines = 3
others = 4.
if sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
endif.remember to create the fieldcatalog equivalent to the Table.
Hope That Helps
Anirban M.