06-04-2013 4:56 PM
I am passing an internal table to smartform as interface parameter.
In the print program, the values are correctly populated into the internal table;
But when I debug the same internal table in smartform, the value column shows '00000' whereas, double clicking the internal table name, I can see the data in it.
In the report, I am using the append statement also:
APPEND
k_konv_item TO
i_konv_item.
Then, I am passing this itab to smartform:
[...]
TABLES
i_item = i_item
i_cond = i_cond
i_cond_item = i_konv_item
[...]
Now, I need to put a loop on this itab in the smartform and need to display the values item-wise.
When I do that with a where condition in the loop, the work area is blank and not fetching any value.
But, if I do the loop without any condition, then the data gets fetched into the work area! but I want the data to be fetched based on condition.
Could anyone help me in this issue please?
06-05-2013 6:04 AM
Hi,
Make sure the value which you give in where condition is exactly the same as you see in the internal table. Sometimes, leading zero can cause difference.
06-04-2013 8:13 PM
How are the internal tables declared in program as well as in smartform. I think you declared the itab WITH HEADERLINE. Debugger would show as table only if you add a Square bracket after the table name.ex. i_cond_item[] .
06-05-2013 5:22 AM
Hi Karthik,
The declarations are like this:
IN Print program:
i_konv_item type standard table of z_purchaseorder_cond_item (this is a structure defined)
k_konv_item type z_purchaseorder_cond_item
In Smartform:
Form Interfaces >> Tables:
i_cond_item type z_purchaseorder_cond_item
Global Definitions:
k_cond_item type z_purchaseorder_cond_item_tab (this is a line type / table type referring structure
z_purchaseorder_cond_item)
Is there any way to extract the data from such an internal table using loop?
Regards,
Narsingh
06-05-2013 1:22 AM
Hi,
Check the where condition hopefully the comparison is working. I think the comparison fails hence no records are shown.
Cheers,
Arindam
06-05-2013 5:26 AM
Hi Arindam,
I am putting a condition like this:
Loop at i_cond_item into k_cond_item where kposn = zebelp.
(Kposn is a variable declared in the structure referred by i_cond_item).
Also, zebelp is not initial.
if i double click the i_cond_item during debug mode, it has values in it:
KPOSN Value
10 xxxxxxxxxxxxxxxxx
20 xxxxxxxxxxxxxx
06-05-2013 5:27 AM
Let us see the condition you used and the entries of your internal table while debugging the form, so that we can check where the problem is.
06-05-2013 11:04 AM
Hi Rhea,
When I double click on the internal table name in debugging, following are the values in it:
Line KPOSN ZVTEXT KWERT
1 10 Discount % on Gross 1162.45-
2 10 Cash Discount 441.73-
3 20 Discount % on Gross 124.90-
4 20 Cash Discount 47.46-
I am using following loop statement in smartform:
LOOP
AT I_COND_ITEM INTO K_COND_ITEMK_ITEM-ZEBELP .
In debug mode, the value of k_item-zebelp is as follows:
K_ITEM-ZEBELP 00010
Regards,
Narsingh
06-05-2013 5:28 AM
Hi Narsingh,
Check if the internal table is declared with header line. If it is declared with header line, then give itab[].
06-05-2013 6:04 AM
Hi,
Make sure the value which you give in where condition is exactly the same as you see in the internal table. Sometimes, leading zero can cause difference.
06-05-2013 12:44 PM
Thanks Jayanthi.
There were no leading zeroes in internal table contents.
But, the comparision value contained leading zeros.
So I removed these and was able to fetch the correct data.
06-06-2013 3:11 AM
so KPOSN and ZEBELP have different types so it failed here:
WHERE KPOSN EQ K_ITEM-ZEBELP
best practice is to make sure fields used in conditions have the same types.
06-06-2013 3:11 AM
06-05-2013 9:16 AM
Hi ,
First in debugging mode check the table values that you are passing to smartform, I mean check its values right before it calls the smartform function module.
Also as you describe the problem you are saying that the data is shown when you try to print without when condition but when u put condition it is not, which can only mean one thing that your where condition must be putting some condition that your loop is not working.
Secondly, the problem that you are saying the values in the workarea is showing 'XXXXXX' or may be "*****" this normally happens when you use At-first command or At-end command. If thats the case please move this to another work area first and then use it , or check if similar thing is happening in your smartform loop.
I hope this helps.
Cheers!
Robindra Jain