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

Submit Report in Background...

mrahhaoui
Participant
0 Likes
1,100

Hi Experts,

I have a problem when I want to execute my report in background rkaep000. There are some fields which are dynamic (e.g. "%%DYN001-LOW") . On my own selction screen I have some fields that are used in the standard report "rkaep000" as dynamic. So, I can't to pass the value to the standard report. Because the report doesn't work properly. I tried to see in the debugger and I remarked that the fields which their screen fields name are dynamics are filled in the table 'GT_FREE_SEL_RANGES[1]-FRANGE_T[1]-SELOPT_T'. But to be honnest I don't know how to use it and give the right name in my work area "wa_p-selname'. I already checked in the forum before to post my message.

Anybody could help me please?

Thanks in advance.

M.


"Controlling Area
  LOOP AT s_kokrs.
    CLEAR wa_p.
    wa_p-selname = 'P_KOKRS'.
    wa_p-kind = 'S'.
    wa_p-sign = s_kokrs-sign.
    wa_p-option = s_kokrs-option.
    wa_p-low = s_kokrs-low.
    wa_p-high = s_kokrs-high.
    APPEND wa_p TO i_tab.
  ENDLOOP.

"Partner Object
  LOOP AT s_parob.
    CLEAR wa_p.
    wa_p-selname = 'P_AROBJ'.
    wa_p-kind = 'S'.
    wa_p-sign = s_parob-sign.
    wa_p-option = s_parob-option.
    wa_p-low = s_parob-low.
    wa_p-high = s_parob-high.
    APPEND wa_p TO i_tab.
  ENDLOOP.

"Posting Date
  LOOP AT s_budat.
    CLEAR wa_p.
    wa_p-selname = 'R_BUDAT'.
    wa_p-kind = 'S'.
    wa_p-sign = s_budat-sign.
    wa_p-option = s_budat-option.
    wa_p-low = s_budat-low.
    wa_p-high = s_budat-high.
    APPEND wa_p TO i_tab.
  ENDLOOP.

"Debit Type
  CLEAR wa_p.
  wa_p-selname = 'BELTP'.
  wa_p-kind = 'P'.
  wa_p-sign = 'I'.
  wa_p-option = 'EQ'.
  wa_p-low = p_beltp.
  APPEND wa_p TO i_tab.

"Bus. Transaction
  LOOP AT s_vrgng.
    CLEAR wa_p.
    wa_p-selname = 'GT_FREE_SEL_RANGES[1]-FRANGE_T[1]-SELOPT_T'.
    wa_p-kind = 'S'.
    wa_p-sign = s_vrgng-sign.
    wa_p-option = s_vrgng-option.
    wa_p-low = s_vrgng-low.
    wa_p-high = s_vrgng-high.
    APPEND wa_p TO i_tab.
  ENDLOOP.

"Layout
  CLEAR wa_p.
  wa_p-selname = 'P_DISVAR'.
  wa_p-kind = 'P'.
  wa_p-sign = 'I'.
  wa_p-option = 'EQ'.
  wa_p-low = p_layout.
  APPEND wa_p TO i_tab.

  IF rd_cost = 'X'.
    SUBMIT rkaep000 WITH p_tcode = 'KSB1'  WITH SELECTION-TABLE i_tab
    TO SAP-SPOOL SPOOL PARAMETERS print_parameters ARCHIVE PARAMETERS archi_parameters
     WITHOUT SPOOL DYNPRO VIA JOB w_name NUMBER w_number
     AND RETURN.
 ENDIF.

Edited by: Alvaro Tejada Galindo on Jul 2, 2009 11:09 AM (Tried to fix the layout...)

Hi Experts,

I have a problem when I want to execute my report in background rkaep000. There are some fields which are dynamic (e.g. "%%DYN001-LOW") . On my own selction screen I have some fields that are used in the standard report "rkaep000" as dynamic. So, I can't to pass the value to the standard report. Because the report doesn't work properly. I tried to see in the debugger and I remarked that the fields which their screen fields name are dynamics are filled in the table 'GT_FREE_SEL_RANGES[1]-FRANGE_T[1]-SELOPT_T'. But to be honnest I don't know how to use it and give the right name in my work area "wa_p-selname'. I already checked in the forum before to post my message.

Anybody could help me please?

Thanks in advance.

M.


"Controlling Area
  LOOP AT s_kokrs.
    CLEAR wa_p.
    wa_p-selname = 'P_KOKRS'.
    wa_p-kind = 'S'.
    wa_p-sign = s_kokrs-sign.
    wa_p-option = s_kokrs-option.
    wa_p-low = s_kokrs-low.
    wa_p-high = s_kokrs-high.
    APPEND wa_p TO i_tab.
  ENDLOOP.

"Partner Object
  LOOP AT s_parob.
    CLEAR wa_p.
    wa_p-selname = 'P_AROBJ'.
    wa_p-kind = 'S'.
    wa_p-sign = s_parob-sign.
    wa_p-option = s_parob-option.
    wa_p-low = s_parob-low.
    wa_p-high = s_parob-high.
    APPEND wa_p TO i_tab.
  ENDLOOP.

"Posting Date
  LOOP AT s_budat.
    CLEAR wa_p.
    wa_p-selname = 'R_BUDAT'.
    wa_p-kind = 'S'.
    wa_p-sign = s_budat-sign.
    wa_p-option = s_budat-option.
    wa_p-low = s_budat-low.
    wa_p-high = s_budat-high.
    APPEND wa_p TO i_tab.
  ENDLOOP.

"Debit Type
  CLEAR wa_p.
  wa_p-selname = 'BELTP'.
  wa_p-kind = 'P'.
  wa_p-sign = 'I'.
  wa_p-option = 'EQ'.
  wa_p-low = p_beltp.
  APPEND wa_p TO i_tab.

"Bus. Transaction
  LOOP AT s_vrgng.
    CLEAR wa_p.
    wa_p-selname = 'GT_FREE_SEL_RANGES[1]-FRANGE_T[1]-SELOPT_T'.
    wa_p-kind = 'S'.
    wa_p-sign = s_vrgng-sign.
    wa_p-option = s_vrgng-option.
    wa_p-low = s_vrgng-low.
    wa_p-high = s_vrgng-high.
    APPEND wa_p TO i_tab.
  ENDLOOP.

"Layout
  CLEAR wa_p.
  wa_p-selname = 'P_DISVAR'.
  wa_p-kind = 'P'.
  wa_p-sign = 'I'.
  wa_p-option = 'EQ'.
  wa_p-low = p_layout.
  APPEND wa_p TO i_tab.

  IF rd_cost = 'X'.
    SUBMIT rkaep000 WITH p_tcode = 'KSB1'  WITH SELECTION-TABLE i_tab
    TO SAP-SPOOL SPOOL PARAMETERS print_parameters ARCHIVE PARAMETERS archi_parameters
     WITHOUT SPOOL DYNPRO VIA JOB w_name NUMBER w_number
     AND RETURN.
 ENDIF.

Edited by: Alvaro Tejada Galindo on Jul 2, 2009 11:09 AM (Tried to fix the layout...)

6 REPLIES 6
Read only

RaymondGiuseppi
Active Contributor
0 Likes
923

In the [SUBMIT|http://help.sap.com/abapdocu/en/ABAPSUBMIT.htm] statement,

- for dynamic selection : use the [WITH FREE SELECTIONS texpr|http://help.sap.com/abapdocu/en/ABAPSUBMIT_SELSCREEN_PARAMETERS.htm#!ABAP_ADDITION_5@5@] option, (textpr is an internal table of type RSDS_TEXPR from type group RSDS)

- for static selection use the [WITH SELECTION-TABLE rspar |http://help.sap.com/abapdocu/en/ABAPSUBMIT_SELSCREEN_PARAMETERS.htm#!ABAP_ADDITION_3@3@] option (rspar is an internal table of DD type RSPARAMS)

Regards,

Raymond

Read only

0 Likes
923

Thank you for your reply I tried to pass like you told me but when the partner object and the business transaction haven't been passed. I clicked on "Futher Selection Criteria" and selected the fields choosen but nothing inside.

*Partner Object
  LOOP AT s_parob.
    w_texpr-tablename = 'COVP'.
    w_expr-option = s_parob-option.
    w_expr-fieldname = 'PAROB1'.
    w_expr-low = s_parob-low.
    w_expr-high = s_parob-high.

    APPEND w_expr TO w_texpr-expr_tab.
    APPEND w_texpr TO texpr.
  ENDLOOP.

*  "Bus. Transaction
  LOOP AT s_vrgng.
    CLEAR wa_p.
    w_texpr-tablename = 'COVP'.
    w_expr-option = s_vrgng-option.
    w_expr-fieldname = 'VRGNG'.
    w_expr-low = s_vrgng-low.
    w_expr-high = s_vrgng-high.

    APPEND w_expr TO w_texpr-expr_tab.
    APPEND w_texpr TO texpr.
  ENDLOOP.
......

** Submit for KSB1 transaction -> Cost Center
  IF rd_cost = 'X'.
    SUBMIT rkaep000
      WITH p_tcode = 'KSB1'
*      WITH SELECTION-TABLE i_tab
      WITH FREE SELECTIONS texpr
      VIA SELECTION-SCREEN
       TO SAP-SPOOL
         SPOOL PARAMETERS print_parameters
         ARCHIVE PARAMETERS archi_parameters
         WITHOUT SPOOL DYNPRO
         VIA JOB w_name NUMBER w_number
       AND RETURN.

Read only

0 Likes
923

Try to use the FM FREE_SELECTIONS_RANGE_2_EX to convert RANGES to the required format.

Regards,

Raymond

Read only

0 Likes
923

What Should I to pass it. When I try with TEXPR I receive a dumping error.

Read only

0 Likes
923

Look at the sample at [WITH FREE SELECTIONS texpr |http://help.sap.com/abapdocu_70/en/ABAPSUBMIT_SELSCREEN_PARAMETERS.htm#!ABAP_ADDITION_5@5@]

(Just modify you code to fill a rsds_trange type and then convert via FM to rsds_texpr type.)

Regards,

Raymond

Read only

Former Member
0 Likes
923

Generally Ranges are just like internal tables and used to pass data in queries in where clause as select options.

If we have assign RANGES in selection screen, we have to pass some data before using them in queries.

So please check the queries where these ranges are used. do thes ranges have some data prior to used in queries?

These might have declared in your program.

Regds,

Anil