How to display records of a table
I'm using PNP LDB in my report and I'd like to display how many records I have so I wrote this code
If i_tab is not initial.
DESCRIBE TABLE i_tab LINES counter.
WRITE counter .
Endif.
but I'm getting wrong result. Can anybody help please.
Hi muralikrishna kaipha,
I can't believe this.
TOP-OF PAGE page is triggered before the first line is written to a page. That means TOP-OF PAGE is triggered by first write statement in program. INITIALIZATION is normally not used to write anything.
You must avoid to write more than one page during TOP-OF PAGE event because this will trigger TOP-OF PAGE recursively endless.
Think about it.
Regards,
Clemens
Similar Messages
-
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. Rsatish,
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 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,
JunHi 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 -
How to change records in standard tables ?
how to change records in standard tables ?
HI,
If you are asking from program..Then you can use BDC or BAPI to update the records in teh standard tables..
OR
use the corresponding tcode to update the record
Thanks
Naren -
How to update Records from Internal table to u2018Zu2019 table?
Hi Friends,
How to update Records from Internal table to u2018Zu2019 table.
I have records in Internal table , that records want to update on u2018Zmarau2019 Table.
( my internal table & u2018 Zu2019 table structures are same.)
Thanking you.
Regards,
SubashHi,
loop at internal table.
modify <Z- table > from values < internal table Workarea>.
if sy-subrc = 0.
COMMIT work.
else.
ROLLBACK waork.
endif.
endloop.
or
UPDATE <Z- table > from table < internal table Workarea>.
if sy-subrc = 0.
COMMIT work.
else.
ROLLBACK waork.
endif.
Prabhudas -
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 display icon status in table control
hi, i trying to display icon in table control its not displaying
i given below statment.
DATA: BEGIN OF WA_MARA,
ICON1(4) TYPE C,
END OF WA_MARA.
INCLUDE <list>.
MOVE ICON_GREEN_LIGHT TO IT_MARA-ICON1.
APPEND IT_MARA..
when i debugging it display green icon but after run the program its display ' @08@ ' in table control.
how to display green icon in table control help me.Hi,
check the link:
Table control in custom infotypes -
How to make records to the table TRFCQIN
hi all,
anyone can tell me
how to make records to the table TRFCQIN
regardsHi Wanna,
Write a module pool program to enter record into table TRFCQIN.
Take fields to which u want to make entries in module pool.
Use insert command to append data in table TRFCQIN.
Refer this code :
CASE OK_CODE_101.
WHEN 'SAV1'.
TRFCQIN-QNAME = 'XYZ'.
TRFCQIN-QCOUNT = "Screen field name at which user will enter value
INSERT TRFCQIN.
if sy-subrc <> 0.
message e007.
else.
clear TRFCQIN.
clear ok_code_101.
endif.
endcase.
Reward points if helpful.
Regards,
Heamnt -
How to display images in a table column?
Hi,
In a VC model, I have to display images in a table column for each record found.
How can this be done?
Regards,
NitinHi Nitin,
It can be done by adding to the table the Image control (can be found under Advanced Controls in the Compose panel).
In the URL property (in the Configure panel of the Image control) you can define any expression that will return the image URL. For example:
="http://hosting.site.url/"&@ImageNameField
Regards,
Udi
Edited by: Udi Cohen on Jun 11, 2008 1:39 PM -
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 ?
RegardsHi,
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 update Records of SAP table from .CSV file
Hi,
I have written a code which takes a data from (,) delimited CSV file and adds it into the Internal table.
Now I want to update the all fields in SAP table with the Internal table.
I want to use Update statement.
Update <table Name> SET <field needs to update> WHERE connditon.
I don't want to iterate through thousand on record in sap table to check the where condition.
Could you please tell me how to do it.Hi. I thing you will not workaround the iterating of the internal table.
You can pre-load all the records into another internal table
check lt_csv[] is not initial. " important, otherwise next select would read all records of the table
select .... into lt_dbitab for all entries in lt_csv where key-fieds = lt_csv-key_fields...
check sy-subrc eq 0 and lt_dbitab[] is not initial.
then do in-memory update of the it_dbitab
loop at it_dbitab assign <fs>.
read table lt_csv assign <fs_csv> with key ... " lt_csv should be sorted table with key, or you should try to use binary search
if sy-subrc eq 0.
...change required lt_dbitab fields: <fs>-comp = <fs_csv>-comp...
endif.
endloop.
ant then you can do mass-update
update dbtab from table lt_dbitab.
From performance view, this solution should be much faster than iterating lt_csv directly and updating every single database record
Br
Bohuslav -
How to update records in a table based on user selection..
Hi all,
This time the above doubt is totally based on the logic of coding which I tried a lot but didn't get any solution. so atlast I come to sdn site.
please help..
The requirement is like that I have a table with 6 fields (1 primary key and other are nonkeys). If the user inputs some values in the fields on the screen, then a row will be added in the table. Upto this i have done well. but when the user want to change some value in the existing row of the table my program unable to do so. Because I couldn't get any logic to do that as there are 5 nonkey fields, so if any one field is modified then the respective row should be selected first based on the user selection and then it should be updated.
At this point I could not get any idea as it may take a lots of if conditions (I guess) to reach to that particular row.
Please help..
thanks ,
sekharHi Sekhar,
I am afraid, the whole design of your program is wrong, let me explain
Let us say you have two rows(5 non key fields) that the user wants to update and the data in these five non key fields are identical and in your program you are getting a number(which is the key) using a number range object. So you will have two entries in the table for the same data.
And on the update page when the user enters the non key fields, how will the program know(or for that matter any one of us) which record to pick, if you have two identical books and if asked for a book wouldn't you ask which one among these two do you want?
Possible Solution: Identify a possible key maintaining the integrity of the data, that is a combination of the non key fields which will help you identify a unique row and make these fields as key fields in the table.
A more costly solution(if you do not want to change the non key field keys to key fields) would be to, adding a check(using select statement) to see if the non key fields combination already exists in the Z table before inserting a record into the table.
If yes, throw a message to the user and just update the values in the table, else insert the record.
Another solution would be to, use the non key fields to generate a key(using some logic) and using this instead of the number range object.
regards,
Chen -
How to display name of the table and the description and the table type
Hi,
Can you people tell me how to display the name of the table and the description and the table type (View, structure, etc...) used in the program.
I want to display in a list.
Kind Regardsuse this program
TABLES : TSTC, tstct.
TABLES : DD03l, DD02l.
DATA : Program like sy-repid.
DATA : BEGIN OF I_FINAL OCCURS 0,
tabname LIKE dd02l-tabname,
TABCLASS LIKE dd02l-tabCLASS,
TEXT LIKE DD02T-DDTEXT,
END OF I_FINAL.
DATA : BEGIN of ITAB Occurs 0,
name like dd02l-tabname,
END OF ITAB.
DATA : TCD(100) TYPE C.
DATA : var1 LIKE dd02l-tabname.
DATA : DESC LIKE TSTCT-TTEXT.
selection-screen skip.
SELECTION-SCREEN : BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.
PARAMETERS : r1 RADIOBUTTON GROUP r DEFAULT 'X'.
Parameters : Tcode like sy-tcode.
selection-screen skip.
PARAMETERS : r2 RADIOBUTTON GROUP r.
Parameters : Prog like sy-repid.
SELECTION-SCREEN END OF BLOCK b2.
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE text-001.
select-options : Type for dd02l-tabclass .
SELECTION-SCREEN END OF BLOCK B1 .
at selection-screen.
if r1 = 'X' and Tcode is initial.
message e001(00) with 'Enter Transaction Code' .
elseif r2 = 'X' and Prog is initial.
message e001(00) with 'Enter Program Name' .
endif.
START-OF-SELECTION.
if r1 = 'X'.
Prog = ' '.
select single * from TSTC where tcode = tcode.
if sy-subrc = 0.
program = TSTC-PGMNA.
select single TTEXT from tstct into desc where tcode = tcode and SPRSL = 'E'.
else.
Write :/ 'Invalid Transaction Code'.
exit.
endif.
elseif r2 = 'X'.
Tcode = ' '.
program = Prog.
endif.
CALL FUNCTION 'GET_TABLES'
EXPORTING
PROGNAME = Program
TABLES
TABLES_TAB = itab.
if itab is initial.
skip.
skip.
skip.
skip.
skip.
WRITE :/40 'No Data Found' color 6 INTENSIFIED OFF.
ELSE.
PERFORM : categorize.
endif.
END-OF-SELECTION.
LOOP AT I_FINAL.
WRITE :/4 I_FINAL-tabname COLOR 2 INTENSIFIED OFF NO-GAP HOTSPOT ON, 35 I_FINAL-TABCLASS COLOR 2 INTENSIFIED OFF NO-GAP,
50 I_FINAL-TEXT COLOR 2 INTENSIFIED OFF NO-GAP.
ENDLOOP.
AT LINE-SELECTION.
TCD = SY-LISEL.
var1 = TCD+3(30).
set parameter id 'DTB' FIELD VAR1.
call transaction 'SE11' and skip first screen.
TOP-OF-PAGE.
WRITE :/45 'TABLE DETAILS RELATED TO THE TRANSACTION CODE' COLOR 7 .
WRITE :/2 'DATE : ' COLOR 1, SY-DATUM COLOR 1 INTENSIFIED OFF NO-GAP.
WRITE :/2 'TRANSACTION CODE : ' COLOR 1, Tcode COLOR 1 INTENSIFIED OFF NO-GAP.
WRITE :/2 'TCODE DESCRIPTION : ' COLOR 1, desc COLOR 1 INTENSIFIED OFF NO-GAP.
WRITE :/2 'PROGRAM NAME : ' COLOR 1, PROGRAM COLOR 1 INTENSIFIED OFF NO-GAP.
SKIP 1.
WRITE :/1(140) SY-ULINE.
WRITE :/4 'TABLE NAME' COLOR 5 INTENSIFIED OFF NO-GAP,35 'TABLE TYPE' COLOR 5 INTENSIFIED OFF NO-GAP,
55 'DESCRIPTION' COLOR 5 INTENSIFIED OFF NO-GAP.
WRITE :/1(140) SY-ULINE.
*& Form categorize
text
--> p1 text
<-- p2 text
FORM categorize .
SELECT dd02ltabname dd02ltabCLASS DD02T~DDTEXT
FROM dd02l INNER JOIN DD02T ON dd02ltabname = dd02Ttabname
INTO TABLE I_FINAL
FOR ALL ENTRIES IN itab
WHERE DD02L~TABNAME = ITAB-NAME AND TABCLASS IN TYPE AND DDLANGUAGE = 'E'.
if sy-subrc <> 0.
skip.
skip.
skip.
skip.
skip.
WRITE :/40 'No Data Found' color 6 INTENSIFIED OFF.
endif. -
How to add record in Qualified table using MDM Java API
Hi experts,
I am trying to add a record into a Table.
but I am facing the problem in setFieldValue method.
//Getting Field-ID to pass in setFieldValue() method.
FieldId[] fields = new FieldId[6];
fields[0] = repSchema.getFieldId("GTINs", "Description");
fields[1] = repSchema.getFieldId("GTINs", "Unit_Descriptor");
fields[2] = repSchema.getFieldId("GTINs", "GTIN");
fields[3] = repSchema.getFieldId("GTINs", "Alternate_Item_Classifications");
fields[4] = repSchema.getFieldId("GTINs", "Country_Of_Origin");
fields[5] = repSchema.getFieldId("GTINs", "Bar_Coded");
Record rec = RecordFactory.createEmptyRecord(mainTableId);
rec.setFieldValue(fields, );
but I am not getting how to assign the value to these fields using MDMvalue Interface.
Can anyone provide me the code sample or Code flow so that I can do this.
Plz help me it'll be great help for me.
Thanks
Tarun
Edited by: Tarun Sharma on Feb 4, 2008 11:39 AM
==========================================================================================
Hi Gurus
I found the way to add the MDMValue in setFieldValue Method.
we can set like this:
setFieldValue(<fieldId object like fieldId[], <MdmValue like this> new StringValue("ABC"));
Now I am facing problem in adding value to lookup flat table.
According to the setFieldValue method we can assign the loookup like this:
setFieldValue(<fieldId[0]>, new LookpValue(<here we have to pass the recordID of lookup table>);
so I want to know how I can pass the recordId of lookup table here.
Please suggest.
Thanks
Tarun Sharma
Edited by: Tarun Sharma on Feb 4, 2008 3:15 PM
Edited by: Tarun Sharma on Feb 4, 2008 3:25 PM
Edited by: Tarun Sharma on Feb 8, 2008 6:58 PMHi Andrea,
I tried your suggestion but now i am getting Type Mismatch Error.
Please suggest me what I can do?
//TableId for Lookup[Flat].
TableId lookupTableId = repSchema.getTableId("Return_Goods_Policies");
FieldId[] ReturnGoodsPolicyTableIdFields = new FieldId[1];
ReturnGoodsPolicyTableIdFields[0] = repSchema.getFieldId("Return_Goods_Policies", "Name");
Record recLookup = RecordFactory.createEmptyRecord(lookupTableId);
try{
recLookup.setFieldValue(ReturnGoodsPolicyTableIdFields[0], new StringValue("New_Brand"));
}catch(Exception ex){
System.out.println(ex);
//Creating Record in Qualified Table - Request Details
CreateRecordCommand createLookupcommand = new CreateRecordCommand(simpleConnection);
createLookupcommand.setSession(session);
createLookupcommand.setRecord(recLookup);
createLookupcommand.execute();
//Getting the recordId of Lookup record.
RecordId lookupRecordId = createLookupcommand.getRecord().getId();
//Table Id for Qualified table.
TableId qualifiedTableId = repSchema.getTableId("Ext_Hardlines");
FieldId[] ExtHardlinesFields = new FieldId[3];
ExtHardlinesFields[0] = repSchema.getFieldId("Ext_Hardlines", "Name");//Text
ExtHardlinesFields[1] = repSchema.getFieldId("Ext_Hardlines", "Pieces_Per_Trade_item");//Integer
ExtHardlinesFields[2] = repSchema.getFieldId("Ext_Hardlines","Return_Goods_Policy");
Record recQualified = RecordFactory.createEmptyRecord(qualifiedTableId);
try{
recQualified.setFieldValue(ExtHardlinesFields[0], new StringValue("Qualified Value"));
recQualified.setFieldValue(ExtHardlinesFields[1], new StringValue("Qualified Description"));
recQualified.setFieldValue(ExtHardlinesFields[2], new LookupValue(lookupRecordId));
}catch(Exception ex){
System.out.println(ex);
//Creating Record in Qualified Table - Request Details
CreateRecordCommand createQualifiedCommand = new CreateRecordCommand(simpleConnection);
createQualifiedCommand.setSession(session);
createQualifiedCommand.setRecord(recQualified);
createQualifiedCommand.execute(); I am getting this Type match here, but i m not getting what mistake i did.
RecordId qualifiedRecordId = createQualifiedCommand.getRecord().getId();
//Adding to Main Table
TableId mainTableId = repSchema.getTableId("GTINs");
FieldId[] gtinsFields = new FieldId[1];
gtinsFields[0] = repSchema.getFieldId("GTINs","Ext_Hardlines");
Record recMain = RecordFactory.createEmptyRecord(mainTableId);
//Adding the new record to Qualifed Lookup value and setting the Yes Qualifiers
QualifiedLookupValue qualifiedLookupValue = new QualifiedLookupValue();
qualifiedLookupValue.createQualifiedLink(qualifiedRecordId);
try{
recMain.setFieldValue(gtinsFields[0], new QualifiedLookupValue(qualifiedLookupValue));
}catch(Exception ex){
System.out.println(ex);
CreateRecordCommand createCmd = new CreateRecordCommand(simpleConnection);
createCmd.setSession(session);
createCmd.setRecord(recMain);
createCmd.execute();
Could you help me out?
Thanks
Tarun
Maybe you are looking for
-
Java application crashes due to some problem in native code
Hi All I have a Java application that calls APIs in a 3rd party DLL(I don't have access to its source code or logs) through my VC++ DLL(Win32) that acts as the wrapper DLL. The Application has many functionalities and is based on multithreading (both
-
How can I get a new window to open in Front of the current window?
There seems to be a related setting for new Tabs, but not for new windows. I fail to see why many people would want to open a new window, but then not want to use it right away. It seems the default should be open the new one in front. Thanks Applica
-
Cannot use jstl tag for jsp page which generated from Human Task
Hi Plz help me. I have tried to using jstl in jsp which generate from Human Task and I deploy it to server( by ant on Jdev ) to see task detail in Oracle Worklist application. But when i submit task and then I access to worklist to see task detail, t
-
As a membership secretary I receive about 200 registrations over a two month period. How can I scan them in and index them? Is there a software that will work with my CanoScan 8800F that will facilitate this? Thanks, Bill
-
Updating iPhones on public computers
I recently updated my iPhone on a public computer. Thinking about it now, I'm worried the update may have left unwanted personal data on the public computer. Is this possible? What type of data could a backup expose?