‎2007 Jun 06 10:58 PM
Hi Experts,
I need to pass parameters(paras&select-options) from Z_FM to report prog.
So, our experts r suggected,
<i><b>submit my_prog with S_CUST = S_CUST-LOW and return</b></i>
but, its working only for one parameter, say S_CUST, but I hv multiple parameters hv to pass, so, in that case,
1) Wht is the syntax?
thanq.
‎2007 Jun 06 11:33 PM
Hi Sridhar
You can definitely pass multiple parameters and select-options thorugh your submit statement. I am giving you an example of how i have used it in my report and you can then replace the parameters with your own.
please see the code below:
SUBMIT X
WITH s_auart IN s_auart
WITH s_aufnr IN s_aufnr
WITH s_addat IN s_addat
WITH x_dy_his EQ x_dy_his
WITH x_dy_iar EQ x_dy_iar
WITH x_dy_mab EQ x_dy_mab
WITH x_dy_ofn EQ x_dy_ofn
WITH s_equnr IN s_equnr
WITH s_gewrk IN s_gewrk
WITH p_disvar EQ p_disvar
WITH s_fsavd IN s_fsavd
WITH s_fsedd IN s_fsedd
WITH s_op_sy IN s_op_sy
WITH s_op_usr IN s_op_usr
WITH s_pernr IN s_pernr
WITH s_steus IN s_steus
WITH s_wo_sy IN s_wo_sy
WITH s_wo_usr IN s_wo_usr
WITH s_ingpr IN s_ingpr
WITH s_iwerk IN s_iwerk
WITH s_tplnr IN s_tplnr
WITH s_vawrk IN s_vawrk
WITH s_revnr IN s_revnr
WITH s_arbpl IN s_arbpl
WITH s_werks IN s_werks
AND RETURN.
Note: X is the program name here.
Hope this helps.
Cheers
shivika
‎2007 Jun 06 11:02 PM
See the example code :
DATA: t_param LIKE rsparams OCCURS 10 WITH HEADER LINE.
- Company Code
t_param-selname = 'I_VBUKR'. t_param-kind = 'P'.
t_param-low = s_bukrs-low.
APPEND t_param.
*-- Period
t_param-selname = 'I_LFMON'. t_param-kind = 'P'.
t_param-low = wa_lfmon.
APPEND t_param.
*-- Fiscal Year
t_param-selname = 'I_LFGJA'. t_param-kind = 'P'.
t_param-low = wa_lfgja.
APPEND t_param.
*-- Check and close period (Default 'X')
t_param-selname = 'I_XCOMP'. t_param-kind = 'P'.
t_param-low = wa_xcomp.
APPEND t_param.
SUBMIT rmmmperi VIA SELECTION-SCREEN
WITH SELECTION-TABLE t_param
AND RETURN.
‎2007 Jun 06 11:39 PM
Thanks Sheshu.
In ur following statements,
<i><b>t_param-selname = 'I_VBUKR'. t_param-kind = 'P'.
t_param-low = s_bukrs-low.
APPEND t_param</b></i>
But, I dont understand that,
1) Wht is <i><b>'I_VBUKR'</b></i>
2) As I need to pass the select-options, I can modify ur syntax to my requirement i.e. select-options, by adding SIGN; OPTION; LOW; HIGH! Is it correct?
thank you,
‎2007 Jun 07 12:38 AM
Hello Sridhar,
It is very simple
In ur following statements,
t_param-selname = 'I_VBUKR'. " This is your report selection screen field
t_param-kind = 'P'. " Type P is parameter S is select-options
t_param-low = s_bukrs-low. " This is ur function module selection
t_param-sign = 'I' . " you can give what ever
t_param-option = 'EQ'
APPEND t_param
Hope you understand.
‎2007 Jun 06 11:33 PM
Hi Sridhar
You can definitely pass multiple parameters and select-options thorugh your submit statement. I am giving you an example of how i have used it in my report and you can then replace the parameters with your own.
please see the code below:
SUBMIT X
WITH s_auart IN s_auart
WITH s_aufnr IN s_aufnr
WITH s_addat IN s_addat
WITH x_dy_his EQ x_dy_his
WITH x_dy_iar EQ x_dy_iar
WITH x_dy_mab EQ x_dy_mab
WITH x_dy_ofn EQ x_dy_ofn
WITH s_equnr IN s_equnr
WITH s_gewrk IN s_gewrk
WITH p_disvar EQ p_disvar
WITH s_fsavd IN s_fsavd
WITH s_fsedd IN s_fsedd
WITH s_op_sy IN s_op_sy
WITH s_op_usr IN s_op_usr
WITH s_pernr IN s_pernr
WITH s_steus IN s_steus
WITH s_wo_sy IN s_wo_sy
WITH s_wo_usr IN s_wo_usr
WITH s_ingpr IN s_ingpr
WITH s_iwerk IN s_iwerk
WITH s_tplnr IN s_tplnr
WITH s_vawrk IN s_vawrk
WITH s_revnr IN s_revnr
WITH s_arbpl IN s_arbpl
WITH s_werks IN s_werks
AND RETURN.
Note: X is the program name here.
Hope this helps.
Cheers
shivika
‎2007 Jun 06 11:43 PM
Thank you Bhorchi.
R U sure that,
1) U can use RETURN along with WITH statement?
2) R U sure the control comes back from X report to called FM?
3) Bcoz, I hv written like,
submit YESR2416_QUOTE_APPROVAL_FINAL
with SS_STATS = SS_STATS-LOW
and return.
In this case, the control did not come back(so no output data obtained the FM from X report i.e. purpose did not served!)
OK, Anyways, I am trying now, let u know.
thank you,
Message was edited by:
Sridhar
‎2007 Jun 06 11:50 PM
Hi Sridhar,
The Control will definately come to the calling program, but as you are saying that the FM has not obtained the output from report X.
SUBMIT does not guaruntee you that output will come to the calling FM. You have to use EXPORT in report X and IMPORT in FM to get the output.
Hope it is clear.
Regards,
Atish
Message was edited by:
Atish Sarda
‎2007 Jun 06 11:53 PM
Hey Sridhar
Are you using your submit in a function module?
Please note that You can start a type 1 program and the corresponding processor in the runtime environment using the SUBMIT statement in another ABAP program.I dont think the control will come back to your FM. What is your requirement?
Cheers
shivika
Message was edited by:
Shivika Bhorchi
‎2007 Jun 06 11:55 PM
> 1) U can use RETURN along with WITH statement?
YES
> 2) R U sure the control comes back from X report to
> called FM?
YES
> 3) Bcoz, I hv written like,
>
> submit YESR2416_QUOTE_APPROVAL_FINAL
> with SS_STATS = SS_STATS-LOW
Change it to
submit YESR2416_QUOTE_APPROVAL_FINAL
with SS_STATS in SS_STATS
and RETURN.
You can check the sy-subrc after the SUBMIT in your function module to check if it was successful or not. You can also put a break point in the submitted prog to verify if it is failing.
~Suresh
‎2007 Jun 07 12:27 AM
Thank you,
Yes, control is not coming back!
My requirement is,
I am passing select-options(values) from a BAPi to X report(ALV), there I get the output by using passed selec-options, later I hv to pass this output to called BAPi.
thank you,
‎2007 Jun 07 12:33 AM
Hi Sarda,
Yes, ym using the EXPORT in X report and IMPORT in my FM/BAPi.
But, the problem is the control is not coming back from X report to FM/BAPi!
Actually, this X report,
1) is hving the selection-screen feature,Does make any difference in sending back the control?
2) yields in ALV report after entering the input on selection screen by users.
3) Other category users calls X report from BAPi
So, How to obtain control back to BAPi?
thank you,
‎2007 Jun 07 12:35 AM
Hi Suresh,
(am using the EXPORT in X report and IMPORT in my FM/BAPi. )
No, control is not coming back!
(But, the problem is the control is not coming back from X report to FM/BAPi!)
Actually, this X report,
1) is hving the selection-screen feature, Does make any difference in sending back the control?
2) yields in ALV report after entering the input on selection screen by users.
3) Other category users calls X report from BAPi
So, How to obtain control back to BAPi?
thank you,
‎2007 Jun 07 12:35 AM
Hey Sridhar
In that case you will have to export your list table to a memory and then import this list in your BAPI from this memory.
The logic would be similar to using FM 'LIST_TO_MEMORY' in your report and then 'LIST_FROM_MEMORY in your BAPI.
LIST_TO_MEMORY has not been released by SAP so u you should not use this. But you can always check the logic and see if you can use the same.
Remember to free the memory once you import the table in your BAPI.
This should work.
cheers
shivika
‎2007 Jun 07 12:40 AM
Hi Sridhar,
It is strange. Control will definately come to the calling program, in your case BAPI.
Selection screen will not make any difference in sending back the control.
Have you tried in the debugging. Just put a break point after the SUBMIT and check if program comes upto that stage.
Let me know the outcome, and please paste the code of SUBMIT you are using.
Regards,
Atish
‎2007 Jun 07 1:04 AM
Hi Sarda,
I tried with all SUBMITS, suggested above by the experts, like,
SUBMIT my_prog
WITH SELECTION-TABLE t_param
AND RETURN.
submit my_prog
with SS_STATS = SS_STATS-LOW
and return.
submit my_prog
WITH ss_stats IN ss_stats1
WITH s_sdate IN ss_stats2
AND RETURN.
In debug mode, control is going to my_prog, yielding output to my_itab, and even its EXPORTing (I mean, SUBRC = 0), then the control is going to AT SELECTION-SCREEN (not coming back to FM/BAPi) and there by dispalying the selection screen!
any clue?
thank you,
‎2007 Jun 07 1:33 AM
Hi Sridhar,
have you just tried as told by me in above post. Just put a break-point after the SUBMIT and see what's happening.
Also can you just check if there is any LEAVE TO SCREEN command in the report X.
Regards,
Atish
‎2007 Jun 07 1:48 AM
Hi Sarda,
1) Yes, I put break-point after SUBMIT in BAPi.
As soon as the control encountering the SUBMIT statement, its going to X report and after filling the output_itab, its encountering the AT SELECTION SCREEN and there by the selection screen is displaying!
2) No, There is no LEAVE TO SCREEN stetement in X report.
any clue?
thank you,
‎2007 Jun 07 1:51 AM
Hi Sridhar,
Which report you are calling. Is this X report a Z report, If yes can you paste the code of the same.
Regards,
Atish
‎2007 Jun 07 1:57 AM
Its Z report, outputs a ALV grid.
Both report prog. and BAPi r Z version.
Its a 3000 lines code!
I guess, as I said Shivika Bhorchi, there is problem with control movement (SUBMIT) between an Executable report prog and BAPi/FM!
Any comments?
thank you,
Message was edited by:
Sridhar
‎2007 Jun 07 2:15 AM
I am going to give you a simple example of what i have done :
I have a FM in which i am submitting a report say X with selection-screen and in this report i am exporting the ouput table into a memory id.
In my FM i am simply importing this table from this memory id .
Call program which gives user the result based on selection screen
and put the output table into memory
SUBMIT X
VIA SELECTION-SCREEN
WITH x_multi EQ callcontrol-multisel
AND RETURN.
Import output table into internal table
IMPORT g_tab TO gt_output
FROM MEMORY ID 'Z_OUTPUT'.
This importing is happening in my FM.
This is working for me and i am getting all the data into the internal table gt_output.
I am really not sure whats happening in your case.
Cheers
shivika
‎2007 Jun 07 2:26 AM
‎2007 Jun 07 2:44 AM
what happens when you execute th report outside the bapi ie all by itself? the issue is definitely with report & not the SUBMIT.
~Suresh
‎2007 Jun 07 3:14 AM
Thank you Suresh,
Yes, I also came to same conclusion! Coz I tried all options with SUBMIT!
But, am confusing Where to write,(EXPORT my_itab to MEMORY ID 'ZP1') (bcoz, I put it just above REUSE_ALV_GRID_DISPLAY, did not worked!) and I guess this is the problem, where I hv to reside the follwoing code!
EXPORT my_itab to MEMORY ID 'ZP1'.
any clue?
thank you,
Message was edited by:
Srikhar
Message was edited by:
Srikhar
‎2007 Jun 07 3:20 AM
You didn't answer my question. What happens when you execute the report by itself.. say from SE80 or SE38? Does it still go back to the AT SELECTION SCREEN event. By any chance, did you use a START-OF-SELECTION & your report doesn't have an END-OF-SELECTION event? can you upload your report code to some free site & paste the link here?
~Suresh
‎2007 Jun 07 3:21 AM
Hi Srikhar,
There is no problem with the location of the EXPORT statement in the code. You can put it before ALV also.
Try one more thing, if you think this report is not working for SUBMIT, Just create a small Z program and USe SUBMIT in Z program and check what's happening. If it SUBMIT even not working here then there is definately something wrong with the report X
Regards,
Atish
‎2007 Jun 07 3:55 AM
Hi Suresh,
1) When I run the reprt from se38, its working well.
2) END-OF-SELECTION.
Right,ur guess is correct! initially, there is no END-OF-SELECTION event and hving the start-of-selection.
so, now, i added the NED-OF-SELECTION event.
But, again the control is encountering very first REPORT statement, then, START-OF-SELECTION (after executing the EXPORT my_itab TO MEMORY ID 'ZP1') i.e. the control is not even encountering the end-of-selection.
thanq.
Message was edited by:
Srikhar
Message was edited by:
Srikhar
Message was edited by:
Srikhar
‎2007 Jun 07 4:09 AM
Hi Srikhar,
You need to write something in the END OF SELECTION to trigger it.
Just Use WRITE /'END OF SELECTION'. to see if it is triggering or not.
Regards,
Atish
‎2007 Jun 07 4:18 AM
Hi Sarda,
Yes, in newly created Z prog. (for test run for SUBMIT), also SUBMIT is not working i.e. control is not coming back.
Cntrol flow is,
EXPORT........
REPORT statement....
START-OF-SELECTION.....
thank you,
‎2007 Jun 07 4:19 AM
Hi Sarda,
OK, ll try by putting some thing in END OF SELECTION:
THANQ:
‎2007 Jun 07 4:32 AM
Hi Sarda,
No use!
Now, the control is encountering the END OF SELECTION, but, again going to REPORT and there by START OF SELECTION.
?????????
thanq.
‎2007 Jun 07 4:36 AM
Hey Srikhar,
Can you just put the code of your X program and FM to some free sites and paste the link here. It is very strange SUBMIT :).
Regards,
Atish
‎2007 Jun 07 12:18 PM
Thank you Sarda,
<i>maaf kijiye! mera office walen bhi forums chalate! so, agar yen dekheto problem ho jata!</i>
am closing here and opening a new thread.
thank you for understaidng.
‎2007 Jun 07 9:54 PM
Hi S.Bhorchi,
Our SDNs helped me in fixing the Y'days issue.
In your following suggestion,
<b><i>SUBMIT X
WITH s_auart IN s_auart
WITH s_aufnr IN s_aufnr
AND RETURN.</i></b>
Pls. clarify that,
1) I guess, the first s_auart is X report selection screen field name, Is it right?
2) How did u defined ur secong s_auart, I mean
3) Did U mentioned s_auart as IMPORT parameter under IMPORT tab strip, like
s_auart TYPE RSPARAMS
or
4) Did u declared as a (i)table in the source code tab strip as
DATA: s_auart TYPE RSPARAMS OCCURS 0 WITH HEADER LINE:
and there by,
s_auart-selname = s_auart,
s_auart-kind = 'S', sign, option, low, high...............etc.
thanq.
‎2007 Jun 08 12:01 AM
‎2007 Jun 08 12:12 AM
Hi S. Bhorchi,
Yes, my problem was solved. Its great of SDNs, thanx.
Actually, I am not the author of prog. , am enhancing it.
The sugestions r from Suresh Datti and Rich (I changed the location of start-of-selection and added the end-of-selection) and I used ur SUBMIT and working well, thanq.
‎2007 Jun 09 7:43 PM
Hi Sueresh Datti,
Culd u pls. respond to my thread with title,
<i><b>Parameters Behaviour, While passing from FM!! </b></i>
thanq.