Changing the selection screen based on the option in list box option

Hi Experts,
I have a list box parameter in my selection screen,
i have four options and i am changing my selection screen based the option selected.
see my code below,
at selection-screen output.
  GS_VRM_VALUES-KEY = '1'.
  GS_VRM_VALUES-TEXT = TEXT-S02.
  APPEND GS_VRM_VALUES TO GT_VRM_VALUES.
  GS_VRM_VALUES-KEY = '2'.
  GS_VRM_VALUES-TEXT = TEXT-S03.
  APPEND GS_VRM_VALUES TO GT_VRM_VALUES.
  GS_VRM_VALUES-KEY = '3'.
  GS_VRM_VALUES-TEXT = TEXT-S04.
  APPEND GS_VRM_VALUES TO GT_VRM_VALUES.
  GS_VRM_VALUES-KEY = '4'.
  GS_VRM_VALUES-TEXT = TEXT-S05.
  APPEND GS_VRM_VALUES TO GT_VRM_VALUES.
  CLEAR: GS_VRM_VALUES.
  CALL FUNCTION 'VRM_SET_VALUES'
    EXPORTING
      ID                    = 'P_DROP'
      VALUES                = GT_VRM_VALUES
  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.
LOOP AT SCREEN .
    CASE P_DROP .
      WHEN '1'.
        IF SCREEN-GROUP1 = 'M2' OR
          SCREEN-GROUP1 = 'M3' OR SCREEN-GROUP1 = 'M4'.
          SCREEN-INPUT = 0.
         SCREEN-ACTIVE = 0.
          screen-invisible = 1.
          MODIFY SCREEN.
        ENDIF.
      WHEN '2'.
        IF SCREEN-GROUP1 = 'M3' OR SCREEN-GROUP1 = 'M4'.
          SCREEN-INPUT = 0.
         SCREEN-ACTIVE = 0.
          screen-invisible = 1.
          MODIFY SCREEN.
        ENDIF.
      WHEN '3'.
        IF SCREEN-GROUP1 = 'M2' OR
            SCREEN-GROUP1 = 'M4' .
          SCREEN-INPUT = 0.
         SCREEN-ACTIVE = 0.
          screen-invisible = 1.
          MODIFY SCREEN.
        ENDIF.
      WHEN '4'.
        IF SCREEN-GROUP1 = 'M2' OR
        SCREEN-GROUP1 = 'M3'.
          SCREEN-INPUT = 0.
         SCREEN-ACTIVE = 0.
          screen-invisible = 1.
          MODIFY SCREEN.
        ENDIF.
      WHEN OTHERS.
        IF SCREEN-GROUP1 = 'M2' OR
           SCREEN-GROUP1 = 'M3' OR SCREEN-GROUP1 = 'M4'.
          SCREEN-INPUT = 0.
         SCREEN-ACTIVE = 0.
      screen-invisible = 1.
          MODIFY SCREEN.
        ENDIF.
    ENDCASE.
  ENDLOOP.
my problem is when i change the option in the list box, the particular modify group ie, the screen is getting changed only after i press enter, So please suggest me how i can change the screen without pressing enter.

Hi,
without using VRM_SET_VALUES...you just create one data element by going se11....create one domain for it...now give the values in the "value range" tab....and at the time of declaration just write ..
PARAMETERS var1 TYPE <your created data element>
                    AS LISTBOX VISIBLE LENGTH 20
                    USER-COMMAND onli
                    DEFAULT <one value>.
You will get the same effect as list box....and make it mandatory..
Arunima

Similar Messages

  • How to gray out certain fields on the selection screen based on the radio b

    HI All,
      I have an ALV report. On the selection screen I have 2 radio buttons ..for eg..A and B.
    When radio button A(its on by default) is on..certain fields not relevant to this should be grayed out. Similarly when radio button B is on, certain fields should be grayed out.
    I did the AT SELECTION SCREEN OUTPUT and also did the
    LOOP AT SCREEN....ENDLOOP logic. The logic works but when I click the radio button B...the screen fields automatically does not gray out. I have to press ENTER and then its grays out.
    I know a USER_COMMAND needs to be attached.
    Can anyone give me a step by step details of how to do this. I truly appreciate it. if a screen painter thing is required..please give me the tcode and step by step detail to do this.
    Thanks

    Try this one too:
    REPORT ztest.
    TABLES: mara,
            bkpf.
    CONSTANTS:
                  c_pos(3) TYPE c VALUE 'POS',
                  c_acc(3) TYPE c VALUE 'ACC',
                  c_all(3) TYPE c VALUE 'ALL',
                  c_x TYPE c VALUE 'X'.
    The Selection Screen Definition
    SELECTION-SCREEN BEGIN OF BLOCK b_0 WITH FRAME TITLE text-000.
    SELECT-OPTIONS: s_mara FOR mara-matnr.
    SELECTION-SCREEN END OF BLOCK b_0.
    SELECTION-SCREEN BEGIN OF BLOCK b_1 WITH FRAME TITLE text-037.
    PARAMETER: rb_all RADIOBUTTON GROUP rb1 USER-COMMAND rad default 'X',
               rb_acc RADIOBUTTON GROUP rb1.
    SELECTION-SCREEN END OF BLOCK b_1.
    SELECTION-SCREEN BEGIN OF BLOCK b_2 WITH FRAME TITLE text-011. "Acct
    SELECT-OPTIONS:   s_blrtc1 FOR bkpf-blart MODIF ID acc,
                      s_blrti1 FOR bkpf-blart MODIF ID acc.
    SELECTION-SCREEN END OF BLOCK b_2.
    SELECTION-SCREEN BEGIN OF BLOCK b_3 WITH FRAME TITLE text-011. "Acct
    SELECT-OPTIONS:   s_blrtc2 FOR bkpf-blart MODIF ID all,
                      s_blrti2 FOR bkpf-blart MODIF ID all,
                      s_blrtv2 FOR bkpf-blart MODIF ID all.
    SELECTION-SCREEN END OF BLOCK b_3.
    AT SELECTION-SCREEN OUTPUT
    AT SELECTION-SCREEN OUTPUT.
      PERFORM f0200_screenfield_hide_logic.
    initialization.
      PERFORM f0200_screenfield_hide_logic.
          FORM f0200_screenfield_hide_logic                             *
    FORM f0200_screenfield_hide_logic.
      LOOP AT SCREEN.
        IF rb_acc = c_x.
          IF screen-group1 = c_all.
            screen-active = 0.
          ELSE.
            screen-active = 1.
          ENDIF.
        ENDIF.
        MODIFY SCREEN.
        IF rb_all = c_x.
          IF screen-group1 = c_acc.
            screen-active = 0.
          ELSE.
            screen-active = 1.
          ENDIF.
        ENDIF.
        MODIFY SCREEN.
      ENDLOOP.
    ENDFORM.                    " F0200_SCREENFIELD_HIDE_LOGIC

  • Displaying Plant as F4 option in the selection screen according to the User Authorization

    Hi all,
    In the selection screen, I need to display the list of plants as F4 search help that the user has authorization.
    How I need to check from the table.
    Please provide me the exact table name where I can get the list of plants that the user has authorization.
    Thanks in Advance.
    Regards,
    karthik

    Hi Madan,
    Thanks for your reply.
    As of now Plant entered in selection screen is validated for authorization like below.
    authority-check object 'M_MATE_WRK'
          id 'ACTVT' field '02'
          id 'WERKS' field p_werks.
       if sy-subrc <> 0.
         message text-010 type c_e.
         exit.
       endif.
    But they are in need of Plants in F4.
    Regards,
    Karthik

  • How to Fill the selection screen while calling the transaction

    Hi All,
             my requirement is in one of the screen while i will press a push button it will call one transaction and it will fill the selection screen build order number field and skip the first screen i.e the selection screen it will show the output of that report directly.
    am using this code .
    case sy-ucomm.
    while 'FSLR'.
    set PARAMETER ID 'ANR' FIELD aufnr.
    RANGES s_aufnr FOR afko-aufnr.
          s_aufnr-sign   = 'I'.
          s_aufnr-option = 'EQ'.
          s_aufnr-low    = aufnr.
          APPEND s_aufnr.
    CALL TRANSACTION 'ZFS1' USING s_aufnr
         MODE 'E' .
        AND SKIP FIRST SCREEN.
    endcase.
    here the problem is i cant use both skip screen and using at a time nither the screen is filling nor its skipping the first screen.
    but its not working would any one please help how can i do this functionality?

    Hi
    Do in this way.
    DATA: rspar TYPE TABLE OF rsparams WITH HEADER LINE.
    rspar-selname = 'S_AUFNR'.
    rspar-kind = 'S'.
    rspar-sign = 'I'.
    rspar-option = 'EQ'.
    rspar-low = 'aufnr'.
    APPEND rspar.
    SUBMIT zfs1_prog  VIA SELECTION-SCREEN WITH SELECTION-TABLE rspar AND RETURN.
    If this doesnt suit yer requirement, I wud suggest you to use BDC as below.
    CALL TRANSACTION 'SE11' USING bdcdata
                           MODE   'E'
                           UPDATE 'A'.

  • The selection screen cannot choose the multiple values at first instance?

    Hi All,
       I have 2 select-options on the selection screen as follows>>
    SELECT-OPTIONS :
                       s_subusr FOR pa0105-usrid NO INTERVALS OBLIGATORY,   
                      s_period FOR vbak-erdat   NO-EXTENSION OBLIGATORY.   
    When I try to enter multiple values by clicking the multiple option button when noting is entered as input on the selection screen.I get a error"Make entry in all required fields".
    But when I enter a value on the selection screen input for s_subusr and then enter value in s_period and then click on multiple option button I am able to see the multi-option Popup.Now I can enter multiple Values.
    Please can anyone help me to enter the values on the multiple option Pop-up whenever the user want?
    Regards,
    Shashank.

    HI
    OBLIGATORY means you have to enter the values , with out filling that values and if you click any thing it will show an error message saying that fill alla required fields
    so if you want you can remove that
    or if you want to keep that OBLIGATORY then fill some values 1st in that select-options and clcik on multiple entries button then it won't show any error
    <b>Reward if usefull</b>

  • Drop down box for the selection screen field of the classical report

    Hi all.
    i want to have the drop down list to choose from, for the region(table:zbwcntry-field:zregion1) on the selection screen.
    what is to be added to the code for this requirement.Also,please note that this is the classical report.
    thanks for this answered.

    hi,
    data  : gv_name  TYPE vrm_id,        " used for vrm id
               gv_repid TYPE sy-repid,      " used to hold program name
    work area to provide drop down list
    DATA :  gs_value TYPE vrm_value,
    Internal table to provide drop down list
    DATA :  gt_values TYPE vrm_values,
    PARAMETER : p_run(12) TYPE c AS LISTBOX VISIBLE LENGTH 12
                                     DEFAULT 'DEFAULT' OBLIGATORY,
    CONSTANTS : gc_run(5) TYPE c VALUE 'P_RUN',    "constant for run mode
    gv_name = gc_run.
      gs_value-key = gc_v1.
      gs_value-text = text-010.
      APPEND gs_value TO gt_values.
      gs_value-key = gc_v2.
      gs_value-text = text-011.
      APPEND gs_value TO gt_values.
      CALL FUNCTION 'VRM_SET_VALUES'
        EXPORTING
          id              = gv_name
          values          = gt_values
        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.
    Hope this is helpful.
    Rgds.,
    subash

  • Display alv grids in selection screen based on the user event

    Hi All,
    I am workign on displaying ALV in same selection screen.I am able to display the ALV in selection screen.
    But i have 2 buttons in my selection screen 'Create' and 'change'.
    When i click on create i need  with some type of data and when i click on 'change' my alv grid another type of data.Ex: if i click on crate mara data should be dispalyed when i click on change makt table data should be dispalyed and also i have user defined buttons are in my grids.
    So i have used 2 containers to dispaly to different data.I am able to display the perfectly but the problem is first time when i click on create the grid is displaying when i click on change button  the create alv grid is displaying down and change data is dispalying up.
    I need only one alv grid at a time.Can anybody please let me know how can i do this.
    Thanks,
    Taragini

    Hello,
    Also I would suggest if it is relevant data maintain in one interntal table and show/hide based on condition
    through fieldcatalog (NO_OUT) parameter.
    Thanks

  • How to populate the next screen based on the previous screen table control

    Hi Experts,
            Is this possible to generate the next screen values based on the table control values in previous screen.
    My Requirement is
    In my First screen i m having 5-7 regional offices in table control and also amount field for each regional offices.(amount field is editable)
    User has to enter amount field for Regional office..based on the amount field i need to process the next screen. For Ex if user is entering  amount for 3 regional offices out of 7 regional offices then i need to get the screen for the 3 regional offices..
    Pls suggest me how to do this..
    Regards,
    Zakir

    Hi Zakir,
    Do you have any button for calling the second screen after entering amount in the first table control screen or you have to call the screen on pressing enter on the table control?
    You will have to handle it in the PAI of the table control loop.Get data entered in the table control in your internal table of table control.You can prepare the data passed to the next screen from this internal table. Fill the second screen elements and Use CALL SCREEN XXX. XXX is your second screen no.
    Thanks,
    Pawan

  • How to add a field to the selection screen and when the user enters ...

    hi all,
    can any one plesase send the code of how to add a field to seletiion screen and when the user enters in the field , it should be store in the database table , the table is MKPF and the field is BKTXT.  Thanks.

    Hi Kripa,
       If u r using PNP ldb then the screen u will get is the screen for that ldb and if u want to add some more fields then u define using selection-screen..as follows
    SELECTION-SCREEN BEGIN OF BLOCK mysel WITH FRAME TITLE text-111.
    PARAMETERS: n_in_en  RADIOBUTTON GROUP g1,
                q_ev  RADIOBUTTON GROUP g1.
    SELECTION-SCREEN END OF BLOCK mysel.
    SELECTION-SCREEN BEGIN OF BLOCK mysel1 WITH FRAME TITLE text-222.
    PARAMETERS: r_date TYPE sy-datum DEFAULT sy-datum.
    SELECTION-SCREEN END OF BLOCK mysel1.
    SELECTION-SCREEN BEGIN OF BLOCK mysel2 WITH FRAME TITLE text-333.
    PARAMETERS:f_ver(3) TYPE c DEFAULT 1,
               c_no(10) TYPE c DEFAULT '9D0161',
               u_id(15) TYPE c,
               password(15) TYPE c,
               r_email(30) TYPE c DEFAULT PARAMETERS: s_not TYPE c AS CHECKBOX.
    PARAMETERS:t_run TYPE c  AS CHECKBOX.
    SELECTION-SCREEN END OF BLOCK mysel2.
    SELECTION-SCREEN BEGIN OF BLOCK mysel3 WITH FRAME TITLE text-444.
    SELECTION-SCREEN BEGIN OF BLOCK mysel4 WITH FRAME TITLE text-555.
    PARAMETERS: p_ser  RADIOBUTTON GROUP g2,
    a_ser  RADIOBUTTON GROUP g2.
    SELECTION-SCREEN END OF BLOCK mysel4.
    SELECTION-SCREEN BEGIN OF BLOCK mysel5 WITH FRAME TITLE text-666.
    PARAMETERS:p_path TYPE string.
    SELECTION-SCREEN END OF BLOCK mysel5.
    SELECTION-SCREEN END OF BLOCK mysel3.
    u will get this additional screen after the screen of ldb.
    I hope this will help u..
    Thanks & Regards
    Ashu Singh.

  • How to get the selected value/key of a drop down list box in webdynpro Java

    Dear SDN Members,
    I have added some static data into a drop down list box by key UI element using the procedure specified in value help tutorial.
    Now i want to display the value selected in a dropdown list box on view whenever i select an item in a dropdown list box.
    Can any one put here the code part relating to this.
    Your help will be awarded.
    Thanks in advance,
    Regards,
    Sireesha.B

    Hi Sireesha,
        You want to display value based on the key selected in dropdown list. If you want to do like that
    1) Create a context attribute for ex: key_value
    2)In the properties of the attribute select the calculated as true.
    3)It will create getter and setter methods for your attribute.
    4)Go to implementation add the following code in getter method of your attribute
    String attributeName = IPrivateCreate.IContextElement.KEY;
    //KEY is your dropdown key attribute not the value attribute.
    IWDAttributeInfo attributeInfo = element.node().getNodeInfo().getAttribute(attributeName);
    ISimpleTypeModifiable simpleType = attributeInfo.getModifiableSimpleType();
    IModifiableSimpleValueSet valueset = simpleType.getSVServices().getModifiableSimpleValueSet();
    Object key = element.getAttributeAsText(attributeName);
    return valueset.getText(key);
    Regards
    Suresh

  • How do i get the data present in the selected row at run time in Multicolumn list box?

    Hi,
    I am using multicolumn list box with three columns and i am having OK button.
    If the user selects particular row and then press ok then that row datas(that 3 values) has to get update in the file.
    Can u tell me how to get that selected row values alone and also how to append the list box value at run time?
    Thanks
    Meenatchi

    You can simply use the Value property of the MLBox to get the row selected & wire it to the Delete from array function with the Itemnames of the MLBox as the Input & Output of the Delate from array function.
    See the attached VI.
    - Partha
    LabVIEW - Wires that catch bugs!
    Attachments:
    Dbl-click Row to get Data & Delete.vi ‏41 KB

  • F4 Help for the selection screen field

    Hi Gurus,
    I have to display F4 help for a selection screen field. i am using following code:
        CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
             EXPORTING
                  retfield        = 'CODE'
                  dynpprog        = lw_repid
                  dynpnr          = sy-dynnr
                  VALUE_ORG       = 'S'
             TABLES
                  value_tab       = gi_text
                 field_tab       = li_fields_tab
                  return_tab      = pi_return_tab
             EXCEPTIONS
                  parameter_error = 1
                  no_values_found = 2
                  OTHERS          = 3.
    My internal table gi_emp has two fields CODE & TEXT. When i select 1 particular value, it returns the CODE value in the pi_return_tab table.
    But my requirement is i have to capture the corresponding TEXT value for the Returned CODE. Ex: following is the F4 help being displayed: -
    001    test
    001    test1
    but is i select code 001(First Value), i also need to capture it's corresponding Text value. In return table pi_return_tab i have only Code value.
    Please help me out.
    Note: Based on return code i can't search into the internal table gi_code, because as shown in the example, code has multiple text.

    Sachin,
    I think this is what you need. The following code will return the key and the text (OR any other columns), if both columns are in the selection screen the selected values (both columns) will also be passed to the corresponding parameters. If you only need the text to be in the return table and not passed to the selection screen then set the parameter for text with NO-DISPLAY option.
    REPORT zktest01 .
    DATA :
      BEGIN OF value_tab OCCURS 0,
        field  LIKE e070-trkorr,
        text   LIKE e07t-as4text,
      END OF value_tab.
    DATA: t_fldtab LIKE dfies OCCURS 0 WITH HEADER LINE,
          t_rettab LIKE ddshretval OCCURS 0 WITH HEADER LINE,
          t_dynmap LIKE dselc OCCURS 0 WITH HEADER LINE.
    PARAMETERS : p_field  LIKE value_tab-field,
                 p_text   LIKE value_tab-text. "NO-DISPLAY.
    INITIALIZATION.
      t_fldtab-tabname   = 'VALUE_TAB'.
      t_fldtab-fieldname = 'FIELD'.
      t_fldtab-langu     = 'E'.
      t_fldtab-position  = 1.
      t_fldtab-offset    = 0.
      t_fldtab-fieldtext = 'Key'.
      t_fldtab-reptext   = 'Key'.
      t_fldtab-leng      = 20.
      t_fldtab-intlen    = 20.
      t_fldtab-outputlen = 20.
      t_fldtab-datatype  = 'CHAR'.
      t_fldtab-inttype   = 'C'.
      t_fldtab-headlen   = 20.
      t_fldtab-keyflag   = 'X'.
      t_fldtab-lowercase = ' '.
      APPEND t_fldtab.
      t_fldtab-tabname   = 'VALUE_TAB'.
      t_fldtab-fieldname = 'TEXT'.
      t_fldtab-position  = 2.
      t_fldtab-offset    = 20.
      t_fldtab-fieldtext = 'Text'.
      t_fldtab-reptext   = 'Text'.
      t_fldtab-leng      = 60.
      t_fldtab-intlen    = 60.
      t_fldtab-outputlen = 60.
      t_fldtab-headlen   = 60.
      t_fldtab-keyflag   = ' '.
      t_fldtab-lowercase = ' '.
      APPEND t_fldtab.
      value_tab-field = '101'.
      value_tab-text = 'dddd'.
      APPEND value_tab.
      value_tab-field = '202'.
      value_tab-text = 'aaaa'.
      APPEND value_tab.
      t_dynmap-fldname = 'FIELD'.
      t_dynmap-dyfldname = 'P_FIELD'.
      APPEND t_dynmap.
      t_dynmap-fldname = 'TEXT'.
      t_dynmap-dyfldname = 'P_TEXT'.
      APPEND t_dynmap.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_field.
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
           EXPORTING
                retfield        = 'FIELD'
                dynpprog        = 'ZKTEST01'
                dynpnr          = '1000'
                dynprofield     = 'P_FIELD'
                value_org       = 'S'
           TABLES
                field_tab       = t_fldtab
                value_tab       = value_tab
                return_tab      = t_rettab
                dynpfld_mapping = t_dynmap
           EXCEPTIONS
                parameter_error = 1
                no_values_found = 2
                OTHERS          = 3.
      IF sy-subrc EQ 0.
      ENDIF.
    START-OF-SELECTION.
    Jeffrey Satriadi

  • Checking the Selection Screen Parameters

    Dear All,
    We are uploading data from various excel sheets into SAP tables. Now at selection screen I just want to check if the location specified exists or not ie. if I have created one variant on one system & then if I am running that report from other system using the variants, since the files does not exists it should throw the error and should return to the selection screen to enter the new parameters.
    Please help me in the code, I am attaching my code herewith.
    Waiting for ur responses,
    Nishu
    *********************CODE***************************
    tables: bseg, zfi_tbl_qty, t001, tgsb.
    data:
            t_excel like alsmex_tabline occurs 0 with header line,
            l_excelfile(128)  type c,
            l_excelfile1(128) type c,
            l_excelfile2(128) type c,
            l_excelfile3(128) type c.
    data: begin of t_bukrs_tmp occurs 0,
             bukrs like t001-bukrs,
          end of t_bukrs_tmp.
    data: begin of t_gsber_tmp occurs 0,
             gsber like tgsb-gsber,
          end of t_gsber_tmp.
    ranges: r_bukrs_tmp for t001-bukrs,
            r_gsber_tmp for tgsb-gsber.
    data: begin of t_type,
           bukrs like bseg-bukrs,
           gsber like bseg-gsber,
           count type i,
         end of t_type.
    data: l_charlen1 type i,
          l_charlen2 type i.
    data:  t_type2 like t_type occurs 0 with header line,
           t_type2_tmp like t_type occurs 0 with header line.
    data:  l_end_row type i,
           l_endrow1 type i,
           l_count type i,
           v_bukrs like bseg-bukrs.
    data : q_count type i value 1,
           v_flag  type i value 0,
           v_gsber like t_type2-gsber.
    data: l_var type c.
    selection-screen begin of block b1 with frame title text-001.
    parameter :  p_file1  type rlgrap-filename obligatory,
                 p_file2  type rlgrap-filename obligatory,
                 p_file3  type rlgrap-filename obligatory,
                 p_file4  type rlgrap-filename obligatory.
    selection-screen end of block b1.
    *perform updation_tbl.
    *clearing the contents of database table before uploading a new file everytime
    delete from zfi_tbl_qty.
    *selection-screen
    at selection-screen on value-request for p_file1.
      call function 'KD_GET_FILENAME_ON_F4'
        exporting
          field_name = p_file1
        changing
          file_name  = p_file1.
    at selection-screen on value-request for p_file2.
      call function 'KD_GET_FILENAME_ON_F4'
        exporting
          field_name = p_file2
        changing
          file_name  = p_file2.
    at selection-screen on value-request for p_file3.
      call function 'KD_GET_FILENAME_ON_F4'
        exporting
          field_name = p_file3
        changing
          file_name  = p_file3.
    at selection-screen on value-request for p_file4.
      call function 'KD_GET_FILENAME_ON_F4'
        exporting
          field_name = p_file4
        changing
          file_name  = p_file4.
    at selection-screen.
      l_excelfile  = p_file1.
      l_excelfile1 = p_file2.
      l_excelfile2 = p_file3.
      l_excelfile3 = p_file4.
    if l_excelfile = l_excelfile1 or l_excelfile = l_excelfile2 or l_excelfile = l_excelfile3
        or l_excelfile1 = l_excelfile2 or l_excelfile1 = l_excelfile3 or l_excelfile2 = l_excelfile3.
            message e010(zn) with 'Files with the same name found Please enter again. '.
    endif.
    start-of-selection.
        select bukrs
               from t001
               into corresponding fields of table t_bukrs_tmp.
        loop at t_bukrs_tmp.
           r_bukrs_tmp-sign = 'I'.
           r_bukrs_tmp-option = 'EQ'.
           r_bukrs_tmp-low = t_bukrs_tmp-bukrs.
           append r_bukrs_tmp.
        endloop.
        select gsber
               from tgsb
               into corresponding fields of table t_gsber_tmp.
        loop at t_gsber_tmp.
           r_gsber_tmp-sign = 'I'.
           r_gsber_tmp-option = 'EQ'.
           r_gsber_tmp-low = t_gsber_tmp-gsber.
           append r_gsber_tmp.
        endloop.
      perform upload_table using l_excelfile   5 2 6 4000.
      perform upload_table using l_excelfile1  5 2 6 4000.
      perform upload_table using l_excelfile2  5 2 6 4000.
      perform upload_table using l_excelfile3  5 2 6 4000.
    if sy-subrc = 0.
      message i010(zn) with 'Files Uploaded Successfully.'.
    if sy-subrc <> 0.
    message e398(00) with 'Files Not Found'.
      leave to screen 0.
    endif.
    ************Calling the other program
    SUBMIT ZFI_REP_IS_CHARGES_POST1.
    *and return.
    *******************Calling the subroutine.
    form upload_table using filename
                           i_begin_col type i
                           i_begin_row type i
                           i_end_col type i
                           i_end_row type i.
      clear   : t_excel.
      refresh : t_excel.
      v_flag = v_flag + 1.
      call function 'ALSM_EXCEL_TO_INTERNAL_TABLE'
        exporting
          filename                = filename
          i_begin_col             = 5
          i_begin_row             = 2
          i_end_col               = 6
          i_end_row               = 4000
        tables
          intern                  = t_excel
        exceptions
          inconsistent_parameters = 1
          upload_ole              = 2
          others                  = 3.
      case v_flag.
        when '1'.
          perform fill_int_tab.
        when '2'.
          perform fill_int_tab.
        when '3'.
          perform fill_int_tab.
        when '4'.
          perform fill_int_tab.
      endcase.
    endform.                    "upload_table
    *uploading data from internal table into database table
    *&      Form  fill_int_tab
          text
    -->  p1        text
    <--  p2        text
    form fill_int_tab .
      clear   : t_type2, q_count.
      refresh : t_type2.
      describe table t_excel lines l_endrow1.
      l_endrow1 = l_endrow1 / 2.
      do.
        loop at t_excel where row = q_count.
          if t_excel-col = 1.
            t_type2-gsber = t_excel-value.
          elseif t_excel-col = 2.
            t_type2-bukrs = t_excel-value.
          endif.
        endloop.
        l_charlen1 = strlen( t_type2-bukrs ).
        l_charlen2 = strlen( t_type2-gsber ).
        if ( t_type2-bukrs <> ' ' and t_type2-gsber <> ' ' ).
          if ( l_charlen1 = 4 and l_charlen2 = 4 ).
            append t_type2. clear t_type2.
          endif.
        endif.
        q_count = q_count + 1.
        if q_count > l_endrow1.
          exit.
        endif.
      enddo.
    t_type2_tmp[] = t_type2[].
    clear t_type2.
    refresh t_type2.
    loop at t_type2_tmp where bukrs in r_bukrs_tmp
                      and gsber in r_gsber_tmp.
      move-corresponding t_type2_tmp to t_type2.
      append t_type2.
    endloop.
      sort t_type2 by bukrs gsber.
      loop at t_type2.
        clear v_gsber.
        l_count = l_count + 1 .
        v_gsber = t_type2-gsber.
        at end of gsber.
         at end of bukrs.
            zfi_tbl_qty-company_code = t_type2-bukrs.
            zfi_tbl_qty-barea = v_gsber.
            zfi_tbl_qty-comb = l_count.
            if v_flag = 1.
              zfi_tbl_qty-type = 'A'.    " Item 1
            endif.
            if v_flag = 2.
              zfi_tbl_qty-type = 'B'.    " Item 2
            endif.
            if v_flag = 3.
              zfi_tbl_qty-type = 'C'.    " Item 3
            endif.
            if v_flag = 4.
              zfi_tbl_qty-type = 'D'.    " Item 4
            endif.
         insert  zfi_tbl_qty from zfi_tbl_qty.
          clear l_count.
        endat.
         endat.
      endloop.
    endform.                    " fill_int_tab

    Hi,
    After calling this FM:
    call function 'ALSM_EXCEL_TO_INTERNAL_TABLE'
    exporting
    filename = filename
    i_begin_col = 5
    i_begin_row = 2
    i_end_col = 6
    i_end_row = 4000
    tables
    intern = t_excel
    exceptions
    inconsistent_parameters = 1
    upload_ole = 2
    others = 3.
    *-> try following code:
    if sy-subrc = '2'.
    message 'File not Found' type 'I'.
          leave list-processing.
    endif.
    Regards,
    Kalyan

  • 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

  • How to get the F4 help for a field in the selection screen

    Hi all,
    I am working on a report program. In the selection screen, I have the field 'Brand Node ID'(ZNODEID). The requirement is to have the F4 help for this field. This field is available in a 'Z' table ZNODETAB. There is no Value table maintained for the corresponding data element. So, without disturbing the table data element/domain, I should get the F4 help in the selection screen of the report. In the F4 help, data should be fetched from the table ZNODETAB and the field is ZNODEID. Is there any way to do this.
    By searching the function modules, I could find that, we can use the FM F4IF_INT_TABLE_VALUE_REQUEST. But, I am not Sure. Can someone tell me the parameters to be passed to this function module to get the F4 help and the procedure to follow. S_NODEID is the select option used in the program. Please help me in this regard. Thanks in advance.
    Thanks & Regards,
    Paddu.

    look at this code and try
    select-options : S_NODEID for ZNODETAB-ZNODEID.
    at selection-screen on value-request for s_nodeid-low
    perform f4_nodeid using 'S_NODEID-LOW'.
    at selection-screen on value-request for s_nodeid-low
    perform f4_nodeid using 'S_NODEID-HIGH'.
    end-of-selection.
    FORM f4_nodeid  USING    p_field.
      declare it_node.
    select znodeid from ZNODETAB into table it_node.
      CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
        EXPORTING
          retfield        = 'ZNODEID'
          dynpprog        = sy-repid
          dynpnr          = sy-dynnr
          dynprofield     = p_field
          value           = space
          value_org       = 'S'
          display         = 'F'
        TABLES
          value_tab       = it_node
        EXCEPTIONS
          parameter_error = 1
          no_values_found = 2
          OTHERS          = 3.
    endform

Maybe you are looking for

  • Error while saving reports in Active Studio.

    Hi, I have installed BAM software and I am creating Reports for External Database objects. I am able to create plan which is running fine. But when I create any Report and try to save it, I am getting the following error.. Exception Message: Length c

  • Selecting from a column based on the id

    Hello All, Is there a way to update a table based on the column id? Example: I have a table where column 2 is an accumulated dollar amount. Each row of the column is a lease. I need to update column 3 with $$ that i get from my cursor say x. Then col

  • Which iPad 4 should I buy if I live outside the US and I want wifi   Celullar

    I want to buy the new ipad from apple.com, i live outside the US, which carrier should i select to work celullar outside the us? or do i need to buy one factory unlocked? thx...

  • Need JavaScript help please!

    Hey guys im just learning javascript and im having a small amount of trouble. its just one problem. in a javascript script i need to use prompt to get a line of text from the user and it the output of the program needs to be the words of the inputed

  • Create Print Output on Delivery Document

    Hi everyone!! Could you explain to me the configuration process for having a new output type to be trigered on a delivery document. I want to name my output ZBXX. Using a program to print called ZVXXPRNCFD and a smartform called ZVME_PRNCFD. My outpu