2014 Mar 21 12:42 PM
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
2014 Mar 21 12:58 PM
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
2014 Mar 21 1:07 PM
Hi Andrea,
Use TAB_VBRP instead of any other type. Assign the table of type TAB_VBRP.
This should help.
Regards,
Sachin
2014 Mar 21 1:19 PM
Hi,
can you post ur code?? maybe there is problem there.
Regards
Miguel
2014 Mar 21 1:25 PM
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
2014 Mar 21 2:16 PM
2014 Mar 21 2:47 PM
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.
2014 Mar 21 2:53 PM
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!
2014 Mar 21 3:15 PM
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