on 12-16-2004 2:53 PM
Hi all,
We need to implement some code in a BAdI for Healthcare. The BAdI is active in the PBO of transaction NV2000. We need to read the value of one field and, if this field has a certain value, default another field with a certain value.
The problem is - this BAdI reads each time another structure which you can change, but the two fields in question are in two different structures. So it's like:
CASE i_structure_name.
...
WHEN 'RNBADI_ADM'.
MOVE c_data TO ls_rnbadi_adm.
*here I could read the value of my controle field which can be found in ls_rnbadi_adm
...
WHEN 'RNBADI_EXTDOC_ADM'.
MOVE c_data TO ls_rnbadi_extdoc_adm.
here I could change my other field which can be found in ls_rnbadi_extdoc_adm
give changed data back
c_data = ls_rnbadi_extdoc_adm.
...
The problem is, in the step where structure ls_rnbadi_extdoc_adm is filled, structure ls_rnbadi_adm is empty so the value of the control field is not accessible any more. The control field is also not an interface parameter so I don't really know its value at runtime... it can be changed so selecting it from the database is not a good idea...
I thought to declare a 'static' variable and give it the value of the control field in the step where ls_rnbadi_adm was filled, so the program would remember it in the step where ls_rnbadi_extdoc_adm was filled. But the ABAP Editor gives a syntax error 'you can't declare statics inside an instance method'.
So any idea how to 'remember' the value of that control field?
Thanks in advance,
Ioana
Hi Ioana,
You can add your own variables in the implementation of your BADI. Go to the class interface of your implementation, hit the tab 'Attributes' and add the control field you need.
Regards,
John.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi John,
If I go to the class interface (via the menu
Go to->Interface) and hit the Attributes tab and then 'Change' the system asks me for a key because I'm trying to change a SAP Standard object ( R3TR INTF IF_EX_ISH_NV2000_PBO ).
Is it OK to do this, or will it give problems with the next upgrade? or am I hitting the wrong button?
Thanks,
Ioana
Hi Ioana,
You should not change the standard SAP interface but your implementation of the interface (the BADI). Use transaction SE19, enter the name of your implementation, Hit change and go to the tab Interface. Then double click on the name of the implementing class and go to the tab Attributes.
Regards,
John.
Hi Ioana,
It depends on your requirements, but normally you would use type instance attribute and visibility public.
Regards,
John.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.