Selection-screen: how to call based on a condition...

Hello experts,
can I do this:
if flag has value, call selection-screen 1 else call selection-screen 2.
Thanks guys!

Hi Viraylab,
  Yes u can call the selection-screen based on some condition.
In this sample of code, if first radio button is chosen then it will call selection-screen 500 and if the second radio button is chosen then it will call selection-screen 1500.
TABLES : ZOBRENT.
SELECTION-SCREEN BEGIN OF BLOCK sel1 WITH FRAME TITLE tit1.
PARAMETERS: R1 RADIOBUTTON GROUP RAD1,
            R2 RADIOBUTTON GROUP RAD1.
SELECTION-SCREEN END OF BLOCK sel1.
SELECTION-SCREEN BEGIN OF SCREEN 500 AS WINDOW.
SELECTION-SCREEN BEGIN OF BLOCK sel2 WITH FRAME TITLE tit2.
PARAMETERS: panid like zobrent-zopanid.
SELECTION-SCREEN END OF BLOCK sel2.
SELECTION-SCREEN END OF SCREEN 500.
SELECTION-SCREEN BEGIN OF SCREEN 1500 AS WINDOW.
SELECTION-SCREEN BEGIN OF BLOCK sel3 WITH FRAME TITLE tit3.
PARAMETERS: brent LIKE zobrent-zo_brent,
            effdat LIKE zobrent-zo_effdat.
SELECTION-SCREEN END OF BLOCK sel3.
SELECTION-SCREEN END OF SCREEN 1500.
INITIALIZATION.
  tit1 = 'Values'.
AT SELECTION-SCREEN ON RADIOBUTTON GROUP RAD1.
  IF R1 = 'X'.
    CALL SELECTION-SCREEN 500.
  ELSEIF R2 = 'X'.
   CALL SELECTION-SCREEN 1500.
  ENDIF.
START-OF-SELECTION.
  tit1 = 'Values'.
  tit2 = 'PANID'.
  tit3 = 'BRENT'.
If found helpful, please do reward.

Similar Messages

  • How to clear all selection screen parameters before calling transaction?

    Hi Experts
       I have a ABAP report that displays data using ALV.
      When I double click a cell it calls transaction MB51. Before calling the transaction I need to set some parameters of the selection screen  of the transaction.
      My code is like below:
      <UL>
       <LI>FREE MEMORY ID 'MAT'. <I>"material</I>
       <LI> FREE MEMORY ID 'WRK'. <I>"plant</I>
       <LI> FREE MEMORY ID 'CHA'. <I>"batch</I>
       <LI><I>* Get the selected ALV row data</I>
       <LI>READ TABLE i_recon INDEX p_selfield-tabindex INTO x_recon.
       <LI><I>*   If link MB51 is clicked then open tcode MB51</I>
       <LI> IF p_selfield-sel_tab_field+8(4) = 'MB51'.
       <LI><I>*   Pass material, plant to the corresponding tcode</I>
       <LI>       SET PARAMETER ID 'MAT' FIELD x_recon-matnr.
       <LI>       SET PARAMETER ID 'WRK' FIELD p_plant.
        <LI>      CALL TRANSACTION 'MB51' AND SKIP FIRST SCREEN.
    </UL>
    The problem is:
    <UL> <LI> 1. First, I run the given transaction before running the report in a separate session with some set of values in the selection screen. For example: plant = AB01, Material = 990001 and Batch = 10001.</LI>
    </UL>
    <UL>
            <LI> 2. Then in another session I run my report. In the report ALV I have selected a record where plant = AB01, Material = 990001 but Batch is blank. But it opens the transaction with plant = AB01, Material = 990001 and Batch = 10001.
    Even though in my ALV record the batch is blank yet it uses the batch value from the memory. That is, the batch value that was given in the transaction earlier. Why it is not getting cleared? I have also used FREE MEMORY ID code in the beginning. But still it is not clearing the values in the memory.
    </UL>
    <UL>
            <LI>What shall I do to clear all the selection screen parameters before calling the transaction?</LI>
    </UL>
    <UL>
            <LI>
    Thanks
    Gopal
    </LI>
    </UL>
    Edited by: gopalkrishna baliga on Aug 11, 2010 10:29 AM

    Its because sap memory is globally shared.
    Do it like this.
    READ TABLE i_recon INDEX p_selfield-tabindex INTO x_recon.
    IF p_selfield-sel_tab_field+8(4) = 'MB51'.
    perform bdc_dynpro      using 'RM07DOCS' '1000'.
    perform bdc_field       using 'BDC_OKCODE'   '=ONLI'.
    perform bdc_field       using 'MATNR-LOW'  x_recon-matnr.
    perform bdc_field       using 'WERKS-LOW'  p_plant.
    perform bdc_field       using 'CHARG-LOW'  p_batch.
    perform bdc_field       using 'DATABASE'  'X'.
    call transaction 'MB51' with i_bdcdata mode 'E'.
    endif.
    form bdc_dynpro using program dynpro.
      clear la_bdcdata.
      la_bdcdata-program  = program.
      la_bdcdata-dynpro   = dynpro.
      la_bdcdata-dynbegin = 'X'.
      append la_bdcdata to i_bdcdata.
    endform.
    form bdc_field using fnam fval.
        clear la_bdcdata.
        la_bdcdata-fnam = fnam.
        la_bdcdata-fval = fval.
        append la_bdcdata to i_bdcdata.
    endform.

  • Calling the selection screen of the calling program after the execution of

    Hi all,
    I had created a program for a purchase order display.
    It has three radio-buttons from where i am calling different programs.
    I am using submit in the calling program and get parameter in at selection-screen output of the called program.
    I am getting the end report without the display of the selection screen of called program. But when i am clicking back on the end-report then i want to come back on the selection screen of the calling program. But i am coming out of the execution.
    Can anyone please tell me how to call the selection screen.
    Thanks in advance,
    Regards
    vamsi

    Hi, when you do the SUMBIT statement, make sure that you are using the extension........  AND RETURN.
    Submit <report> <b>AND RETURN</b>.
    This should return control to the caller.
    Regards,
    Rich Heilman

  • Problem with Hiding fields of selection screen which is called as subscreen

    Hello All,
    I have problem while hiding the selection screen which is called as subscreen.
    Flow of my logic:
    Selection-screen with one field and three buttons CREATE,DISPLAY and CHANGE in application toolbar.
    user enter some value in field and either he press change or dispaly
    When change i need to call selection screen when it is in dispaly i need to stop calling this selection screen.
    Upto my knowledge we can't stop calling selection screen in display mode so there is only one possibility is hiding the fields when it is in display mode.
    How can i hide the fields and where i need to hide fields?
    Please post some codes.
    Regards,
    Lisa

    you can refer the sample code which i mentioned in your previous post. that will solve the problem.

  • Skip the selection screen using BDCTAB call transaction

    Hi experts,
    I am using BDCTAB for call transaction SWI1 I need to skip the selection screen. Can you please tell me how to skip the selection screen using BDC call transaction?
    Thank you in advance.....

    hi,
    the first step is to pass some values to the selection screen, at least Date From and Date To; otherwise, it´ll take a long time. The second step is to emulate the Execute button, which is done with '/08'.
    PERFORM fields USING 'BDC_OKCODE'   '/08'.
    Third step is to catch the programme and screen number.

  • Based from my selection-screen, how can I make the parameter dynamic?

    Hi experts,
    Based from my code below and logic, I have to modify the loop at screen without removing the original IF condition in such a way that the parameter p_code will only be available for input if the radiobutton pr_edit is clicked by the user.
    Again, thank you guys and have a great day!
    SELECTION-SCREEN BEGIN OF BLOCK box1 WITH FRAME TITLE text-001.
    PARAMETERS: pr_upld RADIOBUTTON GROUP grp MODIF ID id3.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 03(30) text-a11 FOR FIELD p_flnme MODIF ID id3.
    PARAMETERS: p_flnme LIKE rlgrap-filename DEFAULT 'C:\' MODIF ID id3.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 1(32) text-002 FOR FIELD p_dcode MODIF ID id1.
    PARAMETERS: p_dcode LIKE vbak-kunnr MODIF ID id1,
                p_name1 LIKE kna1-name1 MODIF ID id1.
    SELECTION-SCREEN END OF LINE.
    PARAMETERS: pr_list RADIOBUTTON GROUP grp MODIF ID id4,
                pr_add  RADIOBUTTON GROUP grp MODIF ID id2,
                pr_edit RADIOBUTTON GROUP grp MODIF ID id5.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN COMMENT 03(30) text-a12 FOR FIELD p_code MODIF ID id2.
    *PARAMETERS: p_kunnr LIKE zts0001-kunnr.
    PARAMETERS: p_code LIKE zts0001-cdseq MODIF ID id6.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN END OF BLOCK box1.
    IF v_compflag EQ space.
        LOOP AT SCREEN.
          IF screen-group1      = 'ID1'.
            screen-input        = '0'.
            screen-output       = '1'.
            MODIFY SCREEN.
          ELSEIF screen-group1  = 'ID2'.
            screen-active       = '1'.
            MODIFY SCREEN.
          ELSEIF screen-group1  = 'ID3'.
            screen-active       = '0'.
            MODIFY SCREEN.
          ELSEIF screen-group1  = 'ID4'.
            screen-active       = '1'.
            MODIFY SCREEN.
          ELSEIF screen-group1  = 'ID5'.
            screen-active       = '1'.
            MODIFY SCREEN.
         ELSEIF screen-group1  = 'ID6'.
            screen-active       = '1'.
            MODIFY SCREEN.
          ENDIF.
        ENDLOOP.
      ELSEIF v_compflag NE space.
        LOOP AT SCREEN.
          IF screen-group1      = 'ID1'.
            screen-active       = '0'.
            MODIFY SCREEN.
          ELSEIF screen-group1  = 'ID2'.
            screen-active       = '0'.
            MODIFY SCREEN.
          ELSEIF screen-group1  = 'ID3'.
            screen-active       = '1'.
            MODIFY SCREEN.
          ELSEIF screen-group1  = 'ID4'.
            screen-active       = '1'.
            MODIFY SCREEN.
          ELSEIF screen-group1  = 'ID5'.
            screen-active       = '0'.
            MODIFY SCREEN.
          ELSEIF screen-group1  = 'ID6'.
            screen-active       = '0'.
            MODIFY SCREEN.
          ENDIF.
        ENDLOOP.
      ENDIF.

    Write the below code in  selection Screen Output Event
    AT SELECTION-SCREEN OUTPUT.
      IF pr_edit EQ 'X'.
        LOOP AT SCREEN.
          IF ( screen-group1 = 'ID6' ).
            screen-input = 0.
            screen-invisible = 1.
            MODIFY SCREEN.
          ENDIF.
        ENDLOOP.
    ENDIF.
    Enjoy Coding.
    Thomas.

  • Selection screen  , how can i update in event ?

    i use : AT SELECTION-SCREEN ON VALUE-REQUEST FOR zw_lfd1.
    in this event i want to update another parameter  , is it possible and how  ?

    Yes it is.  Please implement the following example program.  Do F4 help on the company code, the rest will be filled in.
    report zrich_0002 .
    parameters: p_bukrs type t001-bukrs,
                p_butxt type t001-butxt,
                p_ort01 type t001-ort01,
                p_land1 type t001-land1.
    data: dynfields type table of dynpread with header line.
    data: return type table of ddshretval with header line.
    at selection-screen on value-request for p_bukrs.
      call function 'F4IF_FIELD_VALUE_REQUEST'
           exporting
                tabname           = 'T001'
                fieldname         = 'BUKRS'
                dynpprog          = sy-cprog
                dynpnr            = sy-dynnr
                dynprofield       = 'P_BUKRS'
           tables
                return_tab        = return
           exceptions
                field_not_found   = 1
                no_help_for_field = 2
                inconsistent_help = 3
                no_values_found   = 4
                others            = 5.
      read table return with key fieldname = 'P_BUKRS'.
    * Add it back to the dynpro.
      dynfields-fieldname = return-retfield.
      dynfields-fieldvalue =  return-fieldval.
      append dynfields.
    * Get the company code from db and add to dynpro
      data: xt001 type t001.
      clear xt001.
      select single * into xt001
             from t001
            where bukrs = return-fieldval.
      dynfields-fieldname = 'P_BUTXT'.
      dynfields-fieldvalue = xt001-butxt.
      append dynfields.
      dynfields-fieldname = 'P_ORT01'.
      dynfields-fieldvalue = xt001-ort01.
      append dynfields.
      dynfields-fieldname = 'P_LAND1'.
      dynfields-fieldvalue = xt001-land1.
      append dynfields.
    * Update the dynpro values.
      call function 'DYNP_VALUES_UPDATE'
           exporting
                dyname     = sy-cprog
                dynumb     = sy-dynnr
           tables
                dynpfields = dynfields
           exceptions
                others     = 8.
    start-of-selection.
    Regards,
    Rich Heilman

  • Selection Screen search help values based on condition

    Hi All,
    I am developing this report for HR.And the requirement is in one of the selection screen field the
    value's should be appeared(when f4) based on some condition,ie not all values should come.
    My field is HRP1001-sobid,here there are many values,they dunt want all that to be shown when user
    tries to input the values(F4).And also i need to show the Text for this field(department name) in
    search help.
    Can anyone please guide...
    Thanks in advance.

    Hi Salz
    You can code your own search help procedure for this. To achieve this, first you should add the block:
    <u>e.g.</u>
    AT SELECTION-SCREEN ON VALUE REQUEST FOR p_sobid.
    Within this block you can use the standard FM "<b>RH_OBJID_REQUEST</b>" to call the standard HR help list for objects conditionally.
    Regards
    *--Serdar <a href="https://www.sdn.sap.com:443http://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.sdn.businesscard.sdnbusinesscard?u=qbk%2bsag%2bjiw%3d">[ BC ]</a>

  • Without selection screen how can we featch the file.

    Hi all,
         without selection screen(parameter,select-options iam not using these both.) how can we featch the flat file what ever it may be (file format is xls.textor any thing) how ot do...plz it's urgent for me.
    Regards,
    Krishna,

    Hi varun,
      this is my sample code.here we are geting selection screen.without selection screen hoe to get file from out internal table.
    plz gothrough this code and replay to me varun.
    tables:pa0002.
    type-pools:truxs.
    *data:W_TRUXS_T_TEXT_DATA TYPE TRUXS_T_TEXT_DATA ,
         it_p0001 type standard table of pa0001.
    TYPES: BEGIN OF it_p0002,
            pernr like pa0002-pernr,
            nachn like pa0002-nachn,
            vorna like pa0002-vorna,
           end of it_p0002.
    DATA: t_p0002 type standard table of it_p0002,
          wa_p0002 type It_p0002.
    DATA: it_raw TYPE truxs_t_text_data.
    SELECTION-SCREEN BEGIN OF BLOCK S_BLK WITH FRAME TITLE TEXT-000.
    parameters: P_EXCEL   TYPE RLGRAP-FILENAME.
    SELECTION-SCREEN end OF BLOCK S_BLK.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_EXCEL.
    CALL FUNCTION 'F4_FILENAME'
    EXPORTING
       PROGRAM_NAME        = SYST-CPROG
       DYNPRO_NUMBER       = SYST-DYNNR
       FIELD_NAME          = 'P_EXCEL'
    IMPORTING
       FILE_NAME           = P_EXCEL .
    START-OF-SELECTION.
    CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
      EXPORTING
      I_FIELD_SEPERATOR          =
       I_LINE_HEADER              = 'X'
        I_TAB_RAW_DATA             = it_raw
        I_FILENAME                 = p_excel
      TABLES
        I_TAB_CONVERTED_DATA       = t_p0002[]
    EXCEPTIONS
       CONVERSION_FAILED          = 1
       OTHERS                     = 2.
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    end-of-selection.
        loop at t_p0002 into wa_p0002.
           write:/ wa_p0002-pernr,
                   wa_p0002-nachn,
                   wa_p0002-vorna.
        endloop.

  • Problem in passing selection screen values using CALL TRANSACTION.

    Hi All
    I am facing problem in transfering selection screen values to the called transaction. I am trying to pass the path of the transaction filer but to no avail. The variable for filepath is not empty.
    Below is my code:
    DATA: lt_bdcdata TYPE TABLE OF bdcdata,
           wa_bdcdata TYPE bdcdata,
           opt TYPE ctu_params.
    CLEAR wa_bdcdata.
    wa_bdcdata-program  = 'RFBASM00'.
    wa_bdcdata-dynpro   = '1000'.
    wa_bdcdata-dynbegin = 'X'.
    APPEND wa_bdcdata TO lt_bdcdata.
    CLEAR wa_bdcdata.
    wa_bdcdata-fnam = 'BDC_CURSOR'.
    wa_bdcdata-fval = 'RFPDO1-FEBUMSF'.
    APPEND wa_bdcdata TO lt_bdcdata.
    CLEAR wa_bdcdata.
    wa_bdcdata-fnam = 'RFPDO1-FEBUMSF'.
    wa_bdcdata-fval = gv_filepath.
    APPEND wa_bdcdata TO lt_bdcdata.
    CLEAR wa_bdcdata.
    wa_bdcdata-fnam = 'BDC_OKCODE'.
    wa_bdcdata-fval = 'PASS'.
    APPEND wa_bdcdata TO lt_bdcdata.
    CLEAR wa_bdcdata.
    opt-dismode = 'E'.
    opt-updmode = 'S'.
    CALL TRANSACTION 'FF_5' USING lt_bdcdata OPTIONS FROM opt.
    Please help.
    Harsh

    Hi Harsh,
    I think you have entered wrong main program for tcode 'FF_5' and wrong screen field for the file name. Use the below code instead of yours.
    DATA: lt_bdcdata TYPE TABLE OF bdcdata,
           wa_bdcdata TYPE bdcdata,
           opt TYPE ctu_params,
           gv_filepath type char128 value 'C:\testfile.txt'.
    CLEAR wa_bdcdata.
    wa_bdcdata-program  = 'RFEBKA00'.
    wa_bdcdata-dynpro   = '1000'.
    wa_bdcdata-dynbegin = 'X'.
    APPEND wa_bdcdata TO lt_bdcdata.
    CLEAR wa_bdcdata.
    wa_bdcdata-fnam = 'BDC_CURSOR'.
    wa_bdcdata-fval = 'UMSFILE'.
    APPEND wa_bdcdata TO lt_bdcdata.
    CLEAR wa_bdcdata.
    wa_bdcdata-fnam = 'UMSFILE'.
    wa_bdcdata-fval = gv_filepath.
    APPEND wa_bdcdata TO lt_bdcdata.
    CLEAR wa_bdcdata.
    *wa_bdcdata-fnam = 'BDC_OKCODE'.
    *wa_bdcdata-fval = 'PASS'.
    *APPEND wa_bdcdata TO lt_bdcdata.
    *CLEAR wa_bdcdata.
    opt-dismode = 'A'.
    opt-updmode = 'S'.
    CALL TRANSACTION 'FF_5' USING lt_bdcdata OPTIONS FROM opt.
    Thanks.
    Regards,
    Jey

  • Selection screen / how to clear values in screen parameters parameters

    Hello ,
    I am developing report . It is simple one with standard screen 1000  ( Not Dynpro ).
    On the screen I have several parameters and select options . When I run program , display list
    and press the "Back" Button from tool bar  ,entered values still remain in screen parameters.
    I  code I did 'clear' of parameters  , so after pressing "back" button and before selection screen
    is displayed the parameters show up as initial ( empty ) but once selection screen is displayed
    the values are in parameters again .
    Can you advice how I can clean up the values from  screen parameters  .
    Thank you

    Hi,
    Try the below code....
    DATA: executed TYPE n.
    SELECT-OPTIONS : selop1 FOR sy-datum.
    INITIALIZATION.
    executed = 1.
    AT SELECTION-SCREEN OUTPUT.
      BREAK-POINT.
      IF executed = 1.
        executed = 0.
        REFRESH: selop1.
        CLEAR : selop1.
      ENDIF.
    Regards
    Arbind

  • Selection screen validation  - one field based on another field

    Hi all,
    i'm getting Month in Select option and Year in Parameter.
    When i execute the report, it should check whether one is entered without the other one. If so, it should throw error message. 
    How to do this in selection screen ?
    this is what the coding should be...
      if s_month[] is not initial and p_year is initial.
        Message 'Enter Payroll Year' type 'E'.
      endif.
      if s_month[] is initial and p_year is not initial.
        Message 'Enter Payroll month' type 'E'.
      endif.
    But under which event i should write this..
    can anyone pls help me..
    Regards,
    Shanthi

    Hi Shanti,
    Define your selection-screen elements between
    SELECTION-SCREEN BEGIN OF BLOCK <block name>
    Select-options....
    Parameters:
    SELECTION-SCREEN END OF BLOCK <block name>
    You specify ur code in AT SELECTION-SCREEN ON BLOCK <b1>.
    This would help you if either one of the entry is missing...
    And even you can mention in AT SELECTION-SCREEN event...
    But if you have any other parameters there its not necessary for the user to specify if he had entered...
    As month and year are interrelated for your program its better you go for the first procedure ie in BLOCK event.
    Hope this would help you,
    Regards
    Narin Nandivada.

  • Selection Screen - How to populate more than 1 field with help input

    Hello all,
    I have a selection screen in which 4 fields are defined.
    Help input is available for the first field. On selecting the entry in the popup, I would like the 4 fields to be populated with the corresponding values.
    Try transaction CV01 for a sample of what I want:
      Selecting from the popup will populate all 4 fields.
    Thanks in advance,
    Alain Cyr.

    Please see the following program,  it should show you exactly what you need to do.
    report zrich_0002 .
    parameters: p_bukrs type t001-bukrs,
                p_butxt type t001-butxt,
                p_ort01 type t001-ort01,
                p_land1 type t001-land1.
    data: dynfields type table of dynpread with header line.
    data: return type table of ddshretval with header line.
    at selection-screen on value-request for p_bukrs.
      call function 'F4IF_FIELD_VALUE_REQUEST'
           exporting
                tabname           = 'T001'
                fieldname         = 'BUKRS'
                dynpprog          = sy-cprog
                dynpnr            = sy-dynnr
                dynprofield       = 'P_BUKRS'
           tables
                return_tab        = return
           exceptions
                field_not_found   = 1
                no_help_for_field = 2
                inconsistent_help = 3
                no_values_found   = 4
                others            = 5.
      read table return with key fieldname = 'P_BUKRS'.
    * Add it back to the dynpro.
      dynfields-fieldname = return-retfield.
      dynfields-fieldvalue =  return-fieldval.
      append dynfields.
    * Get the company code from db and add to dynpro
      data: xt001 type t001.
      clear xt001.
      select single * into xt001
             from t001
            where bukrs = return-fieldval.
      dynfields-fieldname = 'P_BUTXT'.
      dynfields-fieldvalue = xt001-butxt.
      append dynfields.
      dynfields-fieldname = 'P_ORT01'.
      dynfields-fieldvalue = xt001-ort01.
      append dynfields.
      dynfields-fieldname = 'P_LAND1'.
      dynfields-fieldvalue = xt001-land1.
      append dynfields.
    * Update the dynpro values.
      call function 'DYNP_VALUES_UPDATE'
           exporting
                dyname     = sy-cprog
                dynumb     = sy-dynnr
           tables
                dynpfields = dynfields
           exceptions
                others     = 8.
    start-of-selection.
    Welcome to SDN!  Please remember to award points for helpful answers and mark you post as solved when solved completely.  Thanks.
    Regards,
    Rich Heilman

  • How to call one report2 from report1 using report1 selection screen

    hi experts,
    iam presently working in report1.
    now, from my report1, i want to call report2 with report1 selection screen.
    how to call?
    thanks in advance.

    Below is an sample example, from where i am calling transaction MB5B (Report-RM07MLBD).
    Here i am using selection screen data from report ZTEST and passing it to RM07MLBD.
    REPORT  ZTEST
    DATA : listtab LIKE abaplist OCCURS 1.
    DATA : listtab_tmp LIKE abaplist OCCURS 1.
    DATA : N TYPE n.
    *DATA mseg_wa TYPE mseg.
    *SELECT-OPTIONS s_matnr for mseg_wa-matnr.
    *SELECT-OPTIONS S_WERKS for Mseg_wa-WERKS.
    PARAMETERS : S_MATNR LIKE MSEG-MATNR,
                 S_WERKS LIKE MSEG-WERKS,
                 S_CHARG LIKE MSEG-CHARG.
    DATA MKPF_WA TYPE MKPF.
    SELECT-OPTIONS S_BUDAT FOR MKPF_WA-BUDAT.
    REFRESH listtab.
    CALL FUNCTION 'LIST_FREE_MEMORY'
    TABLES
    listobject = listtab.
    SUBMIT RM07DOCS using SELECTION-SCREEN '1000'
    WITH matnr = S_MATNR
    WITH werks = S_WERKS
    WITH charg = S_CHARG
    WITH budat-low = S_BUDAT-low
    WITH budat-high = S_BUDAT-high EXPORTING LIST TO MEMORY AND RETURN .
    CALL FUNCTION 'LIST_FROM_MEMORY'
    TABLES
    listobject = listtab
    EXCEPTIONS
    not_found = 1
    OTHERS = 2.
    IF sy-subrc = 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    DESCRIBE TABLE listtab LINES n .
    CALL FUNCTION 'WRITE_LIST'
    EXPORTING
    write_only = 'X'
    TABLES
    listobject = listtab
    EXCEPTIONS
    empty_list = 1
    OTHERS = 2.
    IF sy-subrc = 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.

  • How to fetch data based on this selection screen

    Hi Friends:
       I've a selection screen which contains these 3 fields:
    company code (t001-bukrs)
    material division (mara-spart)
    posting date  (bkpf-budat)
    based on the above fields, I've to fetch the following:
    ekpo-bukrs
    mara-spart
    mseg-werks
    mseg-lgort
    bseg-hkont
    bseg-kostl
    bseg-hkont
    skat-txt50
    mseg-mblnr
    mseg-zeile
    bseg-belnr
    bkpf-bktxt
    mseg-insmk
    bkpf-monat
    bkpf-budat
    mseg-bwart
    mbew-matnr
    makt-maktx
    mseg-menge
    mseg-meins
    mbew-stprs
    mseg-dmbtr
    bseg-pswsl
    ausp-atwrt
    mara-matkl
    mara-mtart
    mbew-bklas
    mbew-bwtar
    mkpf-vgart
    mcha-charg
    mseg-ebeln
    aufk-aufnr
    mseg-ummat
    vbak-vbeln
    likp-vbeln
    bkpf-usnam
    Please help me with the logic . I want to ask that in which order I should start fetching data.How to relate it from selection screen. Which table I should fetch first based on the selection screen.how to relate mseg/bseg/mara/mbew/vbak/bkpf  etc.
    Please help.
    Thanks for your time.

    Hi,
    I dont think you need EKPO to fetch your bukrs. It is available in BKPF too.
    Use inner join to join MKPF, BKPF, MAKT, fetch all the related entreis.
    Use Inner join on MBEW, MCHA for all entries from above query.
    use inner join on AUSP for all entries from above query.
    Use may use separate queries or inner joins for LIKP and VBAK with for all entries.
    Use separate for all entries for BSEG and MSEG. Do not use any JOIN on BSEG as it is a pooled table.
    As per the need you may change the queries..
    Regards,
    Subramanian

Maybe you are looking for

  • How to share external USB drive connected to airport time capsule

    I have a 4TB Seagate USB Hard Drive connected to my Airport Time Capsule.  The Time Capsule connected to a newer iMac running Maverick. I use the Time Capsule for Time Machines Backups and as a Router, as it was designed for. I want to use the extern

  • Can't connect via Built-in ethernet

    Can connect to internet via AirPort, but not by Built-in Ethernet. Network status says "The cable for the Built-in Ethernet is not plugged in". BUT it is and it is live because I have plugged it into another computer and it works fine. How do I check

  • AS2 Sender Adapter test

    Hi Experts, I am working on a 856 AS2 to file scenario. I have followed the links EDI to 850 and a few blogs as well. I have configured the scenario as following: IR Message mapping and Interface mapping have been created for 856 to file and 997 to 9

  • Is there a thunderbolt dock that also powers the macbook?

    Please help me find this device.

  • Clearing cookies, cache and what are plug ins?

    Greetings, I followed a post here from SANIBEL explaining how to successfully clear my cache. Then to clean out the cookies under the Security tab of Preferences by clicking on REMOVE ALL WEBSITE DATA. I then clicked on DETAILS and see that there are