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

Declaring Variable to be Used in External Include

Former Member
0 Likes
1,562

I have declared a variable gv_weupd in SAPMV45A (include MV45ATZZ) It's based on rv02p-weupd.

   DATA: gv_weupd  LIKE rv02p-weupd.

I need to use this variable in USEREXIT_MOVE_FIELD_TO_VBAK and in FV45KFAK_VBAK_FUELLEN.

SAPMV45A does the following: PERFORM VBAK-VBAK_FUELLEN(SAPFV45K)

How do I get gv_weupd to be visible across all this?

Thanks

Dave

1 ACCEPTED SOLUTION
Read only

vallamuthu_madheswaran2
Active Contributor
0 Likes
1,439

Hi,

Declare the variable in the include MV45ATOP.

Thanks & Regards,

Vallamuthu

9 REPLIES 9
Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
1,439

Did you try declaring the variable in the include MV45ATZZ?

Read only

Former Member
0 Likes
1,439

Yes. That's what I said in the first sentence.

"I have declared a variable gv_weupd in SAPMV45A (include MV45ATZZ)"

Read only

0 Likes
1,439

Hi Dave,

The definition of the variable in include MV45ATZZ should begin with ZZ.

DATA: zzgv_weupd  LIKE rv02p-weupd.

- Puneet

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
1,439

Sorry Dave, my bad

I don't think declaring the variable anywhere in SAPMV45A is gonna help! (I'll rather be surprised if it does )

Anyway can you explain your requirement so that we can explore some workarounds?

BR,

Suhas

Read only

Former Member
0 Likes
1,439

I think you're right, but I've only been developing in SAP for 6 months and I was hoping that someone has the best practice method of defining globals like this.

I guess another option would be to export the value to memory and import it.

Would that work?

Read only

vallamuthu_madheswaran2
Active Contributor
0 Likes
1,440

Hi,

Declare the variable in the include MV45ATOP.

Thanks & Regards,

Vallamuthu

Read only

0 Likes
1,439

I did try to put the data statement in MV45ATOP, but it still wasn't visible in FV45KFAK_VBAK_FUELLEN.

Read only

0 Likes
1,439

Hi Dave

These are two different programs not sharing the same variables.

Your best bet would be the SET/GET Parameter id or Export/Import to Memory Id.

Hope this helps

Regards

Vic

Read only

0 Likes
1,439

Export/Import to memory ID worked.

Thanks