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

call method

Former Member
0 Likes
1,218

hi all,

i copied one standard program and adding one new field, i have copied the structure FAGLPOSX to YFAGLPOSX and added my new field in y structure.

all the output data i am sending to lt_items along with the new field.

the problem is with CALL METHOD.

In below call method ct_items does not match with lt_items.

call method gd_ref_to_ch_data->change_items

CHANGING

ct_items = lt_items.

CAN I COPY THE CALL METHOD TO Z, IF SO PLEASE TELL ME THE PROCEDURE.

thanks in advance

9 REPLIES 9
Read only

Former Member
0 Likes
1,093

You can't copy to z a single method. You can copy a class and/or the parts where the object is used.

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
1,093

Hello Lakshmi,

What is the name of the std. program you are copying?

BR,

Suhas

PS: May be the class & the method that you want to copy are part of a BAdI. And since you are copying the std. code no need to use this. You can comment out

Edited by: Suhas Saha on Jan 6, 2009 2:29 PM

Read only

Former Member
0 Likes
1,093

hi suhas,

the program is FAGL_ACCOUNT_ITEMS_GL, i need to add a new output field,

i copied to z and made some of the code changes.

in the function module FAGL_ITEMS_DISPLAY if we debug we have we have one more function module

REUSE_ALV_GRID_DISPLAY.

before the FM REUSE_ALV_GRID_DISPLAY We have a call method.

in the call method we have it_items these it_items we are passing in the FM REUSE_ALV_GRID_DISPLAY.

SO CALL METHOD IS DIFFERING.

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
1,093

Hello Lakshmi,

I suggested the method is for the BAdI FAGL_ITEMS_CH_DATA. You can comment out this code as you have copied the std. code to a custom one if this is posing some problems.

Plz see the following code lines, then it will be clear that the method is called for a BAdI.


DATA: gd_ref_to_ch_data TYPE REF TO IF_EX_FAGL_ITEMS_CH_DATA.

*...BADI FAGL_ITEMS_CH_DATA: change data
  call method cl_exithandler=>get_instance
    EXPORTING
      exit_name              = 'FAGL_ITEMS_CH_DATA'
      null_instance_accepted = 'X'
    IMPORTING
      act_imp_existing       = gd_act_imp_ch_data
    CHANGING
      instance               = gd_ref_to_ch_data.

*... BADI: external processing of lines
*... replaces BTE 00001650
  IF  NOT gd_act_imp_ch_data IS INITIAL
  AND NOT gd_ref_to_ch_data  IS INITIAL.
    lt_items[] = it_items[].
    call method gd_ref_to_ch_data->change_items
      CHANGING
        ct_items = lt_items.
    it_items[] = Lt_items[].
  endif.

Hope this is clear.

BR,

Suhas

Edited by: Suhas Saha on Jan 6, 2009 2:48 PM

Read only

Former Member
0 Likes
1,093

hi suhas ,

as you said i commentd the code,

where as i also commented the following 2 call methods because here we have it_items, if not commented getting an error there.

if i comment i am getting the output field which i want but the data for OFFSET ACCT is missing in the output.

  • CALL METHOD GD_REF_TO_MENUE01->SHOW_BUTTONS

  • EXPORTING

  • it_items = it_items[]

  • FRANGE = lt_frange

  • IMPORTING

  • EXTAB = lt_extab.

  • if sy-subrc = 0.

  • append lines of lt_extab to rt_extab.

  • endif.

  • CALL METHOD GD_REF_TO_MENUE02->SHOW_BUTTONS

  • EXPORTING

  • it_items = it_items[]

  • FRANGE = lt_frange

  • IMPORTING

  • EXTAB = lt_extab.

  • if sy-subrc = 0.

  • append lines of lt_extab to rt_extab.

  • endif.

  • endif.

please suggest.

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
1,093

Hello Lakshmi,

the data for OFFSET ACCT is missing in the output

The methods are for the BAdI's FAGL_ITEMS_MENUE01 & FAGL_ITEMS_MENUE02. I dont think they will effect your output table.

Are the values coming the std. report for the same input? Plz check & let us know.

BR,

Suhas

Edited by: Suhas Saha on Jan 6, 2009 3:29 PM

Read only

Former Member
0 Likes
1,093

the output is coming for the standard report , it is missing in Z report.

once i will debug and let u know.

thank u very much.

Read only

Former Member
0 Likes
1,093

Hi,

You can make a copy of calss..and take that single method and change it...accrding to your requirements.

Regards

Sandeep Reddy

Read only

Former Member
0 Likes
1,093

Hi,

I dont think you can copy the method alone.

You may need to copy the entire class.

Thanks,

Bala.