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

Problem when copying a FM

Former Member
0 Likes
2,047

Hi,

I have to use a std FM to create a report and have to tweak the FM according to my needs before i use it. the name of the std FM is K_KKB_KKBCS_ORDER_REPORT. This FM calculated the Target vs Actual costs. This std SAP FM has 3 layout variants.

I tried to copy this FM to a ZFM to tweak it. When i copied it to the ZFM it did not copy the standard SAP layout variants. So i thought i will create the same variants manually and to my suprise I didnt find some of the fields for selection that are in the original FM.

What am i missing here? If my question is not clear please tell me i will try to rephrase it.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,681

Hi ,

Would you please copy the FM again along with the VARIANTS and then check it.

Regards

Pinaki

Hi,

I have to use a std FM to create a report and have to tweak the FM according to my needs before i use it. the name of the std FM is K_KKB_KKBCS_ORDER_REPORT. This FM calculated the Target vs Actual costs. This std SAP FM has 3 layout variants.

I tried to copy this FM to a ZFM to tweak it. When i copied it to the ZFM it did not copy the standard SAP layout variants. So i thought i will create the same variants manually and to my suprise I didnt find some of the fields for selection that are in the original FM.

What am i missing here? If my question is not clear please tell me i will try to rephrase it.

8 REPLIES 8
Read only

Former Member
0 Likes
1,682

Hi ,

Would you please copy the FM again along with the VARIANTS and then check it.

Regards

Pinaki

Read only

0 Likes
1,681

Hi Pinaki,

there is no option to do that. When i copy a report i get the option to check the VARIANTS but when copying a FM it never prompts for that option.

Read only

0 Likes
1,681

Hi Sivasakthi,

You first copy the entire Function group KKBC to a Z function group.

Then delete the other function modules except K_KKB_KKBCS_ORDER_REPORT.

Create the variant for the FM K_KKB_KKBCS_ORDER_REPORT if required.

Now activate the Function Group .

It will resolve the issue .

Regards

Pinaki

Read only

0 Likes
1,681

I passed a dummy name in the variant field when i executed the FM i copied and voila...i could get all the feild names...

Read only

0 Likes
1,681

Hi Siva,

Can you explain more in detail how you solve this issue? I am facing the same thing now.

Best regards,

Amanda

Read only

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

Hello,

What do you mean by :

I didnt find some of the fields for selection that are in the original FM

.

The FM 'K_KKB_KKBCS_ORDER_REPORT' has an i/p param I_VARIA which contains the variant info. I think you must be knowing this, but FYI this is also related to the i/p param I_WIP.

data: l_varia type disvariant.
  if i_wip is initial.
     move i_varia to l_varia.
  else.
     move '1SAP03' to l_varia-variant.
     move 'SAPLKKBC' to l_varia-report.

  endif.

Hope this helps.

BR,

Suhas

Read only

Former Member
0 Likes
1,681

Hi Suhas,

>>I didnt find some of the fields for selection that are in the original FM

Well let me be more specific here. When i run the 'K_KKB_KKBCS_ORDER_REPORT', and get the ALV display i can choose 3 options from the 'Select Layout' button 1SAP01,1SAP02,1SAP03. and 1SAP01 statnds for Target/Actual comparison. And when i click on the button 'Change Layout' to select some more columns i get a column called Scrap Variance. That is what i need.

But when i copy the 'K_KKB_KKBCS_ORDER_REPORT' into a 'Z_K_KKB_KKBCS_ORDER_REPORT' and execute it without making any changes i dont get the 3 layouts when i click on the 'Select Layout' button. But instead i get only one option 1SAP01 and the description says 'Plan/Actual Comparison' instead of 'Target/Actual comparison'. And when i click on the 'Change Layout' button i dont see the Scrap Variance column at all!

Thanks for your inputs.

Read only

Former Member
0 Likes
1,681

just a thought: Is it some thing to do with Function group.

thanq