Application Development 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: 

Accessing global variables in a BAdI

Former Member
0 Kudos

How can we access the global variables of a program from a BAdI ?The BAdI does not have that particular variable as a part of it's importing/exporting parameter.The BAdI gets triggered at a particular point in the program.The name of the BAdI is /SAPAPO/SDP_SELECTOR and the transaction is /SAPAPO/SDP94(Demand Planning: APO).

Thanks,

Savitha

2 REPLIES 2

former_member589029
Active Contributor
0 Kudos

Hello Savitha,

If the variables are not passed into the BADI then you do not have access to them. The only way around that would be to find a different user exit or BADI before that point where that data is available and save the variables you are interested in (e.g. export to memory). That is not the nicest way to do it but a possibility to get around the problem.

Hope that helps,

Michael

former_member200338
Active Contributor
0 Kudos

Hi,

Try to export the variable to memory id or use database memory id.

Like this.

Export l_vbeln to memory id 'ZTEST'.

you can give any name instead of ZTEST.

or u can export to database memory id

EXPORT tab = lt_vbkd

TO DATABASE indx(V1)

FROM ls_indx ID 'ZTEST'.

Regards,

Niyaz