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: 

Is there any function module, to find whether the statement is within form and endform ?

Former Member
0 Kudos

Hi ABAPers,

i am in middle of something, where i have to find whether the statement is inside form and endform. Is there any function module to find it ? or any other easy ways to do it ? Please suggest.

eg.,

form abcd

....

...

read itab into wa index 1.

...

...

endform

i need to find whether the read statement is inside form and endform or not ? Please suggest.

Thanks in advance.

1 ACCEPTED SOLUTION

ŁukaszPęgiel
Contributor
0 Kudos

You can use FM 'SYSTEM_CALLSTACK' to see in which form you are, but still the question is: What for you need it?

11 REPLIES 11

VenkatRamesh_V
Active Contributor
0 Kudos

Hi Mthukumaran.

Hope i understand your requirement.

ctrl(Function key)+f.

Regards,

Venkat.

Former Member
0 Kudos

Can you explain a bit clear?

Thanks

Vamsi

0 Kudos

I'm trying to find the location of the statement, to proceed further in my requirement.

ie., whether the statement is inside form and endform, or in inside includes of a report like that.

Thank you for your reply

0 Kudos

i am developing a report which gets another report as an input, and i need to find the location of a some statements like line number etc., and to find whether it is within form and endform or inside includes for the given report.

matt
Active Contributor
0 Kudos

What, you're after some kind of "where am i" function module like this?

FORM A.

  CALL FUNCTION MODULE 'WHERE_AM_I' IMPORTING location = location.

  IF location EQ 'A'.

  ...

  ELSEIF location EQ 'B'.

  ....

  ENDIF.

ENDFORM.

FORM B.

  CALL FUNCTION MODULE 'WHERE_AM_I' IMPORTING location = location.

  IF location EQ 'A'.

  ...

  ELSEIF location EQ 'B'.

  ....

  ENDIF.

ENDFORM.

Why? What you trying to achieve? What is this "something" you're in the middle of?

ŁukaszPęgiel
Contributor
0 Kudos

You can use FM 'SYSTEM_CALLSTACK' to see in which form you are, but still the question is: What for you need it?

0 Kudos

i am developing a report which gets another report as an input, and i need to find the location of a some statements like line number etc., and to find whether it is within form and endform or inside includes of the report.

0 Kudos

Then look on scan abap-source in help.

0 Kudos

Thank you, Lukasz.
I was going by scan abap-source, but i thought of simplifying by using function modules.

thank you again.

matt
Active Contributor
0 Kudos

Right - so you're not after runtime information, you're after static information. That's an important distinction to make.

Simple answer: scan/read the ABAP code into an internal table and write a program to analyse it. I'm sure you can figure out the logic - it's not exactly difficult. You could even create your own function module to do it.

0 Kudos

Yeah ! thank you Matthew Billingham.
I am doing the same thing you have mentioned.