02-07-2016 4:22 AM
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.
02-07-2016 5:54 PM
You can use FM 'SYSTEM_CALLSTACK' to see in which form you are, but still the question is: What for you need it?
02-07-2016 7:51 AM
Hi Mthukumaran.
Hope i understand your requirement.
ctrl(Function key)+f.
Regards,
Venkat.
02-07-2016 3:56 PM
02-08-2016 3:19 AM
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
02-08-2016 4:44 AM
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.
02-07-2016 4:07 PM
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?
02-07-2016 5:54 PM
You can use FM 'SYSTEM_CALLSTACK' to see in which form you are, but still the question is: What for you need it?
02-08-2016 3:35 AM
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.
02-08-2016 4:49 AM
02-08-2016 6:01 AM
Thank you, Lukasz.
I was going by scan abap-source, but i thought of simplifying by using function modules.
thank you again.
02-08-2016 6:53 AM
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.
02-09-2016 6:35 AM
Yeah ! thank you Matthew Billingham.
I am doing the same thing you have mentioned.