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: 

Call Transaction with Multiple values in select option using bcdata

1,656

Hi!

i try call transaction with multiple option in select option fields.

my code:

EWHEN 'DETAILS'.
      DATA: bdcdata TYPE TABLE OF bdcdata,
      ls_bdcdata TYPE bdcdata.


      ls_bdcdata-program  = '/ILG/HR_RLE_PAYR_REP'.
      ls_bdcdata-dynpro   = '1000'.
      ls_bdcdata-dynbegin = 'X'.
      APPEND ls_bdcdata TO bdcdata.
      CLEAR ls_bdcdata.
      ls_bdcdata-fnam     = 'rb_04'.  // it's work for radio button
      ls_bdcdata-fval     = 'X'.
      APPEND ls_bdcdata TO bdcdata.
      CLEAR ls_bdcdata.
      ls_bdcdata-fnam     = 'CBOX'.  //it's work for checkbox.
      ls_bdcdata-fval     = 'X'.
      APPEND ls_bdcdata TO bdcdata.
       CLEAR ls_bdcdata.

      ls_bdcdata-fnam     =   'so_numra-low'.  //this is SELECT OPTION FIELD
      ls_bdcdata-fval     =  '5000,5001,5002'. //this is the values
      APPEND ls_bdcdata TO bdcdata.
       CLEAR ls_bdcdata.
     

it tried also append the values like this (it's dont work)

       CLEAR ls_bdcdata.
      ls_bdcdata-fnam     =   'so_numra-low'.  //this is SELECT OPTION FIELD
      ls_bdcdata-fval     =  '5000'. // single
      APPEND ls_bdcdata TO bdcdata.
       CLEAR ls_bdcdata.
     
       CLEAR ls_bdcdata.
      ls_bdcdata-fnam     =   'so_numra-low'.  //this is SELECT OPTION FIELD
      ls_bdcdata-fval     =  '5001'. // single
      APPEND ls_bdcdata TO bdcdata.
       CLEAR ls_bdcdata.

THANKS.

1 ACCEPTED SOLUTION

0 Kudos
1,153

Finally, i Used Submit Report. and it's work, and it's short.

    WHEN 'DETAILS'.
      DATA: r_numer      TYPE RANGE OF /ilg/num4intf_payr_rle,
            r_numer_line LIKE LINE OF r_numer,
            ls_ses       TYPE /ilg/mm_ses_natser_maint,
            lv_index     TYPE i.

    LOOP AT gt_maint INTO ls_ses WHERE sel = 'X'.
        lv_index = sy-tabix.
        r_numer_line-sign   = 'I'.
        r_numer_line-option = 'EQ'.
        r_numer_line-low    = ls_ses-numerator.
        APPEND r_numer_line TO r_numer.
        CLEAR ls_ses.
        MODIFY gt_maint FROM ls_ses INDEX lv_index TRANSPORTING sel.
    ENDLOOP.

      SUBMIT /ilg/hr_rle_payr_rep
          WITH so_numra-low IN r_numer
          WITH cbox = 'X'
          WITH rb_01 = ''
          WITH rb_04 = 'X'
          VIA SELECTION-SCREEN.
3 REPLIES 3

Sandra_Rossi
Active Contributor
0 Kudos
1,153

This code simplifies the filling of a SELECT-OPTIONS field in BDCDATA: https://wiki.scn.sap.com/wiki/display/ABAP/Fill+SELECT-OPTIONS+in+BDCDATA

0 Kudos
1,154

Finally, i Used Submit Report. and it's work, and it's short.

    WHEN 'DETAILS'.
      DATA: r_numer      TYPE RANGE OF /ilg/num4intf_payr_rle,
            r_numer_line LIKE LINE OF r_numer,
            ls_ses       TYPE /ilg/mm_ses_natser_maint,
            lv_index     TYPE i.

    LOOP AT gt_maint INTO ls_ses WHERE sel = 'X'.
        lv_index = sy-tabix.
        r_numer_line-sign   = 'I'.
        r_numer_line-option = 'EQ'.
        r_numer_line-low    = ls_ses-numerator.
        APPEND r_numer_line TO r_numer.
        CLEAR ls_ses.
        MODIFY gt_maint FROM ls_ses INDEX lv_index TRANSPORTING sel.
    ENDLOOP.

      SUBMIT /ilg/hr_rle_payr_rep
          WITH so_numra-low IN r_numer
          WITH cbox = 'X'
          WITH rb_01 = ''
          WITH rb_04 = 'X'
          VIA SELECTION-SCREEN.

Pankaj_Gupta
Product and Topic Expert
Product and Topic Expert
0 Kudos
1,153

To use the call transaction, you have to use the button to open the popup to enter the multiple values. Then only it will work but you have to handle the scroll also in that case.