How to display records into a non table base block..

Hi,
Can anybody help me how to display records into a non table base block....
Find below is my coding but it only display the last record in the first line
in the block.
PROCEDURE CREATE_CARTON_QUESTION IS
CURSOR car_c IS
select /*+ rule */ question_id, question_description
from WHOP.QADB_QUESTIONS
where question_category = 'Carton'
and question_active_flag = 'Y';
v_found VARCHAR2(10);
v_status boolean;
v_error      varchar2(150);
v_count number;
car_r car_c%rowtype;
begin
begin
select count(*) into v_count
from WHOP.QADB_QUESTIONS
where question_category = 'Carton'
and question_active_flag = 'Y';
     exception
     when no_data_found then
     v_count := 0;
end;
if v_count > 0 then
for car_r in car_c loop
---populating carton questions
:la_carton.carton_question_id     := car_r.question_id;
:la_carton.carton_question_answer     := 'N';
:la_carton.carton_error_details     := null;
:la_carton.attribute2          := car_r.question_description;
end loop;
end if;
end;
Thanks in advance.
Regards,
Jun

Hi SNatapov,
Thanks for you reply but still I get this error...
FRM-40737 Illegal restricted procedure GO_BLOCK in WHEN-VALIDATE-ITEM trigger.
Please note that I call that program unit in the last field of my control block inside when-validate-item trigger the questions should be display in la_carton block which is my non-base table block.
Find below is the code....
begin
go_block('la_carton');
first_record;
for car_r in car_c loop
---populating carton questions
:la_carton.carton_question_id := car_r.question_id;
:la_carton.carton_question_answer := 'N';
:la_carton.carton_error_details := null;
:la_carton.attribute2 := car_r.question_description;
next_record;
end loop;
end;
Hoping you can help me this problem...
Thanks in advance.
Regards,
Jun

Similar Messages

  • How to get records into two internal tables from 1 internal table?

    VERME                                                                     LGPLA
    252.000  EA  300     0149A                                  410     0149
    276.000  EA  300     0149A                                  410     0107
    516.000  EA  300     0149A                                  400     3013
    528.000  EA  300     0149A                                  400     3013
    528.000  EA  300     0149A                                  400     3013
    528.000  EA  300     0149A                                  400     3013
    528.000  EA  300     0149A                                  400     3013
    528.000  EA  300     0149A                                  400     3013
    528.000  EA  300     0149A                                  400     3013
    I have above records in my one internal table ITAB.
    I want to divide these records in to two internal tables ITAB1 and ITAB2. and this is based on LGPLA and VERME.
    If there is same LGPLA (last column) and different VERME (1st column) available, then it should append ITAB1
    Otherwise it should append ITAB2.
    ITAB1 should contain ,
    516.000  EA  300     0149A                                  400     3013
    ITAB2 should contain ,
    252.000  EA  300     0149A                                  410     0149
    276.000  EA  300     0149A                                  410     0107
    528.000  EA  300     0149A                                  400     3013
    528.000  EA  300     0149A                                  400     3013
    528.000  EA  300     0149A                                  400     3013
    528.000  EA  300     0149A                                  400     3013
    528.000  EA  300     0149A                                  400     3013
    528.000  EA  300     0149A                                  400     3013
    I have tried with this code
    Loop at itab….
    IF lv_prev_lgpla = wa-lgpla and lv_prev_verme <> wa-verme.
          APPEND wa TO itab1.
    else.
          APPEND wa TO itab2.
    endif.
    lv_prev_lgpla = wa-vlpla.
    lv_prev_verme = wa-anfme.
    Endloop.
    But it contains,
    516.000  EA  300     0149A                                  400     3013
    in table ITAB2 which I don’t want.
    Points rewarded soon.
    Regards,
    Ronn

    Dear Ronny,
    i am gining the solution below.But would request you to change your ITAB STRUCTURE LIKE THIS BEFORE USING THE CODE
    VERME LGPLA
    252.000 EA 300 0149A  0149 410
    276.000 EA 300 0149A  0107 410
    516.000 EA 300 0149A  3013 400
    528.000 EA 300 0149A  3013 400
    528.000 EA 300 0149A  3013 400
    528.000 EA 300 0149A  3013 400
    528.000 EA 300 0149A  3013 400
    528.000 EA 300 0149A  3013 400
    528.000 EA 300 0149A  3013 400
    then do as follows.
    SORT ITAB BY LGPLA VERME.
    LOOP AT ITAB INTO WITAB.
    W_INDEX = SY-TABIX.
    here take all the abOve fields in temp fieds.
    LW_VERME = WITAB-VERME..AND SO ON.
      AT END OF LGPLA.
       MOVE: all LW fields to work area of ITAB1
       APPEND work area of ITAB1 TO ITAB1.
       DELETE ITAB INDEX W_INDEX
      ENDAT.
    ENDLOOP.
    Basically what u r doing here is thet u r using processing event.
    So whenerv VERME changes this event will be triggered.
    Just try this out...something like this only will be he logic.
    Please let me know further

  • How to delete records from dynamic internal table.

    Hi Experts,
    Need urgent help!!!
    Issue is with Dynamic internal tables.
    Below is code written by me :
    FORM select_query USING Lw_tabnam
                      TYPE  t682i-kotabnr.
      DATA :  lw_line  TYPE REF TO data,
              lw_line1 TYPE REF TO data.
        CREATE DATA Lw_line    TYPE (lw_TABNAM).
        ASSIGN      Lw_line->* TO   <WA_tbl>.
        CREATE DATA LW_LINE    TYPE STANDARD TABLE OF (Lw_tabnam)
                               WITH NON-UNIQUE DEFAULT KEY.
        ASSIGN      Lw_line->* TO <TBL>.
        SELECT * FROM  (Lw_tabnam)
                 INTO CORRESPONDING FIELDS OF TABLE <TBL>
                 WHERE (t_keys).
    Endform.
    code is working fine.
    here even the table name and where condition are dynamic,everything is fine upto this point.
    Now i have to delete some record from <TBL> based on some conditons.
         for ex : ( here lc_fieldname is KUNNR)
          loop at t_kunnr.
              lw_tabix = sy-tabix.
            Read table <tbl>
                    with key (lc_fieldname) = t_kunnr-kunnr ASSIGNING <wa_tbl>.
            If sy-subrc = 0.
            *Delete
            delete <tbl> from <wa_tbl>
    delete <tbl> index  lw_tabix.
            Endif.
         Endloop.
    The above delete statement doesn't work ,even we can't use index as it gives a syntax error " something related to "index is not allowed in standard table or hash table.
    Can you help me ab't how to delete records in Dynamic internal table?
    Other option that i am thinking of is to create a static table of type dynamic table.
    means, data itab type standard table of <tbl> .I know the syntax is wrong ,however is there any way to do this?
    Thanks in advance ,
    If you have any suggestion ab't this then do let me know.
    bye,
    Gaurav.

    Hi
    I wrote this code and it works fine:
    DATA LW_TABNAM(10) VALUE 'LFA1'.
    DATA : LW_LINES TYPE REF TO DATA,
           LW_LINE  TYPE REF TO DATA.
    FIELD-SYMBOLS: <TABLE> TYPE TABLE,
                   <WA>    TYPE ANY.
    CREATE DATA LW_LINES TYPE TABLE OF (LW_TABNAM)
    WITH NON-UNIQUE DEFAULT KEY.
    ASSIGN LW_LINES->* TO <TABLE>.
    CREATE DATA LW_LINE TYPE (LW_TABNAM).
    ASSIGN LW_LINE->* TO <WA>.
    DO 10 TIMES.
      APPEND INITIAL LINE TO <TABLE>.
    ENDDO.
    SY-TABIX = 4.
    DELETE <TABLE> INDEX SY-TABIX.
    WRITE SY-SUBRC.
    I hope it help you
    Max

  • How to search records in a standard table with * ?

    Hi everyone,
    Can anyone tell me how to search records in a standard table with * ?
    That is, in screen if user type * abc * for searching the records in which the field MC_STEXT contains 'abc'. What the code should be? How to complete the code below?
      SELECT SINGLE objid FROM p1000  INTO p1000-objid,
      WHERE MC_STEXT = ? .
    Thanks!

    Hi
    There are several way to do that, probably just as some guys wrote the easier way is to use LIKE in WHERE condition and the sign % instead of *:
    V_STRING = '%ABC%'.
    SELECT SINGLE objid FROM p1000 INTO p1000-objid,
    WHERE MC_STEXT LIKE V_STRING.
    U can also use a range (just like select-options):
    RANGES: R_MC FOR P1000-MC_STEXT.
    R_MC-LOW = 'ABC'.
    R_MC(3) = 'ICP'.
    APPEND R_MC.
    SELECT SINGLE objid FROM p1000 INTO p1000-objid,
    WHERE MC_STEXT IN R_MC.
    Max

  • How to display records in jsp

    i have 100 records can anybody tell me how i display records 10 at atime in jsp & by clicking the next button another 10 records displays in the same jsp. How i can do that thing.

    You have to implement a page breake yourself.
    Simple scenario would be to store a page number into a session:
    session.setAttribute("page", selectedPage)
    every time user clicks on a next page link
    When displaying the record read the page and display only those which should be on the page
    Integer selectedPage = session.getAttribute("page")
    if (selectedPage == null) selectedPage = 1;
    //display code goes here

  • How to insert data into the mysql table by giving as a text file

    Hi,
    Any one know's how to insert data into the mysql table by giving as a text file as the input in JSP.Please respond ASAP.
    Thanks:)

    At least you can try StringTokenizer to parse your text files. Or download a text JDBC driver to parse your files, for instance, HXTT Text(www.hxtt.net) or StelsCSV(www.csv-jdbc.com).

  • How to upload records into Infotype 382(Awards)

    Hi,
      Could anyone suggest me how to upload records into infotype 382(Awards) of an Employee.
    For solutions points rewarded.
    Regards,
    Radhu

    Hi
    you can develop a <b>BDC</b> for transaction <b>PA30</b>
    using infotype 382.
    (or)
    can upload using batch input recording in <b>LSMW</b>.
    regards,
    Thangesh

  • How to use order by in stored procedure base block?

    How to use order by in stored procedure base block? I need to change order by dynamically

    Use SET_BLOCK_PROPERTY('BLOCK_NAME',ORDER_BY,'COLUMN_NAME1, COLUMN_NAME2');

  • How to display records of int. table in list tree?

    friends,
       i want to display a list tree using fm RS_TREE_CONSTRUCT and RS_LIST_DISPLAY.
    this is the data that i have to display
    Matnr      doc no.        Stock qty.     Age
    1     45601236           100          55
    1     45601237           10          54
    1     45601238        11          53
    1     45601239           101          52
    now, only the first record should be displayed with a + symbol... when the user clicks the + symbol, then the node has to expand and display the other 3 records pertaining to that material...how to display 4 fields of an internal table in one line and like that, 3 records...i have seen some threads relating to this, but they all display only one value in the child node..how to  display multiple fields like this?
    please address this functinality using FMs alone, as i am not exposed to objects :!
    thanks all
    Sathish. R

    satish,
    Before passing the Node name ,Concatenate all the values of record in one string and pass that string as node name.Now it will work.
    To develop the basic logic  simple program name is :
    "SAPSIMPLE_TREE_CONTROL_DEMO"  In this program use above logic.
    Don't forget to reward if useful.
    Don't forget to reward if useful

  • How to display records from base table as well as some other table?

    Hello expert,
    I have a requirement to develope a form described below:
    One control block and database block.
    DB block  is based on table T1 (USER, Table_name, Column_name, ACCESS);
    In control block, there are three fields,
    User, Table user will enter , and DB block will query based on control block fields(user, table_name).
    In table it is not necessary that all the columns of any table will be given.
    suppose there is a Table X consist of 10 column.
    Initially user give access for all the 10 columns through this form.
    if we query for user , table, all the record will come from table T1.
    now consider the case, when access given to table X number of columns were 10. after that 2 new columns added later.
    now there is no info of added column in table T1. i want if user query DB block, these newly added column must display in DB Block.
    Please help me out.
    Thanks
    Dhirender

    >i want if user query DB block, these newly added column must display in DB Block.
    You need to modify your form and add the two columns as base table items. Forms does not add two base table items by itself.

  • How to display multiple data from different table in one table? please help

    Hi
    I got sun java studio creator 2(the separate installation not the one in the net beans)....
    My question is about displaying data that have been taken from the database.... I know how to display data in a table(just click on the table "bind data" )... but my question is that:
    when i want to use a sql statement that taken the data from different table...
    how can i display that data in the table(that will be shown in the web) ??? when i click bind data on the table i can only select one table i can't select more than one....
    Note:
    1) i'm using the rowset for displaying the data in the table, since the sql statement is depending on a condition(i.e. select a from b where c= ? )...
    2) i mean by different table is that( i.e. select a from table1,table2 )..
    thanks in advance...

    Hi,
    937440 wrote:
    Hi every one, this is my first post in this portal. Welcome to the forum!
    Be sure to read the forum FAQ {message:id=9360002}
    I want display the details of emp table.. for that I am using this SQL statement.
    select * from emp where mgr=nvl(:mgr,mgr);
    when I give the input as 7698 it is displaying the corresponding records... and also when I won't give any input then it is displaying all the records except the mgr with null values.
    1)I want to display all the records when I won't give any input including nulls
    2)I want to display all the records who's mgr is null
    Is there any way to incorporate to include all these in a single query..It's a little unclear what you're asking.
    The following query always includes rows where mgr is NULL, and when the bind variable :mgr is NULL, it displays all rows:
    SELECT  *
    FROM     emp
    WHERE     LNNVL (mgr != :mgr)
    ;That is, when :mgr = 7698, it displays 6 rows, and when :mgr is NULL it displays 14 rows (assuming you're using the Oracle-supplied scott.emp table).
    The following query includes rows where mgr is NULL only when the bind variable :mgr is NULL, in which case it displays all rows:
    SELECT     *
    FROM     emp
    WHERE     :mgr     = mgr
    OR       :mgr       IS NULL
    ;When :mgr = 7698, this displays 5 rows, and when :mgr is NULL it displays 14 rows.
    The following query includes rows where mgr is NULL only when the bind variab;e :mgr is NULL, in which case it displays only the rows where mgr is NULL. That is, it treats NULL as a value:
    SELECT     *
    FROM     emp
    WHERE     DECODE ( mgr
                , :mgr, 'OK'
                )     = 'OK'
    ;When :mgr = 7698, this displays 5 rows, and when :mgr is NULL, it displays 1 row.

  • How to display 'List' of objects in table format

    I am trying to display bunch of records in the table format.
    I have the List of bean object populated with table datas.
    Currently the code is working fine ,if I tend to display one record.I am wondering how to display all the records.
    I know theres a 'Fieldloop'.If thats the one please explain with example.

    iterate the object list using field loop. eg. is given below
    [      <Field name='MatchTable'>
    <Display class='SimpleTable'>
    <Property name='columns'>
    <List>
    <String>title</String>
    </List>
    </Property>
    </Display>
         <FieldLoop for='name' in='userlist'>
    <Field name='username'>
    <Display class='Label'>
    <Property name='labels'>
    <ref>name</ref>
    </Property>
    </Display>
    </Field>
         <FieldLoop>
         </Field>

  • How to insert records into an Excel file

    i was wondering if anyone knows how to insert records from a pl/sql block straight into an excel file

    try with spool or UTL_FILE...
    Re: CSV into Oracle and Oracle into CSV
    SQL> spool c:\test1.csv
    SQL> select substr(str,2,length(str)-3) from (select regexp_replace(column_value,'\s*<[^>]*>[^>]*>',',') str from table(xmlsequence(cursor(select * from test_emp))));
    SUBSTR(STR,2,LENGTH(STR)-3)
    9999,fredi&apos;s,CLERK,2345,10-OCT-06,1250,123,20
    4567,STEWART,ANALYST,3456,02-APR-07,3200,215,30
    2345,Cockrel,CLERK,7566,23-JAN-82,800,30
    3 rows selected.
    SQL> spool off;

  • How to display record in column mode?

    Hi,
    I have difficulty in displaying record in column mode.
    Example: I have CALENDAR table with column DATECOL
    CALENDAR
    DATECOL DATE
    Data in CALENDAR table is follow : 1/1/06, 2/1/06, 3/1/06, 4/1/06, 5/1/06, 6/1/06
    How to create SELECT statement so result will be follow:
    DATECOL 1 2 3 4 5 6
    Any advise from you ?
    Regards

    Hi,
    Try this:
    DECLARE
    z_result VARCHAR2(2000) := ' ';
    CURSOR c1 IS
    SELECT DATECOL
    FROM CALENDAR;
    BEGIN
    FOR i IN c1 LOOP
    z_result := z_result || TO_CHAR(i.DATECOL,'DD') || ' ';
    END LOOP;
    DBMS_OUTPUT.ENABLE;
    DBMS_OUTPUT.PUT_LINE('DATECOL ' || z_result);
    END;
    Peter D.

  • How to import data into a Z table from excel file?

    hi,
    i have a custom created Z table into which i want to import some data from an excel file. which function can i use to do so because SE16 allows me to insert data only one by one via a data entry screen. this is time consuming. i want to import data from excel file so that its faster.

    HI,
    this program uploads data from excel and modifies ztable,(inserts records into ztable), check this and modify according to ur requirement)
    This program uploads material number from excel sheet and does
    ******modifications to material number if required by the user
    ******and updates the table zmatnr with new material against the old material number
    REPORT  zmat_no message-id zebg.
    TYPE-POOLS  truxs.
    TABLES:zmatnr.
    DATA : itab LIKE alsmex_tabline OCCURS 0 WITH HEADER LINE.
    DATA row LIKE alsmex_tabline-row.
    data : g_matnr like mara-matnr.
    data : count type i.
    data : itab_count type i.
    data : gi_final like zmatnr occurs 0 with header line.
    *data : begin of gi_final occurs 0,
          mat_old like mara-matnr,
          mat_new like mara-matnr,
          end of gi_final.
    ***********************Selection Screen*************************
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    PARAMETER : pfname LIKE rlgrap-filename OBLIGATORY.
    select-options : records for count.
    SELECTION-SCREEN END OF BLOCK b1.
    *********************At Selection Screen*************************
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR pfname.
      PERFORM search.
    START-OF-SELECTION.
    perform process.
    form process.
      CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
        EXPORTING
          filename                = pfname
          i_begin_col             = 1
          i_begin_row             = 2
          i_end_col               = 12
          i_end_row               = 65000
        TABLES
          intern                  = itab
        EXCEPTIONS
          inconsistent_parameters = 1
          upload_ole              = 2
          OTHERS                  = 3.
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      describe table itab lines itab_count.
       row = 1.
      loop at itab.
        if itab-row <> row.
          append gi_final.
          clear gi_final.
        endif.
        case itab-col.
          when '1'.
          CLEAR G_MATNR.
          gi_final-OLD_MATNR = itab-value.
          CONCATENATE 'NEW' gi_final-old_matnr INTO itab-value.
            gi_final-new_MATNR = itab-value.
          endcase.
        row = itab-row.
      append gi_final.
      clear gi_final.
      endloop.
      CALL FUNCTION 'PROGRESS_INDICATOR'
      EXPORTING
        I_TEXT  = 'File Has Been Successfully Uploaded from Workstation ' .
      if not gi_final[] is initial.
        if not records-low is initial .
          if not records-high is initial.
            records-high = records-high + 1.
            DESCRIBE TABLE gi_final LINES count.
            IF records-high < count.
              DELETE gi_final FROM records-high TO count.
            ENDIF.
            IF records-low <> 1.
              IF records-low <> 0.
                DELETE gi_final FROM 1 TO records-low.
              ENDIF.
            ENDIF.
          endif.
        endif.
      endif.
      IF NOT GI_FINAL[] IS INITIAL.
        CALL FUNCTION 'PROGRESS_INDICATOR'
         EXPORTING
           I_TEXT  = 'Processing zmatnr table'
           I_OUTPUT_IMMEDIATELY = 'X'.
          if itab_count <> count.
             message i000 with 'records are not matching'.
             exit.
          else.
             modify zmatnr from table gi_final.
             message i000 with 'data base table modified successfully'.
          endif.
      endif.
    endform.
    *&      Form  search
          text
    -->  p1        text
    <--  p2        text
    FORM search .
      CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
        EXPORTING
          static    = 'X'
        CHANGING
          file_name = pfname.
    ENDFORM.                    " search
    regards
    siva

Maybe you are looking for

  • How do you print on the back of a greeting card in Photo Creations

    I want to put pictures/text on the back of a greeting card created in Photo Creations, how do I do that? This question was solved. View Solution.

  • What charger to get for iPhone?

    Hi! Recently I bought iPhone from USA, it came with american wall charger, it seems to me it's not original. I live in Europe and want to get a replacement, but I can't find original one for reasonable price. My question - can I use non-original char

  • Syncing iCal and iPhone

    My MacBook and iPhone are not syncing properly,especially in iCal...there's intermittent syncing. This started happening after I installed Lion. Does anyone have any suggestions?

  • Recently started having issues with WiFi

    Hello everyone, Recently I started having serious issues with Wifi. I fixed it kind of by turning off iTunes iCloud backup, but generally the signal is low. As an iOS 5 tester in the Apple Developer program, I tested it for months on my iPod without

  • Stuck in post with NX8600GTS

    Hi there, I just finished building a new system and everything works fine, goes to windows, etc. until I insert the NX8600GTS card into the PCI-E slot. Once the card is inserted, the it no longer boots into windows and gets stuck in post at Auto-Dete