Lock selective fields in Table

I have a table with 8 columns and 20 rows and I want to be able to lock out specific fields with content "na" to prevent user from editing those fields.
Is it doable in LV8.6?

Question 1) are you using a "Table control" for the display purpose?
2) is all the "NA" appears on one column?
If the answer to Question 1 is yes, then i am afraid you can not just simply disable a praticular cell in the table. (atleast i didnt see any built in property as such). But it could be done by some algorithm based current selected cell and may be switching the postion to the next cell when the "NA" cell is selected.
If the answer to the question 2 is yes, then simply put that column data in to a list box or something else (next to your table).
Regards
Guru (CLA)

Similar Messages

  • How to know no of selected fields in Table Control in at the first iteratio

    Hi ABAP Gurus,
    I have developed screen with Table control. At one particular scenario, I need to
    display an error message if all the displayed records are not selected. So I need to know the No of selected fields on the Table control in the very first iteration of the Loop in PAI event. Is there any Function Module/Method or any other way to Achieve this. 
    Thanks in Advance..
    Regards,
    Vishwanath

    You can simply count them, but looping the table and checking the "select" flag.
    data: records type i.
    data: counter type i.
    clear counter.
    Loop at itab where sel = 'X'.
    counter = counter + 1.
    endloop.
    describe table itab lines records.
    if records <> counter.
    message e001(00) with 'Not all records were selected'.
    endif.
    Regards,
    Rich Heilman

  • Select fields from Table PA0001 where condition in PA0000 EQ X.

    I'm quite new here at SDN an to ABAP as my code below will show.  =)
    I have two tables PA0001 and PA0000 and I want to show the PERNR from Table PA0001 WHERE PA0000-stat2 EQ '3'.
    SELECT PERNR STAT2 FROM pa0000 INTO CORRESPONDING FIELDS OF TABLE it_act WHERE stat2 EQ '3'.    "this works fine
    SELECT * FROM pa0001 INTO TABLE it_pos.
    LOOP AT it_pos INTO wa_pos WHERE It_pos-pernr EQ it_act-pernr.                
    WRITE......
    ENDLOOP.
    Isn't it possible to put the conditions in the LOOP statement? Should i somehow do i join in the select instead?
    If you dont understand what I mean just ask and I will try to explain.
    Best Regards Claes.

    Hi Claes Widestadh ,
    I have total Code for you, to solve your Problem, I have written the code for you & tested it, and it was Working Very Fine.
    Please find the Below Code.
    TABLES : PA0000, PA0001.
    DATA : IT_PA0000 LIKE PA0000 OCCURS 0 WITH HEADER LINE,
           IT_PA0001 LIKE PA0001 OCCURS 0 WITH HEADER LINE.
    DATA : BEGIN OF IT_FINAL OCCURS 0,
           PERNR LIKE PA0001-PERNR,
           END OF IT_FINAL.
    SELECT PERNR STAT2 INTO CORRESPONDING FIELDS OF TABLE IT_PA0000 FROM
    PA0000 WHERE STAT2 = '3'.
    SELECT * FROM PA0001 INTO TABLE IT_PA0001.
    SORT IT_PA0001.
    LOOP AT IT_PA0000.
      READ TABLE IT_PA0001 WITH KEY PERNR = IT_PA0000-PERNR.
      IF SY-SUBRC = 0.
        IT_FINAL-PERNR = IT_PA0001-PERNR.
        APPEND IT_FINAL.
        CLEAR IT_FINAL.
      ENDIF.
    ENDLOOP.
    LOOP AT IT_FINAL.
      WRITE :/ IT_FINAL.
    ENDLOOP.
    Note: If you find this Answer is very Helpful Please allot me the Points.
    Please do let me know any isssues at your end.
    Thanks,
    Satya Krishna.M

  • Locking Selected Fields on Submit

    Hello,
    I've been working on a multiple-item quote request form. My intention is that Party A (Requestor) will fill in the item description and details necessary for Party B (Vendor) to provide a quote. The form will be emailed to the Vendor who will complete the remaining fields (price and delivery) and email the form back to the Requestor.
    The item description and details (provided by Requestor) and the item price and delivery (provided by Vendor) are both wrapped in thier own subform and both are contained in a repeating subform. I've scripted the buttons that add/delete instances of the subform for each separate item being quoted and the button that emails the form to the Vendor. It took me a long time, but I finally got the buttons to work!
    Now I'd like to find a way to 'lock' the fields filled by the Requestor when the form is emailed but still leave the fields open that need to be completed by Vendor. I'd also like to lock the contact information fields at the top at the same time. I've attached a JPEG with the form layout to clarify...
    I've been reading a lot of old posts regarding similar topics and tried some of the solutions provided but cannot seem to make them work for my application. The closest I've been able to come is locking the entire form. I have the form set to email on event=click of the "Submit to Vendor via Email" button and the locking action on the event=mouseup of the same button.
    Does anyone know how I should approach this? I'm begining to think I designed my form and myself into a corner! Unfortunately I do not have a server on which to host the form but would be happy to email it to anyone willing to help.
    Thanks,
    Jake

    I dont know what I was thinking.  After some rest, and a second look, I can see this what the code is doing.
    I am trying to provide a button that will lock elements on individual pages that are part of multiple instances. Note, each instance will contain said button.
    Example: TRANSMITTAL[3].lockButton should only lock items on that instance of  TRANSMITTAL[3].
    The two attempts had different results
    form1.TRANSMITTAL.lockButton::click - (JavaScript, client)
    var j = _TRANSMITTAL.count;
    for (var i=0; i<j; i++){
         var currentSubform = xfa.resolveNode("TRANSMITTAL[" + i + "]");
         varLOCK.LockAllFields(currentSubform, "Lock");
    ..resulted in Locking ALL instances.
    form1.TRANSMITTAL.lockButton::click - (JavaScript, client)
    varLOCK.LockAllFields(form1.TRANSMITTAL);
    ..resulted in nothing.
    Any suggestions?

  • Cannot select the fields for table view WB2_V_MKPF_MSEG2

    Hi, I have a program where the query is using join statement of MSEG and MKPF.  As part of the performance enhancement I use Table View WB2_V_MKPF_MSEG2 instead.
    Validation: Entries in MSEG and MKPF is the same as in  WB2_V_MKPF_MSEG2 = OK (via SE16)
    But upon debugging the program on SY-SUBRC breakpoint, I can see 5 rows appended in internal table T_MSEG "BUT" the entries are all blank.
    The entries in my SE16 are exact data that's appearing on the filter statement in my SQL query below.  SE16 is giving correct output, but using table view in my SQL does not give me the correct output.
    (Note: This is my first time to use table view in ABAP-SQL)
      SELECT MATNR_I BWART_I MENGE_I
        FROM  WB2_V_MKPF_MSEG2
          INTO CORRESPONDING FIELDS OF TABLE T_MSEG
      WHERE MATNR_I IN R_MATNR3
          AND  MATNR_I IN R_COMPNTS
          AND  WERKS_I EQ P_WERKS
          AND  BWART_I EQ '931'
         AND  BUDAT    IN S_GSTRP 
         AND  MJAHR    EQ W_DOC_YEAR.
    IF SY-SUBRC EQ 0.
    ENDIF.
    THANKS, appreciate your inputs.
    Regards,
    Jun

    Hi Suhas,
    I just did a short test just now:
    REPORT  ZTEST_SELVIEW.
    TABLES: WB2_V_MKPF_MSEG2.
    TYPES: BEGIN OF Y_MSEG,
             MATNR LIKE MSEG-MATNR,
             BWART LIKE MSEG-BWART,
             MENGE LIKE MSEG-MENGE,
           END   OF Y_MSEG.
    DATA: T_MSEG TYPE STANDARD TABLE OF Y_MSEG.
    SELECT MATNR_I
           BWART_I
           MENGE_I
      FROM WB2_V_MKPF_MSEG2
      INTO CORRESPONDING FIELDS OF TABLE T_MSEG
    WHERE MATNR_I EQ '000000000000004000'
       AND WERKS_I EQ '0288'
       AND BWART_I EQ '931'
    *   AND BUDAT   EQ '20071117'
       AND MJAHR   EQ '2007'.
    IF SY-SUBRC EQ 0.
    ENDIF.
    In my debug, T_MSEG contains the same number of rows that my SE16>WB2_V_MKPF_MSEG2(using the hard coded statement in my SQL) "BUT" each rows does not have any entries.  Bottomline, I can't only see blank entries in ITAB T_MSEG but the rows are being selected properly, so the itab contains x-number of rows with blank entries.
    Thanks.

  • How to do a select from a table whose name is saved in a field?

    Hello,
    This is an abap report.
    I need to do a select from a table whose name is saved in a field of Z* table.
    Like this..
    SELECT * FROM znodos.
       SELECT * FROM znodos-tabla.   "znodos-tabla contain the Z* table name
           move zodos-tabla-txtmd to.....
       endselect.
    endselect.
    Is this possible??
    Thanks

    Hi Ilie Aleman 
    Give variable name in ().. Variable name refers to variable which contains table name
    SELECT * FROM (znodos-tabla).
    Regards,
    Mohaiyuddin
    Edited by: Mohaiyuddin Soniwala on Jan 22, 2008 5:18 PM

  • Select from three tables (one field)

    Dear Friends
    I have start-of-selection.
      select * from qals into corresponding fields of table itab where enstehdat in s_tarih.
      loop at itab.
          select matnr ntgew  from mara into (mara-matnr, mara-ntgew) where matnr eq itab-matnr.
          select matnr zfirmaadi ztezgah1 from zomt_malz into (zomt_malz-matnr, zomt_malz-zfirmaadi, zomt_malz-ztezgah1)
           where matnr eq itab-matnr.
            move-corresponding itab to itab2.
            itab2-zfirmaadi = zomt_malz-zfirmaadi.
            itab2-matnr = zomt_malz-matnr .
            itab2-ztezgah1 = zomt_malz-ztezgah1.
            itab2-ntgew = mara-ntgew.
            if sy-subrc = 0.
            append itab2.
            endif.
          endselect.
        endselect.
    endloop.
    end-of-selection.
    And I want to get unique matnr from this qals,zomt_malz, mara .
    Your helps will be very appreciated.

    hi,
    never use select statemnts inside loop.
    use FOR ALL ENTRIES.
    look this code.
    select * from qals
    into corresponding fields of table itab
    where enstehdat in s_tarih.
    select matnt ntgew
    from mara
    into table itab_mara
    for all entries in itab
    where
    matnr = itab-matnr.
    select matnr zfirmaadi ztezgah1
    from zomt_malz into table itab_ ztezgah1
    for all entries in itab
    where
    matnr = itab-matnr.
    loop at itab.
    move-corresponding itab to itab2.
    read table itab_mara with key matnr = itab-matnr.
    if sy-subrc = 0.
    itab2-ntgew = mara-ntgew.
    endif.
    read table  itab_ ztezgah1 with key matnr = itab-matnr.
    if sy-subrc = 0.
    itab2-zfirmaadi = zomt_malz-zfirmaadi.
    itab2-matnr = zomt_malz-matnr .
    itab2-ztezgah1 = zomt_malz-ztezgah1.
    endif.
    append itab2.
    clear itab2.
    endloop.
    regrds
    anver
    if helped mark points

  • To fetch selective fields from DATABASETABLE into Internal TABLE

    Hi Friends,
    I have declared an internal table with fields for e.g. A , B , C , D.
    This does not have any records as of now.
    I have to fetch data from a DATABASE TABLE with fields A , B , X , Y , Z having records .
    I only need records for fields A B fron DB table.Can any one pls tell how can I do that with performance issues in mind as lots of records are there.
    I had written a query where:
    SELECT A B from dbtab
                        into CORRESPONDING FIELDS of table it_table.
    It_table i had defined with only two fields A B.
    Is this correct?
    Please tell wats the way to do it as I am new to ABAP.
    THANKS in ADVANCE..

    Hi.....
    What mentioned in all above answers is very helpful for ur requirement...
    and...
       Here some Steps to increase the performence of your programs...
    >Use Select Single when only one row is expected
    >Use Select Where rather than Selectu2026Check
    >Use Select with aggregate functions (SUM, MAX, MINu2026)
    >Use a View instead of nested Selects
    >Use Select column specific instead of select * for few fields
    >Use Selectu2026Into Table rather than Select...Move Corru2026Apend
    >Use Join extension with Select if possible
    >Use special operators (CO, CA, CS) rather than code your own
    >Use Delete Adjacent Duplicates rather than manual processing
    >Specify key fields for Readu2026Binary Search
    >Use Loop At Where rather than Loop Atu2026Check
    >Copy Internal Tables with TAB_DEST() = TAB_SRC()
    >Specify the sort key as restrictively as possible
    >Use Append To, Insert Into, Collect Into rather than Move
    >Compare tables with If Tab1() = Tab2()u2026
    >Use Delete ITAB Whereu2026 instead of Loop At ITAB Whereu2026Delete..
    >Use Case statements instead of If-constructions
    >Use Call Functions wisely, Performs use less memory
    >Use While instead of Do Exit
    >Use Type I for Indices
    >Keep Occurs clause realistic or use 0
    >Use COMMIT WORK as appropriate to free the Data Base and preserve work
    >
    >Avoid:
    >Using Shift inside a While-loop
    >Leaving unneeded declarations in your program
    >Using Move-corresponding for just a few fields
    >Excessive nested includes within function calls
    >Using DB field names if the value will be changed
    >Using Occurs clause if only the header is needed
    Thanks,
    Naveen.I

  • Export all data of selected line in search help to fields in table control

    I've created a search help which will export 4 fields. These 4 fields should be populated to the corresponding fields in TABLE CONTROL. However, in my program, only the first column is populated and the others are blank. How to solve this problem? Do I need to include POV? Thank you.

    Hi,
    1. Create a search help with four exporting parameters.
        ( check the you have created properly the sterp step
         procedure in creating the search help).
    2. No need to go for POV.
    3. After creating the table control assign the fieldnames into   
       the control, then click on the fieldname it will show the  
       attributes of that field . ther you can find te search help field
       fill that field with your search help name .
    4.After assigning the field, check it in executing the report.
          Hope this will work for you, if it is not let me know.
          Reward points if it is  helpful .
    Regards,
    Madhavi

  • Lock and Unlock a table:AFVU

    Hi Folks.
    I want to modify a standard table (AFVU )  with new user dates from User.For this,First I need to lock and unlock the table.
    When I am trying for the standard table lock object (EAFVU) ,it was not there in the system.
    Is there any way to find out the lock object for a particular table?
    How to proceed for this?
    Any Pointers are much helpful.

    Hi,
    Go to SE11 and display your table - do a where used list and select lock objects.
    I really hope when you say you are modifying a standard table you are only updating custom appends on that table, and not directly updating standard SAP fields...
    Gareth.

  • Passing a structure of selected fields

    hi folks
    hope all will be fine
    just see the code typed below it is a module pool program
    and thing is here instead of passing the table lfa1 into custom container , i need to pass a internal table that contains specific fields .
    what i need to do
    any pointers regarding this are welcome
    *& Module pool       ZCONTAINER
    PROGRAM  zcontainer.
    *&      Module  USER_COMMAND_0100  INPUT
          text
    MODULE user_command_0100 INPUT.
    ENDMODULE.                 " USER_COMMAND_0100  INPUT
    *&      Module  STATUS_0100  OUTPUT
          text
    MODULE status_0100 OUTPUT.
    data: itab type table of lfa1.
      DATA: identity TYPE REF TO cl_gui_custom_container.
      DATA: grid TYPE REF TO cl_gui_alv_grid.
      select * from lfa1 into table itab.
      IF identity IS INITIAL.
        CREATE OBJECT identity
          EXPORTING
       parent                      =
            container_name              ='ALV'.
       style                       =
       lifetime                    = lifetime_default
       repid                       =
       dynnr                       =
       no_autodef_progid_dynnr     =
    EXCEPTIONS
       cntl_error                  = 1
       cntl_system_error           = 2
       create_error                = 3
       lifetime_error              = 4
       lifetime_dynpro_dynpro_link = 5
       others                      = 6
    *IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
               WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    *ENDIF.
        CREATE OBJECT grid
          EXPORTING
       i_shellstyle      = 0
       i_lifetime        =
            i_parent          =  identity.
       i_appl_events     = space
       i_parentdbg       =
       i_applogparent    =
       i_graphicsparent  =
       i_name            =
       i_fcat_complete   = space
    EXCEPTIONS
       error_cntl_create = 1
       error_cntl_init   = 2
       error_cntl_link   = 3
       error_dp_create   = 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.
        CALL METHOD grid->set_table_for_first_display
          EXPORTING
       i_buffer_active               =
       i_bypassing_buffer            =
       i_consistency_check           =
            i_structure_name              = 'LFA1'
       is_variant                    =
       i_save                        =
       i_default                     = 'X'
       is_layout                     =
       is_print                      =
       it_special_groups             =
       it_toolbar_excluding          =
       it_hyperlink                  =
       it_alv_graphics               =
       it_except_qinfo               =
       ir_salv_adapter               =
          CHANGING
            it_outtab                     = itab
       it_fieldcatalog               =
       it_sort                       =
       it_filter                     =
    EXCEPTIONS
       invalid_parameter_combination = 1
       program_error                 = 2
       too_many_lines                = 3
       others                        = 4
        IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
               WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
      ENDIF.
    SET PF-STATUS 'xxxxxxxx'.
    SET TITLEBAR 'xxx'.
    ENDMODULE.                 " STATUS_0100  OUTPUT
    thnx in advance
    with regards
    S.Janagar

    Hi,
    Go thru the following code once it may be help full for u.
    REPORT z_1060_oops_alv_grid.
    TYPES : BEGIN OF tw_ekko,
    mark TYPE flag,
    ebeln TYPE ebeln,
    bukrs TYPE bukrs,
    bstyp TYPE ebstyp,
    bsart TYPE esart,
    aedat TYPE erdat,
    END OF tw_ekko,
    tt_ekko TYPE TABLE OF tw_ekko.
    TYPES : BEGIN OF tw_ekpo,
    ebeln TYPE ebeln,
    ebelp TYPE ebelp,
    statu TYPE astat,
    aedat TYPE paedt,
    END OF tw_ekpo,
    tt_ekpo TYPE TABLE OF tw_ekpo.
    DATA: wa_ekko TYPE tw_ekko,
    it_ekko TYPE tt_ekko.
    DATA: wa_ekpo TYPE tw_ekpo,
    it_ekpo TYPE tt_ekpo.
    DATA: cl_container1 TYPE REF TO cl_gui_custom_container,
    cl_container2 TYPE REF TO cl_gui_custom_container,
    cl_container3 TYPE REF TO cl_gui_custom_container,
    cl_alv1 TYPE REF TO cl_gui_alv_grid,
    cl_alv2 TYPE REF TO cl_gui_alv_grid,
    cl_alv3 TYPE REF TO cl_gui_alv_grid.
    DATA : v_ebeln TYPE ebeln.
    DATA: i_fldcat TYPE lvc_t_fcat,
    i_fldcat1 TYPE lvc_t_fcat,
    wa_fldcat LIKE LINE OF i_fldcat.
    CLASS lcl_event DEFINITION
    CLASS lcl_event DEFINITION.
    PUBLIC SECTION.
    METHODS: toolbar FOR EVENT toolbar OF cl_gui_alv_grid IMPORTING e_object e_interactive,
    usercommand FOR EVENT user_command OF cl_gui_alv_grid IMPORTING e_ucomm.
    ENDCLASS. "lcl_event DEFINITION
    CLASS lcl_event IMPLEMENTATION
    CLASS lcl_event IMPLEMENTATION.
    METHOD toolbar.
    PERFORM toolbar CHANGING e_object e_interactive
    e_object->mt_toolbar.
    ENDMETHOD. "lcl_event IMPLEMENTATION
    METHOD usercommand.
    PERFORM user_command CHANGING e_ucomm.
    ENDMETHOD. "usercommand
    ENDCLASS. "lcl_event IMPLEMENTATION
    SELECTION-SCREEN BEGIN OF BLOCK blk1 WITH FRAME TITLE t001.
    SELECT-OPTIONS: so_ebeln FOR v_ebeln.
    SELECTION-SCREEN END OF BLOCK blk1.
    START-OF-SELECTION.
    CALL SCREEN 100.
    DATA: obj_event TYPE REF TO lcl_event.
    CREATE OBJECT obj_event.
    *& Module STATUS_0100 OUTPUT
    text
    MODULE status_0100 OUTPUT.
    SET PF-STATUS 'STATUS_100'.
    SET TITLEBAR 'TITLE_100'.
    SELECT ebeln
    bukrs
    bstyp
    bsart
    aedat
    INTO CORRESPONDING FIELDS OF TABLE it_ekko
    FROM ekko
    WHERE ebeln IN so_ebeln.
    IF cl_alv1 IS INITIAL.
    CREATE OBJECT cl_container1 EXPORTING container_name = 'CONT1'.
    CREATE OBJECT cl_alv1 EXPORTING i_parent = cl_container1.
    PERFORM fieldcatalog.
    CALL METHOD cl_alv1->set_table_for_first_display
    EXPORTING
    I_BUFFER_ACTIVE =
    I_BYPASSING_BUFFER =
    I_CONSISTENCY_CHECK =
    I_STRUCTURE_NAME =
    IS_VARIANT =
    i_save = 'X'
    I_DEFAULT = 'X'
    is_layout =
    IS_PRINT =
    IT_SPECIAL_GROUPS =
    IT_TOOLBAR_EXCLUDING =
    IT_HYPERLINK =
    IT_ALV_GRAPHICS =
    IT_EXCEPT_QINFO =
    IR_SALV_ADAPTER =
    CHANGING
    it_outtab = it_ekko
    it_fieldcatalog = i_fldcat
    it_sort =
    IT_FILTER =
    EXCEPTIONS
    invalid_parameter_combination = 1
    program_error = 2
    too_many_lines = 3
    OTHERS = 4
    IF sy-subrc 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    CREATE OBJECT obj_event.
    SET HANDLER : obj_event->toolbar FOR cl_alv1.
    SET HANDLER : obj_event->usercommand FOR cl_alv1.
    CALL METHOD cl_alv1->set_toolbar_interactive.
    ELSE.
    CALL METHOD cl_alv1->refresh_table_display.
    ENDIF.
    ENDMODULE. " STATUS_0100 OUTPUT
    *& Form toolbar
    text
    <--P_E_OBJECT text
    <--P_E_INTERACTIVE text
    <--P_E_OBJECT_>MT_toolbar text
    FORM toolbar CHANGING p_e_object TYPE REF TO cl_alv_event_toolbar_set
    p_e_interactive
    mt_toolbar TYPE ttb_button.
    DATA wal_button TYPE stb_button.
    wal_button-text = 'ITEM DETAILS'.
    wal_button-quickinfo = 'PROCEED'.
    wal_button-function = 'ITM1'.
    wal_button-butn_type = 0.
    wal_button-disabled = space.
    INSERT wal_button INTO p_e_object->mt_toolbar INDEX 1.
    ENDFORM. " toolbar
    *& Form user_command
    text
    <--P_E_UCOMM text
    FORM user_command CHANGING p_e_ucomm.
    CASE p_e_ucomm.
    WHEN 'ITM1'.
    LEAVE TO SCREEN 200.
    ENDCASE.
    ENDFORM. " user_command
    *& Module STATUS_0200 OUTPUT
    text
    MODULE status_0200 OUTPUT.
    SET PF-STATUS 'STATUS_200'.
    SET TITLEBAR 'TITLE_200'.
    CLEAR wa_ekko.
    LOOP AT it_ekko INTO wa_ekko WHERE mark = 'X'.
    READ TABLE it_ekko INTO wa_ekko WITH KEY mark = 'X'.
    IF sy-subrc = 0.
    CLEAR wa_ekPo.
    SELECT SINGLE ebeln
    ebelp
    statu
    aedat
    FROM ekpo
    INTO wa_ekpo
    WHERE ebeln = wa_ekKo-ebeln.
    APPEND wa_ekPo TO it_ekPo.
    ENDIF.
    ENDLOOP.
    IF cl_alv2 IS INITIAL.
    CREATE OBJECT cl_container2 EXPORTING container_name = 'CONT2'.
    CREATE OBJECT cl_alv2 EXPORTING i_parent = cl_container2.
    PERFORM fieldcatalog1.
    CALL METHOD cl_alv2->set_table_for_first_display
    EXPORTING
    I_BUFFER_ACTIVE =
    I_BYPASSING_BUFFER =
    I_CONSISTENCY_CHECK =
    I_STRUCTURE_NAME =
    IS_VARIANT =
    i_save = 'X'
    I_DEFAULT = 'X'
    is_layout =
    IS_PRINT =
    IT_SPECIAL_GROUPS =
    IT_TOOLBAR_EXCLUDING =
    IT_HYPERLINK =
    IT_ALV_GRAPHICS =
    IT_EXCEPT_QINFO =
    IR_SALV_ADAPTER =
    CHANGING
    it_outtab = it_ekPo
    it_fieldcatalog = i_fldcat1
    it_sort =
    IT_FILTER =
    EXCEPTIONS
    invalid_parameter_combination = 1
    program_error = 2
    too_many_lines = 3
    OTHERS = 4
    IF sy-subrc 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    ELSE.
    CALL METHOD cl_ALV2->refresh_table_display.
    ENDIF.
    ENDMODULE. " STATUS_0200 OUTPUT
    *& Module USER_COMMAND_0100 INPUT
    text
    MODULE user_command_0100 INPUT.
    IF sy-ucomm = 'BACK' OR sy-ucomm = 'EXIT' OR sy-ucomm = 'CANCEL'.
    LEAVE TO SCREEN 0.
    ENDIF.
    ENDMODULE. " USER_COMMAND_0100 INPUT
    *& Module USER_COMMAND_0200 INPUT
    text
    MODULE user_command_0200 INPUT.
    IF sy-ucomm = 'BACK'.
    LEAVE TO SCREEN 100.
    ENDIF.
    IF sy-ucomm = 'EXIT' OR sy-ucomm = 'CANCEL'.
    LEAVE TO SCREEN 0.
    ENDIF.
    ENDMODULE. " USER_COMMAND_0200 INPUT
    *& Form fieldcatalog
    text
    --> p1 text
    <-- p2 text
    FORM fieldcatalog .
    wa_fldcat-col_pos = '1'.
    wa_fldcat-fieldname = 'MARK'.
    wa_fldcat-checkbox = 'X'.
    wa_fldcat-edit = 'X'.
    APPEND wa_fldcat TO i_fldcat.
    CLEAR wa_fldcat.
    wa_fldcat-col_pos = '2'.
    wa_fldcat-fieldname = 'EBELN'.
    wa_fldcat-tabname = 'IT_EKKO'.
    wa_fldcat-outputlen = 10.
    wa_fldcat-scrtext_m = 'PO NUMBER'.
    APPEND wa_fldcat TO i_fldcat.
    wa_fldcat-col_pos = '3'.
    wa_fldcat-fieldname = 'BUKRS'.
    wa_fldcat-tabname = 'I_EKKO'.
    wa_fldcat-outputlen = 10.
    wa_fldcat-scrtext_m = 'Type'.
    APPEND wa_fldcat TO i_fldcat.
    wa_fldcat-col_pos = '4'.
    wa_fldcat-fieldname = 'BSTYP'.
    wa_fldcat-tabname = 'I_EKKO'.
    wa_fldcat-outputlen = 10.
    wa_fldcat-scrtext_m = 'Type'.
    APPEND wa_fldcat TO i_fldcat.
    wa_fldcat-col_pos = '5'.
    wa_fldcat-fieldname = 'BSART'.
    wa_fldcat-tabname = 'I_EKKO'.
    wa_fldcat-outputlen = 10.
    wa_fldcat-scrtext_m = 'Type'.
    APPEND wa_fldcat TO i_fldcat.
    wa_fldcat-col_pos = '6'.
    wa_fldcat-fieldname = 'AEDAT'.
    wa_fldcat-tabname = 'I_EKKO'.
    wa_fldcat-outputlen = 10.
    wa_fldcat-scrtext_m = 'Type'.
    APPEND wa_fldcat TO i_fldcat.
    ENDFORM. " fieldcatalog
    *& Form fieldcatalog1
    text
    --> p1 text
    <-- p2 text
    FORM fieldcatalog1 .
    wa_fldcat-col_pos = '1'.
    wa_fldcat-fieldname = 'EBELN'.
    wa_fldcat-tabname = 'IT_EKPO'.
    wa_fldcat-outputlen = 10.
    wa_fldcat-scrtext_m = 'PO NUMBER'.
    APPEND wa_fldcat TO i_fldcat1.
    wa_fldcat-col_pos = '2'.
    wa_fldcat-fieldname = 'EBELP'.
    wa_fldcat-tabname = 'IT_EKPO'.
    wa_fldcat-outputlen = 10.
    wa_fldcat-scrtext_m = 'PO NUMBER'.
    APPEND wa_fldcat TO i_fldcat1.
    wa_fldcat-col_pos = '3'.
    wa_fldcat-fieldname = 'STATU'.
    wa_fldcat-tabname = 'IT_EKPO'.
    wa_fldcat-outputlen = 10.
    wa_fldcat-scrtext_m = 'PO NUMBER'.
    APPEND wa_fldcat TO i_fldcat1.
    wa_fldcat-col_pos = '4'.
    wa_fldcat-fieldname = 'AEDAT'.
    wa_fldcat-tabname = 'IT_EKPO'.
    wa_fldcat-outputlen = 10.
    wa_fldcat-scrtext_m = 'PO NUMBER'.
    APPEND wa_fldcat TO i_fldcat1.
    ENDFORM. " fieldcatalog1
    Regards,
    Vijetha.

  • Update PRODH field from table T179T

    hi,
    i want to update PRODH field from table T179T into table VBRP. for this we
    need to take selection option also.
    selection option will be :
    ·             Sales Organization (field VBRK-VKORG)
    ·       Billing Date Range (VBRK-FKDAT)
    ·       Distribution Channel (Vbrk-vtweg
    while i have done this for one field by using hard code but like:
    TABLES: VBRP.
    CLEAR VBRP.
    UPDATE VBRP SET PRODH = 'PLC01' WHERE VBELN = '0008300051'.
    SELECT SINGLE * FROM VBRP WHERE VBELN = '0008300051'.
    WRITE: VBRP-VBELN,VBRP-PRODH.
    but this is not the right way. please guide me how to solve this.

    TABLES: VBRP.
    CLEAR VBRP.
    UPDATE VBRP SET PRODH = 'PLC01' WHERE VBELN = '0008300051'.
    <b>commit work.</b>
    SELECT SINGLE * FROM VBRP WHERE VBELN = '0008300051'.
    WRITE: VBRP-VBELN,VBRP-PRODH.
    use commit work after update statement.
    But this code would make vbrp-vbeln as plc01 only.
    If you want to get the prodh value from t179t, then write a sleect on t179t and then update.
    TABLES: VBRP.
    CLEAR VBRP.
    select single prodh
      from t179t
    where......
    UPDATE VBRP SET PRODH = t179-prodh WHERE VBELN = '0008300051'.
    commit work.
    SELECT SINGLE * FROM VBRP WHERE VBELN = '0008300051'.
    WRITE: VBRP-VBELN,VBRP-PRODH.

  • Dynamic display of fields of table in ALV report.

    To display the records of a table in ALV report dynamically such that first 10 fields of the table should only be displayed excluding 'mandt' field .
    That is field no 2nd to 11th should be displayed.

    parameters: p_vari type slis_vari.
    at selection-screen on value-request for p_vari.
      perform alv_variant_f4 changing p_vari.
    form alv_variant_f4 changing l_vari type slis_vari.
    On F4 for layout selection - Get laouts created to this report.
      data: l_variant type disvariant.
      l_variant-report   = sy-repid.
      l_variant-username = sy-uname.
      call function 'REUSE_ALV_VARIANT_F4'
        exporting
          is_variant = l_variant
          i_save     = 'A'
        importing
          es_variant = l_variant
        exceptions
          others     = 1.
      if sy-subrc = 0.
        l_vari = l_variant-variant.
      endif.
    Create a structure
    data: wa_layout type disvariant.
    fill up the layout with selected fields.
    wa_layout-report = sy-repid.
    wa_layout-username = sy-uname " Choose this if you want user specific
    wa_layout-variant = p_vari.
    Assign the same to the REUSE_ALV_GRID_DISPLAY
    it is a import paramter  IS_VARIANT = wa_layout.
    All you have to do is first execute the report and save layouts what exactly you want
    and then next time you run the report you will get a chance to select the layout of your own.
    or
    You can get rid of MANDT field from fieldcatalog and internal table by creating a new
    structure. I mean, if you know you always want to display the field from 2 to 11 then simply
    delete the field from fieldcatalog.
    You can assign to different field catalog using Field symbols and change your internal
    table as well since you have created a dynamic internal table.
    Let me know if you need more.

  • Is it possible to display only dynamically selected fields in the out put?

    Is it possible to display only dynamically selected fields in the out put? i need to display set of columns in the selection criteria, but in the output i have display only input given fields. because i need to convert it into .csv file. So i have to display selected fields from internal table. In oracle they are using"execute immediate". is there any equivalent in SAP?
    thanks in advance.

    Hi Remya,
    Are you talking about dynamic programming in ABAP ?
    If yes, there are concepts like RTTS which facilitates it.
    Yes, the select query also supports dynamic selection of fields. ( Please care about ( ) in dynamic sql ).
    Do more research on Field Symbols and statements like ASSIGN COMPONENT OF.
    Regards,
    Philip.

  • Using radio button selection in multiple tables

    Hello All,
    I've got a bit of a design issue and it being a Friday my brain is a bit foggy and I can't seem to figure out a solution.
    what I want to do is have 3 tables. The user should only be able to select one line from any of the three tables.
    I can do this by having events that clear down selection on the two other tables on any selection of the third, but the select buttons of tables don't really give the UI impression that only one row can be selected. To do this I'd like to use the radio button element.
    so
    table A
    choice - name
    (o) - Anne
    (o) - Bob
    (o) - Charlie
    Table B
    choice - name
    (x) - David
    (o) - Ellen
    (o) - Fran
    Table C
    choice - name
    (o) - George
    Here the entry in table B for David is selected. But any selection of any of the other options should deselected.
    My thoughts are to use a radio button ui element, bind the "selected" value to a unique id for each row/table (an attribute of the node element for each table) and the value to a common shared attribute (not table specific).
    Any better ideas - and certainly any which would mean I'm not going to have to maintain a lookup table of my unique ids and node elements to find out which one is selected?
    Cheers,
    Chris

    Ok - here's how I did it.
    I created another lookup table which had a guid and reference to the element.
    in the each elements I had a guid which I bound to the key for selection property of the radio button in the table.
    I then bound the selected key property to an attribute that was common to all elements.
    in my "processing" logic I read the selected key, read the lookup table - and therefore got the reference to the selected element.
    Would have been an awful lot easier if I could have used a reference to the element itself as the "key" - but that was required to be a character field.
    [image showing radio button selection working across multiple tables|http://i51.tinypic.com/bi79dx.jpg]
    End result works quite nicely.
    Cheers,
    Chris

Maybe you are looking for

  • The battery-sucking Nomad from hell

    I have a brand new Nomad Jukebox Zen Xtra MP3 Player (40 GB). The fully charged battery, drains in 6 hours! It doesn't matter if I'm actually using it, or it is just on, or even if it's totally off... It drains in 6 hours no matter what. I understand

  • How to make a JFrame not shown in taskbar

    i want to make a frame not shown in taskbar (similiar to jdialog) when clicking a button how can i make it.

  • Black ink won't work

    I see there are several posts about this already, but I would appreciate any additional troubleshooting measures to make this happen.  I have had this printer approx. 2 years and it is not used a ton; so I am frustrated that I the black ink is alread

  • My schedule report is being sent twice

    Crystal 10.0 This has happened to two of my reports now and I can't see anything wrong. I've loaded the report in the normal way and confirmed its working, then added a schedule to send it automatically to a number of people (individual email address

  • Applet ignore sign

    I have created an applet and signed it. Everything was greate until today. Suddenly when I try to sign new applets I get a message saying that the applet was signed, but when I execute it I see that it is not signed (I have checked that the expiratio