‎2009 Jan 29 5:34 PM
Hi ,
I have a requuirement that , need to call a standard report in a new session when i click on first level output.Am using ' FM ABAP4_CALL_TRANSACTION' STARTING NEW TASK to create anew session by filling bdcdata
but problem is...i wanted to submit a range to report.
Can any one let me know how to submit a range using BDCDATA...
Thanks in advance..
Regards,
Anand Lokineni.
‎2009 Jan 30 9:38 AM
Hi,
I believe by ranges you mean data to select options of a selection screen ?
If yes, I just recorded one standard transaction tx.MB5S and created a function module for the recording.
Here is the snippet of the function module:
FUNCTION Z_MB5S_CALL.
...
" this is the part which populated the select option of the selection screen.
perform bdc_dynpro using 'SAPLALDB' '3000'.
perform bdc_field using 'BDC_OKCODE'
'=ACPT'.
" The value is passed by first setting the cursor on the field and then setting the value.
"1. Set the cursor.
perform bdc_field using 'BDC_CURSOR'
'RSCSEL-SLOW_I(01)'.
"2. Set the value
perform bdc_field using 'RSCSEL-SLOW_I(01)'
SLOW_I_01_002.
" Same for the others.
perform bdc_field using 'RSCSEL-SLOW_I(02)'
SLOW_I_02_003.
perform bdc_field using 'RSCSEL-SLOW_I(03)'
SLOW_I_03_004.
perform bdc_field using 'RSCSEL-SLOW_I(04)'
SLOW_I_04_005.
perform bdc_field using 'RSCSEL-SLOW_I(05)'
SLOW_I_05_006.
perform bdc_field using 'RSCSEL-SLOW_I(06)'
SLOW_I_06_007.
perform bdc_field using 'RSCSEL-SLOW_I(07)'
SLOW_I_07_008.
perform bdc_field using 'RSCSEL-SLOW_I(08)'
SLOW_I_08_009.
perform bdc_field using 'RSCSEL-SLOW_I(09)'
SLOW_I_09_010.
perform bdc_dynpro using 'RM07MSAL' '1000'.
perform bdc_field using 'BDC_CURSOR'
'LIFNR-LOW'.
perform bdc_field using 'BDC_OKCODE'
'=ONLI'.
perform bdc_field using 'EKORG-LOW'
LOW_011.
perform bdc_field using 'FINAL'
FINAL_012.
perform bdc_dynpro using 'SAPMSSY0' '0120'.
perform bdc_field using 'BDC_OKCODE'
'=&F03'.
perform bdc_dynpro using 'RM07MSAL' '1000'.
perform bdc_field using 'BDC_OKCODE'
'/EE'.
perform bdc_field using 'BDC_CURSOR'
'LIFNR-LOW'.
perform bdc_transaction tables messtab
using 'MB5S'
CTU
MODE
UPDATE.
if sy-subrc <> 0.
subrc = sy-subrc.
exit.
endif.
perform close_group using CTU.
ENDFUNCTION.
This is a custom function module, so you can tweak this function's tables parameter to receive the list of values for the range and loop at this list and populate the range/select options as shown above.
Hope this solves the issue.
regards,
Advait
‎2009 Jan 29 8:53 PM
I don't know how to do that, but why don't you SUBMIT directly the report ?
‎2009 Jan 30 8:21 AM
‎2009 Jan 30 8:30 AM
‎2009 Jan 30 8:34 AM
‎2009 Jan 30 9:22 AM
If your transaction calls a program with selection-screen, then calling directly this program is the same as calling the transaction. If you want to submit it asynchronously, the simplest is to submit it as a job.
‎2009 Jan 30 9:38 AM
Hi,
I believe by ranges you mean data to select options of a selection screen ?
If yes, I just recorded one standard transaction tx.MB5S and created a function module for the recording.
Here is the snippet of the function module:
FUNCTION Z_MB5S_CALL.
...
" this is the part which populated the select option of the selection screen.
perform bdc_dynpro using 'SAPLALDB' '3000'.
perform bdc_field using 'BDC_OKCODE'
'=ACPT'.
" The value is passed by first setting the cursor on the field and then setting the value.
"1. Set the cursor.
perform bdc_field using 'BDC_CURSOR'
'RSCSEL-SLOW_I(01)'.
"2. Set the value
perform bdc_field using 'RSCSEL-SLOW_I(01)'
SLOW_I_01_002.
" Same for the others.
perform bdc_field using 'RSCSEL-SLOW_I(02)'
SLOW_I_02_003.
perform bdc_field using 'RSCSEL-SLOW_I(03)'
SLOW_I_03_004.
perform bdc_field using 'RSCSEL-SLOW_I(04)'
SLOW_I_04_005.
perform bdc_field using 'RSCSEL-SLOW_I(05)'
SLOW_I_05_006.
perform bdc_field using 'RSCSEL-SLOW_I(06)'
SLOW_I_06_007.
perform bdc_field using 'RSCSEL-SLOW_I(07)'
SLOW_I_07_008.
perform bdc_field using 'RSCSEL-SLOW_I(08)'
SLOW_I_08_009.
perform bdc_field using 'RSCSEL-SLOW_I(09)'
SLOW_I_09_010.
perform bdc_dynpro using 'RM07MSAL' '1000'.
perform bdc_field using 'BDC_CURSOR'
'LIFNR-LOW'.
perform bdc_field using 'BDC_OKCODE'
'=ONLI'.
perform bdc_field using 'EKORG-LOW'
LOW_011.
perform bdc_field using 'FINAL'
FINAL_012.
perform bdc_dynpro using 'SAPMSSY0' '0120'.
perform bdc_field using 'BDC_OKCODE'
'=&F03'.
perform bdc_dynpro using 'RM07MSAL' '1000'.
perform bdc_field using 'BDC_OKCODE'
'/EE'.
perform bdc_field using 'BDC_CURSOR'
'LIFNR-LOW'.
perform bdc_transaction tables messtab
using 'MB5S'
CTU
MODE
UPDATE.
if sy-subrc <> 0.
subrc = sy-subrc.
exit.
endif.
perform close_group using CTU.
ENDFUNCTION.
This is a custom function module, so you can tweak this function's tables parameter to receive the list of values for the range and loop at this list and populate the range/select options as shown above.
Hope this solves the issue.
regards,
Advait