Skip to Content
0

logic to append and add a field

Dec 01, 2016 at 07:48 PM

10

avatar image

Hi Friends,

i have called a FM inside my program as shown in the code below -

CALL FUNCTION 'ZSD_CUSTOMER_DELV'
 EXPORTING
 kunnr = wa_cust-kunnr
 bukrs = p_bukrs
 from_date = s_budat-low
 to_date = s_budat-high
 TABLES
 it_dt1 = it_get_fina1_1
 it_dt2 = it_get_fina1_2

Now i have merged the two IT to one as - it_get_final_3.

both it_get_final_1 and it_get_final_2 have the same table structure.

_
In my final IT i.e. it_get_final_3 i want to add one more field flag and display in ALV.


if not it_get_final_1 is initial
flag field = 'X'.
else. 
if not it_get_final_2 is initial
flag_field_ = 'Y'.
endif.


table it_get_fina1_1 and it_get_fina1_2 dnt have a field flag.


ALV as follows - 



TRY.

        CALL METHOD cl_salv_table=>factory

          IMPORTING

            r_salv_table = gr_alv

          CHANGING

            t_table      = it_final_3.

      CATCH cx_salv_msg .

    ENDTRY.

    gr_functions = gr_alv->get_functions( ).

    gr_functions->set_all( abap_true ).



    gr_columns = gr_alv->get_columns( ).

    gr_columns->set_optimize( abap_true ).



    gr_column ?= gr_columns->get_column( 'Doc No' ).

    gr_column->set_visible( value  = if_salv_c_bool_sap=>false ).



    gr_column ?= gr_columns->get_column( 'Name' ).

    gr_column->set_visible( value  = if_salv_c_bool_sap=>false ).
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

0 Answers