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

filling range using..... bdcdata

Former Member
0 Likes
1,792

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.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,226

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

6 REPLIES 6
Read only

Sandra_Rossi
Active Contributor
0 Likes
1,226

I don't know how to do that, but why don't you SUBMIT directly the report ?

Read only

0 Likes
1,226

Using Submit can we call transaction in a new session??

Read only

0 Likes
1,226

yes i think so

varun

Read only

0 Likes
1,226

If yes..let me know the procedure...

Regards,

Aanand.

Read only

0 Likes
1,226

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.

Read only

Former Member
0 Likes
1,228

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