2008 Nov 24 9:10 AM
Dear all
I have a function module where I have a table as optional parameter.
No I should be able to check if this table is existing or not. How can this be done?
I tried several things like try + catch but nothing worked. All lead in an exception when it is not given to the function.
Thank you
Herbert
Dear all
I have a function module where I have a table as optional parameter.
No I should be able to check if this table is existing or not. How can this be done?
I tried several things like try + catch but nothing worked. All lead in an exception when it is not given to the function.
Thank you
Herbert
2008 Nov 24 9:26 AM
Just use as;
IF itab[] IS INITIAL. "No table passed
"Do operations without table
ELSE.
"Do operations with table
ENDIF.This will solve your problem.
Regards
Karthik D
2008 Nov 24 9:32 AM
Hi,
You can define your table like this in the TABLES tab:
TAB TYPE STANDARD TABLE
Regards,
Ali
2008 Nov 24 9:44 AM
2008 Nov 24 10:31 AM
Thanx for your fast replies.... but the problem is a little bit more complex, sorry for not giving all details at begining.
So the problem is following that in User Exit RV63A901 we like to use the table TKOMP.
This user exit is called by 2 FM.
PRICING_COMPLETE
PRICING_SUBSCREEN_PAI
in PRICING_COMPLETE TKOMP is not optional, but in the other one it is marked as OPTIONAL and therefore it's not available.
Using the solution with 'IS SUPPLIED' does not work in this case because I'm not directly in the FM I guess.
The solution IS INITIAL finish in a dump GETWA_NOT_ASSIGNED.
Are there any other ideas?
2008 Nov 24 10:52 AM
2008 Nov 24 12:18 PM
This unfortunatly does not work. Because TKOMP is not a Field symbol. Also when the dump calls it like this
2008 Nov 24 12:44 PM
Hi,
Anyhow since its a table, use DESCRIBE TABLE and check SY-TFILL or lines.
DESCRIBE TABLE itab.
IF SY-TFILL EQ 0. "IF no records exist
"Do without table
ENDIF.And this is my last suggestion, i will be glad if it works
Regards
Karthik D
2009 Aug 06 2:10 PM
Hi,
I am also facing same issue, any solution please update here.
Thanks & Regards
Vijayanand Poreddy
2009 Aug 06 9:32 PM
Hello Herbert,
I assume you get a dump information like this:
>
> This error may occur if
> - you address a typed field symbol before it has been set with
> ASSIGN or
> - if you address a global function interface partameter, even
> though the relevent function module is not active,
> i.e. it is not in the list of active calls. You can get the list
> of active calls from the this short dump.
>
Thus access to optional parameters is not possible in case the function module has not been called. Sounds like you need to know which module is calling your exit. If there is no obvious way to do so possibly it would make sense to check for notes in the customer service system.
Best Regards
Klaus
2009 Aug 06 2:34 PM
Hi,
You could call function SYSTEM_CALLSTACK to determine from which function the user exit is being called. Depending on the outcome, you could then decide to use the table or not.
Rgds,
Mark
2009 Aug 06 2:39 PM
For Eg:
Your Table name which is given in FM is T_data.
Now you declare your own internal table of the same type in the exit and write the code like this.
it_internal_tab[] = t_data[].
*now check whether it_internal table is initial or not
Regards,
Mayank
2009 Aug 06 3:03 PM
Hi,
I got a solution for this issue, but i am not able to justify what is the logic behind this. i kept a check above my code as follows
IF preisfindungsart_kopf is not initial.
<my exisisting code>
ENDIF
with this check, the code will be executed only after TKOMP is filled/avialable in that routine.
Regards
Vijayanand Poreddy
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |