Hello,
There is a need in my function module where I need to take the help of a transaction wherein I would require the values of an internal table ( which is populated somewhere in the transaction program ) to be passed back to my function module where I intend to use these values to populate in a structure and to do some other mumbo jumbo with it.
So, I did the following:
- In my function module, I was able to create a structure which would hold the exact same stuff like the data of the internal table in the transaction program.
- I then wrote the following SUBMIT code so it jumps to the transaction program to get the values I need.
EXPORT internaltable TO MEMORY ID c_memory.
SUBMIT ZTRANSACTIONPROGRAM
WITH w_param1 EQ '1000'
WITH w_param2 EQ iw_something
AND RETURN.
IMPORT internaltable FROM MEMORY ID c_memory.
- What is happening basically is :- When I debug the code, I find that the execution does go to the transaction program I want it to go. But, soon after it jumps back to the calling FM code. ( Is this because of the return statement I have added here?) And, the internal table which is imported is empty. No values whatsoever.
- If I want it to go all the way to the line of code in the transaction program - exactly after which that internal table( which I need ) is getting populated - what would I have to do?
- I could insert some code which basically says " Hey! If my calling program is "this"(my FM) -> only then copy this particular internal table at this line ( I would want to insert the code at the place where I would need a data transfer) to the memory id. " Plus, I would want this internal table to be exported so I can import it back to my FM and use it. And, may be an EXIT statement after that? So, I would not want the whole of the transaction program to execute.
Could you help me figure out how I need to code this requirement of mine in the transaction program? Is this doable? Please provide how I would need to code this out in the transaction program.
Would appreciate suggestions and alternatives to this approach.
Thanks & Regards,
Alice.