Application Development and Automation 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: 
Read only

Smartforms internal table is not getting filled

Former Member
0 Likes
1,622

Hi experts,

as I am new to ABAP I am struggeling on a simple select statement.

In my smartform I have access to a structure where the invoice number is stored.

I am reading the condition number out of table VBRK as i want to get all lines out of KONV where KNUMH matches.

Unfortunately my select is not filling the internal table gt_konv.

Thats the coding:

<code>  DATA: LS_KONV TYPE KONV.
  DATA: GT_KONV TYPE TABLE OF KONV.
  DATA: GV_KNUMH TYPE KNUMH.
  DATA: gv_knumv type knumv.
  SELECT SINGLE KNUMV FROM VBRK INTO GV_KNUMV WHERE
    VBELN = GS_HD_GEN-BIL_NUMBER.
    GV_KNUMH = GV_KNUMV.

  SELECT * FROM KONV INTO CORRESPONDING FIELDS OF TABLE GT_KONV WHERE
        KNUMH = GV_KNUMH.

The variables gv_knumv and gv_knumh are filled propperly.

If I search in SE16N I get a result, so there should actually be something filled

Any ideas on that?

Thanks

1 ACCEPTED SOLUTION
Read only

rajkumarnarasimman
Active Contributor
0 Likes
1,389

Hi Tim Schempp,

Consider KNUMV field in KONV table instead of KNUMH like below.

 SELECT * FROM KONV INTOCORRESPONDINGFIELDSOFTABLE GT_KONV WHERE  KNUMV = GV_KNUMH.

Regards

Rajkumar Narasimman

5 REPLIES 5
Read only

mmcisme1
Active Contributor
0 Likes
1,389

Did you try looking at the table VBRK and verify the invoice number is there? Then have you removed the 0s from your invoice? If so, put them back into the invoice number.

Next look at KONV and verify the number your retrieved from VBRK is there.

If it is there - then run in debug. Again I think your BIL_Number probably has the front 0s removed. That's a guess. Debug should be your friend. Remember - SAP doesn't like it when you query their tables without the leading 0s.

Read only

Former Member
0 Likes
1,389

Thanks for your reply.

The invoice number is there. I didn´t remove the leading zeros. But actually the first select works correct.

I select with the value of the gv_knumh respectively with gv_knumv in KONV.

As I used the debugger I saw, that also the values of the condition are used with leading zeros.

Copying the value of gv_knumh and searching in SE16N finds a result.

Read only

rajkumarnarasimman
Active Contributor
0 Likes
1,390

Hi Tim Schempp,

Consider KNUMV field in KONV table instead of KNUMH like below.

 SELECT * FROM KONV INTOCORRESPONDINGFIELDSOFTABLE GT_KONV WHERE  KNUMV = GV_KNUMH.

Regards

Rajkumar Narasimman

Read only

Former Member
0 Likes
1,389

Thank you. I really didn´t see it.

Read only

Jelena_Perfiljeva
Active Contributor
0 Likes
1,389

This is already closed but I feel it's important to point out that we should avoid such SELECTs in the forms. If you're using the standard billing output structure type LBBIL_INVOICE in the interface and a standard program (or at least a custom one that has most of the same logic) then you should already have the pricing information in the tables IT_KOND or HD_KOND.

If a certain pricing condition is not included there then it might be just missing the print flag in the pricing procedure configuration. This is an easy change that does not affect anything other than output.