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: 

Values in internal table appear as '00000' in debug mode

Former Member
0 Kudos

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?

1 ACCEPTED SOLUTION

jayanthi_jayaraman
Active Contributor
0 Kudos

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.

12 REPLIES 12

Former Member
0 Kudos

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[] .

0 Kudos

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

arindam_m
Active Contributor
0 Kudos

Hi,

Check the where condition hopefully the comparison is working. I think the comparison fails hence no records are shown.

Cheers,

Arindam

Former Member
0 Kudos

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

Former Member
0 Kudos

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.

0 Kudos

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_ITEM
WHERE KPOSN EQ

K_ITEM-ZEBELP .

In debug mode, the value of k_item-zebelp is as follows:

K_ITEM-ZEBELP                                     00010

Regards,

Narsingh

Former Member
0 Kudos

Hi Narsingh,

Check if the internal table is declared with header line. If it is declared with header line, then give itab[].

jayanthi_jayaraman
Active Contributor
0 Kudos

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.

0 Kudos

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.

0 Kudos

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.

0 Kudos

This message was moderated.

Former Member
0 Kudos

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