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

Macro Explanation

HariMaradana
Active Participant
0 Likes
482

Dear Experts,

Can anyone explain below macro.

DEFINE get_value.

call method of excel 'Cells' = cell

EXPORTING

#1 = &1 "v_rcount

#2 = &2. "2

get property of cell 'Value' = &3. " value from the table .

if not &3 is initial and &4 = 'T'. "e_file

&4 = 'F'.

endif.

END-OF-DEFINITION.

I never used Macros, Please explain in detail.

Thanks

Cris

1 ACCEPTED SOLUTION
Read only

uwe_schieferstein
Active Contributor
0 Likes
450

Hello Cris

Macros are used to "abbreviate" coding. The repetitive part of the coding is defined in the macro. Below is and example of filling the itab of excluded functions for an ALV toolbar:


DATA: lt_excltab   TYPE ui_functions.

  APPEND cl_gui_alv_grid=>mc_func_loc_info TO lt_excltab.
  APPEND cl_gui_alv_grid=>mc_func_loc_graph TO lt_excltab.
  APPEND cl_gui_alv_grid=>...                          TO lt_excltab.
...

Use of macro:


DEFINE mac_exclude_function.
  APPEND &1 TO lt_excltab.
END-OF-DEFINITON.


mac_exclude_function: cl_gui_alv_grid=>mc_func_loc_info,
                      cl_gui_alv_grid=>mc_func_loc_graph,
                                  ...

Regards

Uwe

2 REPLIES 2
Read only

uwe_schieferstein
Active Contributor
0 Likes
451

Hello Cris

Macros are used to "abbreviate" coding. The repetitive part of the coding is defined in the macro. Below is and example of filling the itab of excluded functions for an ALV toolbar:


DATA: lt_excltab   TYPE ui_functions.

  APPEND cl_gui_alv_grid=>mc_func_loc_info TO lt_excltab.
  APPEND cl_gui_alv_grid=>mc_func_loc_graph TO lt_excltab.
  APPEND cl_gui_alv_grid=>...                          TO lt_excltab.
...

Use of macro:


DEFINE mac_exclude_function.
  APPEND &1 TO lt_excltab.
END-OF-DEFINITON.


mac_exclude_function: cl_gui_alv_grid=>mc_func_loc_info,
                      cl_gui_alv_grid=>mc_func_loc_graph,
                                  ...

Regards

Uwe

Read only

0 Likes
450

Thank you very much....

Have a good weekend..

Cris