Retrieving values from table control using DYNP_VALUES_READ

Hi all,
I am trying to retrieve the values from the table control using the FM DYNP_VALUES_READ. I have a situation where user enter values in table control in T.code FB60 in Withholding tab for validation purpose. There i'll have to check based on some entries maintained in SET.
I am unable to get the values when i scroll to the next page in the table control. FM raising an exception invalid_dynprofield.
Expecting reply...

You have to populate the dynpfields internal table before calling the function,
data: repid like sy-repid.
dynpfields-fieldname = 'PNAME'.
append dynpfields.
repid = sy-repid.
call function 'DYNP_VALUES_READ'
exporting
dyname = repid
dynumb = sy-dynnr
tables
dynpfields = dynpfields
exceptions
others.
read table dynpfields index 1.
pname = dynpfields-fieldvalue.
Now you will have the field value in pname
Hope this helps
Vinodh Balakrishnan

Similar Messages

  • Deleting the values from table control

    HI,
    I need to remove the selected line from the Table control on my screen.
    The point is that the Internal table does not have any records,.
    for example in the Customer Create screen,
    while entering the bank details we will enter it in a tbale contraol.
    but the records doesnt exist in the database. but the record gets deleted from the table control only if we press delete button.
    please guide me.
    please note : I want to delete the record from Table Control on the screen and I dont have any corresponding database records..
    regards

    Hi..
    The solution to your problem - deleting values from table control.
    Here: it_wizard is the internal table which is holding the value of table control.
             wa_wizard is the work are of the internal table it_wizard.
             it_delete is the internal table which holds the deleted record of table control.
             wa_delete is the work area of the internal table it_delete
    Also here the field ZSEL is the character field which is used to select the entire record in the table control.
    LOOP AT it_wizard into wa_wizard WHERE zsel = 'X'.
           MOVE-CORRESPONDING wa_wizard TO wa_delete.
           APPEND wa_delete TO it_delete.
           delete table it_wizard from wa_wizard.
    DELETE  FROM zfin_goods WHERE ZFG = WA_delete-ZFG.
    ENDLOOP
    if sy-subrc eq 0.
    Message 'Delete Successful' type 'S'.
    endif.
    The above code will delete the record from both the table control.internal table and the database table.
    I think this will help you to great extent.
    Ward regards,
    Bhuvaneswari
    Edited by: BHUVANESWARI THIRUNAVUKKARASU on Jan 7, 2009 10:39 AM

  • Take input from table control using wizard

    Dear experts,
    I am trying to take data from table control into internal table using wizard.
    In main report program i defined the internal table and used wizard after  that.
    I could see internal table there and i picked the fields i wanted.
    Also i defined a workarea of same time.Further i made a push button.
    In PAI user command module i specified
    loop at itab. (one used for table control data)
    endloop.
    Here i put break point and find that no data is coming from grid.
    With wizard what additional i have to do ?

    Hi
    PROCESS AFTER INPUT.
    MODULE USER_COMMAND_2209.  "do processing
    loop at itab.
       module UPDATE.                           "read from tbl ctl into db table using wa.
    endloop.
    DATA:   itab TYPE TABLE OF YSTUDENT WITH HEADER LINE,
                WA LIKE LINE OF ITAB.
    MODULE UPDATE INPUT.
    WA-ID = YSTUDENT-ID.
    WA-NAME = YSTUDENT-NAME.
    INSERT YSTUDENT FROM WA.  
    ENDMODULE.
    Instead of Insert into table, you can write: APPEND WA TO ITAB.    
    Also YSTUDENT-ID is the name of the column in your tbl ctrl.
    Make sure your PBO also loops thro the itab:
    loop at itab with control tab1.
    endloop.
    Hope this helps
    Regards,
    Jayanthi.K

  • How to read the field value from Table Control

    Hello Experts,
    I am creating my first Table Control Screen. Basically I have to create a screen (102) with a table control which has 2 fields: A_QTY, B_QTY and 2 Buttons: SAVE, EXIT.
    When Clicked on 'SAVE' the data (MATNR) from a previous screen (101)  and the data (A_QTY, B_QTY) from the new screen (102) should be saved into a Z-table.
    Internal table t_data has 3 fields.
    MATNR
    A_QTY
    B_QTY.
    Table Control TC_RACK was declared like this:
    controls tc_rack type tableview using screen 0102.
    I/0 Fields:
    A_QTY type ZQTY.
    B_QTY type ZQTY.
    The screen Flow Logic:
    process before output.
    module status_0102.
      loop at t_data into w_data with control tc_rack.
      endloop.
    process after input.
      module exit_0102 at exit-command.
      loop at tc_rack.
      endloop.
    module user_command_0102.
    module status_0102output.
      set pf-status 'STATUS_102'.
      set titlebar 'TITLE_102'.
      describe table t_rack lines tc_rack-lines.
    endmodule.                 "status_0102 output
    process after input.
    module user_command_0615 input.
    case ok_code.
       when 'SAVE_RK'.
       when others.
    endcase.
    endmodule.                 "user_command_0102 input
    Now for eg, when the users enter values for A_QTY and B_QTY like this:
    A_QTY     B_QTY
    1000         2000
    3000         4000
    How can I read these values and pass them to T_DATA so that I can save it into Z-table?
    I greatly appreciate your help.
    I've gone through some previously posted threads and could not understand because my knowledge in this area is preliminary.
    Thanks a lot.
    Could you please let me know
    Edited by: dev a on Jan 13, 2010 2:46 PM

    Hi dev a
    You should use
      DATA: lv_name(30) TYPE c.
      FIELD-SYMBOLS: <QTY> type ZQTY.
    GET CURSOR FIELD lv_name.   "Get the field name in table control
    check sy-subrc = 0.
    assign  (lv_name) to <QTY>.  "Here you get the value in <QTY>
    check sy-subrc = 0.
    Also use <your table control>-current_line to get the table index uo're currently on.
    Hint: Do not use GET CURSOR LINE if you want to get table index since this gives you the line relative to dialog screen
    Good luck
    Dean Q.
    Edited by: Dean Q on Jan 13, 2010 11:11 PM

  • How to retrieve data from Table Control

    Hi,
    I am a Beginner to ABAP. I want to know how to fetch the selected rows from Screen table control.
    Here is my scenario:
    I am having one table control with selection field. Once i select some rows means the selected rows are going to be stored in one Internal Table.
    If any body knows the thing means please reply me the logic as well as giving me some code sample.
    Thankyou.

    Hi Mithun,
    Try to implement this code in your requirement.
    There will be some button on your screen and after selecting some or all the records from the table control you must be pressing some button for collecting the selected rows from the table control too your internal table.
    Put Fcode of that button in WHEN condition in this CASE.
    CONSTANTS: kc_sel_flag TYPE char01    VALUE 'X'.
      CASE sy-ucomm.
        WHEN kc_sel.
          PERFORM f_sel_desel USING kc_sel_flag.
      ENDCASE.
    FORM f_sel_desel
         USING    p_sel_desel TYPE c.
    Set the value
      wa_cond_type-z_sel = p_sel_desel.
    Update the Itab.
      MODIFY it_cond_type
             FROM wa_cond_type
             TRANSPORTING z_sel
             WHERE mandt EQ sy-mandt. "Where cond is only to specify all
    ENDFORM.                    " f_sel_desel
    After that all the selected records will be having 'X' in the internal table.
    Regards,
    Mueksh Kumar

  • Get value from table control

    Hi Guys,
    FYI, im having a table control with field Plant and Material. I have defaulted the <b>std search help</b> to field <u>Material</u> at the screen painter. Meaning system will call up the search help for Material once i press F4.
    Since the search help for field Material is a collective search help, and there is a <u>Plant</u> field available for Material filtering. Thus i may need to get the Plant's value from of same row of the  table control to Populate into the Material's search help.
    I have already tried to create a new module under the LOOP...ENDLOOP at PAI's flow logic. And try to use parameter id to set the value for plant, purpose is to populate it to Material's search help when i click F4 on material field. The problem is the new module that i coded under LOOP...ENDLOOP will never trigger when i click F4. Because there is NO event to trigger my module.
    Other than the above, i tried to code it under POV. But it doesn't work as well, because there is more than 1 record under table control and i can not determine the during runtime which row of F4 for material being click.
    Please comment on this above on how to solve the problem.
    Thanks in advance.

    Hi,
          You can call standard collective search help [say for Eg:<b>MAT1</b>] through Process on value-request event and set the paramenter id of Plant field before calling the funtion module <b>'HELP_START'</b>.Then we can get the materials specific to the PLANT in the corresponding row of the TABLE CONTROL.
    To get which row of the table control is clicked use <b>Get Cursor Line</b> Statement as i mentioned below.
    Flow logic:
    PROCESS ON VALUE-REQUEST.
    FIELD x_marc-matnr MODULE mat_shelp.
    Module definition:
    MODULE mat_shelp INPUT.
      DATA:v_help_info LIKE help_info,n TYPE i,
       it_dyselect LIKE TABLE OF dselc WITH HEADER LINE,
        it_dyvaltab LIKE TABLE OF dval WITH HEADER LINE.
      REFRESH it_dyselect.
      it_dyselect-fldname = 'MANDT'.
      it_dyselect-dyfldname = 'SY-MANDT'.
      APPEND it_dyselect.
      it_dyselect-fldname = 'MATNR'.
      it_dyselect-dyfldname = 'X_MARC-MATNR'.
      APPEND it_dyselect.
      v_help_info-call     =     'M'.
      v_help_info-object     =     'F'.
      v_help_info-program     =      sy-repid.    "'ZVIG_MOD_TABLE_CONTROL_1'.
      v_help_info-dynpro     =     sy-dynnr.    "'9001'.
    v_help_info-tabname     =      'MARC'.
      v_help_info-fieldname = 'MATNR'.
      v_help_info-fieldtype     =  'CHAR'.
      v_help_info-keyword   =   'MATNR'.
      v_help_info-fieldlng = 18.
      v_help_info-fldvalue = ''.
      v_help_info-mcobj = 'MAT1'.
      v_help_info-spras = 'E'.
      v_help_info-menufunct = 'HC'.
      v_help_info-title =     'SAP'.
      v_help_info-dynprofld = 'X_MARC-MATNR'.     <b>----
    > Give ur screen field name</b>
      v_help_info-tcode     =      sy-tcode.       "'ZTC1'.
      v_help_info-pfkey     =      'MEN'.
      v_help_info-docuid     =     'FE'.
      v_help_info-pov     =     'N'.
    v_help_info-curow     =   '2'.
    v_help_info-cucol     =  '1'.
      v_help_info-dynpprog = sy-repid.       " ZVIG_MOD_TABLE_CONTROL_1
      v_help_info-stepl     =   '1'.
      v_help_info-selectart = 'A'.
      GET CURSOR LINE n.
      READ TABLE it_marc INTO x_marc INDEX n.
      SET PARAMETER ID 'WRK' FIELD  X_MARC-WERKS .
      CALL FUNCTION 'HELP_START'
        EXPORTING
          help_infos         = v_help_info
        TABLES
          dynpselect         = it_dyselect
          dynpvaluetab       = it_dyvaltab           .
    ENDMODULE.                 " mat_shelp  INPUT

  • How to delete record from table control using BDC?

    Hello friends,
    I am running a BDC program to delete records.
    I have file with following records and i got these records into t_itab.
    Material     Plant     Start date     End date     Cost
    MQ100001     S001     09/01/2008     09/31/2008     55.00
    MQ100004     S002     09/01/2008     09/31/2008     56.00
    MQ100008     S003     09/01/2008     09/31/2008     57.00
    Now, I have BDC transaction in which table control screen which contains following structure.
    MQ100001     S001     09/01/2008     09/31/2008     55.00
    MQ100002     S002     09/01/2008     09/31/2008     56.00
    MQ100004     S003     09/01/2008     09/31/2008     47.00     
    MQ100005     S004     09/01/2008     09/31/2008     25.00
    MQ100006     S012     09/01/2008     09/31/2008     76.00
    MQ100007     S033     09/01/2008     09/31/2008     17.00
    MQ100008     S011     09/01/2008     09/31/2008     95.00
    MQ100009     S002     09/01/2008     09/31/2008     46.00
    I have recorded from SHDB in which first record will be delete.
    So, when i loop through t_itab,instead of deleting MQ100001,MQ100004 and MQ100008 from BDC screen,
    it is deleting MQ100001,MQ100002 and MQ100004 (first record for each process ).
    Which i don't want to.
    Is there any facility in BDC to put records on top which i want to delete?
    Please guide me.
    Regards,
    RH

    One option is to identify the table and find out the location as the number of row which should be deleted from the table and then in the bdc program instead of postioning the cursor on the row 1(using the statement perform bdc_cursor ....(01)), replace the 01 with the row number.
    Second option is that if a filter control is available for the table control, then filter the data each and every time with the material number to be deleted and then delete the first row.
    Regards
    Farzan

  • How to add selected values from table(selected using checkbox)to table?

    Hi All,
    i have created simple page with search panel with table in table i have created one column as check box for selecting.
    here what my requirement is i need to do search multiple times to add some roles to from some different categories.here whenever i searched i ll get some roles into table there i ll select some role and i ll click add buttion. whenever i click add i need to add those roles into some other table finally i ll submit added roles.
    here i followed one link http://www.oracle.com/technetwork/developer-tools/adf/learnmore/99-checkbox-for-delete-in-table-1539659.pdf
    i used same code and able to see selected row in console, as object array how to add these into table.
    please help me out
    Thanks in advance
    siva shankar

    Thank you for a quick reply
    i used the same thing before i go for table check box concept.here what i observed is when i search i am getting some results i am able to shuttle.but if i search again the shuttle is refreshing with new values even not available list its refreshing selected list. IF dont want refresh selected ones.
    my usecase after make some searches I will select some roles from different categories at finally i ll submit.
    i hope you understand me requirement. please suggest me is this requirement is possible in shuttle component? if yes please guide me.
    thanks
    Siva Sankar

  • How to retrieve value from xml file

    hi all,
    can somebody pls tell me how to retrieve value from xml file using SAXParser.
    I want to retrieve value of only one tag and have to perform some validation with that value.
    it's urgent .
    pls help me out
    thnx in adv.
    ritu

    hi shanu,
    the pbm is solved, now i m able to access XXX no. in action class & i m able to validate it. The only thing which i want to know is it ok to declare static ArrayList as i have done in this code. i mean will it affect the performance or functionality of the system.
    pls have a look at the following code snippet.
    public class XMLValidator {
    static ArrayList strXXX = new ArrayList();
    public void validate(){
    factory.setValidating(true);
    parser = factory.newSAXParser();
    //all factory code is here only
    parser.parse(xmlURI, new XMLErrorHandler());     
    public void setXXX(String pstrXXX){          
    strUpn.add(pstrXXX);
    public ArrayList getXXX(){
    return strXXX;
    class XMLErrorHandler extends DefaultHandler {
    String tagName = "";
    String tagValue = "";
    String applicationRefNo = "";
    String XXXValue ="";
    String XXXNo = "";          
    XMLValidator objXmlValidator = new XMLValidator();
    public void startElement(String uri, String name, String qName, Attributes atts) {
    tagName = qName;
    public void characters(char ch[], int start, int length) {
    if ("Reference".equals(tagName)) {
    tagValue = new String(ch, start, length).trim();
    if (tagValue.length() > 0) {
    RefNo = new String(ch, start, length);
    if ("XXX".equals(tagName)) {
    XXXValue = new String(ch, start, length).trim();
    if (XXXValue.length() > 0) {
    XXXNo = new String(ch, start, length);
    public void endElement(String uri, String localName, String qName) throws SAXException {                    
    if(qName.equalsIgnoreCase("XXX")) {     
    objXmlValidator.setXXX(XXXNo);
    thnx & Regards,
    ritu

  • Retrieve values from a HTML table !!!

    Hi.
    How can i retrieve values from a HTML table using javascript ?
    I´m trying to use the command "document.getElementsByTagName" without success.
    Thanks in advance.
    Eduardo

    Hi, Deepu.
    I´m still with trouble in retrieving the value in HTML.
    In debug the C_CELL_ID seems to be correctly updated but
    when using the command "document.getElementById" the value is always "null".
    I implemented in the method DATA_CELL the code :
      if i_x = 3 and i_y = 2.
      C_CELL_ID             = 'zs'.
      C_CELL_CONTENT = 10. 
      endif.
    And in HTML :
    var ztest = document.getElementById('zs');
    alert(ztest);
    Could you help me please.
    Many regards
    Eduardo S.
    Message was edited by: Eduardo   Silberberg

  • From two given tables, how do you fetch the values from two columns using values from one column(get values from col.A if col.A is not null and get values from col.B if col.A is null)?

    From two given tables, how do you fetch the values from two columns using values from one column(get values from col.A if col.A is not null and get values from col.B if col.A is null)?

    Hi,
    Use NVL or COALESCE:
    NVL (col_a, col_b)
    Returns col_a if col_a is not NULL; otherwise, it returns col_b.
    Col_a and col_b must have similar (if not identical) datatypes; for example, if col_a is a DATE, then col_b can be another DATE or it can be a TIMESTAMP, but it can't be a VARCHAR2.
    For more about NVL and COALESCE, see the SQL Language manual: http://docs.oracle.com/cd/E11882_01/server.112/e26088/functions119.htm#sthref1310
    I hope this answers your question.
    If not, post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) for all tables involved, and also post the results you want from that data.
    Explain, using specific examples, how you get those results from that data.
    Always say which version of Oracle you're using (e.g., 11.2.0.2.0).
    See the forum FAQ: https://forums.oracle.com/message/9362002

  • Retrieving values from a table

    Hi all,
    I need to retrieve values from CSKS-KOSTL for values containing the pattern entered by the user. For example, if the user enters 1, need to retrieve all the KOSTL values starting with 1. But when i write a SELECT statement mentioning where kostl in '1', it is ignoring all the values like (0000001, 00001034, 0012334, and others). Only values starting with 1 is only retrieved as this is a character field and due to conversion routine, zeroes are prefixed while storing in the database.
    Could any one let me know how to retrieve the values from the database in this situation?

    If you want to use IN operator in your where clause then you should define a range variable(R_KOSTL) which refers to CSKS=KOSTL and populate the range as below
    R_KOSTL-SIGN = 'I'.
    R_KOSTL-OPTION = 'CP'.
    R_KOSTL-LOW = '1*'.
    APPEND R_KOSTL.
    and then write your select statement as .... WHERE kostl IN r_kostl.
    The approach suggested by Amit should also work fine.
    Thanks
    Kiran

  • How can I insert values from table object into a regular table

    I have a table named "ITEM", an object "T_ITEM_OBJ", a table object "ITEM_TBL" and a stored procedure as below.
    CREATE TABLE ITEM
    ITEMID VARCHAR2(10) NOT NULL,
    PRODUCTID VARCHAR2(10) NOT NULL,
    LISTPRICE NUMBER(10,2),
    UNITCOST NUMBER(10,2),
    SUPPLIER INTEGER,
    STATUS VARCHAR2(2),
    ATTR1 VARCHAR2(80),
    ATTR2 VARCHAR2(80),
    ATTR3 VARCHAR2(80),
    ATTR4 VARCHAR2(80),
    ATTR5 VARCHAR2(80)
    TYPE T_ITEM_OBJ AS OBJECT
    ITEMID VARCHAR2(10),
    PRODUCTID VARCHAR2(10),
    LISTPRICE NUMBER(10,2),
    UNITCOST NUMBER(10,2),
    SUPPLIER INTEGER,
    STATUS VARCHAR2(2),
    ATTR1 VARCHAR2(80),
    ATTR2 VARCHAR2(80),
    ATTR3 VARCHAR2(80),
    ATTR4 VARCHAR2(80),
    ATTR5 VARCHAR2(80)
    TYPE ITEM_TBL AS TABLE OF T_ITEM_OBJ;
    PROCEDURE InsertItemByObj(p_item_tbl IN ITEM_TBL, p_Count OUT PLS_INTEGER);
    When I pass values from my java code through JDBC to this store procedure, how can I insert values from the "p_item_tbl" table object into ITEM table?
    In the stored procedure, I wrote the code as below but it doesn't work at all even I can see values if I use something like p_item_tbl(1).itemid. How can I fix the problem?
    INSERT INTO ITEM
    ITEMID,
    PRODUCTID,
    LISTPRICE,
    UNITCOST,
    STATUS,
    SUPPLIER,
    ATTR1
    ) SELECT ITEMID, PRODUCTID, LISTPRICE,
    UNITCOST, STATUS, SUPPLIER, ATTR1
    FROM TABLE( CAST(p_item_tbl AS ITEM_TBL) ) it
    WHERE it.ITEMID != NULL;
    COMMIT;
    Also, how can I count the number of objects in the table object p_item_tbl? and how can I use whole-loop or for-loop to retrieve values from the table object?
    Thanks.

    Sigh. I answered this in your other How can I convert table object into table record format?.
    Please do not open multiple threads. It just confuses people and makes the trreads hard to follow. Also, please remember we are not Oracle employees, we are all volunteers here. We answer questions if we can, when we can. There is no SLA so please be patient.
    Thank you for your future co-operation.
    Cheers, APC

  • Remove vertical scroll bar from table control

    hi,
    i had used table control in my application. i want remove vertical scroll bar from table control.
    At initial time in table control there is no vertical scroll bar. In my table control lines are dependent on internal table which i was used to fill it.
    i was used these code for to set table control lines.
    DESCRIBE TABLE IT_RISK_ZINRISEXC LINES EXC_LINE.
    TC_RISK_EX-LINES =   EXC_LINE .
    Initially there is no data in internal table so there is no vertical scroll bar. After getting value i am filling internal table. and there is scroll bar in my table control. but i does not want that.
    i was not selected RESIZING-VERTICAL OR -HORIZONTAL.

    Hi,
    From Scroll Bars in Table Control
    You can remove the scroll bar in the table control by switching off horizontal and vertical scrolling in the properties of the table control. The properties can be accessed from the screen painter by double clicking on the table control. Regarding the page up and page down functions, I believe you add those buttons in the screen layout and code for them. You can use the standard function code for the page up and page down functions.
    or
    You can get rid of the vertical scroll bars by not setting table control lines. This way the user can only see the visible lines of the table control. As for the horizontal scrollbar, just make sure that your table control doesn't contain too many fields.
    Regards,
    Raj.

  • Create Table Control using Dynamic Internal Table.

    Hi,
       I have requirement in which I will create a Dynamic Internal Table and then I need to create a Table Control Using that Internal Table. Now this can't be done using Screen Editor as it requires a pre-defined internal table or a DDIC Object.
      Please Help.

    This should be correct answer(I am not author of code below):
    REPORT ztablemaintace NO STANDARD PAGE HEADING.
    TYPE-POOLS: rsds.
    DATA: is_x030l TYPE x030l,
    it_dfies TYPE TABLE OF dfies,
    is_dfies TYPE dfies,
    it_fdiff TYPE TABLE OF field_dif,
    is_fdiff TYPE field_dif.
    DATA: w_selid TYPE rsdynsel-selid,
    it_tables TYPE TABLE OF rsdstabs,
    is_tables TYPE rsdstabs,
    it_fields TYPE TABLE OF rsdsfields,
    it_expr TYPE rsds_texpr,
    it_ranges TYPE rsds_trange,
    it_where TYPE rsds_twhere,
    is_where TYPE rsds_where,
    w_active TYPE i.
    DATA: it_content TYPE REF TO data,
    it_modif TYPE REF TO data,
    it_fcat TYPE lvc_t_fcat.
    DATA: w_okcode TYPE sy-ucomm.
    FIELD-SYMBOLS: <itab> TYPE STANDARD TABLE,
    <ntab> TYPE STANDARD TABLE.
    * Macros
    DEFINE table_error.
      message e398(00) with 'Table' p_table &1.
    END-OF-DEFINITION.
    DEFINE fixed_val.
      is_fdiff-fieldname = is_dfies-fieldname.
      is_fdiff-fixed_val = &1.
      is_fdiff-no_input = 'X'.
      append is_fdiff to it_fdiff.
    END-OF-DEFINITION.
    * Selection screen
    SELECTION-SCREEN: BEGIN OF BLOCK b01 WITH FRAME.
    PARAMETERS: p_table TYPE tabname OBLIGATORY "table
    MEMORY ID dtb
    MATCHCODE OBJECT dd_dbtb_16.
    SELECTION-SCREEN: BEGIN OF LINE,
    PUSHBUTTON 33(20) selopt USER-COMMAND sel,
    COMMENT 55(15) selcnt,
    END OF LINE.
    SELECTION-SCREEN: SKIP.
    PARAMETERS: p_rows TYPE i. "rows
    SELECTION-SCREEN: END OF BLOCK b01,
    SKIP,
    BEGIN OF BLOCK b02 WITH FRAME.
    PARAMETERS: p_displ TYPE c AS CHECKBOX. "display
    SELECTION-SCREEN: END OF BLOCK b02.
    * Initialization
    INITIALIZATION.
      MOVE '@4G@ Filter records' TO selopt.
    * PBO
    AT SELECTION-SCREEN OUTPUT.
      IF w_active IS INITIAL.
        CLEAR: selcnt.
      ELSE.
        WRITE w_active TO selcnt LEFT-JUSTIFIED.
      ENDIF.
    * PAI
    AT SELECTION-SCREEN.
      IF p_table NE is_x030l-tabname.
        CALL FUNCTION 'DDIF_NAMETAB_GET'
          EXPORTING
            tabname   = p_table
          IMPORTING
            x030l_wa  = is_x030l
          TABLES
            dfies_tab = it_dfies
          EXCEPTIONS
            OTHERS    = 1.
        IF is_x030l IS INITIAL.
          table_error 'does not exist or is not active'.
        ELSEIF is_x030l-tabtype NE 'T'.
          table_error 'is not selectable'.
    *    ELSEIF is_x030l-align NE 0.
    *      table_error 'has alignment - cannot continue'.
        ENDIF.
    * Default values for system fields
        REFRESH: it_fdiff.
        is_fdiff-tabname = p_table.
        LOOP AT it_dfies INTO is_dfies.
          IF is_dfies-datatype = 'CLNT'.
            fixed_val sy-mandt.
          ELSEIF is_dfies-rollname = 'ERDAT'
          OR is_dfies-rollname = 'ERSDA'
          OR is_dfies-rollname = 'AEDAT'
          OR is_dfies-rollname = 'LAEDA'.
            fixed_val sy-datum.
          ELSEIF is_dfies-rollname = 'ERTIM'
          OR is_dfies-rollname = 'AETIM'.
            fixed_val sy-uzeit.
          ELSEIF is_dfies-rollname = 'ERNAM'
          OR is_dfies-rollname = 'AENAM'.
            fixed_val sy-uname.
          ENDIF.
          CALL FUNCTION '/SAPDMC/DATAELEMENT_GET_TEXTS'
            EXPORTING
              name        = is_dfies-rollname
            IMPORTING
              text_middle = is_dfies-reptext
            EXCEPTIONS
              not_found   = 1
              OTHERS      = 2.
          IF sy-subrc <> 0.
            MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
            WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
          ENDIF.
          MODIFY it_dfies FROM is_dfies.
      ENDLOOP.
    * Prepare free selection on table
      REFRESH it_tables.
      is_tables-prim_tab = p_table.
      APPEND is_tables TO it_tables.
      CLEAR: w_selid.
    ENDIF.
    IF sy-ucomm = 'SEL'.
      IF w_selid IS INITIAL.
    * Init free selection dialog
        CALL FUNCTION 'FREE_SELECTIONS_INIT'
          EXPORTING
            expressions  = it_expr
          IMPORTING
            selection_id = w_selid
            expressions  = it_expr
          TABLES
            tables_tab   = it_tables
          EXCEPTIONS
            OTHERS       = 1.
      ENDIF.
    * Display free selection dialog
      CALL FUNCTION 'FREE_SELECTIONS_DIALOG'
        EXPORTING
          selection_id            = w_selid
          title                   = 'Selection'
          status                  = 1
          as_window               = 'X'
        IMPORTING
          expressions             = it_expr
          field_ranges            = it_ranges
          number_of_active_fields = w_active
        TABLES
          fields_tab              = it_fields
        EXCEPTIONS
          OTHERS                  = 1.
    ENDIF.
    * Start of processing
    START-OF-SELECTION.
      PERFORM f_create_table USING p_table.
      PERFORM f_select_table.
      PERFORM f_display_table.
    * FORM f_create_table *
    FORM f_create_table USING in_tabname.
      FIELD-SYMBOLS: <fcat> TYPE lvc_s_fcat.
      CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
        EXPORTING
          i_structure_name = in_tabname
        CHANGING
          ct_fieldcat      = it_fcat
        EXCEPTIONS
          OTHERS           = 1.
      IF sy-subrc = 0.
    *   Complete field catalog
        LOOP AT it_fcat ASSIGNING <fcat>.
          <fcat>-tabname = in_tabname.
        ENDLOOP.
        CALL FUNCTION 'LVC_FIELDCAT_COMPLETE'
          CHANGING
            ct_fieldcat = it_fcat
          EXCEPTIONS
            OTHERS      = 1.
      ELSE.
        WRITE: 'Error building field catalog'.
        STOP.
      ENDIF.
    * Create dynamic table for data
      CALL METHOD cl_alv_table_create=>create_dynamic_table
        EXPORTING
          it_fieldcatalog = it_fcat
        IMPORTING
          ep_table        = it_content.
      IF sy-subrc = 0.
        ASSIGN it_content->* TO <itab>.
      ELSE.
        WRITE: 'Error creating internal table'.
        STOP.
      ENDIF.
    * Create dynamic table for modif
      CALL METHOD cl_alv_table_create=>create_dynamic_table
        EXPORTING
          it_fieldcatalog = it_fcat
        IMPORTING
          ep_table        = it_modif.
      IF sy-subrc = 0.
        ASSIGN it_modif->* TO <ntab>.
      ELSE.
        WRITE: 'Error creating internal table'.
        STOP.
      ENDIF.
    ENDFORM.                    "f_create_table
    * FORM f_select_table *
    FORM f_select_table.
      IF w_active = 0.
        SELECT * FROM (p_table)
        INTO CORRESPONDING FIELDS OF TABLE <itab>
        UP TO p_rows ROWS.
      ELSE.
    * Selection with parameters
        CALL FUNCTION 'FREE_SELECTIONS_RANGE_2_WHERE'
          EXPORTING
            field_ranges  = it_ranges
          IMPORTING
            where_clauses = it_where.
        READ TABLE it_where INTO is_where WITH KEY tablename = p_table.
        SELECT * FROM (p_table)
        INTO CORRESPONDING FIELDS OF TABLE <itab>
        UP TO p_rows ROWS
        WHERE (is_where-where_tab).
      ENDIF.
      IF sy-dbcnt = 0.
        WRITE: 'No record selected'.
        STOP.
      ENDIF.
    ENDFORM.                    "f_select_table
    * FORM f_display_table *
    FORM f_display_table.
      DATA: l_answer TYPE c,
      l_eflag TYPE c.
      CLEAR: w_okcode.
      REFRESH: <ntab>.
    * Display table contents
      CALL FUNCTION 'STC1_FULLSCREEN_TABLE_CONTROL'
        EXPORTING
          header       = p_table
          tabname      = p_table
          display_only = p_displ
          endless      = 'X'
          no_button    = space
        IMPORTING
          okcode       = w_okcode
        TABLES
    *      nametab      = it_dfies
          table        = <itab>
    *      fielddif     = it_fdiff
          modif_table  = <ntab>
        EXCEPTIONS
          OTHERS       = 1.
      IF sy-subrc = 0.
        IF p_displ IS INITIAL AND w_okcode = 'SAVE'.
    * Confirm update
          CALL FUNCTION 'POPUP_TO_CONFIRM'
            EXPORTING
              titlebar              = p_table
              text_question         = 'Do you want to update table ?'
              default_button        = '2'
              display_cancel_button = ' '
            IMPORTING
              answer                = l_answer
            EXCEPTIONS
              OTHERS                = 1.
          IF l_answer = '1'.
    * Apply modifications
            IF NOT <ntab>[] IS INITIAL.
              PERFORM f_add_system USING space.
              MODIFY (p_table) FROM TABLE <ntab>.
              IF sy-subrc NE 0.
                l_eflag = 'X'.
              ENDIF.
            ENDIF.
    * Apply deletions
            IF l_eflag IS INITIAL.
              REFRESH: <ntab>.
              CALL FUNCTION 'STC1_GET_DATA'
                TABLES
                  deleted_data = <ntab>
                EXCEPTIONS
                  OTHERS       = 1.
              IF NOT <ntab>[] IS INITIAL.
                DELETE (p_table) FROM TABLE <ntab>.
                IF sy-subrc NE 0.
                  ROLLBACK WORK.
                  l_eflag = 'X'.
                ENDIF.
              ENDIF.
            ENDIF.
    * Apply creations
            IF l_eflag IS INITIAL.
              REFRESH: <ntab>.
              CALL FUNCTION 'STC1_GET_DATA'
                TABLES
                  new_data = <ntab>
                EXCEPTIONS
                  OTHERS   = 1.
              IF NOT <ntab>[] IS INITIAL.
                PERFORM f_add_system USING 'X'.
                INSERT (p_table) FROM TABLE <ntab>.
                IF sy-subrc NE 0.
                  ROLLBACK WORK.
                  l_eflag = 'X'.
                ENDIF.
              ENDIF.
            ENDIF.
            IF l_eflag IS INITIAL.
              COMMIT WORK.
              MESSAGE s261(53).
            ELSE.
              MESSAGE s075(3i).
              PERFORM f_select_table.
            ENDIF.
          ENDIF.
    * Display table again
          PERFORM f_display_table.
        ENDIF.
      ENDIF.
    ENDFORM.                    "f_display_table
    * FORM f_add_system *
    FORM f_add_system USING new TYPE c.
      FIELD-SYMBOLS: <irec> TYPE ANY,
      <upd> TYPE ANY.
      LOOP AT it_fdiff INTO is_fdiff.
        READ TABLE it_dfies INTO is_dfies
        WITH KEY fieldname = is_fdiff-fieldname.
        LOOP AT <ntab> ASSIGNING <irec>.
          ASSIGN COMPONENT is_fdiff-fieldname OF STRUCTURE <irec> TO <upd>.
          IF is_dfies-datatype = 'CLNT'.
            <upd> = sy-mandt.
          ELSE.
            CASE is_dfies-rollname.
              WHEN 'AENAM'.
                <upd> = sy-uname.
              WHEN 'AEDAT' OR 'LAEDA'.
                <upd> = sy-datum.
              WHEN 'AETIM'.
                <upd> = sy-uzeit.
              WHEN OTHERS.
            ENDCASE.
          ENDIF.
        ENDLOOP.
      ENDLOOP.
    ENDFORM.                    "f_add_system

Maybe you are looking for

  • Select LONG column from Remote table

    Hi to all. I have the following problem: I can't select a LONG column from remote database, when there are Join operation in the query. Example: SELECT long_column FROM remote_table@DB -> that's OK, but: SELECT long_column FROM remote_table@DB INNER

  • What can I do about driver updates that will not install because of an "unknown error".

    I have an HP p6530 Pavilion that is taking a while to startup. Not real long but longer then it should. I tried to install driver updates from Intel for the Chipset and RAID but when I download and install it will not finish the install because of an

  • Safari 4 for Windows & Adobe PDF files?

    Hi all, Running Safari 4, and love the browser with the exception that any time it tries to open a PDF file within the browser it crashes. Has been this way with acrobat 9.0 and also 9.1 Any suggestions/fixes, or at least workarounds to that it will

  • Small dvd stuck in dvd drive

    My son stuck a small dvd into the dvd drive in my MacBook Pro and now I can't get it out.  The size of the dvd is much smaller than standard... it came with a watch I bought my husband for Christmas.  Any ideas on how to eject?  I tried going to Laun

  • Focus peaking indicator in After Effects?

    Does anybody know if After Effects has some kind of focus peaking indicator? It's basically a way for me to tell which part of the scene is the sharpest if I have a 3D camera with DOF enabled... similar to what professional video cameras have built i