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 rep WITH FREE SELECTIONS

Former Member
0 Kudos

I created a report that displays a grid. From the grid you can click on a cell to drill down to another report.

When the user clicks on a hot spot, I build a submit call and call the drill down transaction with the following code:

SUBMIT rkaep000

WITH FREE SELECTIONS wtbl_rsds_texpr

WITH kostl = wa_kostl

WITH kstar = wa_kstar

WITH r_budat BETWEEN wa_budat AND lc_date_high

WITH p_usedb = 'X'

WITH p_usear = ' '

WITH p_tcode = p_tr

AND RETURN.

Everything worked fine until recently when the user wanted to further expand the selection criteria with a dynamic selection parameter. I found the appropriate statement WITH FREE SELECTIONS, created and populated the correct structure and added it to my submit statement above.

The SUBMIT handles all the parameters fine except WITH FREE SELECTIONS - this is ignored during the call.

I have read and reread the help section for WITH FREE SELECTIONS and am beginning to think that I may not be able to call a program and pass it dynamic select option.

Does anyone have any ideas on this.

Thanks in advance,

Marty K.

1 ACCEPTED SOLUTION

andreas_mann3
Active Contributor
0 Kudos

Hi Martin,

it's fine, that your problem is solved.

So please say

'Thanks the SDN way'. Click on the yellow star, and award suitable points.

Check out this weblog:

/people/mark.finnern/blog/2004/08/10/spread-the-love

regards Andreas

20 REPLIES 20

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

Are you sure that you are appending to your internal table wtbl_rsds_texpr.

Regards,

Rich Heilman

Former Member
0 Kudos

Hi Martin,

It looks like you are on the right track here but I can't see why you are not able to pass on the dynamic selection values to the 'SUBMIT' statement.

If I look at the documentation, it says that you are to fill in your dynamic selections in an internal table of type RSDS_TEXPR which you are doing. How are you filling this 'wtbl_rsds_texpr' table? There are some function modules suggested by the documentation. Are you using them?

If possible could please paste the section of the code where you fill this internal table?

Regards,

Srinivas

Former Member
0 Kudos

Thank you for the quick responses. Here are the data declarations and set-up of the structure.

DATA l_expr TYPE rsds_expr.

DATA l_etab TYPE rsds_expr_tab.

DATA wa_etab TYPE LINE OF rsds_expr_tab.

wa_etab-fieldname = 'BLDAT'.

wa_etab-option = 'BT'.

wa_etab-low = '19000101'.

wa_etab-high = wa_bldat.

APPEND wa_etab TO l_etab.

l_expr-tablename = 'COOI'.

l_expr-expr_tab = l_etab.

INSERT l_expr INTO wtbl_rsds_texpr INDEX 1.

The TR I am submitting to is KSB2. I found the code they used to build this structure and duplicated it. Our structures 'look' identical at runtime. I did see the FMs RS_REFRESH_FROM_DYNAMICAL_SEL and FREE_SELECTIONS_RANGE_2_EX but it looks to me like these would be used to extract parameters from a program you are in and use them to pass out. I need to create my select option from a hot spot on the grid and force the next report to use this dynamically. When I step through the submit and get to the form that sets up the dynamic selection there is no trace of my code in the calling programs like structure. So I am either passing this incorrectly or it just isn't possible

I also thought about creating a dynamic variant but this also does not appear to welcome dynamic selection criteria.

Thanks again in advance,

Marty K

0 Kudos

Hi Martin,

By looking at your code here, it looks like the problem is where you are filling l_expr.

> DATA l_expr TYPE rsds_expr.

> DATA l_etab TYPE rsds_expr_tab.

> DATA wa_etab TYPE LINE OF rsds_expr_tab.

>

> wa_etab-fieldname = 'BLDAT'.

> wa_etab-option = 'BT'.

> wa_etab-low = '19000101'.

> wa_etab-high = wa_bldat.

> APPEND wa_etab TO l_etab.

>

> l_expr-tablename = 'COOI'.

> l_expr-expr_tab = l_etab.<b> <-- comment out this line</b>

l_expr-expr_tab[] = l_etab[]<b> <------do this</b>

> INSERT l_expr INTO wtbl_rsds_texpr INDEX 1. <b><--- i am not sure why you needed this 'wtbl_rsds_texpr'</b>

Please let me know if you still have a problem along with the section of the code again.

Srinivas

0 Kudos

Thanks again for this quick response.

I tried your code and the results were identical to mine except that without this line of code -->INSERT l_expr INTO wtbl_rsds_texpr INDEX 1. I end up with a Deep structure and the program is looking for a nested table (I am not sure if this makes a difference). But the contents are identical either way.

The dynamic selection is passing to the called program but the called program is not handling the selection.

Thanks again,

Marty K.

0 Kudos

Forgive me if I'm missing something here. Any reason why you can't do the following?

Ranges: some_date for sy-datum.

some_date-sign = 'I'.

some_date-option = 'BT'.

some_date-low = '19000101'.

some_date-high = wa_bldat.

APPEND some_date.

submit <report>

with s_date in some_date.

0 Kudos

Hi Srinivas. In regards to your comments:

l_expr-expr_tab = l_etab. <-- comment out this line

l_expr-expr_tab[] = l_etab[] <------do this

Since these 2 tables are defined WITHOUT header lines, these statements are equivalent although I do prefer to use the bracket notation to improve readability.

Thanks for your posting.

andreas_mann3
Active Contributor
0 Kudos

Martin,

i think abap rkaep000 has <b>no</b> free selections

in terms of a logical database (ldb) !

(i'll guess here's another procedurs as ldb )

-> so you <b>can't</b> use the parameter

with free selections !

Andreas

0 Kudos

Rich,

Thanks for your comments. The problem is that this particular parameter is dynamic, not static and it cannot be addressed directly that I am aware of.

Andreas,

Although I am inexperienced, I think your explanation about the ldb is probably correct.

Does anyone have any other ideas on how I can accomplish this?

If not, thanks for all the responses. This was the first time I used the forum and am impressed with the timely responses.

Marty K

0 Kudos

Can you please explain to me what makes a parameters/select-option dynamic?

Regards,

Rich Heilman

0 Kudos

Thanks again for the response Rich.

If you go to Transaction KSB2

->enter a cost center

->choose 'further selection criteria'

->open the 'documents/objects' folder

->choose the 'document date' select option

This is the field I am having trouble addressing in my call. I you look at the technical information of the first field here it shows a screen field name of

'%%DYN001-LOW'. If go back to the folder and choose another select option, say 'user name', and look at the technical information for both fields, 'user name' now has '%%DYN001-LOW' and the original option selected ('document date')has '%%DYN002-LOW'.

At runtime the program builds a table of the type rsds_texpr like I have described earlier with all of your dynamic select-options and builds a DB where clause based upon these values.

There is no way (I can see) to address these select-options directly. However, it seems to me if the standard transaction KSB2 can do it, then you should be able to also do from a custom call to the program.

Again thanks in advance for any help,

Marty K

0 Kudos

Thanks for the response. Now I understand what you mean. I, however, have never seen this before today. They only thing that I can think of is maybe calling the transaction KSB2 using BDC in MODE "E". Do the recording up to and including the "Execute" step. Transaction will stop at the next screen.

Regards,

Rich Heilman

0 Kudos

Here is a quick and dirty of a BDC that I just threw together. It updates your dynamic selection and executes the report.

Implement this sample and check it out. Should give you what you need.

Regards,

Rich Heilman

report zrich_0004

no standard page heading line-size 255.

data: bdcdata like bdcdata occurs 0 with header line.

parameters: p_kostl type csks-kostl.

start-of-selection.

perform bdc_dynpro using 'RKAEP000' '0300'.

perform bdc_field using 'BDC_CURSOR'

'KOSTL-LOW'.

perform bdc_field using 'BDC_OKCODE'

'=UCFS'.

perform bdc_dynpro using 'SAPLSSEL' '1104'.

perform bdc_field using 'BDC_OKCODE'

'=%_GC 116 25'.

perform bdc_dynpro using 'SAPLSSEL' '1104'.

perform bdc_field using 'BDC_OKCODE'

'=CRET'.

perform bdc_field using 'BDC_CURSOR'

'%%DYN001-HIGH'.

perform bdc_field using '%%DYN001-LOW'

'01/01/2004'.

perform bdc_field using '%%DYN001-HIGH'

'02/05/2004'.

perform bdc_dynpro using 'RKAEP000' '0300'.

perform bdc_field using 'BDC_CURSOR'

'KOSTL-LOW'.

perform bdc_field using 'BDC_OKCODE'

'=ONLI'.

perform bdc_field using 'KOSTL-LOW'

p_kostl.

call transaction 'KSB2' using bdcdata

mode 'E'.

----


  • Start new screen *

----


form bdc_dynpro using program dynpro.

clear bdcdata.

bdcdata-program = program.

bdcdata-dynpro = dynpro.

bdcdata-dynbegin = 'X'.

append bdcdata.

endform.

----


  • Insert field *

----


form bdc_field using fnam fval.

clear bdcdata.

bdcdata-fnam = fnam.

bdcdata-fval = fval.

append bdcdata.

endform.

0 Kudos

Rich - thank you again for the quick response and code.

The problem with CALL TRANSACTION is that although it will process the transaction it will not display it on the screen. I am calling program KSB2 from a grid as a means of allowing the user to drilldown from a grid selection and then return to the grid.

Before I knew about the SUBMIT statement I was experimenting with CALL TRANSACTION but was unable to get it to <u>display</u> the transaction for the user and then return.

Thanks again to everyone for monitoring this post.

Marty K

0 Kudos

Have you implemented my program? This BDC will stop for user interaction. The mode is set to 'E' which means that it will stop for errors. If a screen is thrown that the BDC is not expecting, it will stop and allow the user to finish it.

Regards,

Rich Heilman

0 Kudos

Rich,

I must apologize as I did not run this code (I was basing my reply on previous experience). I will give this a try and let you know how it goes.

Thanks again,

Marty K

andreas_mann3
Active Contributor
0 Kudos

Hi Martin ,

here's another possible solution:

in include RKAEPFOB there's an import of table

table l_t_texpr

form free_selection_mem

...

WHEN 'I'.

IMPORT ct_fields

ct_free_selection

ct_free_sel_ranges

ct_expressions FROM MEMORY ID ls_memory_id.

...

Just debug !

Let's know, if this helps.

regards Andreas

Forum Home | Help | Search

0 Kudos

Thanks again for all the prompt responses.

Andreas,

I tried your suggestion as it looks to be a little more seamless than the CALL TRANSACTION solution.

I have been initially successful in moving my ct_expressions table into the submitted program via EXPORT/IMPORT but that is as far as I have gotten. I still need to build the remaining import structures.

I will give you a final report of any success.

Thanks again to everyone for the ideas.

Marty K

0 Kudos

To All who have been monitoring this post,

I have implemented the solution Andreas suggested (using EXPORT TO MEMORY) and initial testing shows it to be working as designed.

Thanks again to everyone for the assistance.

Marty K

andreas_mann3
Active Contributor
0 Kudos

Hi Martin,

it's fine, that your problem is solved.

So please say

'Thanks the SDN way'. Click on the yellow star, and award suitable points.

Check out this weblog:

/people/mark.finnern/blog/2004/08/10/spread-the-love

regards Andreas