2023 Sep 25 4:10 PM
Hi everyone,
I'm facing this kind of conflict type dump in my ZPROGRAM while calling the fm "FREE_SELECTIONS_RANGE_2_EX".
I have to SUBMIT transaction FBL5N passing free selections like I do manually in 2 fields:
HKONT
and BUDAT
*****Below is the piece of code regarding this part.
DATA: first_day TYPE sy-datum,
last_day TYPE sy-datum.
DATA: BEGIN OF it_saknr_m OCCURS 0,
saknr TYPE saknr,
mitkz TYPE mitkz,
END OF it_saknr_m,
wa_saknr_m LIKE LINE OF it_saknr_m.
DATA: trange TYPE rsds_trange WITH HEADER LINE,
trange_line LIKE LINE OF trange,
trange_frange_t_line_bsid LIKE LINE OF trange_line-frange_t,
trange_frange_bsid LIKE LINE OF trange_frange_t_line_bsid-selopt_t,
texpr TYPE rsds_texpr.
LOOP AT it_saknr_m INTO wa_saknr_m.
CASE wa_saknr_m-mitkz.
WHEN 'D'.
trange_line-tablename = 'BSID'.
APPEND trange_line TO trange.
trange_frange_t_line_bsid-fieldname = 'BUDAT'.
trange_frange_bsid-sign = 'I'.
trange_frange_bsid-option = 'BT'.
trange_frange_bsid-low = first_day.
trange_frange_bsid-high = last_day.
APPEND trange_frange_bsid
TO trange_frange_t_line_bsid-selopt_t.
APPEND trange_frange_t_line_bsid TO trange_line-frange_t.
CLEAR: trange_frange_t_line_bsid, trange_frange_bsid.
trange_frange_t_line_bsid-fieldname = 'HKONT'.
trange_frange_bsid-sign = 'I'.
trange_frange_bsid-option = 'EQ'.
trange_frange_bsid-low = wa_saknr_m-saknr.
trange_frange_bsid-high = ''.
APPEND trange_frange_bsid
TO trange_frange_t_line_bsid-selopt_t.
APPEND trange_frange_t_line_bsid TO trange_line-frange_t.
ENDLOOP.
LOOP AT trange.
lv_index = sy-tabix.
IF trange-tablename = 'BSID'.
trange-frange_t = trange_line-frange_t.
MODIFY trange INDEX lv_index.
ENDIF.
…..
ENDLOOP.
**** At this point this is what I have in the TRIANGE table
*** And here is where the dump occurs
CALL FUNCTION 'FREE_SELECTIONS_RANGE_2_EX'
EXPORTING
field_ranges = trange
IMPORTING
expressions = texpr.
2023 Sep 25 5:03 PM
Stop using header lines, they are OBSOLETE.
They are OBSOLETE just because this kind of error happens.
Error is normal, be careful.
FUNCTION FREE_SELECTIONS_RANGE_2_EX
IMPORTING
VALUE(FIELD_RANGES) TYPE RSDS_TRANGE
EXPORTING
VALUE(EXPRESSIONS) TYPE RSDS_TEXPR.
DATA: trange TYPE rsds_trange WITH HEADER LINE, <=================
If you are using ABAP 7.40 or +, use constructor expressions instead of all your old ABAP.
2023 Sep 25 5:17 PM
Thank you sandra.rossi for your advice,
Unfortunately, the company I work for has all employees and programs that use old ABAP and to align everything they kept it that way.
2023 Sep 25 7:34 PM