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

New implementation for a badi

Former Member
0 Likes
1,870

Hi Guys,

There is one badi def. with which i have to create an implementation for it , and in implemenation i have to just add a clear statement for a particular field of a structure in a required method.

1) The problem is importing parameter of that method is a object reference in which there is a structure(Private). I have to clear one of the field of the structure , so how can i access that field which i have to clear ?

2) Second thing is once i have cleared , i have 5 changing parameters (only one importing parameter in my case of required method) , how to make changes get reflected. And also those 5 parameters are of type field selection. So how to use these parameters to make my changes get reflected ?

PFA

Please help me out.

Regards,

Hemanth

1 ACCEPTED SOLUTION
Read only

Sijin_Chandran
Active Contributor
0 Likes
1,841

By looking at both the mentioned circumstances,


1) The problem is importing parameter of that method is a object reference in which there is a structure(Private). I have to clear one of the field of the structure , so how can i access that field which i have to clear ?

2) Second thing is once i have cleared , i have 5 changing parameters (only one importing parameter in my case of required method) , how to make changes get reflected. And also those 5 parameters are of type field selection. So how to use these parameters to make my changes get reflected ?

It makes me feel that this is not the right BADI to cater your requirement.

Can you further explain why you want to clear a Standard variable or what is the exact requirement. So that you can get relevant suggestions.

Hi Guys,

There is one badi def. with which i have to create an implementation for it , and in implemenation i have to just add a clear statement for a particular field of a structure in a required method.

1) The problem is importing parameter of that method is a object reference in which there is a structure(Private). I have to clear one of the field of the structure , so how can i access that field which i have to clear ?

2) Second thing is once i have cleared , i have 5 changing parameters (only one importing parameter in my case of required method) , how to make changes get reflected. And also those 5 parameters are of type field selection. So how to use these parameters to make my changes get reflected ?

PFA

Please help me out.

Regards,

Hemanth

9 REPLIES 9
Read only

Sijin_Chandran
Active Contributor
0 Likes
1,842

By looking at both the mentioned circumstances,


1) The problem is importing parameter of that method is a object reference in which there is a structure(Private). I have to clear one of the field of the structure , so how can i access that field which i have to clear ?

2) Second thing is once i have cleared , i have 5 changing parameters (only one importing parameter in my case of required method) , how to make changes get reflected. And also those 5 parameters are of type field selection. So how to use these parameters to make my changes get reflected ?

It makes me feel that this is not the right BADI to cater your requirement.

Can you further explain why you want to clear a Standard variable or what is the exact requirement. So that you can get relevant suggestions.

Read only

0 Likes
1,841

Its very lengthy process, its getting difficult to explain, in simple i need to clear a variable called supplying plant in that particular badi(Since its a standard bussiness process)

Read only

0 Likes
1,841

Hemanth,

if the parameter you want to change is NOT in the changing parameters of your BADI, then this is not the BADI you need.

Try to use an implicit enhancement to achieve this, or try to user another BADI.

PS.: maybe you can use field-symbol assignment to access the data you need in memory, but this is not recommended.

Regards,

Frisoni

Read only

0 Likes
1,841

Ok Frisoni, ill check alternate badi's or enhancements

Prior to this let me check whether i can access the field or not , so could you help out how to access fields in the debugger.

PFA for structure info @ debug level.

.

Regards,

Hemanth

Read only

0 Likes
1,841

Not sure if it is exactly what you need, but is kind like this:

    FIELD-SYMBOLS: <fs_ekko> TYPE ekko.

    ASSIGN ('(SAPLMEPO)EKKO') TO <fs_ekko>.

    IF sy-subrc IS INITIAL.

      CLEAR <fs_ekko>-reswk.

    ENDIF.

Regards,

Frisoni

Read only

0 Likes
1,841

Hi Frison,

I think this gonna work for me and thanks. But just tell me why are u assigning '(SAPLMEPO)EKKO' ?

Regards,

Hemanth

Read only

0 Likes
1,841

Hemanth,

SAPLMEPO is the main program, all objects and references you see inside BADI are in some point called in main program. So, you access the EKKO structure to change the values you need.

Regards,

Frisoni

Read only

0 Likes
1,841

Thank you so much Frisoni.

Read only

SharathYaralkattimath
Contributor
0 Likes
1,841

Using GET REFERENCE you could clear the private attribute of the object instance.

http://help.sap.com/abapdocu_740/en/abapget_reference.htm

I'm not able to understand your 2nd requirement, if you could tell me the BADI name / method I could understand better.

Thanks,

Sharath