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

BAPI_SL_GETTOTALRECORDS selects no data

Former Member
0 Likes
737

Hi gurus. I'm writing an ABAP program that uses BAPI_SL_GETTOTALRECORDS, as follows:


PARAMETERS: p_bukrs TYPE bukrs OBLIGATORY DEFAULT '0542',
            p_gjahr TYPE gjahr OBLIGATORY DEFAULT sy-datum(4),
            p_monat TYPE monat OBLIGATORY DEFAULT sy-datum+4(2).

DATA: gt_totals_spl TYPE STANDARD TABLE OF bapi1021_totals_spl.

  DATA: lt_extin TYPE STANDARD TABLE OF bapiparex,
        lt_extout TYPE STANDARD TABLE OF bapiparex,
        lt_return TYPE bapiret2.

  data: l_ledger type RLDNR,
        l_peragg type BAVLD.

  l_ledger = 'VW'.
  l_peragg = ''.

  break-point.

  CALL FUNCTION 'BAPI_SL_GETTOTALRECORDS'
    EXPORTING
      ledger               = l_ledger
*      recordtype           = '0'
*      version              = '1'
      companycode          = p_bukrs
*      gl_account           = '13179210'
      fiscalyear           = p_gjahr
      period_agg           = l_peragg
    IMPORTING
      RETURN               = lt_return
    TABLES
      extensionin          = lt_extin
      totals_spl           = gt_totals_spl
      extensionout         = lt_extout.

The thing is that, no matter what input parameters I enter the program, the BAPI always returns no data.

I've tested it using SE37 with the same parameters and I get desired data.

Does anyone realize if ther'se anything wrong in my code? Am I missing something here?

2 REPLIES 2
Read only

Former Member
0 Likes
641

Hi

Were you able to solve it? I want to use the same BAPI.

Regards

Arjan

Read only

Former Member
0 Likes
641

Hi

When I use for version a 3 digit value (001) then the bapi finds the data from the summary table. Using less digits (1 or 2) the bapi will not find the data.