Skip to Content
-1

Smartforms internal table is not getting filled

Feb 07 at 11:41 AM

50

avatar image

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

10 |10000 characters needed characters left characters exceeded

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.

0

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.

0

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.

0
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Best Answer
Rajkumar Narasimman Feb 07 at 02:51 PM
0

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

Share
10 |10000 characters needed characters left characters exceeded
Tim Schempp Feb 07 at 03:16 PM
0

Thank you. I really didn´t see it.

Share
10 |10000 characters needed characters left characters exceeded