Modifying the selection screen dynamically

Hey folks,
I have posted this question previously but no one understood the real problem.
I have 4 fields
Company Code
material Number
plant
storage Location
Unit
when I select the company code AA01 from the F4 help I want to disable material number and Plant ..Like this i have 4 scenarios where based upon the input given in the selection screen other fields have to be enabled or disabled.
I have already used at selection screen on output but that doesn't help me as its a PBO event I tried to search for a proper event but cudn't find it. Is there any way i can achieve this. A sample code wud be easy for me to understand .
Thanks in advance
Rock

Set different groups in your fieds on the screen.
Set the screen group for the Material and Plant as the GR1
Set the screen gorup for the Storage location as the GR2.
You need to modify your screen fields on the PBO event.
Like:
IF P_BUKRS = 'AA01'.
loop at screen.
   if screen-group1 = 'GP1'.
     screen-input = 0.
     modify screen.
   elseif screen-group2 = 'GP2'. 
     screen-input = 1.
     modify screen.
   endif.
endloop. 
else.
loop at screen.
   if screen-group1 = 'GP2'.
     screen-active = 0.
     modify screen.
   elseif screen-group2 = 'GP1'. 
     screen-input = 1.
     modify screen.
   endif.
endloop. 
endif.
Regards,
Naimesh Patel

Similar Messages

  • How to create the selection screen dynamically

    Hi,
    I have a requirement to create the selection screen Dynamically. All the fields that should appear on the selection screen will be available in a custom table. So, based on the entries available in the Z tables, the selection screen should be built. Eg. If there are 10 records available in the Z table, the selection screen should consist of 10 fields. If there are 100 entries, the Selection screen should contain 100 fields. and the logic to build this selection screen should be carried out dynamically in the program.
    Could anyone of you please share the valuable inputs on this. If anyone has the sample code to do this, please share.
    Thanks in advance.
    Regards,
    Paddu.

    Hi,
    Kindly go through this sample program below:
    DEMO_LIST_FORMAT_INPUT *and
    check this function module:
    FREE_SELECTIONS_DIALOG *.
    Hope it helps
    Regards
    Mansi

  • Modify the selection screen for the transaction VF04

    Hi all,
    My requirement is as follow . I need to modify the selection screen (1000) in such a way that I need to add three more fields to te existing selection screen and make some check boxes checked by default which are unchecked . I have found out all the exits in this development clas VF .  I am listing them out here .
    J_3RSINV  Export Sales
    SDVFX001  User exit header line in delivery to accounting          
    SDVFX002  User exit for A/R line (transfer to accounting)          
    SDVFX003  User exit: Cash clearing (transfer to accounting)        
    SDVFX004  User exit: G/L line (transfer to accounting)             
    SDVFX005  User exit: Reserves (transfer to accounting)             
    SDVFX006  User exit: Tax line (transfer to accounting)             
    SDVFX007  User exit: Billing plan during transfer to Accounting    
    SDVFX008  User exit: Processing of transfer structures SD-FI       
    SDVFX009  Billing doc. processing KIDONO (payment reference number)
    SDVFX010  User exit item table for the customer lines              
    SDVFX011  Userexit for the komkcv- and kompcv-structures           
    V05I0001  User exits for billing index                             
    V05N0001  User Exits for Printing Billing Docs. using POR Procedure
    V60A0001  Customer functions in the billing document               
    V60P0001  Data provision for additional fields for display in lists
    V61A0001  Customer enhancement: Pricing          
    Going with the descrition I dont see any of them suits my requirement .  But there should be an approach . Can anyone please help me to find out an exit or explain me how do we identify an exit to modify the selection screen of an standard ransaction .
    Regards,
    Varun .

    Hello,
    I would suggest you to go for BADI,
    Follow the below steps to find out what all BADI's are called when you press any button in any transaction.
    1) Goto se24 (Display class cl_exithandler)
    2) Double click on the method GET_INSTANCE.
    3) Put a break point at Line no.25 (CASE sy-subrc).
    Now
    4) Execute SAP standard transaction
    5) Press the required button for which you need to write an exit logic, the execution will stop at the break point.
    6) Check the values of variable 'exit_name', it will give you the BADI name called at that time.
    7) This way you will find all the BADIs called on click of any button in any transaction.
    Regs,
    Venkat

  • Modifying the selection screen in an LDB

    Hello Experts,
       I have a requirement wherein, i need to copy a standard report which used an LDB 'ERM', into a z report and modify its selection screen(Add a check box).
    Is this possible?
    If yes, can you tell me how?
    Thanks in advance,
    Regards,
    Ravi

    Hi ravi,
    1. simple
    2. just add your single line code for checkbox.
    3. It will automatically come
       beneath the standard selection screen of ldb.
    regards,
    amit m.

  • How to Modify the Selection Screen in Report Painter

    Hi All,
    I am working on Report painter and writer,
    can any body helpme how to change the selection screen i.e i want add some more  select options to the exisiting roport .
    how can i  add more select options to the exisiting one
    please let me know the Procedure and provide some relevent documents .
    Thanks and Best regards.
    uma

    Hello...
    In the program ...we can find the following chunk of code..
    selection-screen:begin of block B1 with frame title text-001.
    Parameters : ....
    select-options:.....
    selection-screen:end of block b1.
    if we need to add any more user inputs we can write the code inside the existing
    selection screen....end of block .
    or create a new block ..just the block name should be different...
    if we are using select options...we need to declare the table name using the key word for the field on which we are giving select options ....
    Tables : BSIK.
    Please see the following code:
    Imagine :- we have the current selection screen..
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
    PARAMETERS: P_BUKRS LIKE BSIK-BUKRS DEFAULT SPACE.
    SELECT-OPTIONS: S_LIFNR FOR BSIK-LIFNR.
    SELECTION-SCREEN END OF BLOCK B1.
    we need to add 2 more fields on the selection screen ..this we can do as the following
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
    PARAMETERS: P_BUKRS LIKE BSIK-BUKRS DEFAULT SPACE.
    SELECT-OPTIONS: S_LIFNR FOR BSIK-LIFNR,
                    S_HKONT FOR BSIK-HKONT.
    PARAMETER: P_DATE LIKE BSIK-BUDAT OBLIGATORY DEFAULT
               SY-DATUM.
    SELECTION-SCREEN END OF BLOCK B1.
    OR...create a new block...
    SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-002.
    SELECT-OPTIONS:   S_HKONT FOR BSIK-HKONT.
    PARAMETER: P_DATE LIKE RFPDO-ALLGSTID OBLIGATORY DEFAULT
               SY-DATUM.
    SELECTION-SCREEN END OF BLOCK B2.
    there are many options available in selection screens..like creating check box,radio button etc..
    for more info press F1 help on the Selection screen in the ABAP editor
    Revert back if not clear and reward if helpful
    Regards
    Byju

  • Changing of default values on the selection screen dynamically

    Hi,
          I have 2 radiobuttons R_A & R_B and i have one text field like P_TEXT. Based on selection of radio button i have to change the default values in P_TEXT on the selection screen. like if i select R_A i have to display P_TEXT = 'A'. if i select R_B then it has to display P_TEXT = 'B'. I tried like as below
    in AT SELECTION-SCREEN OUPUT EVENT.
                 IF R_A = 'X'
                   P_TEXT = 'A'.
                 ELSEIF R_B= 'B'.
                   P_TEXT = 'B'.
                 ENDIF.
            But it's not working. it is working only for first radio button. when i select second radio button it is not giving the second value. can any one tell the sol.
    Tks in advance.

    Hi Pammi,
    Use this code, its working:-
    PARAMETERS : r_a RADIOBUTTON GROUP gp1 DEFAULT 'X' USER-COMMAND rb,
                 r_b RADIOBUTTON GROUP gp1,
                 p_text(20).
    "we use user command with the radiobutton so that some event is occured in order to call AT SELECTION-SCREEN OUTPUT.
    AT SELECTION-SCREEN OUTPUT.
      IF r_a = 'X'.
        p_text = 'Hello'.
      ELSEIF r_b = 'X'.
        p_text = 'Hi'.
      ENDIF.
    In the above case 'AT SELECTION-SCREEN OUTPUT' will act as PBO of the selection screen and will change value of selection text as per condition.
    Hope this solves your problem.
    Thanks & Regards,
    Tarun Gambhir

  • Modify the selection screen

    Hi all ,
    This is how I have defines my selection screen :
    *           S E L E C T   O P T I O N S & P A R A M E T E R S         *
    SELECTION-SCREEN BEGIN OF BLOCK b1
                              WITH FRAME TITLE text-001.
    SELECTION-SCREEN SKIP 1 .
    SELECTION-SCREEN BEGIN OF BLOCK b4
                              WITH FRAME TITLE text-004.
    SELECT-OPTIONS : s_matnr FOR mast-matnr ,
                     s_werks FOR mast-werks OBLIGATORY ,
                     s_andat FOR mast-andat ,
                     s_aedat FOR mast-aedat ,
                     s_stlnr FOR stko-stlnr NO-DISPLAY .
    SELECTION-SCREEN END OF BLOCK b4.
    SELECTION-SCREEN SKIP 1 .
    SELECTION-SCREEN BEGIN OF BLOCK b3
                              WITH FRAME TITLE text-003.
    PARAMETERS : p_sspec  TYPE c AS CHECKBOX DEFAULT 'X',
                 p_fspec   TYPE c AS CHECKBOX DEFAULT 'X'.
    SELECTION-SCREEN END OF BLOCK b3.
    SELECTION-SCREEN BEGIN OF BLOCK b2
                              WITH FRAME TITLE text-002.
    PARAMETERS : p_pr TYPE sfpoutputparams-preview  RADIOBUTTON GROUP g1 ,
                 p_rm TYPE sfpoutputparams-reqimm   RADIOBUTTON GROUP g1 ,
                 p_dl TYPE c                        RADIOBUTTON GROUP g1 .
    SELECTION-SCREEN END OF BLOCK b2.
    SELECTION-SCREEN BEGIN OF BLOCK b5
                              WITH FRAME TITLE text-017.
    PARAMETERS : p_fpath LIKE rlgrap-filename .
    SELECTION-SCREEN END OF BLOCK b5.
    SELECTION-SCREEN END OF BLOCK b1.
    Now my requirement is the file path parameter should not be displayed when I select p_pr or p_rm . It should be displayed only when I select p_dl . I know this has to be coded in at selection-screen output event but not sure how to achieve this .
    Can anyone help me out with this  .
    Thanks,
    Varun  .

    See the Below Logic :
    Selection Screen
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    PARAMETERS:     s_werks  LIKE zwafpo-dwerk OBLIGATORY DEFAULT '1000'.
    "Plant
    PARAMETERS:     p_vdatu  LIKE sy-datum OBLIGATORY modif id bel .
    select-options : s_vdatu for sy-datum obligatory modif id rel.
    SELECT-OPTIONS: s_waveno FOR  zwafpo-zzrun. "Wave Run
    SELECT-OPTIONS: s_dept   FOR  marc-zzdept OBLIGATORY. "Department
    select-options : s_arbpl for RC68A-arbpl modif id arb.
    select-options : s_mtart for mara-mtart modif id mta.
    SELECT-OPTIONS: s_pwave  FOR  zwafpo-zzpwaveno.
    SELECT-OPTIONS: s_swave  FOR  zwafpo-zzswaveno.
    SELECT-OPTIONS: s_aufnr  FOR  zwafpo-aufnr.
    SELECT-OPTIONS: s_matnr  FOR  zwafpo-matnr.
    SELECTION-SCREEN END OF BLOCK b1.
    SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.
    SELECTION-SCREEN BEGIN OF LINE.
    PARAMETERS p_conf AS CHECKBOX DEFAULT 'X'.
    SELECTION-SCREEN COMMENT 5(30) text-003.
    SELECTION-SCREEN END OF LINE.
    *selection-screen skip 1.
    SELECTION-SCREEN BEGIN OF LINE.
    PARAMETERS p_pconf AS CHECKBOX DEFAULT 'X'.
    SELECTION-SCREEN COMMENT 5(26) text-007.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    PARAMETERS p_nconf AS CHECKBOX DEFAULT 'X'.
    SELECTION-SCREEN COMMENT 5(25) text-004.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    PARAMETERS p_teco AS CHECKBOX DEFAULT 'X'.
    SELECTION-SCREEN COMMENT 5(28) text-008.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    PARAMETERS p_del AS CHECKBOX DEFAULT 'X'.
    SELECTION-SCREEN COMMENT 5(25) text-006.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN END OF BLOCK b2.
    SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-005.
    PARAMETERS: p_sumexc RADIOBUTTON GROUP g1 DEFAULT 'X'. "Incl Summary rpt
    PARAMETERS: p_suminc RADIOBUTTON GROUP g1.             "Only Summary rpt
    SELECTION-SCREEN END OF BLOCK b3..
    selection-screen : begin of block blk with frame title text-010.
    parameters : p_old radiobutton group rad default 'X',
                 p_new radiobutton group rad.
    selection-screen : end of block blk.
    User Dynamic Selection
    at selection-screen output.
      select single * from t000md.
      loop at screen.
        case screen-group1.
          when 'REL'.
            if not  p_old is initial.
              screen-input = '0'.
              screen-required = '0'.
              screen-invisible = '1'.
            endif.
            modify screen.
          when 'BEL'.
            if not p_new is initial.
              screen-input = '0'.
              screen-required = '0'.
              screen-invisible = '1'.
            endif.
            modify screen.
          when 'ARB'.
            if  p_new is initial.
              screen-input = '0'.
              screen-required = '0'.
              screen-invisible = '1'.
            endif.
            modify screen.
          when 'MTA'.
            if  p_new is initial.
              screen-input = '0'.
              screen-required = '0'.
              screen-invisible = '1'.
            endif.
            modify screen.
        endcase.
      endloop.
    Reward Points if it is helpful
    Thanks
    Seshu

  • Modifying the selection screen

    Dear all,
    I have two fields in selection screen sales order & SV Note.
    Here if i enter SO,the SV Note field should be disabled & if i enter SV Note, SO field should be disabled.
    Can any one give me the code for this ASAP.
    Thanks & Regards,
    Naresh

    Hi Naresh,
    Use the following code
    select-options : s_order .... modif id 'ABC',
                           s_sv..........modif id 'DEF'.
    at selection-screen.
    loop at screen.
    if screen-group1 = 'DEF'.
       if not s_order is initial and screen-fieldname = 'S_SV'.
         screen-input = '0'.
         modify screen.
       endif.
    endif.
    endloop.
    try this and get back to me incase of any queries.
    Dont forget to reward points if found useful.
    Thanks,
    Satyesh

  • How to modify the selection screen frame.

    <b>Friends,
    I need to create two separate blocks A | B.
    Using SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME , we can able to create the blocks one below the other.
    How to create two blocks side by side?
    And also how to fix the size for the block
    Example: block with specific height and width
    Please help it
    <b></b></b>

    Hi,
    If you use the WITH FRAME addition, a frame is drawn around the block. You can nest up to five different blocks with frames.
    SELECTION-SCREEN BEGIN OF BLOCK RAD1
                              WITH FRAME TITLE TEXT-002.
      PARAMETERS R1 RADIOBUTTON GROUP GR1.
      PARAMETERS R2 RADIOBUTTON GROUP GR1.
    SELECTION-SCREEN BEGIN OF BLOCK RAD2
                              WITH FRAME TITLE TEXT-002.
      PARAMETERS R3 RADIOBUTTON GROUP GR2.
      PARAMETERS R4 RADIOBUTTON GROUP GR2.
    SELECTION-SCREEN END OF BLOCK RAD2.
    SELECTION-SCREEN END OF BLOCK RAD1.
    Regards
    Sudheer

  • How to display the dynamic text in the selection screen

    Hi All,
    I want to display the dynamic text in the selection screen .... ( I searched in forums , didnt get the any answer fot this sort of qustion ).....
    EX: If i have the date of today 31st  it has to show message like " today date is 31 like some thing "  when i execute the report .
    Could any one face this sort of requirment, Please let me know.
    Thanks in advance.
    Reagrds,
    Bharani

    Where would you like this dynamic text being displayed? As an "message" or in some parameter field?
    If first
    parameters date type d.
    data: text type string.
    at selection-screen.
       concatenate 'Today is' date into text.
       message text type 'I'.
    If second
    parameters pa_text type c length 50.
    at selection-screen on date.
      if date is not initial.
        concatenate 'Today is' date into  pa_text.
      enidf.
    at selection-screen output.
       "show it as read only
       loop at screen.
        if screen-name = 'PA_TEXT'.
               screen-input = abap_false.
              modify screen.
        endif.
       endloop.
    Regards
    Marcin

  • Dynamic Selection option in the selection screen

    Hi ,
    I have a requirement like this ....
    The user wants some fields to be default available in the selection screen. But they also want to be able to select the data based on additional fields (all the remaining fields ) which they want to see in the dynamic selection .
    The basic list for selections should be limited to the fields listed in the specifications provided to me and the remaining fields should be made available through the dynamic selection option.
    In the transaction FBL3N , this facility is provided.
    Kindly help me with this..
    thanks,
    Sumit .

    Hi Sumit,
    To include dynamic selection check this sample code.
    TYPE POOLS DECLARATIONS FOR VALUE REQUEST MANAGER AND ICONS
    TYPE-POOLS : vrm,
                 icon.
    *SELECTION SCREEN FIELDS
    TABLES : sscrfields.*GLOBAL DECLARATIONS
    DATA : flag TYPE c,
          tablename(10),
          mmtable LIKE dd02l-tabname,
          sdtable LIKE dd02l-tabname,
          hrtable LIKE dd02l-tabname.*DECLARATIONS FOR SELECTION SCREEN STATUS
    DATA it_ucomm TYPE TABLE OF sy-ucomm.***********SELECTION-SCREENS**********************
    SELECTION-SCREEN BEGIN OF BLOCK blk1 WITH FRAME.*FOR DYNAMIC DISPLAY OF MODULES
    PARAMETERS :  pa RADIOBUTTON GROUP rad USER-COMMAND com MODIF ID mod,
                  pb RADIOBUTTON GROUP rad MODIF ID rad,
                  pc RADIOBUTTON GROUP rad MODIF ID cad.SELECTION-SCREEN SKIP.**TO INCLUDE DYNAMIC ICONS
    SELECTION-SCREEN COMMENT 2(6) text_001.*DYNAMIC LIST BOX BASED ON USER SELECTIONS
    PARAMETERS one AS LISTBOX VISIBLE LENGTH 20  MODIF ID mod.
    PARAMETERS two AS LISTBOX VISIBLE LENGTH 20   MODIF ID rad.
    PARAMETERS three AS LISTBOX VISIBLE LENGTH 20 MODIF ID cad.SELECTION-SCREEN END OF BLOCK blk1.*DISPLAY DYNAMIC PUSHBUTTON ON APP TOOLBAR ON USER CLICKS
    SELECTION-SCREEN: FUNCTION KEY 1,
                      FUNCTION KEY 2,
                      FUNCTION KEY 3.**EVENT ON SELECTION SCREEN FOR OUTPUT DISPLAY
    AT SELECTION-SCREEN OUTPUT.*CLICK OF FIRST RADIO BUTTON
      IF pa = 'X'.
        sscrfields-functxt_01 = 'Materials Management'.
        WRITE icon_plant AS ICON TO text_001.
    *CODE TO GET DYNAMICS BASED ON THE SELECTED RADIO
        LOOP AT SCREEN.
          IF screen-group1 = 'MOD'.
            screen-intensified = '1'.
            screen-active = 1.
            screen-display_3d = '1'.
            MODIFY SCREEN.
          ENDIF.
          IF screen-group1 = 'RAD'.
            screen-intensified = '0'.
            screen-active = 0.
            screen-display_3d = '0'.
            MODIFY SCREEN.
          ENDIF.
          IF screen-group1 = 'CAD'.
            screen-intensified = '0'.
            screen-active = 0.
            screen-display_3d = '0'.
            MODIFY SCREEN.
          ENDIF.
        ENDLOOP.
      ENDIF.*CLICK OF SECOND RADIO
      IF pb = 'X'.
        sscrfields-functxt_02 = 'Sales And Distribution'.
        WRITE icon_ws_ship AS ICON TO text_001.
        LOOP AT SCREEN.
          IF screen-group1 = 'RAD'.
            screen-intensified = '1'.
            screen-active = 1.
            screen-display_3d = '1'.
            MODIFY SCREEN.
          ENDIF.
          IF screen-group1 = 'MOD'.
            screen-intensified = '0'.
            screen-active = 0.
            screen-display_3d = '0'.
            MODIFY SCREEN.
          ENDIF.
          IF screen-group1 = 'CAD'.
            screen-intensified = '0'.
            screen-active = 0.
            screen-display_3d = '0'.
            MODIFY SCREEN.
          ENDIF.
        ENDLOOP.
      ENDIF.*CLICK OF THIRD RADIO
      IF pc = 'X'.
        sscrfields-functxt_03 = 'Human Resources'.
        WRITE icon_new_employee AS ICON TO text_001.
        LOOP AT SCREEN.
          IF screen-group1 = 'RAD'.
            screen-intensified = '0'.
            screen-active = 0.
            screen-display_3d = '0'.
            MODIFY SCREEN.
          ENDIF.
          IF screen-group1 = 'MOD'.
            screen-intensified = '0'.
            screen-active = 0.
            screen-display_3d = '0'.
            MODIFY SCREEN.
          ENDIF.
          IF screen-group1 = 'CAD'.
            screen-intensified = '1'.
            screen-active = 1.
            screen-display_3d = '1'.
            MODIFY SCREEN.
          ENDIF.
        ENDLOOP.
      ENDIF.*CUSTOMISING THE TOOLBARS OF THE SELECTION SCREEN
    *WITH F8 BUTTON DISABLED  APPEND :  'PRIN' TO it_ucomm,
                'SPOS' TO it_ucomm,
                'ONLI' TO it_ucomm.  CALL FUNCTION 'RS_SET_SELSCREEN_STATUS'
        EXPORTING
          p_status  = sy-pfkey
        TABLES
          p_exclude = it_ucomm.
    **EVENT ON THE SELECTION
    AT SELECTION-SCREEN.* LIST BOX ONE VALUES
      CASE one.
        WHEN '1'.
          mmtable = 'MARC'.
        WHEN '2'.
          mmtable = 'MARA'.
        WHEN '3'.
          mmtable = 'MARD'.
        WHEN '4'.
          mmtable = 'MARM'.
      ENDCASE.* LIST BOX TWO VALUES
      CASE two.
        WHEN '1'.
          sdtable = 'VBAK'.
        WHEN '2'.
          sdtable = 'VBAP'.
        WHEN '3'.
          sdtable = 'VBUK'.
        WHEN '4'.
          sdtable = 'VBUP'.
      ENDCASE.* LIST BOX THREE VALUES
      CASE three.
        WHEN '1'.
          hrtable = 'PA0001'.
        WHEN '2'.
          hrtable = 'PA0006'.
        WHEN '3'.
          hrtable = 'PA0022'.
        WHEN '4'.
          hrtable = 'PA0008'.
      ENDCASE.*VALUES FOR CLICK OF THE PUSHBUTTON ON APP TOOLBAR
    *AND ENABLING THE BUTTONS TO PERFORM F8
      CASE sscrfields-ucomm.
        WHEN 'FC01'.
          tablename = mmtable.
          sscrfields-ucomm = 'ONLI'.
        WHEN 'FC02'.
          tablename = sdtable.
          sscrfields-ucomm = 'ONLI'.
        WHEN 'FC03'.
          tablename = hrtable.
          sscrfields-ucomm = 'ONLI'.
      ENDCASE.*INITIALIZATION EVENT
    INITIALIZATION.*VALUES ASSIGNED TO DROPDOWNLISTS IN THE SUBROUTINES
      PERFORM f4_value_request_pa.
      PERFORM f4_value_request_pb.
      PERFORM f4_value_request_pc.*START OF SELECTION EVENT
    START-OF-SELECTION.*SUBROUTINE FOR OUTPUT
      PERFORM output.*&----------------------------------------------------------------*
    *&      Form  f4_value_request_PA
    *       text
    *SUBROUTINE TO PROVIDE DROPDOWN VALUES TO LIST1
    FORM f4_value_request_pa.  DATA: l_name TYPE vrm_id,
            li_list TYPE vrm_values,
            l_value LIKE LINE OF li_list.  l_value-key = '1'.
      l_value-text = 'Plant Data for Material'.
      APPEND l_value TO li_list.
      CLEAR l_value.  l_value-key = '2'.
      l_value-text = 'General Material Data'.
      APPEND l_value TO li_list.
      CLEAR l_value.  l_value-key = '3'.
      l_value-text = 'Storage Location Data for Material'.
      APPEND l_value TO li_list.
      CLEAR l_value.  l_value-key = '4'.
      l_value-text = 'Units of Measure for Material'.
      APPEND l_value TO li_list.
      CLEAR l_value.
      l_name = 'ONE'.  CALL FUNCTION 'VRM_SET_VALUES'
        EXPORTING
          id              = l_name
          values          = li_list
        EXCEPTIONS
          id_illegal_name = 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.ENDFORM. " f4_value_request_tabname*&----------------------------------------------------------------*
    *&      Form  f4_value_request_PB
    *       text
    *SUBROUTINE TO PROVIDE DROPDOWN VALUES TO LIST2FORM f4_value_request_pb.  DATA: l_name TYPE vrm_id,
            li_list TYPE vrm_values,
            l_value LIKE LINE OF li_list.  l_value-key = '1'.
      l_value-text = 'Sales Document: Header Data'.
      APPEND l_value TO li_list.
      CLEAR l_value.  l_value-key = '2'.
      l_value-text = 'Sales Document: Item Data'.
      APPEND l_value TO li_list.
      CLEAR l_value.  l_value-key = '3'.
      l_value-text = 'Sales Document:Header Status'.
      APPEND l_value TO li_list.
      CLEAR l_value.  l_value-key = '4'.
      l_value-text = 'Sales Document: Item Status'.
      APPEND l_value TO li_list.
      CLEAR l_value.
      l_name = 'TWO'.
      CALL FUNCTION 'VRM_SET_VALUES'
        EXPORTING
          id              = l_name
          values          = li_list
        EXCEPTIONS
          id_illegal_name = 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.
    ENDFORM. " f4_value_request_PB*&----------------------------------------------------------------*
    *&      Form  f4_value_request_PC
    *       text
    *SUBROUTINE TO PROVIDE DROPDOWN VALUES TO LIST3FORM f4_value_request_pc.  DATA: l_name TYPE vrm_id,
            li_list TYPE vrm_values,
            l_value LIKE LINE OF li_list.  l_value-key = '1'.
      l_value-text = 'HR Master :Infotype 0001 (Org. Assignment)'.
      APPEND l_value TO li_list.
      CLEAR l_value.  l_value-key = '2'.
      l_value-text = 'Address Infotype 0006'.
      APPEND l_value TO li_list.
      CLEAR l_value.  l_value-key = '3'.
      l_value-text = 'Education Infotype 0022'.
      APPEND l_value TO li_list.
      CLEAR l_value.  l_value-key = '4'.
      l_value-text = 'Basic Pay Infotype 0008'.
      APPEND l_value TO li_list.
      CLEAR l_value.
      l_name = 'THREE'.
      CALL FUNCTION 'VRM_SET_VALUES'
        EXPORTING
          id              = l_name
          values          = li_list
        EXCEPTIONS
          id_illegal_name = 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.
    ENDFORM. " f4_value_request_PC
    *&      Form  OUTPUT
    *       text
    *      -->P_TABLENAME  text
    *fINAL OUTPUT
    FORM output.  DATA p_table(10).  p_table = tablename.*popup to display teh selected table and
    *Continue button is clicked
      CALL FUNCTION 'POPUP_TO_DISPLAY_TEXT'
        EXPORTING
          titel        = 'User Selections '
          textline1    = p_table
          textline2    = 'is the Selected table'
          start_column = 25
          start_row    = 6.*assigning the table value in p_table to the
    * Table in SE16 transaction by explicitly calling
      SET PARAMETER ID 'DTB' FIELD p_table.
      CALL TRANSACTION 'SE16'.
    ENDFORM.                    "OUTPUT
    Regards,
    Manoj Kumar P

  • Modifying Selection screen dynamically

    Hi guyz
    herez another question
    Can we modify selection-screen dynamically  as we do in case of screen
    What i want to do is
    I want to display one parameter as  checkbox and when user ticks this box I want to display another one
    If we are defining two checkboxes earlier and making one invisible than can we modify selection screen to display another check box
    Thanks in advance

    Take a look at this example.
    REPORT EVENT_DEMO.
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME.
      PARAMETERS: R1 RADIOBUTTON GROUP RAD1 DEFAULT 'X',
                  R2 RADIOBUTTON GROUP RAD1,
                  R3 RADIOBUTTON GROUP RAD1.
    SELECTION-SCREEN END OF BLOCK B1.
    SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME.
      PARAMETERS: R4 RADIOBUTTON GROUP RAD2 DEFAULT 'X',
                  R5 RADIOBUTTON GROUP RAD2,
                  R6 RADIOBUTTON GROUP RAD2.
    SELECTION-SCREEN END OF BLOCK B2.
    AT SELECTION-SCREEN ON RADIOBUTTON GROUP RAD1.
      IF R1 = 'X'.
        MESSAGE W040(HB).
      ENDIF.
    AT SELECTION-SCREEN ON RADIOBUTTON GROUP RAD2.
      IF R4 = 'X'.
        MESSAGE W040(HB).
      ENDIF.

  • Dynamic ALV as per the periods on the selection screen

    Hello Experts
    I am new to dynamic ALV , Please help me to sought out my confusion.
    I want to create a dynamic ALV , based on the period mentioned at selection screen.
    for example I want to display the movement type  ( sum of the quantity ) for materials for the full month.
    I want the ALV output as below.
    Material  .........qty 01.04.2011..... qty 02.04.2011... qty 03.04.2011 ........ qty 30.04.2011
    AB1........................... 30.................... 20............................. 50......................... 200
    AB2.................................................... 50 ............................. 80 ..........................10
    I create an internal table itab with there fields to selact the data
    MATNR
    date
    qty
    select MATNR
           date
           qty
    into itab
    from mseg
    where based on the selection screen.
    then collect the data to other table date wise , now i have summrise data of material quantity
    now the results after collection data into table itab2 is as follows
    Material  ................... date ................................   qty
    AB1  ....................    01.04.2011.......................  30
    AB1  ...................     02.04.2011 ....................... 20
    AB1  ...................   03.04.2011.......................  50
    AB1  ...................   .30.04.2011.......................  200
    AB2 ....................   02.04.2011.......................   50
    AB2 .......................   03.04.2011.......................   80
    AB2 .......................   30.04.2011 .......................   10
    How can I display these fields horizontally instead of vertically ,
    and to the exact column as per the field catalog column header belongs to date.
    it would be so helpful if somebody explain with code by taking the above example.
    Thanks in Advance

    Hello Both Experts ,
    I write the below code and it is working for the requirement.
    Can you please check
    REPORT  z_test_dynamic                          .
    TABLES : mkpf , mseg .
    TYPES : BEGIN OF t_mseg ,
          mblnr TYPE mblnr ,
          bwart TYPE bwart ,
          matnr TYPE matnr ,
          werks TYPE werks_d ,
          menge TYPE menge_d ,
          budat TYPE budat ,
      END OF t_mseg.
    TYPES : BEGIN OF t_mseg_1 ,
          matnr TYPE matnr ,
          menge TYPE menge_d ,
          budat TYPE budat ,
      END OF t_mseg_1.
    DATA : gt_mseg TYPE STANDARD TABLE OF t_mseg ,
           gs_mseg TYPE t_mseg,
           gt_mseg_1 TYPE STANDARD TABLE OF t_mseg_1 ,
           gs_mseg_1 TYPE t_mseg_1,
           gt_mseg_2 TYPE STANDARD TABLE OF t_mseg_1 ,
           gs_mseg_2 TYPE t_mseg_1..
    DATA : gt_date TYPE STANDARD TABLE OF sy-datum ,
          gs_date TYPE sy-datum..
    DATA: ok_code LIKE sy-ucomm,
          g_container TYPE scrfname VALUE 'CONTAINER_01',
          grid1  TYPE REF TO cl_gui_alv_grid,
          g_custom_container TYPE REF TO cl_gui_custom_container.
    DATA: gt_fieldcat TYPE lvc_t_fcat.
    DATA: gp_table TYPE REF TO data.
    FIELD-SYMBOLS: <gt_table> TYPE table.
    SELECTION-SCREEN : BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    SELECT-OPTIONS : s_matnr FOR mseg-matnr ,
                     s_bwart FOR mseg-bwart NO INTERVALS,
                     s_werks FOR mseg-werks ,
                     s_budat FOR mkpf-budat .
    PARAMETERS   : p_mjahr TYPE mjahr OBLIGATORY.
    SELECTION-SCREEN : END OF BLOCK b1.
    PERFORM field_catalog.
    CALL METHOD cl_alv_table_create=>create_dynamic_table
      EXPORTING
        it_fieldcatalog = gt_fieldcat
      IMPORTING
        ep_table        = gp_table.
    ASSIGN gp_table->* TO <gt_table>.
    PERFORM select_main_data.
    PERFORM move_data.
    *&      Form  select_main_data
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM select_main_data .
      SELECT      mseg~mblnr
          mseg~bwart
          mseg~matnr
          mseg~werks
          mseg~menge
          mkpf~budat
        INTO TABLE gt_mseg
        FROM mseg AS mseg INNER JOIN mkpf AS mkpf
        ON mseg~mblnr = mkpf~mblnr AND
           mseg~mjahr = mkpf~mjahr
        WHERE matnr IN s_matnr AND
             budat IN s_budat AND
             werks IN s_werks AND
             bwart IN s_bwart AND
             mseg~mjahr EQ p_mjahr .
      IF  gt_mseg IS NOT INITIAL.
        LOOP AT gt_mseg INTO gs_mseg.
          gs_mseg_1-matnr = gs_mseg-matnr.
          gs_mseg_1-budat = gs_mseg-budat.
          gs_mseg_1-menge = gs_mseg-menge.
          COLLECT gs_mseg_1 INTO gt_mseg_1.
        ENDLOOP.
      ENDIF.
      gt_mseg_2 = gt_mseg_1.
      DELETE ADJACENT DUPLICATES FROM gt_mseg_2  COMPARING matnr.
    ENDFORM.                    " select_main_data
    *&      Form  field_catalog
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM field_catalog .
      DATA : lt_day_attributes TYPE STANDARD TABLE OF casdayattr ,
             ls_day_attributes TYPE casdayattr .
      DATA: ls_fieldcat TYPE lvc_s_fcat ,
            lv_fieldname TYPE lvc_fname.
      IF s_budat-high IS INITIAL.
        s_budat-high = s_budat-low.
      ENDIF.
      CALL FUNCTION 'DAY_ATTRIBUTES_GET'
       EXPORTING
    *   FACTORY_CALENDAR                 = ' '
    *   HOLIDAY_CALENDAR                 = ' '
         date_from                        = s_budat-low
         date_to                          = s_budat-high
         language                         = sy-langu
    * IMPORTING
    *   YEAR_OF_VALID_FROM               =
    *   YEAR_OF_VALID_TO                 =
    *   RETURNCODE                       =
        TABLES
          day_attributes                   = lt_day_attributes
    * EXCEPTIONS
    *   FACTORY_CALENDAR_NOT_FOUND       = 1
    *   HOLIDAY_CALENDAR_NOT_FOUND       = 2
    *   DATE_HAS_INVALID_FORMAT          = 3
    *   DATE_INCONSISTENCY               = 4
    *   OTHERS                           = 5
      IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      LOOP AT lt_day_attributes INTO ls_day_attributes.
        gs_date = ls_day_attributes-date.
        APPEND gs_date TO gt_date.
      ENDLOOP.
      ls_fieldcat-fieldname = 'MATNR'.
      ls_fieldcat-inttype    = 'CHAR18'.
      ls_fieldcat-coltext    = 'MATERIAL'.
    *   ls_fieldcat-decimals_o   = '2'.
      ls_fieldcat-outputlen = 18.
      APPEND ls_fieldcat TO gt_fieldcat.
      LOOP AT gt_date INTO gs_date.
        CONCATENATE 'QTY_' gs_date INTO lv_fieldname.
        ls_fieldcat-fieldname = lv_fieldname.
        ls_fieldcat-inttype    = 'QUAN'.
        ls_fieldcat-coltext    = gs_date.
        ls_fieldcat-decimals_o   = '2'.
    *    ls_fieldcat-outputlen = 18.
        APPEND ls_fieldcat TO gt_fieldcat.
      ENDLOOP.
    ENDFORM.                    " field_catalog
    *&      Form  move_data
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM move_data .
      DATA: l_row TYPE sy-index.
      FIELD-SYMBOLS: <ls_table>.
      FIELD-SYMBOLS: <l_field> ,
                     <l_mseg_1> TYPE t_mseg_1.
      DATA: ls_fieldcat TYPE lvc_s_fcat .
      ASSIGN LOCAL COPY OF INITIAL LINE OF <gt_table> TO <ls_table>.
      SORT gt_mseg_1 BY matnr.
      LOOP AT gt_mseg_1 ASSIGNING <l_mseg_1> .
        IF <l_field> IS ASSIGNED.
          UNASSIGN <l_field>.
        ENDIF.
        MOVE-CORRESPONDING <l_mseg_1> TO <ls_table>.
          READ TABLE gt_fieldcat INTO ls_fieldcat WITH KEY coltext = <l_mseg_1>-budat.
          IF sy-subrc EQ 0.
            ASSIGN COMPONENT ls_fieldcat-fieldname OF STRUCTURE <ls_table> TO <l_field>.
            <l_field> = <l_mseg_1>-menge.
          ELSE.
            <l_field> =  0.
          ENDIF.
        AT end of matnr.
          APPEND <ls_table> TO <gt_table>.
    clear <ls_table>.
        ENDAT.
      ENDLOOP.
    ENDFORM.                    " move_data
    your answers help me lot . I am awarding the points.
    Very Very Thanks
    Edited by: Dilraj Singh on Apr 13, 2011 3:58 PM
    Edited by: Dilraj Singh on Apr 13, 2011 4:09 PM
    Edited by: Dilraj Singh on Apr 13, 2011 4:23 PM

  • Dynamic Parameters in the Selection screen

    Hi,
    I want to have a pair of Parameters (Source & Target Field) in the Selection Screen. Is it possible to create more pairs of Parameters by click of a Button or something else?
    Sinan

    hi,
    Dynamic generation of selection-screen is bit confusing.
    I have a sample program which takes an integer as an input. After giving input, click on the button on selection screen. You can make a similar logic in your case also.
    Create a program with name 'Z_13317_DYN_CHKBOX' and paste the following code in it. Also make ensure that an include with name 'Z_13317_DYN_INCL' is not existing earlier because this program will be overwritten each and everytime.
    Suppose, if you have given 3 as input and if you have clicked the button, then 3 checkboxes will be generated on your selection screen.
    REPORT  Z_13317_DYN_CHKBOX.
    types :begin of t_itab1,
            line(72),
           end of t_itab1.
    data: incl type table of t_itab1 with header line.
    parameters: p_tab type i,
                p_frst type c no-display.
    selection-screen begin of line.
    selection-screen: pushbutton 2(20) but1 user-command cli1.
    selection-screen end of line.
    include z_13317_dyn_incl if found.
    initialization.
    at selection-screen output.
      if p_frst = ' '.
        p_frst = 'X'.
        perform crt_dyn_incl.
      endif.
    at selection-screen.
      case sy-ucomm.
        when 'CLI1'.
        perform crt_dyn_incl.
      endcase.
    *&      Form  crt_dyn_incl
    *       text
    form crt_dyn_incl .
      perform populate_incl.
      perform del_incl.
      insert report 'Z_13317_DYN_INCL' from incl.
      commit work.
      submit z_13317_dyn_chkbox via selection-screen with p_frst = p_frst.
    endform.                    " crt_dyn_incl
    *&      Form  del_incl
    *       text
    form del_incl .
      call function 'RS_DELETE_PROGRAM'
        exporting
         program                          = 'Z_13317_DYN_INCL'
         suppress_checks                  = 'X'
         suppress_popup                   = 'X'
         with_cua                         = ' '
         with_documentation               = ' '
         with_dynpro                      = 'X'
         with_includes                    = ' '
         with_textpool                    = ' '
         with_variants                    = ' '
      if sy-subrc <> 0.
      endif.
    endform.                    " del_incl
    *&      Form  populate_incl
    *       text
    form populate_incl .
      data: v_cnt type n.
      do p_tab times.
        v_cnt = v_cnt + 1.
        incl-line = 'parameters: '.
        concatenate incl-line 'p_chk' v_cnt into incl-line.
        concatenate incl-line 'as checkbox.' into incl-line separated by space.
        append incl.
        clear incl.
      enddo.
    endform.                    " populate_incl
    Regards
    Sailaja.

  • Adding fields on selection screen dynamically

    Hi all,
    Can we add some fields to selection screen dynamically on pushbutton click?
    Regards,
    Dnyanesh

    just have look below code
    REPORT zrsdvsr1
           LINE-SIZE 220
           LINE-COUNT 65(5).
    TYPE-POOLS : slis.
    TABLES
    TABLES: vbak.
    DATA DECLARATIONS
    Ranges
    RANGES: r_posnr FOR vbap-posnr.
    DATA: BEGIN OF t_veramt OCCURS 0,
            vbeln TYPE vbap-vbeln,
            posnr TYPE vbap-posnr,
            matnr TYPE vbap-matnr,
            netwr TYPE vbap-netwr,
            mwsbp TYPE vbap-mwsbp,
          END OF t_veramt.
    DATA: BEGIN OF t_disamt OCCURS 0,
            vbeln TYPE vbap-vbeln,
            posnr TYPE vbap-posnr,
            matnr TYPE vbap-matnr,
            netwr TYPE vbap-netwr,
            mwsbp TYPE vbap-mwsbp,
            netwr_v TYPE vbap-netwr,
            mwsbp_v TYPE vbap-mwsbp,
            disc_val TYPE vbap-mwsbp,
          END OF t_disamt.
    *&   ALV FIELDS
    DATA : alv_fcat TYPE slis_t_fieldcat_alv WITH HEADER LINE,
           alv_layout TYPE slis_layout_alv.
    SELECTION SCREEN
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    PARAMETERS:  p_ver RADIOBUTTON GROUP g1 USER-COMMAND rad DEFAULT 'X',
                 p_sab RADIOBUTTON GROUP g1 .
    SELECTION-SCREEN END OF BLOCK b1.
    SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.
    SELECT-OPTIONS: s_vbeln FOR vbak-vbeln NO INTERVALS MODIF ID gr1.
    PARAMETERS:    p_dwfile TYPE  rlgrap-filename
                   DEFAULT 'C:\test1.txt' MODIF ID gr2,         "#EC NOTEXT
                   p_upfile TYPE  rlgrap-filename
                   DEFAULT 'C:\test.txt' MODIF ID gr3.          "#EC NOTEXT
    SELECTION-SCREEN END OF BLOCK b2.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_upfile.
    **************F4 Help For Input File Name****************************
      CALL FUNCTION 'F4_FILENAME'
           EXPORTING
                program_name  = syst-cprog
                dynpro_number = syst-dynnr
                field_name    = 'C:\'
           IMPORTING
                file_name     = p_upfile.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_dwfile.
    **************F4 Help For Input File Name****************************
      CALL FUNCTION 'F4_FILENAME'
           EXPORTING
                program_name  = syst-cprog
                dynpro_number = syst-dynnr
                field_name    = 'C:\'
           IMPORTING
                file_name     = p_dwfile.
    AT SELECTION-SCREEN OUTPUT.
      LOOP AT SCREEN.
        IF  p_sab = 'X'.
          IF screen-group1 = 'GR1' OR screen-group1 = 'GR2'.
            screen-active = '0'.
            screen-invisible = '1'.
          ELSE.
            screen-active = '1'.
            screen-invisible = '0'.
          ENDIF.
          MODIFY SCREEN.
        ELSE.
          IF screen-group1 = 'GR3'.
            screen-active = '0'.
            screen-invisible = '1'.
          ELSE.
            screen-active = '1'.
            screen-invisible = '0'.
          ENDIF.
          MODIFY SCREEN.
        ENDIF.
      ENDLOOP.
    START-OF-SELECTION
    START-OF-SELECTION.
    Check Radio Button
      IF p_ver = 'X'.
        PERFORM get_details_open_so_vertex.
      ELSE.
        PERFORM get_details_open_so.
      ENDIF.
    Display the output.
      PERFORM diplay_report .
    regards
    vinod

Maybe you are looking for

  • Why can't i install ox x Marvericks on my computer.

    From MC I have a Macbook Pro. 13.3 inc. 6 Gb of memory and 350gb space. OS : 10.7 Lion it meets all the requirement to upgrade to OX Marvericks. When I click on the link  nothing happens. The download link goes in a circlue and then ends. nothing hap

  • Nokia Music for Nokia Asha 311

    I do'nt nokia music application download Moderator's Note: The subject was amended as we have moved the post to the most appropriate board.

  • Regular expressions - annoyance

    If: Pattern p = Pattern.compile( "(\\d){2}:(\\d){2}-(\\d){2}:(\\d){2}", Pattern.CASE_INSENSITIVE ); matches "01:02-03:04" matcher.group(1) returns: 1, instead of the "01" that should be matched. This is also the case with what should be a character m

  • What is the 'error:9643 severity 16,state 3'

    This database is done image (no witness), the main database log error. Some time ago to have a error:9642 look at the saying is' database mirroring endpoint error in transmissionconnection ', the error of 5, 6 times then no longer prompt. Today and t

  • Does Visa have any buffer/memory or similar?

    Hi, I have a comunication with 2 radiomodems via RS232 port, and I get data with VISA in my laptop and have a Visual Basic program that controls the frames in the other embbedded PC that sends me frames of an electronic compass and a GPS. The thing i