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

Hi Gurus, Doubt in Function module

0 Likes
1,532

Hi Gurus,

for creating a function module we have to create it under function group.

we can have lot of function modules under a funtion group. and we can have global variables here. it partly acts as class.

doubt here is how can we find how the global variables are getting filled.

i have a scenario, PM_PARTNER_CHECK_COMPLETE in this FM i have a global internal table XIHPA. i need to know how or when this global variable is getting filled.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,487

Hi Dinesh,

Double click on XIHPA it will take you to the top include.

Click on where used list in toolbar and click enter.

This will give you where all this table is used.

n/ow press Control + F and type APPEND.

There are some 10 locations where it is getting filled.

Another best solution will be finding it in debug mode.

Keep a WATCHPOINT on this table it will stop exactly where it is changed.

Regards

11 REPLIES 11
Read only

Former Member
0 Likes
1,488

Hi Dinesh,

Double click on XIHPA it will take you to the top include.

Click on where used list in toolbar and click enter.

This will give you where all this table is used.

n/ow press Control + F and type APPEND.

There are some 10 locations where it is getting filled.

Another best solution will be finding it in debug mode.

Keep a WATCHPOINT on this table it will stop exactly where it is changed.

Regards

Read only

Former Member
0 Likes
1,487

Hi,

use

1) where used list

2) create breakpoint, watch point.

3) Debug the code

you will understand the functionality .

Read only

Former Member
0 Likes
1,487

Hi

you can use the debugger for this .In debugger we can set extended debugger to debug the Function module

Read only

Former Member
0 Likes
1,487

hi,

since the internal table is global ,any function module under the function group can fill the internal table (on the same program).

Use extended debugger and check whether calling function module is fiilling the internal table ,(similarly check all the function module ).

Other probablity is that code inside the function group will be filling the internal table ,if this is the case when execution reaches your funtion call ,it will load the entire function group (internal table get filled during that time ) .

Read only

0 Likes
1,487

can you please tell me about the watch point for internal table.

as of i know we can find any value change inside a internal table through watch point.

EX. if table has 10 entries,

loop at itab.

.

.

.

end loop.

we can keep watch point to find when it reaches itab-matnr = 5. we can acheive that by watch point.

but, take my above ex. how can we have watchpoint for that scenario.

Read only

0 Likes
1,487

Hi,

You are partially correct.

The function of the watch point is to stop at the point when there is a change in the value of the variable defined in it.

You can just define the name of the variable whose value change needs to be spotted, by only specifying the name. Eg; itab[].

Also as you mentioned you can keep a check on the step where the value of the variable changes to a appropriate value, by specifying the condition in it . Eg . when itab-matnr = 0.

Read only

0 Likes
1,487

Hi Priyan,

in the FM "PM_PARTNER_CHECK_COMPLETE" the global variable that is my internal table XIHPA is global. when i entered in to my function module in debugging mode i try to check when this table gets filled the first value.

i tried to put watch point but it shows    "Variable XIHPA[] does not exist" as it is not defined in this FM. can you please tell me the steps to use the watch point in this scenario.

Read only

0 Likes
1,487

Hi Dinesh,

While trying to create the watchpoint make sure that the status of the variable defined is active because the watchpoint checks for variable in the current driver program.

The issue you are facing is because you are trying to create a watchpoint with a variable which is not defined in the current driver program while debugging.

Please note that you can't create a watchpoint if the status of the variable is as follows.

Read only

0 Likes
1,487

You create a watchpoint on table without any condition in that case it will stop at each change in the table...

The first change will be insert only .... so you will get where it is getting filled.

Read only

mayur_priyan
Active Participant
0 Likes
1,487

Hi,

Double click on the table in the program and get to know where it is being used. Create Breakpoints at places where the table is getting modified like MODIFY, APPEND statements and debug. Or you could use the WATCHPOINT option while debugging through the FM.

Read only

former_member184611
Active Participant
0 Likes
1,487

Hi Dinesh,

Simply put a watch point for that variable.

Thanks,

Abyson Joseph

Applexus Technologies