How to create the select option in the screen

HI,
I am developing one module pool program and I have below requirement,
currently plant is acting like PARAMETER and the now it should be changed to select option.
how to create the select option in the screen
Thanks and regarding,
Malla
Moderator message - Please search before asking - post locked
Edited by: Rob Burbank on Dec 16, 2009 1:41 PM

Try RANGES.
The RANGES has same structure as that of select-options.

Similar Messages

  • How to creat a select-options in the screen layout of se80.

    Because in se80 ,the screen is drawed in the screen layout,but it just have text-field for parameter.
    Thanks!

    In your main program, you can declare your desired select-option. Do your select-option declaration before calling your dialog screen.
    Create a subscreen in your screen's flow logic (PBO & PAI) that contains your selection screen with its corresponding screen number of your declared subscreen.
    sample code of select-option declaration below.
    SELECTION-SCREEN BEGIN OF SCREEN 5003 AS SUBSCREEN.
    SELECTION-SCREEN BEGIN OF BLOCK PARAM.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT (18) TEXT-ABK FOR FIELD S_ABKRS.
    SELECT-OPTIONS: S_ABKRS FOR PA0001-ABKRS.
    SELECTION-SCREEN POSITION 47.
    PARAMETER: P_ATEXT LIKE T549T-ATEXT VISIBLE LENGTH 30.
    SELECTION-SCREEN POSITION 70.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN END OF BLOCK PARAM.
    SELECTION-SCREEN END OF SCREEN 5003.
    call screen 5000.
    Sample Flow logic Code below of screen 5000:
    *--- PBO
    PROCESS BEFORE OUTPUT.
      CALL SUBSCREEN SUB_5003 INCLUDING SY-REPID '5003'. " subscreen 5003
      MODULE STATUS_5000.
      LOOP AT GT_MBBH INTO GS_MBBH WITH CONTROL TC_MBILL
                    CURSOR TC_MBILL-TOP_LINE.
      ENDLOOP.
    *--- PAI
    PROCESS AFTER INPUT.
      LOOP AT GT_MBBH.
        FIELD GS_MBBH-SELEC MODULE TC_TABLE_MARK ON REQUEST.
      ENDLOOP.
      MODULE USER_COMMAND_5000.
      CALL SUBSCREEN SUB_5003.  " subscreen 5003
    Hope this will help..

  • How to create the select option for the Plant in screen (Module pool)

    HI,
    I am developing one module pool program and I have below requirement,
    currently plant is acting like PARAMETER and the now it should be changed to select option.
    how to create the select option in the screen
    Thanks and regarding,
    Malla
    Moderator message - Cross post locked
    Edited by: Rob Burbank on Dec 16, 2009 1:41 PM

    Steps to get SELECT-OPTIONS in module pool programs.
    1.Start one dialog program with SAPMZ_001.
    Place the below code in the TOP include of the dialog program.
    TABLES marc.
    SELECTION-SCREEN BEGIN OF SCREEN 3200 AS SUBSCREEN.
    SELECT-OPTIONS: werks FOR marc-werks.
    SELECTION-SCREEN END OF SCREEN 3200. 
    2 .Create one screen 3000.
    Go to Layout of the screen and Define subscreen area on the screen and Name it as l_subscreen.
    Place the below code in the Flow logic of the screen.
    PROCESS BEFORE OUTPUT.
      CALL SUBSCREEN l_subscreen INCLUDING 'SAPMZ_001' '3200'.
    PROCESS AFTER INPUT.
      CALL SUBSCREEN l_subscreen.
    Activate all.
    Create Transaction code for the dialog program .
    Execute the transaction code. You will see the select-option for werks how we see on Selection-screen.

  • Create a select option in a screen

    Is it possible to create a select option in a screen?
    I can easily create the 2 input boxes, but not with the little button on the right like when we create a select option in a report.
    Is the any other simple way to create a select option without creating a report? (the reason is because I want to have everything in the same module pool)

    Hi,
    Please refer to SAP's documentation here: http://help.sap.com/saphelp_nw70/helpdata/en/e4/2adbec449911d1949c0000e8353423/frameset.htm.
    Especially Part 'Subscreens and Tabstrips for Selection Screens', there go to 'Selection Screens as Subscreens'.
    HTH, Gerd Rother

  • How to create a selection option or parameters in a subarea of the screen

    Hi Experts,
        My program have a screen 1001 and it is splited into two parts: the first is a Subarea for selection option, and the last is a table control. Now I want to create some selection option and parameters in the first subarea just like we do in screen 1000. Do we have any convenient way to do that?
    Thanks in advance
    Joe

    Hi Joe,
    Yes ,it can be done like below code:
    TABLES : mara.
    SELECTION-SCREEN BEGIN OF SCREEN 1001 AS SUBSCREEN.
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    SELECT-OPTIONS: s_matnr FOR mara-matnr,
                    s_matkl FOR mara-matkl,
                    s_mtart FOR mara-mtart.
    SELECTION-SCREEN END OF BLOCK b1.
    SELECTION-SCREEN END OF SCREEN 1001.
    DATA: number(4) TYPE n VALUE '1001'.
    START-OF-SELECTION.
      CALL SCREEN 100.
    in screen flow logic .write below statements.
    first declare the subscreen area  'AREA' in screen.
    PROCESS BEFORE OUTPUT.
    MODULE STATUS_0100.
    CALL SUBSCREEN area INCLUDING sy-repid number.
    PROCESS AFTER INPUT.
    CALL SUBSCREEN area.
    MODULE USER_COMMAND_0100.
    Reward if useful,
    Regards,
    Talwinder

  • How to create a Select-option and a pushbutton together

    Hi Experts,
    I have defined a selection screen in my module pool program and I am including this screen in my Module pool Dynpro. Now, my problem is that if I write the following piece of code to define my selection screen, it gives me an error that "Error when generating the selection screen "1010" of report "ZTESTHIM_MOD" ".
    SELECTION-SCREEN BEGIN OF SCREEN 1010 AS SUBSCREEN.
    SELECT-OPTIONS: s_matnr FOR  mara-matnr NO INTERVALS,
                    s_matkl FOR  mara-matkl NO INTERVALS,
                    s_mtart FOR mara-mtart NO INTERVALS,
                    s_ersda FOR mara-ersda NO INTERVALS.
    SELECTION-SCREEN PUSHBUTTON 10(5) pubu USER-COMMAND test.
    SELECTION-SCREEN END OF SCREEN 1010.
    Please help me whats the reason for this.
    Also, if I define the select-options within a block and pushbutton outside it, the code is working fine.
    The problem is that I want a select-option and a pushbutton in the same line.
    Please help me out.
    Useful answers will be duly rewarded.
    Thanks in advance.
    Regards,
    Himanshu
    null

    Hi,
    You have declared so many select options in one line and also you want to include a push button in the same line, this is not possible.
    Since the visible lenght of the line is less than the number of fields you want to display this will not be possible.
    What you can do is instead group then using
    SELECTIOn-SCREEN BEGIN OF BLOCK b1.
    here use lines
    SELECTION-SCREEN END OF BLOCK b1
    Regards,
    Sesh

  • How do I pass SELECT-OPTIONS to another screen via CALL TRANSACTION?

    Good day, everyone!
    I am writing a program that will be passing PARAMETERS and SELECT-OPTIONS values to another transaction via the CALL TRANSACTION statement.  I'm new at this, and I've run into a problem.  I have several fields that are defined as SELECT-OPTIONS, like so:
    SELECT-OPTIONS so_ccode FOR fkkop-bukrs.
    The user may select multiple values, enter a range, exclude certain values, etc. -- the things a SELECT-OPTIONS allows.
    But how do I pass all of this to a field on another screen using CALL TRANSACTION when I only have two fields (BDCDATA-FNAM and BDCDATA-FVAL) available to me?  That works fine for PARAMETERS, but I can send low/high values, different signs/options, etc. for the SELECT-OPTIONS variables.
    Please help!!  Points awarded for all helpful answers.
    Thank you,
    Dave

    Don't use CALL TRANSACTION. Use SUBMIT instead.
    Rob

  • How to hide a select option on slelection screen??

    Hi all,
        I wanna hide a screen field (select option) on  selection-screen. I looped the screen in AT SELECTION-SCREEN OUTPUT and found the name of screen to hide. But the <option_name>_low and <option_name>_high are always show here.
         Who can give me a way to do that???
    In fact, i wanna hide or display the select option after choosing a radiobutton.Who can give me a way??

    Hi,
    Check the below code.
    tables: pa0000, pa0001.
    parameters: p_rad1 radiobutton group rad1 default 'X' user-command rusr,
    p_rad2 radiobutton group rad1,
    p_rad3 radiobutton group rad1,
    p_rad4 radiobutton group rad1,
    p_rad5 radiobutton group rad1.
    selection-screen: begin of block blk1 with frame.
    select-options: s_pernr for pa0000-pernr modif id ABC,
    s_stat2 for pa0000-stat2 modif id DEF,
    s_werks for pa0001-werks modif id GHI,
    s_persg for pa0001-persg modif id JKL,
    s_persk for pa0001-persk modif id MNO.
    selection-screen: end of block blk1.
    AT SELECTION-SCREEN output.
    LOOP AT SCREEN.
    IF SCREEN-GROUP1 = 'ABC'.
    IF p_rad1 = 'X'.
    SCREEN-ACTIVE = 1.
    ELSE.
    SCREEN-ACTIVE = 0.
    ENDIF.
    MODIFY SCREEN.
    ENDIF.
    IF SCREEN-GROUP1 = 'DEF'.
    IF p_rad2 = 'X'.
    SCREEN-ACTIVE = 1.
    ELSE.
    SCREEN-ACTIVE = 0.
    ENDIF.
    MODIFY SCREEN.
    ENDIF.
    IF SCREEN-GROUP1 = 'GHI'.
    IF p_rad3 = 'X'.
    SCREEN-ACTIVE = 1.
    ELSE.
    SCREEN-ACTIVE = 0.
    ENDIF.
    MODIFY SCREEN.
    ENDIF.
    IF SCREEN-GROUP1 = 'JKL'.
    IF p_rad4 = 'X'.
    SCREEN-ACTIVE = 1.
    ELSE.
    SCREEN-ACTIVE = 0.
    ENDIF.
    MODIFY SCREEN.
    ENDIF.
    IF SCREEN-GROUP1 = 'MNO'.
    IF p_rad5 = 'X'.
    SCREEN-ACTIVE = 1.
    ELSE.
    SCREEN-ACTIVE = 0.
    ENDIF.
    MODIFY SCREEN.
    ENDIF.
    ENDLOOP.
    *Note
    *Titles for Rado buttons and parameters.
    *P_RAD1 Personal Number
    *P_RAD2 Employment Status
    *P_RAD3 Personnel Area
    *P_RAD4 Employee Group
    *P_RAD5 Employee Sub group
    *S_PERNR Personal Number
    *S_PERSG Employee Group
    *S_PERSK Employee Sub group
    *S_STAT2 Employment Status
    *S_WERKS Personnel Area

  • I have managed some how to disable the select option on the track

    kpad on my macbook pro, is ther any way I can reselect the one finger option?

    Sure you can. Try:
    Project > Table of Contents, click the Setting button
    (lower left), and -- in the Run Time Options part of the pop-up,
    clear the "show search" checkbox. and hit OK.
    Joe

  • Regarding the select-options on the selection screen

    In select-options the low and high fileds must be displayed in the following explained manner...
    How to get the low field value as 1000 (default) and it must be in display mode (not possible to change the value) and high field must be empty and it has to allow us to enter the value.
    How to get this....?
    Please help me in this regard...
    Thank u very much
    Regards..
    Nagarjuna

    TABLES : mara.
    SELECT-OPTIONS: s_matnr FOR mara-matnr.
    INITIALIZATION.
      S_MATNR-SIGN  = 'I'.  "inclusion
      S_MATNR-OPTION = 'BT'    "between
      S_MATNR-LOW = '1000'.
      APPEND s_matnr.
    AT SELECTION-SCREEN OUTPUT.
      LOOP AT SCREEN.
        IF screen-name EQ 'S_MATNR-LOW'.
          screen-input = 0.
          MODIFY screen.
          EXIT.
        ENDIF.
      ENDLOOP.
    Reward if Helpful.

  • How to create a Bool Option for Full Screen and Page Item in Mucow?

    Hi Guys!
    I was looking to create a bool option in Mucow widget options which toggles between Full Screen and a Normal Page Item .
    Example: Qooqee's Google Map Widget
    Need some help.
    Thanks in Advance

    Dear Pushpa,
    Transaction Code :SHD0 is working fine.
    Please accept my sincere thanks for your sharing your Knowledge.
    I am able to fulfill my
    Regarding the enhancement, I have not tried.
    Once I will complete, I will award the fulll marks to you.
    With Best Regards,
    Raghu Sharma

  • How to change the select-options fields length to long

    Dear friends:
       I had develop a program for sent email,and it have a field for fill mail address as below:
       data: lmail like adr6-smtp_addr.
       select-options: mailadd for lmail no intervals.
       my customer complain that the field is too short,but I can not change it to longer,the select-options component limit the visible length , how can i do for this problem!

    Dear All:
      I had realized this function.
      I defined a parameter and a pushbutton to replace the select-option componet,
    the code share as below.
    data: lmail like adr6-smtp_addr.
    SELECTION-SCREEN BEGIN OF LINE.
    parameters: mailCopy like lmail.
    selection-screen:pushbutton 64(5) pubu user-command mailButt.
    SELECTION-SCREEN END OF LINE.
    select-options: mailadd for lmail NO INTERVALS no-display.
    at selection-screen output.
      CLEAR l_count.
      DESCRIBE TABLE mailadd LINES l_count.
      IF l_count > 1.
        write ICON_DISPLAY_MORE as icon to pubu.
      ELSE.
        write ICON_ENTER_MORE  as icon to pubu.
      ENDIF.
    at selection-screen.
      CLEAR l_count.
      DESCRIBE TABLE mailadd LINES l_count.
      IF NOT mailCopy IS INITIAL AND mailadd[] IS INITIAL.
        MailAdd-low = mailCopy.
        Append mailadd.
      ENDIF.
      IF l_count = 1 and mailCopy IS INITIAL.
        refresh mailadd.
        clear mailadd.
      endif.
      if sy-ucomm = 'MAILBUTT'.
        perform show_box.
      endif.
    *       FORM show_box                                                 *
    FORM show_box.
      TYPE-POOLS aqadh .
      DATA: tab_and_field TYPE  rstabfield.
      tab_and_field-tablename = 'ADR6'.
      tab_and_field-fieldname = 'SMTP_ADDR'.
      CALL FUNCTION 'COMPLEX_SELECTIONS_DIALOG'
           EXPORTING
                TEXT           = 'SET E-Mail To '
                tab_and_field  = tab_and_field
           TABLES
                range          = MAILADD
           EXCEPTIONS
                no_range_tab   = 1
                cancelled      = 2
                internal_error = 3
                OTHERS         = 4.
      IF NOT MAILADD[] IS INITIAL.
        READ TABLE MAILADD INDEX 1.
        MAILCopy = MAILADD-LOW.
      ELSE.
        CLEAR MAILCopy.
      ENDIF.
    ENDFORM.

  • How to select option to the particular view container

    Hi All,
    I am working on ALV , i have view container for search parameters, here i want to add select option in to the same view container.. anyone help me to achive the same.
    Thanks
    Ram

    As Tamil said above, you have to put the select options in the view that you are embedding in the view container. For help on how to use select options in webdynpro, you can have a look at the tutorial in the following link...
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/c09fec07-0dab-2a10-dbbe-c9a26bdff03e

  • Reading the select options of selection screen

    Hi All,
    I have a problem in reading the select options from the selection screen.
    I have two select-options on the selection screen. Based on the first select-option value, I need to get the F4 values for the second select-option.
    I am using the function module 'RS_REFRESH_FROM_SELECTOPTIONS' for getting the select-options values. But here there is small problem.
    This FM is returing the values if i select the multiple values. But if I give a single value in the select-options i.e., If i give only the low value, I am getting the blank entries from the function module.
    How can I get the value of the select-option if i give only the low field.
    Please help me in this regard.
    Regards,
    Kishore.

    Hi,
    Try to use FM "DYNP_VALUES_READ"
    CALL FUNCTION 'DYNP_VALUES_READ'
        EXPORTING
          dyname               = sy-cprog
          dynumb               = sy-dynnr
        TABLES
          dynpfields           = i_dynpfields
        EXCEPTIONS
          invalid_abapworkarea = 1
          invalid_dynprofield  = 2
          invalid_dynproname   = 3
          invalid_dynpronummer = 4
          invalid_request      = 5
          no_fielddescription  = 6
          invalid_parameter    = 7
          undefind_error       = 8
          double_conversion    = 9
          stepl_not_found      = 10
          OTHERS               = 11.
    and after this you can read the internal table i_dynpfields.

  • Populating multiple entries in the select option of a Report

    Hi,
      Ineed to populate multiple entries in the select option of a report where the bdctab has more entries than the number of rows in the select option. I have tried the transaction LINS ( Insert row) but it works intermittently based on the RSSEL-LOW(xx) value. Looking forward to any inputs.
    cheers
    Aveek

    Hi,
      Here is my code dump:
    **Version 0005
    *CTS D7AK900899 New Version code fixed for testaveek28 case.
    *MOD-1887120: Code that is changed after the release of transport.
    Populate the general selection criteria on first screen
      PERFORM f_populate_bdc_tab USING:
      'X'  'APO_BAPI_DEL_TRANS_OBJECTS'  '1000',
    ' '  'BDC_CURSOR'                  'EXT_PROD-LOW',
      ' '  'BDC_OKCODE'                  '=%011',
    ' '  'BDC_OKCODE'                  '=DUMMY',
      ' '  'PLVERS'                      '000',
      ' '  'MD_SYS'                      p_log,
      ' '  'EXTRB'                       'X',
      ' '  'MO_DEL'                      'X',
      ' '  'SIM'                         space,
      ' '  'P_LOGDEL'                    '5'.
      sort it_core_prod by pcode.
      delete adjacent duplicates from it_core_prod
                       comparing pcode.
      describe table it_core_prod lines lv_line.
      CLEAR lv_count.
    LOOP AT it_core_prod ASSIGNING <lfs_data>.
       lv_count = 1.
       CONCATENATE gc_rscsel gc_l_brac lv_count gc_r_brac INTO lv_fname.
       if lv_line > 1.
         PERFORM f_populate_bdc_tab USING:
         'X'  'SAPLALDB'                    '3000',
         ' '  lv_fname                    <lfs_data>-pcode,
         ' '  'BDC_OKCODE'                  '=LINS'.
         CLEAR lv_fname.
    ENDLOOP.
    *Populate the select options screen for product
    PERFORM f_populate_bdc_tab USING:
    'X'  'SAPLALDB'                    '3000',
    ' '  'BDC_SUBSCR'                  'SAPLALDB 3010SCREEN_HEADER',
    ' '  'BDC_OKCODE'                  '=ACPT'.
    sort it_prod_var by pcode prvar.
    delete adjacent duplicates from it_core_prod
                       comparing pcode prvar.
    PERFORM f_populate_bdc_tab USING:
         'X'  'SAPLALDB'                    '3000'.
    LOOP AT it_core_prod ASSIGNING <lfs_data>.
      lv_pcode = <lfs_data>-pcode.
    *lv_count = lv_count + 1.
      lv_count = 1.
      CONCATENATE gc_rscsel gc_l_brac lv_count gc_r_brac INTO lv_fname.
       if lv_line > 1.
          PERFORM f_populate_bdc_tab USING:
          'X'  'SAPLALDB'                    '3000',
          ' '  lv_fname                    <lfs_data>-pcode,
          ' '  'BDC_OKCODE'                  '=LINS'.
          CLEAR lv_fname.
      describe table it_prod_var lines lv_line.
    sort <lfs_data> by locno pcode prvar.
      LOOP AT it_prod_var ASSIGNING <lfs_data1>  where pcode = lv_pcode.
      lv_count = lv_count + 1.
        lv_count = 1.
        CONCATENATE gc_rscsel gc_l_brac lv_count gc_r_brac INTO lv_fname.
       if lv_line > 1.
          PERFORM f_populate_bdc_tab USING:
          'X'  'SAPLALDB'                    '3000',
          ' '  lv_fname                    <lfs_data1>-prvar,
          ' '  'BDC_OKCODE'                  '=LINS'.
        else.
         PERFORM f_populate_bdc_tab USING:
         ' '  lv_fname                    <lfs_data>-prvar,
         ' '  'BDC_OKCODE'                  '=LINS'.
        endif.
          CLEAR lv_fname.
      ENDLOOP.
    ENDLOOP.
    Populate the select options screen for product
      PERFORM f_populate_bdc_tab USING:
    'X'  'SAPLALDB'                    '3000',
    ' '  'BDC_SUBSCR'                  'SAPLALDB  3010SCREEN_HEADER',
      ' '  'BDC_OKCODE'                  '=ACPT'.
    Populate the select options for the Locations
      PERFORM f_populate_bdc_tab USING:
      'X'  'APO_BAPI_DEL_TRANS_OBJECTS'  '1000',
    ' '  'BDC_CURSOR'                  'EXT_PRD-LOW',
      ' '  'BDC_OKCODE'                  '=%012',
      ' '  'PLVERS'                      '000',
    ' '  'MD_SYS'                      p_log,
      ' '  'EXTRB'                       'X',
      ' '  'MO_DEL'                      'X',
      ' '  'SIM'                         space,
      ' '  'P_LOGDEL'                    '5'.
    Populate the select options screen for product
      PERFORM f_populate_bdc_tab USING:
      'X'  'SAPLALDB'                    '3000',
    ' '  'BDC_SUBSCR'                  'SAPLALDB  3010SCREEN_HEADER',
      ' '  'BDC_OKCODE'                  '=ACPT'.
      CLEAR lv_count.
      LOOP AT it_loc_data ASSIGNING <lfs_data>.
        lv_count = lv_count + 1.
      lv_count = 1.
        CONCATENATE gc_rscsel gc_l_brac lv_count gc_r_brac INTO lv_fname.
        PERFORM f_populate_bdc_tab USING:
        ' '  lv_fname                    <lfs_data>-locno.
       ' '  'BDC_OKCODE'                  '=LINS'.
        CLEAR lv_fname.
        PERFORM f_populate_bdc_tab USING:
         'X'  'SAPLALDB'                    '3000',
         ' '  lv_fname                    <lfs_data>-locno,
         ' '  'BDC_OKCODE'                  '=LINS'.
         CLEAR lv_fname.
      ENDLOOP.
    CLEAR lv_count.
    LOOP AT it_loc_data ASSIGNING <lfs_data>.
       lv_count = 1.
       CONCATENATE gc_rscsel gc_l_brac lv_count gc_r_brac INTO lv_fname.
       PERFORM f_populate_bdc_tab USING:
         'X'  'SAPLALDB'                    '3000',
         ' '  lv_fname                    <lfs_data>-locno,
         ' '  'BDC_OKCODE'                  '=LINS'.
         CLEAR lv_fname.
    ENDLOOP.
    Populate the objects to be deleted on first screen
      PERFORM f_populate_bdc_tab USING:
      'X'  'APO_BAPI_DEL_TRANS_OBJECTS'  '1000',
      ' '  'BDC_OKCODE'                  '=DUMMY',
      ' '  'PLVERS'                      '000',
      ' '  'MD_SYS'                      p_log,
      ' '  'EXTRB'                       'X',
      ' '  'MO_DEL'                      'X',
      ' '  'MO_STAT'                     'X',
      ' '  'PO_DEL'                      'X',
      ' '  'SL_DEL'                      'X',
      ' '  'ST_DEL'                      'X',
      ' '  'PIR_DEL'                     'X',
      ' '  'SIM'                         space,
      PERFORM f_populate_bdc_tab USING:
      'X'  'SAPLSPO1'                    '0500',
      ' '  'BDC_OKCODE'                  '=OPT1'.
    **Version 0005
    *CTS D7AK900899 New Version code fixed for testaveek28 case.
    *MOD-1887120: Code that is changed after the release of transport.
    Populate the general selection criteria on first screen
      PERFORM f_populate_bdc_tab USING:
      'X'  'APO_BAPI_DEL_TRANS_OBJECTS'  '1000',
    ' '  'BDC_CURSOR'                  'EXT_PROD-LOW',
      ' '  'BDC_OKCODE'                  '=%011',
    ' '  'BDC_OKCODE'                  '=DUMMY',
      ' '  'PLVERS'                      '000',
      ' '  'MD_SYS'                      p_log,
      ' '  'EXTRB'                       'X',
      ' '  'MO_DEL'                      'X',
      ' '  'SIM'                         space,
      ' '  'P_LOGDEL'                    '5'.
      sort it_core_prod by pcode.
      delete adjacent duplicates from it_core_prod
                       comparing pcode.
      describe table it_core_prod lines lv_line.
      CLEAR lv_count.
    LOOP AT it_core_prod ASSIGNING <lfs_data>.
       lv_count = 1.
       CONCATENATE gc_rscsel gc_l_brac lv_count gc_r_brac INTO lv_fname.
       if lv_line > 1.
         PERFORM f_populate_bdc_tab USING:
         'X'  'SAPLALDB'                    '3000',
         ' '  lv_fname                    <lfs_data>-pcode,
         ' '  'BDC_OKCODE'                  '=LINS'.
         CLEAR lv_fname.
    ENDLOOP.
    *Populate the select options screen for product
    PERFORM f_populate_bdc_tab USING:
    'X'  'SAPLALDB'                    '3000',
    ' '  'BDC_SUBSCR'                  'SAPLALDB 3010SCREEN_HEADER',
    ' '  'BDC_OKCODE'                  '=ACPT'.
    sort it_prod_var by pcode prvar.
    delete adjacent duplicates from it_core_prod
                       comparing pcode prvar.
    PERFORM f_populate_bdc_tab USING:
         'X'  'SAPLALDB'                    '3000'.
    LOOP AT it_core_prod ASSIGNING <lfs_data>.
      lv_pcode = <lfs_data>-pcode.
    *lv_count = lv_count + 1.
      lv_count = 1.
      CONCATENATE gc_rscsel gc_l_brac lv_count gc_r_brac INTO lv_fname.
       if lv_line > 1.
          PERFORM f_populate_bdc_tab USING:
          'X'  'SAPLALDB'                    '3000',
          ' '  lv_fname                    <lfs_data>-pcode,
          ' '  'BDC_OKCODE'                  '=LINS'.
          CLEAR lv_fname.
      describe table it_prod_var lines lv_line.
    sort <lfs_data> by locno pcode prvar.
      LOOP AT it_prod_var ASSIGNING <lfs_data1>  where pcode = lv_pcode.
      lv_count = lv_count + 1.
        lv_count = 1.
        CONCATENATE gc_rscsel gc_l_brac lv_count gc_r_brac INTO lv_fname.
       if lv_line > 1.
          PERFORM f_populate_bdc_tab USING:
          'X'  'SAPLALDB'                    '3000',
          ' '  lv_fname                    <lfs_data1>-prvar,
          ' '  'BDC_OKCODE'                  '=LINS'.
        else.
         PERFORM f_populate_bdc_tab USING:
         ' '  lv_fname                    <lfs_data>-prvar,
         ' '  'BDC_OKCODE'                  '=LINS'.
        endif.
          CLEAR lv_fname.
      ENDLOOP.
    ENDLOOP.
    Populate the select options screen for product
      PERFORM f_populate_bdc_tab USING:
    'X'  'SAPLALDB'                    '3000',
    ' '  'BDC_SUBSCR'                  'SAPLALDB  3010SCREEN_HEADER',
      ' '  'BDC_OKCODE'                  '=ACPT'.
    Populate the select options for the Locations
      PERFORM f_populate_bdc_tab USING:
      'X'  'APO_BAPI_DEL_TRANS_OBJECTS'  '1000',
    ' '  'BDC_CURSOR'                  'EXT_PRD-LOW',
      ' '  'BDC_OKCODE'                  '=%012',
      ' '  'PLVERS'                      '000',
    ' '  'MD_SYS'                      p_log,
      ' '  'EXTRB'                       'X',
      ' '  'MO_DEL'                      'X',
      ' '  'SIM'                         space,
      ' '  'P_LOGDEL'                    '5'.
    Populate the select options screen for product
      PERFORM f_populate_bdc_tab USING:
      'X'  'SAPLALDB'                    '3000',
    ' '  'BDC_SUBSCR'                  'SAPLALDB  3010SCREEN_HEADER',
      ' '  'BDC_OKCODE'                  '=ACPT'.
      CLEAR lv_count.
      LOOP AT it_loc_data ASSIGNING <lfs_data>.
        lv_count = lv_count + 1.
      lv_count = 1.
        CONCATENATE gc_rscsel gc_l_brac lv_count gc_r_brac INTO lv_fname.
        PERFORM f_populate_bdc_tab USING:
        ' '  lv_fname                    <lfs_data>-locno.
       ' '  'BDC_OKCODE'                  '=LINS'.
        CLEAR lv_fname.
        PERFORM f_populate_bdc_tab USING:
         'X'  'SAPLALDB'                    '3000',
         ' '  lv_fname                    <lfs_data>-locno,
         ' '  'BDC_OKCODE'                  '=LINS'.
         CLEAR lv_fname.
      ENDLOOP.
    CLEAR lv_count.
    LOOP AT it_loc_data ASSIGNING <lfs_data>.
       lv_count = 1.
       CONCATENATE gc_rscsel gc_l_brac lv_count gc_r_brac INTO lv_fname.
       PERFORM f_populate_bdc_tab USING:
         'X'  'SAPLALDB'                    '3000',
         ' '  lv_fname                    <lfs_data>-locno,
         ' '  'BDC_OKCODE'                  '=LINS'.
         CLEAR lv_fname.
    ENDLOOP.
    Populate the objects to be deleted on first screen
      PERFORM f_populate_bdc_tab USING:
      'X'  'APO_BAPI_DEL_TRANS_OBJECTS'  '1000',
      ' '  'BDC_OKCODE'                  '=DUMMY',
      ' '  'PLVERS'                      '000',
      ' '  'MD_SYS'                      p_log,
      ' '  'EXTRB'                       'X',
      ' '  'MO_DEL'                      'X',
      ' '  'MO_STAT'                     'X',
      ' '  'PO_DEL'                      'X',
      ' '  'SL_DEL'                      'X',
      ' '  'ST_DEL'                      'X',
      ' '  'PIR_DEL'                     'X',
      ' '  'SIM'                         space,
      PERFORM f_populate_bdc_tab USING:
      'X'  'SAPLSPO1'                    '0500',
      ' '  'BDC_OKCODE'                  '=OPT1'.
      CLEAR gv_msg_error.
      lv_ctu_params-nobinpt = space.
    lv_ctu_params-dismode = gc_mode_e.
      lv_ctu_params-dismode = 'A'.
      lv_ctu_params-updmode = 'S'.
      lv_ctu_params-racommit = 'X'.
    Call Transaction /SAPAPO/BP2
    CALL TRANSACTION gc_bp2 USING ct_bdc_data
    OPTIONS FROM lv_ctu_params
    MESSAGES INTO lt_msg_tab.

Maybe you are looking for