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

Method Parameter problem

deiamolina
Contributor
0 Likes
2,006

Hi,

I'm trying to use an Enhancement spot in LV60UF0V (Include of RV_INVOICE_POST function) and I facing the follow problem.

I want to copy a value in a field on xvbrp to another field in the same internal table. The point is that I don't know how to declarate the parameter in  the Method.

I've trying without sucess so far:

Use  VBRPVB (same declaration in the function) and I got this dump: ""VBRP" is neither specified under "TABLES" nor is it defined as an internal table."

Use a table type ref to VBRPVB, VBRP_TAB and I got this dump: "XVBRP" is not type-compatible with formal parameter "VBRP".

The XBRPVB is standard so I cannot change it.

I am not used to OO.

Can anyone help me?

Thanks,

Andréa

8 REPLIES 8
Read only

Former Member
0 Likes
1,790

Hi,

For the Error ""VBRP" is neither specified under "TABLES" nor is it defined as an internal table."", Please search for Table Type and assign it.

For the Error ""XVBRP" is not type-compatible with formal parameter "VBRP".",

These two structures are not same. XVBRP has additional fields which tells whether the entry is updated or inserted.

So, use move-corresponding VBRP to XVBRP to move these values

Regards,

Peri

Read only

Former Member
0 Likes
1,790

Hi Andrea,

Use TAB_VBRP instead of any other type. Assign the table of type TAB_VBRP.

This should help.

Regards,

Sachin

Read only

Former Member
0 Likes
1,790

Hi,

can you post ur code?? maybe there is problem there.

Regards

Miguel

Read only

Private_Member_7726
Active Contributor
0 Likes
1,790

Hi,

the formal method parameter should be of type TAB_VBRP, and XVBRP[] should be passed as actual parameter in method call, i believe, if wha you are trying to pass is the table "body".

cheers,

Janis

Read only

deiamolina
Contributor
0 Likes
1,790

Hi all.

I guess that I was not clear.

It's a parameter

  and  I changed to TAB_VBRP. Still not working.Atually I got the message that you can sse in the first screenshot.

I tried Table type: VBRP_TAB and I tried to use VBRPVB that is exactly the same declaration.

- Here it goes.

Thanks

Read only

0 Likes
1,790

Hi Andrea,

Try this code:


FIELD-SYMBOLS <fs_xvbrp> TYPE VBRP_TAB.

ASSIGN xvbrp[] TO <fs_xvbrp>.


CALL METHOD ZREBATE->SAVE_ZZREBATE_VF01 CHANGING vbrp = <fs_xvbrp>.


When you change <fs_xvbrp> also xvbrp change.


-------------------------------------------------------------------------------------------------------------


In alternative to field-symbols need to activate the flag on parameter VBRP:


Regards,


Angelo.

Read only

0 Likes
1,790

Hey Andrea, long time no see

I was curious about why your solution didn't work, so I've recreated your problem in my system. Everything activated just fine:

-------

DATA object TYPE REF TO ZTESTE_BADI_DEF. "generical badi implementation

GET BADI object.

CALL BADI object->teste

  CHANGING

    vbrp = xvbrp[].

-------

VBRP_TAB is a table type for VBRPVB, which has the same reference from function module's XVBRP parameter. No need to create field-symbols for any of this.

In my example, TESTE is an interface method, and it has VBRP as a changing parameter associated with VBRP_TAB. You must use [] for XVBRP, as function module tables comes with headerlines, and your changing parameter won't have one.

Are you really sure you've activated your custom BADI interfaces before activating the enhancement? Sometimes when trying a lot of things we might get confused.

Hope it helps, see ya!

Read only

0 Likes
1,790

,

Ex-mentor ainda mentorando

Thanks a million. It's working properly

I used the same associate type that you suggested (VBRP_TAB), used as parameter the table [] and not the work area and activated all Enhancement, just in case.

Now I don't know if I forgot to activated some objective or it was the parameter or associate type.

Anyway,

One more time thanks.

Glad to see you around here.

Kind Regards,

Andréa Molina