cancel
Showing results for 
Search instead for 
Did you mean: 

infopackage: routine to select values from DSO

Former Member
0 Kudos

Hi experts

I need to filter the value for document number FC_OPBEL in an infopackage.

The source for the relevant document numbers is a DSO ZFC_DS85.

The following routine doesn't extract the relevant document numbers from source system ERP although they already exist there.

What's wrong on this routine?

Thanks!

Accepted Solutions (1)

Accepted Solutions (1)

sander_vanwilligen
Active Contributor
0 Kudos

Hi Thomas,

In general I suggest to debug the coding. E.g. put the statement BREAK-POINT before the SELECT statement and run the InfoPackage in dialog (i.e. not in background). Then you can have a look at the variables and how the processing is done.

E.g. the routine should look as follows:

form compute_CALMONTH

  tables   l_t_range      structure rssdlrange

  using    p_infopackage  type rslogdpid

           p_fieldname    type rsfnm

  changing p_subrc        like sy-subrc.

  DATA: l_idx LIKE sy-tabix.

  READ TABLE l_t_range WITH KEY

       fieldname = 'CALMONTH'.

  l_idx = sy-tabix.

*....

  BREAK-POINT.

  MODIFY l_t_range INDEX l_idx.

  p_subrc = 0.

endform.

Please note the last statement P_SUBRC = 0 which is always required. Otherwise it does not work.

Furthermore, is the field name correct?

Best regards,

Sander

Former Member
0 Kudos

Hi experts

Problem solved! Thanks

DATA: l_idx like sy-tabix.

READ TABLE l_t_range with key     fieldname = 'OPBEL'.

TYPES: BEGIN OF ds85,   

                     FC_OPBEL TYPE /BI0/OIFC_OPBEL,   

              END OF ds85.

DATA: wa TYPE ds85.

DATA: it_beleg TYPE TABLE OF ds85.

SELECT FC_OPBEL

        FROM /bic/azfc_ds8500 

        INTO TABLE it_beleg.

DELETE ADJACENT DUPLICATES FROM it_beleg.

SORT it_beleg BY FC_OPBEL.

IF it_beleg IS NOT INITIAL.

LOOP AT it_beleg INTO wa. 

     l_t_range-low = wa-FC_OPBEL.

     l_idx = sy-tabix. 

       IF l_idx = 1.  

             modify l_t_range index l_idx.

          ELSE.   

          APPEND l_t_range TO l_t_range. 

     ENDIF. 

CLEAR wa.

ENDLOOP.

ENDIF.

p_subrc = 0.

Answers (0)