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: 

SUBMIT REPORT and SELECTION-TABLE

alekszo
Explorer
905

Hello,

I am trying to call report RIEQUI20 with selection table. I noticed that if my selection table contains selections on field EQUNR, only the first entry in selection table is factored in, the rest are ignored.

The following code calls report RIEUI20 with two selections on field EQUNR. The report returns the entry for equipment 10004174. The one with number 10004171 is ignored and not returned. If I switch the order in selection table so that EQUNR 10004171 is the first entry, only the equipment 10004171 is returned by the report. The expected behavior would be that the report returns both equipments 10004174 and 10004171.


  DATA:

        selection_table TYPE TABLE OF rsparams,
        selection TYPE rsparams.

  selection-selname = 'EQUNR'.
  selection-sign = 'I'.
  selection-kind = 'S'.
  selection-option = 'EQ'.
  selection-low = '10004174'.

  APPEND selection TO selection_table.

  selection-selname = 'EQUNR'.
  selection-sign = 'I'.
  selection-kind = 'S'.
  selection-option = 'EQ'.
  selection-low = '10004171'.

  APPEND selection TO selection_table.

  SUBMIT riequi20
    WITH SELECTION-TABLE selection_table
    AND RETURN.

In this particular report this behavior seems to occur only with selections on EQUNR. Selections on other fields seem to work properly. I observed the same behavior with report RIAUFK20 with selection on AUFNR. Performing the same selections via SE38 returns correct data.

What is the cause of this? Can't selections on these fields be passed to the report via selection-tables? If so, why and how should one do it?

Thank you in advance,

Aleks

1 ACCEPTED SOLUTION

gabmarian
Active Contributor
374

You are missing the leading zeros. Both types EQUNR and AUFNR using alpha conversion and selection table expects the values in internal format.

(It seems though that the conversion exit is automatically applied on the first record but not on the rest of them).

7 REPLIES 7

gabmarian
Active Contributor
375

You are missing the leading zeros. Both types EQUNR and AUFNR using alpha conversion and selection table expects the values in internal format.

(It seems though that the conversion exit is automatically applied on the first record but not on the rest of them).

374

Thank you! It works now!

374
  selection-selname = 'EQUNR'.
  selection-sign = 'I'.
  selection-kind = 'S'.
  selection-option = 'EQ'.
  selection-low = conv equnr( '10004174' ). 

374
Frederic Girod Unfortunately, I'm afraid CONV does not execute any conversion exit. CONV is only for ABAP type conversion, it doesn't look at DDIC peculiarities. You have to do it the old way. Or eventually use the string template because ALPHA (it's the conversion exit of EQUNR) is the only conversion exit managed:
  selection-low = |{ CONV equnr( '10004174' ) ALPHA = IN }|. 

0 Kudos
374

Yep it does not work, I let my comment for your correction

This is typicaly the statement not logic, not easy to read

thanga_prakash
Active Contributor
374

@Aleksander Zotov It is problem with the conversion, where it was not adding leading zeroes except first line, try with the code below

DATA:selection_table TYPE TABLE OF rsparams,
     selection       TYPE rsparams.

selection-selname = 'EQUNR'.
selection-sign = 'I'.
selection-kind = 'S'.
selection-option = 'EQ'.
selection-low = CONV equnr( |{ '10004174' ALPHA = IN }| ).

APPEND selection TO selection_table.

selection-selname = 'EQUNR'.
selection-sign = 'I'.
selection-kind = 'S'.
selection-option = 'EQ'.
selection-low = CONV equnr( |{ '10004171' ALPHA = IN }| ).

APPEND selection TO selection_table.

SUBMIT riequi20
  WITH SELECTION-TABLE selection_table
  AND RETURN.

FredericGirod
Active Contributor
0 Kudos
374
  selection-selname = 'EQUNR'.
  selection-sign = 'I'.
  selection-kind = 'S'.
  selection-option = 'EQ'.
  selection-low = conv equnr( '10004174' ).