Lexical parameter in SELECT INTO (Very Urgent)
I have to write a query which takes some value & put it into a variable. but i have to use lexical parameter in my query.
e.g
select sal into v_sal
from emp
where deptno=20 &p_lexpara;
the form amd report builder do not compile this syntax & give error on &p_lexpara
Pl. help me out
Thanks
In Report Builder you can not use clause INTO.
Correct one is:
select sal
from emp
where deptno=20 &p_lexpara
In Forms you can not use lexical parameter but you can create lexical parameter in CREATE_GROUP_FROM_QUERY. So you can create record group in this way and then use lexical parameter like:
DECLARE
rg_name VARCHAR2(40) := 'Salary';
rg_id RecordGroup;
errcode NUMBER;
BEGIN
** Make sure group doesn't already exist
rg_id := Find_Group( rg_name );
** If it does not exist, create it and add the two
** necessary columns to it.
IF Id_Null(rg_id) THEN
rg_id := Create_Group_From_Query( rg_name,
'select sal from emp where deptno=20 '||p_lexpara;
END IF;
** Populate the record group
errcode := Populate_Group( rg_id );
END;
and then with Get_Group_Number_Cell you can retrive values of SAL e.g something like:
status := Populate_Group( rg_id );
*/ *** Zero status is success*** /
IF status = 0 THEN
match := Get_Group_Number_Cell('Salary.SAL',1);
Message('The Salary is '||to_CHAR(match));
ELSE
Message('Error creating query record group.');
RAISE Form_Trigger_Failure;
END IF;
Similar Messages
-
Getting Exception in the select clause - Very Urgent
Hi,
I have given the below statement but it is showing the exception.
SELECT *
FROM (lv_tab_name)
INTO CORRESPONDING FIELDS OF TABLE <fs_1>.
If I execute the above select statement it is showing the below exception.
Exception CX_SY_NO_HANDLER triggered.
An exception with the type CX_SY_OPEN_SQL_DB occurred.
It is working very well if I mention the few field names.
Please let me know the possible reasons.
Thanks,
SuvinThanks much for your quick response.
I have tried with what you mentioned but it is not working.
Please find my code below.
*Declarations
DATA: ddfields TYPE STANDARD TABLE OF ddfield.
DATA: ls_ddfields TYPE ddfield.
DATA: lt TYPE lvc_t_fcat.
DATA: ls TYPE lvc_s_fcat.
DATA: lv_tab_name TYPE dd02l-tabname.
Data References
DATA: lt_data TYPE REF TO data.
DATA: new_line TYPE REF TO data.
Field Symbols
FIELD-SYMBOLS: <fs_1> TYPE ANY TABLE.
FIELD-SYMBOLS: <fs_data> TYPE REF TO data.
FIELD-SYMBOLS: <fs_2> TYPE ANY,
<l_field> TYPE ANY.
Get the fields of the database table, here i am passing the table name
CALL FUNCTION 'DD_NAMETAB_TO_DDFIELDS'
EXPORTING
KEYFIELDS = 'X'
NULLABLE = 'X'
tabname = lv_tab_name
TABLES
ddfields = ddfields.
LOOP AT ddfields INTO ls_ddfields.
ls-fieldname = ls_ddfields-fieldname.
APPEND ls TO lt.
ENDLOOP.
*Assigning Field-Symbol to our dynamic internal table
ASSIGN lt_data TO <fs_data>.
Calling the method CREATE_DYNAMIC_TABLE
CALL METHOD cl_alv_table_create=>create_dynamic_table
EXPORTING
it_fieldcatalog = lt
IMPORTING
ep_table = <fs_data>
EXCEPTIONS
generate_subpool_dir_full = 1
OTHERS = 2.
IF sy-subrc EQ 0.
ASSIGN <fs_data>->* TO <fs_1>.
Create a work area for the dynamic table.
CREATE DATA new_line LIKE LINE OF <fs_1>.
A field-symbol to access that work area
ASSIGN new_line->* TO <fs_2>.
ENDIF.
Selecting the Data from the respective table.
SELECT *
FROM (lv_tab_name)
INTO CORRESPONDING FIELDS OF TABLE <fs_1>.
Please advise..it is very urgent.
Thanks,
Suvin -
Lexical parameter in select statement showing null or column name in xml tag instead of value
Hi,
i am using lexical parameter in report select statement as
Select &order value from oe_order_headers_all a where order_number ='7889'
and setting : order:='a.order_number'; in after parameter form trigger.
lexical parameter intial value set to null
when i run this report , its not showing order number in output ,its showing null or a.order_number as text.
Please help.try this
Select &order data_show
from oe_order_headers_all
where order_number ='7889'
and setting :order:='order_number'; in after parameter form trigger.
Hope this helps
Hamid -
Generation of XML Tags for columns in Lexical parameter in select query
Hi,
I have lexical parameter in my select statement of my data model in the report.
How do i generate XML tags for these columns inside a Lexical Parameter?
Simple Example: I have data model query as follows:
SELECT msi.inventory_item_id
&LP_SELECT
FROM mtl_system_items_b
Here my lexical Parameter LP_SELECT is generated in before report trigger as follows in my report:
:LP_SELECT := 'msi.segment1,msi.description';
So, the question is how to generate XML Tags for columns in Lexical Parameter(as in the example above, i need XML tags for these columns - segment1 and description)
Thanks,
Ratantry this
Select &order data_show
from oe_order_headers_all
where order_number ='7889'
and setting :order:='order_number'; in after parameter form trigger.
Hope this helps
Hamid -
Dear Friends it is too urgent,
I have to build a query where i want to select records from the tables dynamically from different users. i.e Suppose I have many users 'USER1' , 'USER2' , 'USER3'... AND SO ON. All users have same tables. suppose 'Employee' is the table reside in all users. Now suppose if I supply owner name in the query, it must retrieve rows from Employee table from that particular user.
I'll be very thankful for the kind favour
RegardsSrinivas , thanks for the follow up , actually the problem is the referencing of object , whenever u create object in a schema, it is stored with refernce of schema name. LIKE SCHEMA.OBJECT , when u call the object u don't need to define the schema because u are actually working on that schema but if u try to call the object from other schema u need to require the schema name Now i must describe the workeability of object with examples. Now suppose i have a table EMPLOYEE which has the object Address_Type AND IT IS DEFINED IN 2 USERS
'USER1' AND 'USER2'
EMPLOYEE
EMPNO NUMBER(10),
ENAME VARCHAR2(50),
HIREDATE DATE,
ADDRESS ADDRESS_TYPE
To get value of the address u have to select like that way from 2 different users USER1 and USER2
select a.empno,a.ename, a.hiredate,
address_type(a.address.colname...)
from user1.employee
or u can also select like
select a.empno,a.ename, a.hiredate,a.address.colname
from user2.employee a
Now coming to the problem
if u try to create a dummy table in user1 from user2 it will give u error
CREATE TABLE USER1.DUMMY
AS
SELECT * FROM USER2.EMPLOYEE
ERROR at line 1:
ORA-00902: invalid datatype
This error is because object is created with the name of the schema (USER2.ADDRESS) and the schema where u are creating this object also contain the object type with refernce to the object
(USER1.ADDRESS).
The problem occurs when I try to define a variable of %ROWTYPE
it needs a schema name which i can not set it dynamically in the declaration part like for example
CREATE OR REPLACE PROCEDURE EMP_PROC (V_USER IN VARCHAR2)
IS
U_NAME VARCHA2(100);
type curref is REF CURSOR;
vcur curref;
REC [SCHEMA].EMPLOYEE%ROWTYPE [ HERE THE SCHEMA IS PASSING AS AN ARGUMENT WHICH IS NOT ALLOWED IN THE DECLARATION PART ]
------ IF I TRY TO REPLACE SCHEMA WITH THE VARIABLE
------ U_NAME IT IS NOT ACCEPTED
I think I wrote a lot to tell u about the actual problem.
Please dear friends, specially Barbera, i u look closely to my problem I'll be highly thankful. If suppose it is not possible I need other work around.
Regards
Shah I think the problem comes down to the fact that object address_typ in schema1 will have a different global object identifier to address_typ in schema2. They are therefore seen as different datatypes.
If you had a third schema which owned the object, and referenced this is the other two schemas, then you could quite happily insert the contents from schema1 into schema2.
e.g.
Schema3
CREATE OBJECT address_typ AS OBJECT (line_1 VARCHAR2(100), line_2 VARCHAR2(100));
GRANT ALL ON address_typ TO PUBLIC WITH GRANT OPTION;
Schema1
CREATE TABLE emp(empno NUMBER, ename VARCHAR2(100), address schema3.address_typ);
GRANT SELECT ON emp TO PUBLIC;
INSERT INTO emp VALUES (1, 'Smith', schema3.address_typ('Street','Town'));
Schema2
CREATE TABLE emp(empno NUMBER, ename VARCHAR2(100), address schema3.address_typ);
INSERT INTO emp SELECT * FROM schema1.emp;
In this example, the address column in both schema's is of the same datatype (schema3.address_typ).
I hope this sheds some light on your last post. -
Need help to disable input selection-screen - very urgent
Hi SAP experts,
I have a requirement where in I need to disable ( Grey out ) the input fileds on the selection screen .
My problem is as I am using ABAP query I am not able to use any events ( AT SELECTION-SCREEN OUTPUT ).
My selection screen looks like this
MATERIAL NUMBER ( SELECT-OPTIONS)
MATERIAL TYPE ( PARAMETERS )
Now I want to add one more check box below the above fields on the selection-screen.When I click on the check-box,the MATERIAL NUMBER must be greyed out and MATERIAL TYPE should remain the same.
Please let me know the coding for the same. All answers would be rewarded.
Thanks in Advance,
Suresh.Hi,
Check out these codes.
1.
TABLES : mara, makt.
parameter: p_matnr type mara-matnr,
p_maktx type makt-maktx.
at selection-screen output.
select single maktx
from makt
into p_maktx
where matnr = p_matnr
and spras = 'EN'.
loop at screen.
if screen-name = 'P_MAKTX'.
screen-input = 0.
modify screen.
endif.
endloop.
2.
TABLES : mara, makt.
TYPES:BEGIN OF tp_maktx,
maktx TYPE makt-maktx,
END OF tp_maktx.
DATA:t_maktx TYPE STANDARD TABLE OF tp_maktx,
wa_maktx TYPE tp_maktx.
SELECT-OPTIONS: s_matnr FOR mara-matnr.
SELECT-OPTIONS: s_maktx FOR makt-maktx.
INITIALIZATION.
REFRESH s_maktx[].
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF screen-name = 'S_MAKTX-LOW' or screen-name = 'S_MAKTX-HIGH'.
screen-input = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
REFRESH s_maktx[].
if s_matnr[] is not initial.
SELECT maktx FROM makt
INTO TABLE t_maktx
WHERE matnr IN s_matnr
AND spras = 'EN'.
endif.
LOOP AT t_maktx INTO wa_maktx.
s_maktx-low = wa_maktx-maktx.
APPEND s_maktx.
CLEAR:wa_maktx.
ENDLOOP.
3.
TABLES : mara, makt.
parameter p_cb1 type c as checkbox.
parameter p_cb2 type c as checkbox.
parameter p_cb3 type c as checkbox.
initialization.
loop at screen.
if screen-name = 'P_CB3'.
screen-invisible = 1.
modify screen.
endif.
endloop.
at selection-screen output.
*loop at screen.
*if screen-name = 'P_CB3'.
*screen-invisible = 1.
*modify screen.
*endif.
*endloop.
loop at screen.
if p_cb1 = 'X'.
if screen-name = 'P_CB2'.
screen-invisible = 1.
modify screen.
endif.
if screen-name = 'P_CB3'.
screen-invisible = 0.
modify screen.
endif.
endif.
if p_cb2 = 'X'.
if screen-name = 'P_CB3'.
screen-invisible = 1.
modify screen.
endif.
if screen-name = 'P_CB1'.
screen-invisible = 0.
modify screen.
endif.
endif.
if p_cb3 = 'X'.
if screen-name = 'P_CB1'.
screen-invisible = 1.
modify screen.
endif.
if screen-name = 'P_CB2'.
screen-invisible = 0.
modify screen.
endif.
endif.
endloop.
Reward if helpful..
Regards. -
Use lexical parameter in select statement
Hi,
I have a report like below:
select d.dname, &par1 mgrSal, &par2 empSal from emp e, dept d where d.deptno=e.deptno
and d.deptno = :dno;
Here the &par1 and &par2 are calling a function like:
:par1 := ' f(:dno, :job)';
in the after parameter form. the function returns a number ( something like count(*) or max(sal) ).
Now the reports server (6i) generats error message:
inlalid column or miss expression.
What is the right way for this kind of report? Please help me.
Any help is greatly appreciated.Hi,
I have a report like below:
select d.dname, &par1 mgrSal, &par2 empSal from emp e, dept d where d.deptno=e.deptno
and d.deptno = :dno;
Here the &par1 and &par2 are calling a function like:
:par1 := ' f(:dno, :job)';
in the after parameter form. the function returns a number ( something like count(*) or max(sal) ).
Now the reports server (6i) generats error message:
inlalid column or miss expression.
What is the right way for this kind of report? Please help me.
Any help is greatly appreciated.
Try debugging it in the same good old way.
What you have stated seems to have no problem
but you never know. So In the after param form see whether it is actually setting a value to your parameter.
If that is Ok I dont think you should have problems.
But there are two things which look odd here. since the Parameter value is not changing after the after param form why do you need it in the query?
Second If you are trying to display the departments thier emp count and max salary I think You can use straight selects than anyhting else.
Try doing it
vij -
Select statement- very urgent pls help
hi
i want to extract following fields into one internal table.
anyone pls help me to do this?
mara-mandt, mara-matnr, mara-meins, mara-laeda, mara-aenam, marc-werks, makt-maktx, sy-datum, sy-uzeit, sy-uname
Thanks
KumarHi Kumar K,
TABLES: MARA, MARC, MAKT.
SELECT-OPTIONS: S_MATNR FOR MARA-MATNR.
PARAMETERS : P_WERKS LIKE MARC-WERKS OBLIGATORY.
DATA : BEGIN OF WA_FINAL,
MANDT LIKE MARA-MANDT,
MATNR LIKE MARA-MATNR,
MEINS LIKE MARA-MEINS,
LAEDA LIKE MARA-LAEDA,
AENAM LIKE MARA-AENAM,
WERKS LIKE MARC-WERKS,
MAKTX LIKE MAKT-MAKTX,
DATE TYPE SY-DATUM,
TIME TYPE SY-UZEIT,
UNAME TYPE SY-UNAME,
END OF WA_FINAL,
BEGIN OF WA_MARA,
MANDT LIKE MARA-MANDT,
MATNR LIKE MARA-MATNR,
MEINS LIKE MARA-MEINS,
LAEDA LIKE MARA-LAEDA,
AENAM LIKE MARA-AENAM,
END OF WA_MARA,
BEGIN OF WA_MAKT,
MATNR LIKE MAKT-MATNR,
MAKTX LIKE MAKT-MAKTX,
END OF WA_MAKT,
BEGIN OF WA_MARC,
MATNR LIKE MARC-MATNR,
WERKS LIKE MARC-WERKS,
END OF WA_MARC.
DATA : IT_MARA LIKE STANDARD TABLE OF WA_MARA WITH HEADER LINE,
IT_FINAL LIKE STANDARD TABLE OF WA_FINAL WITH HEADER LINE,
IT_MAKT LIKE STANDARD TABLE OF WA_MAKT WITH HEADER LINE,
IT_MARC LIKE STANDARD TABLE OF WA_MARC WITH HEADER LINE.
SELECT MANDT
MATNR
MEINS
LAEDA
AENAM
FROM MARA
INTO TABLE IT_MARA
WHERE MATNR IN S_MATNR.
IF IT_MARA[] IS NOT INITIAL.
SELECT MATNR
WERKS
FROM MARC
INTO TABLE IT_MARC
FOR ALL ENTRIES IN IT_MARA
WHERE MATNR = IT_MARA-MATNR
AND WERKS = P_WERKS.
ENDIF.
IF IT_MARA[] IS NOT INITIAL.
SELECT MATNR
MAKTX
FROM MAKT
INTO TABLE IT_MAKT
FOR ALL ENTRIES IN IT_MARA
WHERE MATNR = IT_MARA-MATNR.
ENDIF.
LOOP AT IT_MARA.
IT_FINAL-MANDT = IT_MARA-MANDT.
IT_FINAL-MATNR = IT_MARA-MATNR.
IT_FINAL-MEINS = IT_MARA-MEINS.
IT_FINAL-LAEDA = IT_MARA-LAEDA.
IT_FINAL-AENAM = IT_MARA-AENAM.
READ TABLE IT_MARC WITH KEY MATNR = IT_MARA-MATNR.
IF SY-SUBRC = 0.
IT_FINAL-WERKS = IT_MARC-WERKS.
ENDIF.
READ TABLE IT_MAKT WITH KEY MATNR = IT_MARA-MATNR.
IF SY-SUBRC = 0.
IT_FINAL-MAKTX = IT_MAKT-MAKTX.
ENDIF.
IT_FINAL-DATE = SY-DATUM.
IT_FINAL-TIME = SY-UZEIT.
IT_FINAL-UNAME = SY-UNAME.
APPEND IT_FINAL.
CLEAR : IT_FINAL, IT_MARA , IT_MAKT, IT_MARC.
ENDLOOP.
now IT_FINAL table contains the final data which you want...
Hope it will solve your problem
Reward points if useful...
Thanks & Regards
ilesh 24x7 -
Very Urgent!...regarding selection criterion in Info Packages
Hi all,
This is very urgent requirement for the project now. Is there any way to indicate a field in selection criterion of a IP as blank.
Like if I want to select all the records which have a field 0WBS_element as blank from one ODS into another ODS. How do I indicate it in the IP( any solution apart from writing a routine!)
cheers
SudhirHi Sudhir,
Pls. refer to the earlier posted forums :
Rotuine in Infopackage for Data Selection---- Urgent
Thanks,
Raj -
Passing parameter from Servlet to javascript in JSP. Very Urgent - 5 jukes!
Well my servlet will retrieve questions from database.
Then the player will answer the question in the JSP and submit the answer to the servlet to process.
Each time an answer is submitted, or a "Next Question" button is clicked, the countdown time will restart.
And will reload the page with a new question.
So how can i do that?
This is my servlet, JSP, javascript
=====================================================================
* Interacts with the player depending on his types of selection and output them
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
import java.util.*;
public class GameQuestionServlet extends HttpServlet
String sSQL = null;
String sCategory = null;
String paramName = null;
User userObject = null;
Questions gameQsObj = new Questions();
HttpSession session;
int cnt = -1;
int score = 0;
boolean connected = false;
public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
session = request.getSession(false);
//System.out.println("Testing Score:" + score);
if(connected == true)
Questions object = (Questions)gameQsObj.getQsList().elementAt(cnt);
System.out.println("\n" + object.sAns1);
System.out.println(object.sAns2);
System.out.println(object.sAns3 + "\n");
Enumeration enum = request.getParameterNames();
while(enum.hasMoreElements())
paramName = (String)enum.nextElement();
if(paramName.equals("mcq"))
System.out.println(request.getParameter("mcq"));
score = Integer.parseInt(userObject.score.trim());
System.out.println("Player old score: " + score);
//Check to see if the selected answer matches the correct answer
if((object.sCorrect).equals(request.getParameter("mcq")))
score = score + 10;
else
if((object.sCorrect).equals(request.getParameter("mcq")))
score = score + 10;
else
if((object.sCorrect).equals(request.getParameter("mcq")))
score = score + 10;
else
score = score - 10;
System.out.println("Player current score: " + score);
else //will only go into this once
userObject = (User)session.getAttribute("user");
System.out.println("\n"+userObject.nric);
System.out.println(userObject.name);
System.out.println(userObject.password);
System.out.println(userObject.email);
System.out.println(userObject.score+"\n");
//depending on user selection
sCategory = request.getParameter("qsCategory");
sSQL = "SELECT * FROM " + sCategory;
gameQsObj.getQuestions(sSQL, sCategory);
score = Integer.parseInt(userObject.score);
connected = true;
System.out.println("Connected:" + connected);
System.out.println("Before:" + userObject.score);
cnt = cnt + 1; //increment to retrieve next question
userObject.score = Integer.toString(score);
System.out.println("After:" + userObject.score);
if(cnt < 3) //setting for the number of questions per game.
//request.setAttribute("qsCnt", cnt); //count of the question number
request.setAttribute("aQs", gameQsObj.getQsList().elementAt(cnt));
System.out.println(request.getAttribute("aQs"));
System.out.println("This is question number: "+ cnt);
getServletConfig().getServletContext().getRequestDispatcher("/JSP/PlayGame.jsp").forward(request, response);
else
//forward to the result page
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
doPost(request, response);
<%@ page import="Questions" %>
<HTML>
<HEAD>
<TITLE>Play Game</TITLE>
<SCRIPT LANGUAGE="JavaScript">
var refreshinterval=10
var displaycountdown="yes"
var starttime
var nowtime
var reloadseconds=0
var secondssinceloaded=0
function starttime() {
starttime=new Date()
starttime=starttime.getTime()
countdown()
function countdown() {
nowtime= new Date()
nowtime=nowtime.getTime()
secondssinceloaded=(nowtime-starttime)/1000
reloadseconds=Math.round(refreshinterval-secondssinceloaded)
if (refreshinterval>=secondssinceloaded) {
var timer=setTimeout("countdown()",1000)
if (displaycountdown=="yes") {
window.status="You have "+reloadseconds+ " second before timeout"
else {
hide();
clearTimeout(timer)
//window.location.reload(true)
function hide() {
//hidelayer
if(gameLayers.style.visibility == "visible"){
gameLayers.style.visibility = "hidden"
oops.style.visibility = "show"
window.onload=starttime
</SCRIPT>
</HEAD>
<BODY>
<FORM METHOD="post" ACTION="http://localhost:8080/Java_Assignment2/servlet/GameQuestionServlet">
<DIV ID="oops" STYLE="position:absolute; left:300px; top:30px; width:120px; height:150px; z-index:2; visibility:hidden">
Oops! 30 seconds time up!!! <BR><BR>
<INPUT TYPE="submit" VALUE="Next Question">
<INPUT TYPE="hidden" NAME="nextQs" VALUE="Next Question">
</DIV>
<DIV ID="gameLayers" STYLE="position:absolute; left:300px; top:30px; width:120px; height:150px; z-index:3; visibility:show">
<TABLE BORDER="0">
<TR>
<TH><BIG>Questions:</BIG></TH>
</TR>
<%
Questions aQsObj = (Questions)request.getAttribute("aQs");
String aQsBody = aQsObj.sQs;
String aQsAns1 = aQsObj.sAns1;
String aQsAns2 = aQsObj.sAns2;
String aQsAns3 = aQsObj.sAns3;
%>
<TR>
<TD><B><%= aQsBody%></B></TD>
</TR>
<TR>
<TD>
<SELECT SIZE="3" NAME="mcq">
<OPTION SELECTED><%= aQsAns1 %></OPTION>
<OPTION><%= aQsAns2 %></OPTION>
<OPTION><%= aQsAns3 %></OPTION>
</SELECT><BR><BR>
</TD>
</TR>
<TR>
<TD>
<INPUT TYPE="submit" VALUE="Submit Your Answer">
<INPUT TYPE="hidden" NAME="submitAns" VALUE="Submit Your Answer">
</TD>
</TR>
</TABLE>
</DIV>
</FORM>
</BODY>
</HTML>
This must be answered before 28th of september.
Please help. It is indeed very urgent.this is just a skeleton code.. alot of stuff is not here..
<FORM name = "form1" action="../servlet/wateverSevlet>
<input type="text" name="searchStr" size="40">
<INPUT type="hidden" id=answer name=answer size=7>
<input type="button" name="button" value="Submit Answer" onClick="javascript:submitCheck(document.form1.searchStr.value);">
<input type="button" name="button" value="Skip Question" onClick="javascript:submitCheck('skip');">
</form>
<SCRIPT LANGUAGE="JavaScript">
function submitCheck(str)
form1.answer.value = str
form1.submit()
</script>i assuming you are submitting it to the same servlet regardless of whether the user clicks the skip question or the submit question button. -
SQL SELECT Query Help ..Please its very Urgent!!
Hi All,
I am having Oracle Database whice is storing 1000's of records daily.
I need to select some information based on date and time.
I am having two coloumns for Date and time. The first column(testDate) of type Date stores date as MM/DD/YY format and the second column(testTime)of type Numeric stores the time in seconds.
The Example data is :
testDate ------=-- testTime
11/12/2002 --- 35000
11/12/2002 --- 43000
11/12/2002 --- 45000
11/12/2002 --- 75000
11/13/2002 --- 2000
11/13/2002 --- 3500
11/13/2002 --- 4300
11/13/2002 --- 9800
11/13/2002 --- 23000
11/14/2002 --- 5000
11/14/2002 --- 10000
11/14/2002 --- 15000
How can i write a SELECT Query to get the records of specific date and seconds to next day specific date and seconds.I mean i want all the records between 11/12/2002 --- 43000 seconds to 11/14/2002 --- 1000 seconds.
If any one helps me in this regard iam very thank full to them.Its very urgent for me.
ThanksHi m7nra,
I used the query as
SELECT * FROM table
WHERE testDate + (testTime/(24*60*60)) BETWEEN TO_DATE('MM/DD/YYYY','12.11.2002') AND TO_DATE('MM/DD/YYYY','14.11.2002')
its giving DATE FORMAT NOT RECOGNIZED error.
The Example data is :
testDate ------=-- testTime
11/12/2002 --- 35000
11/12/2002 --- 43000
11/12/2002 --- 45000
11/12/2002 --- 75000
11/13/2002 --- 2000
11/13/2002 --- 3500
11/13/2002 --- 4300
11/13/2002 --- 9800
11/13/2002 --- 23000
11/14/2002 --- 5000
11/14/2002 --- 10000
11/14/2002 --- 15000
infact i need all the records between 11/12/2002 --- 43000 seconds to 11/14/2002 --- 1000 seconds.
Please help me to find a full query beacuse iam very new to Oracle.
Thanks,
S R Mannava -
Its very urgent:how to insert data into database tables
Hi All,
I am very new to oaf.
I have one requirement data insert into database tables.
here createPG having data that data insert into one custom table.
but i dont know how to insert data into database tables.
i wrote the code in am,co as follows.
in am i wrote the code:
public void NewoperationManagerLogic()
ManagerCustomTableVOImpl vo1=getManagerCustomTableVO1();
OADBTransaction oadbt=getOADBTransaction();
if(!vo1.isPreparedForExecution())
vo1.executeQuery();
Row row=vo1.createRow();
vo1.insertRow(row);
in createPG processrequest co:
public void processRequest(OAPageContext pageContext, OAWebBean webBean)
super.processRequest(pageContext, webBean);
ManagerInformationAMImpl am=(ManagerInformationAMImpl)pageContext.getApplicationModule(webBean);
am.NewoperationManagerLogic();
process form request:
public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
super.processFormRequest(pageContext, webBean);
if(pageContext.getParameter("Submit")!=null)
ManagerInformationAMImpl am=(ManagerInformationAMImpl)pageContext.getApplicationModule(webBean);
am.getOADBTransaction().commit();
please help with an example(sample code).
its very urgent.
thanks in advance
Seshu
Edited by: its urgent on Dec 25, 2011 9:31 PMHi ,
1.)You must have to create a EO based on custom table and then VO based on this EO eventually to save the values in DB
2.) the row.setNewRowState(Row.STATUS_INITIALIZED); is used to set the the status of row as inialized ,this is must required.
3.) When u will create the VO based on EO the viewattributes will be created in VO which will be assigned to the fields to take care the db handling .
You must go thtough the lab excercise shipped with you Jdeveloper ,there is a example of Create Employee page ,that will solve your number of doubts.
Thanks
Pratap -
Very very urgent. population data from database into dropdownbox
Hi,
i imported a model through ejbs
this is to create new entries into database ,
and my scenerio iso now i need to populate the values that i stored into database thro EJBS in a drop down box of wd application.
plz help me through code ,i am new to java webdynpro...
neede very urgently,
Thanx .
Arjun.G
Message was edited by:
arjun swamyHi,
Have a look at these threads
Dropdown by index in table - fetching values from database
Dropdown by index
Kind Regards,
Saravanan K -
Error during GR(very very urgent)
Hi all,
i am using a developed program for GR.i used this program before.there was no error.but now i am facing error like
<b>PO ordered quqntity exceeded by 18,000 EA.</b>.i am using <b>BAPI_GOODSMVT_CREATE</b> for goods transfer.
In the selection screen, i am putting
PO number- PO1
material number- MAT
GR quantity- 18,000
delivery order-111
i want to receive the material MAT of quantity 18,000 from that PO.initially i have ordered PO quntity as 1 lakh. Till now i have received 42,000 materials,now i try to receive 18,000 materials.but it is showing this type of error.
This error is fired from the return parameter of that BAPI only.error having message class-M7 & error no-022
is comming.
i am giving my coding below.plz suggest where is the problem.it is very very urgent.recently my company has added some patches to update the SAP.is this the cause for that error.plz suggest.
any idea will be highly appreaciated.
Regards
REPORT zmui001
LINE-SIZE 140
LINE-COUNT 65
NO STANDARD PAGE HEADING.
*-- DATA DECLARATION--
*-- tables
TABLES : ekpo,
ekbe,
marv.
*--Includes
INCLUDE : <icon>. " Include for Icons
*-- Types
TYPES : BEGIN OF t_mseg,
ebeln LIKE ekko-ebeln,
name1 LIKE lfa1-name1,
lifnr LIKE lfa1-lifnr,
eknam LIKE t024-eknam,
mblnr LIKE mkpf-mblnr,
matnr LIKE ekpo-matnr,
maktx LIKE makt-maktx,
lgort LIKE mseg-lgort,
charg LIKE mseg-charg, "chg: 10/17/2005
menge LIKE mseg-menge,
budat LIKE mkpf-budat,
bldat LIKE mkpf-bldat, " chg : 08/18/2003
xblnr LIKE mkpf-xblnr,
END OF t_mseg.
DATA: BEGIN OF t_ekbe,
ebeln LIKE ekbe-ebeln,
ebelp LIKE ekbe-ebelp,
bwart LIKE ekbe-bwart,
matnr LIKE ekbe-matnr,
menge LIKE ekbe-menge,
END OF t_ekbe,
BEGIN OF t_ekpo,
ebeln LIKE ekpo-ebeln,
ebelp LIKE ekpo-ebelp,
matnr LIKE ekpo-matnr,
menge LIKE ekpo-menge,
END OF t_ekpo.
TYPES : BEGIN OF t_options.
INCLUDE STRUCTURE itcpo.
TYPES : END OF t_options.
*--Internal tables
DATA: BEGIN OF i_item OCCURS 50. "Create Material Document Item
INCLUDE STRUCTURE bapi2017_gm_item_create.
DATA: END OF i_item .
DATA: BEGIN OF i_return OCCURS 20. "Return parameter
INCLUDE STRUCTURE bapiret2.
DATA: END OF i_return.
DATA: BEGIN OF i_part OCCURS 0, " Internal table for split data
part(20),
END OF i_part.
DATA: BEGIN OF i_return1 OCCURS 20. "Return parameter
INCLUDE STRUCTURE bapiret1.
DATA: END OF i_return1.
*-- Work areas
DATA: BEGIN OF wa_header . "Material Document Header Data
INCLUDE STRUCTURE bapi2017_gm_head_01.
DATA: END OF wa_header .
DATA: BEGIN OF wa_return . "Output Structure
INCLUDE STRUCTURE bapi2017_gm_head_ret.
DATA: END OF wa_return .
*-- Work areas
DATA: wa_mseg TYPE t_mseg,
wa_ekbe LIKE t_ekbe,
wa_ekpo LIKE t_ekpo,
wa_options TYPE t_options,
i_ekbe LIKE STANDARD TABLE OF t_ekbe,
i_ekbe2 LIKE STANDARD TABLE OF t_ekbe,
i_ekpo LIKE STANDARD TABLE OF t_ekpo.
*---Variables
DATA: v_first, " variable to get first digit
v_set TYPE c,
v_found TYPE p,
v_menge TYPE p,
v_ebeln LIKE ekko-ebeln,
v_lifnr LIKE ekko-lifnr,
v_belnr LIKE ekbe-belnr,
v_postdate LIKE mkpf-budat,
v_bukrs LIKE marv-bukrs,
v_datum LIKE sy-datum,
v_lgort LIKE mard-lgort, " Stge. location
v_bwart LIKE mseg-bwart, " Movement type
v_infnr LIKE eina-infnr, " Info record no.
v_ltsnr LIKE eina-ltsnr.
*---Constants
CONSTANTS: c_comma TYPE c VALUE ',', " For splitting data at commas
c_01(2) TYPE c VALUE '01', " For movement code in Bapi
c_b TYPE c VALUE 'B', " For mvt. Indicator in Bapi
c_save(4) TYPE c VALUE 'SAVE', " For button text
c_clear(5) TYPE c VALUE 'CLEAR', " For clear button
c_mvmt(4) TYPE c VALUE 'MVMT',
c_ok(2) TYPE c VALUE 'OK',
c_error(5) TYPE c VALUE 'Error'.
*--SELECTION SCREEN DESIGN--
SELECTION-SCREEN BEGIN OF BLOCK blk1 WITH FRAME.
PARAMETERS: p_bar(75) , " Scanned data from barcode
p_ebeln LIKE ekko-ebeln, " PO number
p_matnr LIKE ekpo-matnr, " Material number
p_menge LIKE ekpo-menge, " Quantity
p_lifnr LIKE ekko-lifnr, " Vendor code
p_frbnr LIKE mkpf-frbnr, " Reference doc for goods mvt
p_status(5) TYPE c.
SELECTION-SCREEN END OF BLOCK blk1.
SELECTION-SCREEN PUSHBUTTON 15(10) v_save USER-COMMAND mvmt.
SELECTION-SCREEN PUSHBUTTON 40(10) v_clear USER-COMMAND clear.
INITIALIZATION -
INITIALIZATION.
v_save = c_save .
v_clear = c_clear.
*--AT SELECTION_SCREEN--
AT SELECTION-SCREEN .
IF sy-ucomm = c_clear.
PERFORM f_clear.
ELSE.
IF sy-ucomm <> c_mvmt.
if not sy-tabix is initial and sy-ucomm <> c_mvmt.
*--- Extracting the data by splitting the scanned values.
PERFORM f_get_split_data.
*--- Validating the input data.
PERFORM f_check_inputs.
ELSE .
*--- Validating the input data.
PERFORM f_check_inputs.
*-- Determining the posting date and period check.
PERFORM f_get_posting_date.
*---Post goods movement
PERFORM f_post_receipt.
ENDIF.
ENDIF.
SUBROUTINES *
*& Form f_check_inputs
Validating the input parameters
FORM f_check_inputs.
*-- Validating material no.
SELECT SINGLE matnr INTO p_matnr
FROM mara
WHERE matnr = p_matnr.
IF sy-subrc = 4.
p_status = c_error.
MESSAGE e003(zm) WITH 'Material no.'.
ENDIF.
*-- Validating JHT reference no.
SELECT SINGLE ebeln
lifnr
bukrs
INTO (p_ebeln, v_lifnr , v_bukrs)
FROM ekko
where unsez = p_unsez. chg:07072003
WHERE ebeln = p_ebeln.
IF sy-subrc = 4.
p_status = c_error.
MESSAGE e003(zm) WITH 'Purchase order no.'.
ENDIF.
*-- Validating material po combination
SELECT SINGLE *
FROM ekpo
WHERE ebeln = p_ebeln
AND matnr = p_matnr.
IF sy-subrc = 4.
p_status = c_error.
MESSAGE e003(zm) WITH 'Purchase order no.' ' and Material no.'.
ENDIF.
*--- Checking for DO entry . (chng : 30/06/2003)
IF p_frbnr IS INITIAL.
MESSAGE e018(m7) WITH 'Delivery no.'.
p_status = c_error.
PERFORM f_clear.
ENDIF.
*-- Validating material po do combination
SELECT SINGLE a~belnr
INTO v_belnr
FROM ekbe AS a
INNER JOIN mkpf AS b
ON abelnr = bmblnr
AND agjahr = bmjahr
WHERE a~ebeln = ekpo-ebeln
AND a~ebelp = ekpo-ebelp
AND b~xblnr = p_frbnr.
IF sy-subrc = 0.
MESSAGE e019(zm) WITH v_belnr.
p_status = c_error.
PERFORM f_clear.
ENDIF.
p_status = c_ok.
ENDFORM. " f_check_inputs
*& Form f_get_split_data
Extracting the data by splitting the Scanned data
FORM f_get_split_data.
*-- Splitting the data at commas
SPLIT p_bar AT c_comma INTO TABLE i_part.
*-- Assigning the parts to variables.
LOOP AT i_part.
v_first = i_part-part+0(1).
TRANSLATE v_first TO UPPER CASE.
CASE v_first .
WHEN 'V'.
p_lifnr = i_part-part+1(10).
WHEN 'P'.
p_matnr = i_part-part+1(18).
WHEN 'Q'.
p_menge = i_part-part+1(13).
WHEN 'K'.
p_ebeln = i_part-part+1(10).
WHEN 'D'.
p_frbnr = i_part-part+2(16).
WHEN OTHERS.
CONTINUE.
ENDCASE.
ENDLOOP.
ENDFORM. " f_get_split_data
*& Form f_get_posting_date
Determing the posting date for document
FORM f_get_posting_date.
*-- get the current period for todays date.
DATA: l_period LIKE t009b-poper.
CALL FUNCTION 'DATE_TO_PERIOD_CONVERT'
EXPORTING
i_date = sy-datum
i_periv = 'K4'
IMPORTING
e_buper = l_period
E_GJAHR =
EXCEPTIONS
input_false = 1
t009_notfound = 2
t009b_notfound = 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.
*-- Determining whether the open period
SELECT SINGLE *
FROM marv
WHERE bukrs = v_bukrs.
IF sy-subrc = 0.
IF l_period = marv-lfmon .
v_postdate = sy-datum.
ELSE.
CALL FUNCTION 'BAPI_CCODE_GET_FIRSTDAY_PERIOD'
EXPORTING
companycodeid = v_bukrs
fiscal_period = marv-lfmon
fiscal_year = marv-lfgja
IMPORTING
first_day_of_period = v_postdate
return = i_return1.
IF NOT i_return[] IS INITIAL.
LOOP AT i_return1.
MESSAGE i016(zm) WITH i_return-message.
ENDLOOP.
ENDIF.
ENDIF.
ENDIF.
ENDFORM. " f_get_posting_date
*& Form f_post_receipt
Post the goods receipt for entered data.
FORM f_post_receipt.
PERFORM f_fill_item.
PERFORM f_fill_header.
PERFORM f_execute_transfer.
PERFORM f_clear.
ENDFORM. " f_post_receipt
*& Form f_fill_item
Updating the item data for the GR
FORM f_fill_item.
Checking for IQC cycle is done here.(chng : 23/07/2003)
PERFORM f_check_iqc.
*---- Assigning movement type as per IQC cycle.(chng : 23/07/2003)
IF v_lgort IS INITIAL.
MOVE '101' TO i_item-move_type.
SELECT SINGLE lgort INTO i_item-stge_loc
FROM ekpo
where ebeln = v_ebeln and " chg :07/07/2003
WHERE ebeln = p_ebeln AND
matnr = p_matnr .
ELSE.
MOVE v_lgort TO i_item-stge_loc.
MOVE v_bwart TO i_item-move_type.
ENDIF.
MOVE p_matnr TO i_item-material.
MOVE p_menge TO i_item-entry_qnt.
move v_ebeln to i_item-po_number. " 07/07/2003
MOVE p_ebeln TO i_item-po_number.
MOVE v_lifnr TO i_item-vendor.
MOVE c_b TO i_item-mvt_ind.
select single ebelp into i_item-po_item " chg :29/07/2003
from ekpo
where ebeln = p_ebeln
and matnr = p_matnr
and elikz = ''.
SELECT ebeln
ebelp
matnr
menge
INTO CORRESPONDING FIELDS OF TABLE i_ekpo
FROM ekpo
WHERE ebeln = p_ebeln
AND matnr = p_matnr
AND loekz = '' .
SORT i_ekpo BY ebeln ebelp matnr.
LOOP AT i_ekpo INTO wa_ekpo.
IF v_found = 0.
SELECT ebeln ebelp
bwart menge
INTO CORRESPONDING FIELDS OF TABLE i_ekbe
FROM ekbe
WHERE ebeln = p_ebeln
AND ebelp = wa_ekpo-ebelp
AND matnr = p_matnr.
and elikz = '' . CHG -- 03/19/2004
IF sy-subrc = 0.
LOOP AT i_ekbe INTO wa_ekbe .
IF wa_ekbe-bwart = '101'.
v_menge = v_menge + wa_ekbe-menge.
ENDIF.
IF wa_ekbe-bwart = '102'.
v_menge = v_menge - wa_ekbe-menge.
ENDIF.
IF wa_ekbe-bwart = '122'.
v_menge = v_menge - wa_ekbe-menge.
ENDIF.
ENDLOOP.
chng: 03/19/2004 compare po qty against receipt
v_menge = v_menge + p_menge .
IF wa_ekpo-menge >= v_menge .
v_found = 1.
MOVE wa_ekpo-ebelp TO i_item-po_item.
ENDIF.
ELSE .
v_found = 1.
MOVE wa_ekpo-ebelp TO i_item-po_item.
ENDIF.
ENDIF.
CLEAR : wa_ekbe, i_ekbe, v_menge.
ENDLOOP.
IF v_found = 0 .
MESSAGE e003(zm) WITH ' delivery items'.
ENDIF.
APPEND i_item.
CLEAR : i_item, v_found .
ENDFORM. " f_fill_item
*& Form f_check_iqc
Checking the storage location for the (chng : 23/07/2003)
FORM f_check_iqc.
CALL FUNCTION 'Z_M_GET_IQC_STATUS'
EXPORTING
matnr = p_matnr
lifnr = v_lifnr
IMPORTING
lgort = v_lgort
bwart = v_bwart
ltsnr = v_ltsnr
infnr = v_infnr
EXCEPTIONS
non_iqc_vendor = 1
OTHERS = 2.
IF sy-subrc <> 0.
CLEAR : v_lgort , v_bwart , v_ltsnr.
ENDIF.
ENDFORM. " f_check_iqc
*& Form f_fill_header
Updating data in the header
FORM f_fill_header.
MOVE v_postdate TO wa_header-pstng_date.
MOVE sy-datum TO wa_header-doc_date.
MOVE p_frbnr TO wa_header-ref_doc_no.
ENDFORM. " f_fill_header
*& Form f_execute_transfer
Executing the goods movement.
FORM f_execute_transfer.
CALL FUNCTION 'BAPI_GOODSMVT_CREATE'
EXPORTING
goodsmvt_header = wa_header
goodsmvt_code = c_01
IMPORTING
goodsmvt_headret = wa_return
TABLES
goodsmvt_item = i_item
return = i_return.
IF i_return[] IS INITIAL .
COMMIT WORK.
*--- UPdating Info record for IQC cycle ind.(chng : 23/07/2003)
IF NOT v_ltsnr IS INITIAL.
UPDATE eina SET ltsnr = v_ltsnr
WHERE infnr = v_infnr.
ENDIF.
REFRESH : i_item.
CLEAR : wa_header,v_ltsnr , v_infnr,v_bwart,v_lifnr.
MESSAGE i012(migo) WITH wa_return-mat_doc.
PERFORM f_do_print.
ELSE.
REFRESH : i_item.
CLEAR : wa_header,v_ltsnr , v_infnr,v_bwart,v_lifnr.
PERFORM write_errors.
ENDIF.
ENDFORM. " f_execute_transfer
FORM write_errors.
WRITE: 0(90) sy-uline ,
/0'|',
3 'System messages for GR posting',
90 '|',
/0(90) sy-uline .
LOOP AT i_return.
CASE i_return-type.
WHEN 'E'.
MESSAGE i016(zm) WITH i_return-message.
WHEN 'W'.
MESSAGE i017(zm) WITH i_return-message.
WHEN 'I'.
WRITE: /0'|',
icon_yellow_light AS ICON ,
'|',
10 i_return-message,
90 '|'.
MESSAGE i018(zm) WITH i_return-message.
WHEN 'S'.
WRITE: /0'|',
icon_green_light AS ICON ,
'|',
10 i_return-message,
90 '|'.
MESSAGE i018(zm) WITH i_return-message.
WHEN OTHERS.
WRITE: /0'|',
icon_red_light AS ICON ,
'|',
10 i_return-message,
90 '|'.
MESSAGE e016(zm) WITH i_return-message.
ENDCASE.
AT LAST .
WRITE:/0(90) sy-uline .
ENDAT.
ENDLOOP.
ENDFORM. " write_errors
*& Form f_clear
Clearing the input parameters
FORM f_clear.
CLEAR : p_ebeln ,
p_bar,
p_matnr,
p_frbnr,
v_lifnr,
p_menge,
p_status.Hi all,
can anyone suggest any idea?
Regrds
pabitra -
Please help me with the following two questions, very urgent
Hi All,
Please help me with some scenerios about what are the common problems when modifying a standard script such a standard Invoice script and how can we overcome them.
What are the common problems encountered when working with SAP SMARTFORMS and how to overcome them?
Please help me with these questions, its very urgent.
Thanks in advance.
MD.hi
hope it will help you.
reward if ehlp.
How to create a New smartfrom, it is having step by step procedure
http://sap.niraj.tripod.com/id67.html
step by step good ex link is....
http://smoschid.tripod.com/How_to_do_things_in_SAP/How_To_Build_SMARTFORMS/How_To_Build_SMARTFORMS.html
Here is the procedure
1. Create a new smartforms
Transaction code SMARTFORMS
Create new smartforms call ZSMART
2. Define looping process for internal table
Pages and windows
First Page -> Header Window (Cursor at First Page then click Edit -> Node -> Create)
Here, you can specify your title and page numbering
&SFSY-PAGE& (Page 1) of &SFSY-FORMPAGES(Z4.0)& (Total Page)
Main windows -> TABLE -> DATA
In the Loop section, tick Internal table and fill in
ITAB1 (table in ABAP SMARTFORM calling function) INTO ITAB2
3. Define table in smartforms
Global settings :
Form interface
Variable name Type assignment Reference type
ITAB1 TYPE Table Structure
Global definitions
Variable name Type assignment Reference type
ITAB2 TYPE Table Structure
4. To display the data in the form
Make used of the Table Painter and declare the Line Type in Tabstrips Table
e.g. HD_GEN for printing header details,
IT_GEN for printing data details.
You have to specify the Line Type in your Text elements in the Tabstrips Output options.
Tick the New Line and specify the Line Type for outputting the data.
Declare your output fields in Text elements
Tabstrips - Output Options
For different fonts use this Style : IDWTCERTSTYLE
For Quantity or Amout you can used this variable &GS_ITAB-AMOUNT(12.2)&
5. Calling SMARTFORMS from your ABAP program
REPORT ZSMARTFORM.
Calling SMARTFORMS from your ABAP program.
Collecting all the table data in your program, and pass once to SMARTFORMS
SMARTFORMS
Declare your table type in :-
Global Settings -> Form Interface
Global Definintions -> Global Data
Main Window -> Table -> DATA
Written by : SAP Hints and Tips on Configuration and ABAP/4 Programming
http://sapr3.tripod.com
TABLES: MKPF.
DATA: FM_NAME TYPE RS38L_FNAM.
DATA: BEGIN OF INT_MKPF OCCURS 0.
INCLUDE STRUCTURE MKPF.
DATA: END OF INT_MKPF.
SELECT-OPTIONS S_MBLNR FOR MKPF-MBLNR MEMORY ID 001.
SELECT * FROM MKPF WHERE MBLNR IN S_MBLNR.
MOVE-CORRESPONDING MKPF TO INT_MKPF.
APPEND INT_MKPF.
ENDSELECT.
At the end of your program.
Passing data to SMARTFORMS
call function 'SSF_FUNCTION_MODULE_NAME'
exporting
formname = 'ZSMARTFORM'
VARIANT = ' '
DIRECT_CALL = ' '
IMPORTING
FM_NAME = FM_NAME
EXCEPTIONS
NO_FORM = 1
NO_FUNCTION_MODULE = 2
OTHERS = 3.
if sy-subrc <> 0.
WRITE: / 'ERROR 1'.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
call function FM_NAME
EXPORTING
ARCHIVE_INDEX =
ARCHIVE_INDEX_TAB =
ARCHIVE_PARAMETERS =
CONTROL_PARAMETERS =
MAIL_APPL_OBJ =
MAIL_RECIPIENT =
MAIL_SENDER =
OUTPUT_OPTIONS =
USER_SETTINGS = 'X'
IMPORTING
DOCUMENT_OUTPUT_INFO =
JOB_OUTPUT_INFO =
JOB_OUTPUT_OPTIONS =
TABLES
GS_MKPF = INT_MKPF
EXCEPTIONS
FORMATTING_ERROR = 1
INTERNAL_ERROR = 2
SEND_ERROR = 3
USER_CANCELED = 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.
Smartform
you can check this link here you can see the steps and you can do it the same by looking at it..
http://smoschid.tripod.com/How_to_do_things_in_SAP/How_To_Build_SMARTFORMS/How_To_Build_SMARTFORMS.html
SMARTFORMS STEPS.
1. In Tcode se11 Create a structure(struct) same like the Internal table that you are going to use in your report.
2. Create Table type(t_struct) of stracture in se11.
3. In your program declare Internal table(Itab) type table of structure(struct).
4. Define work area(wa) like line of internal table.
5. Open Tcode Smartforms
6. In form Global setting , forminterface Import parameter define Internal table(Itab) like table type of stracture(t_struct).
7. In form Global setting , Global definitions , in Global data define Work area(wa) like type stracture(struct).
8. In form pages and window, create Page node by default Page1 is available.
9. In page node you can create numbers of secondary window. But in form there is only one Main window.
10. By right click on page you can create windows or Go to Edit, Node, Create.
11. After creating the window right click on window create table for displaying the data that you are passing through internal table.
12. In the table Data parameter, loop internal internal table (Itab) into work area(wa).
13. In table there are three areas Header, Main Area, Footer.
14. Right click on the Main area create table line by default line type1 is there select it.
15. Divide line into cells according to your need then for each cell create Text node.
16. In text node general attribute. Write down fields of your work area(wa) or write any thing you want to display.
17. Save form and activate it.
18. Then go to Environment, function module name, there you get the name of function module copy it.
19. In your program call the function module that you have copied from your form.
20. In your program in exporting parameter of function pass the internal table(itab).
SAP Smart Forms is introduced in SAP Basis Release 4.6C as the tool for creating and maintaining forms.
SAP Smart Forms allow you to execute simple modifications to the form and in the form logic by using simple graphical tools; in 90% of all cases, this won't include any programming effort. Thus, a power user without any programming knowledge can
configure forms with data from an SAP System for the relevant business processes.
To print a form, you need a program for data retrieval and a Smart Form that contains the entire from logic. As data retrieval and form logic are separated, you must only adapt the Smart Form if changes to the form logic are necessary. The application program passes the data via a function module interface to the Smart Form. When activating the Smart Form, the system automatically generates a function module. At runtime, the system processes this function module.
You can insert static and dynamic tables. This includes line feeds in individual table cells, triggering events for table headings and subtotals, and sorting data before output.
You can check individual nodes as well as the entire form and find any existing errors in the tree structure. The data flow analysis checks whether all fields (variables) have a defined value at the moment they are displayed.
SAP Smart Forms allow you to include graphics, which you can display either as part of the form or as background graphics. You use background graphics to copy the layout of an existing (scanned) form or to lend forms a company-specific look. During printout, you can suppress the background graphic, if desired.
SAP Smart Forms also support postage optimizing.
Also read SAP Note No. 168368 - Smart Forms: New form tool in Release 4.6C
What Transaction to start SAP Smart Forms?
Execute transaction SMARTFORMS to start SAP Smart Forms.
Key Benefits of SAP Smart Forms:
SAP Smart Forms allows you to reduce considerably the implementation costs of mySAP.com solutions since forms can be adjusted in minimum time.
You design a form using the graphical Form Painter and the graphical Table Painter. The form logic is represented by a hierarchy structure (tree structure) that consists of individual nodes, such as nodes for global settings, nodes for texts, nodes for output tables, or nodes for graphics.
To make changes, use Drag & Drop, Copy & Paste, and select different attributes.
These actions do not include writing of coding lines or using a Script language.
Using your form description maintained in the Form Builder, Smart Forms generates a function module that encapsulates layout, content and form logic. So you do not need a group of function modules to print a form, but only one.
For Web publishing, the system provides a generated XML output of the processed form.
Smart Forms provides a data stream called XML for Smart Forms (XSF) to allow the use of 3rd party printing tools. XSF passes form content from R/3 to an external product without passing any layout information about the Smart Form.
SmartForms System Fields
Within a form you can use the field string SFSY with its system fields. During form processing the system replaces these fields with the corresponding values. The field values come from the SAP System or are results of the processing.
System fields of Smart Forms
&SFSY-DATE&
Displays the date. You determine the display format in the user master record.
&SFSY-TIME&
Displays the time of day in the form HH:MM:SS.
&SFSY-PAGE&
Inserts the number of the current print page into the text. You determine the format of the page number (for example, Arabic, numeric) in the page node.
&SFSY-FORMPAGES&
Displays the total number of pages for the currently processed form. This allows you to include texts such as'Page x of y' into your output.
&SFSY-JOBPAGES&
Contains the total page number of all forms in the currently processed print request.
&SFSY-WINDOWNAME&
Contains the name of the current window (string in the Window field)
&SFSY-PAGENAME&
Contains the name of the current page (string in the Page field)
&SFSY-PAGEBREAK&
Is set to 'X' after a page break (either automatic [Page 7] or command-controlled [Page 46])
&SFSY-MAINEND&
Is set as soon as processing of the main window on the current page ends
&SFSY-EXCEPTION&
Contains the name of the raised exception. You must trigger your own exceptions, which you defined in the form interface, using the user_exception macro (syntax: user_exception <exception name >).
Example Forms Available in Standard SAP R/3
SF_EXAMPLE_01
Simple example; invoice with table output of flight booking for one customer
SF_EXAMPLE_02
Similar to SF_EXAMPLE_01 but with subtotals
SF_EXAMPLE_03
Similar to SF_EXAMPLE_02, whereby several customers are selected in the application program; the form is called for each customer and all form outputs are included in an output request
Advantages of SAP Smart Forms
SAP Smart Forms have the following advantages:
1. The adaption of forms is supported to a large extent by graphic tools for layout and logic, so that no programming knowledge is necessary (at least 90% of all adjustments). Therefore, power user forms can also make configurations for your business processes with data from an SAP system. Consultants are only required in special cases.
2. Displaying table structures (dynamic framing of texts)
3. Output of background graphics, for form design in particular the use of templates which were scanned.
4. Colored output of texts
5. User-friendly and integrated Form Painter for the graphical design of forms
6. Graphical Table Painter for drawing tables
7. Reusing Font and paragraph formats in forms (Smart Styles)
8. Data interface in XML format (XML for Smart Forms, in short XSF)
9. Form translation is supported by standard translation tools
10. Flexible reuse of text modules
11. HTML output of forms (Basis release 6.10)
12. Interactive Web forms with input fields, pushbuttons, radio buttons, etc. (Basis-Release 6.10)
Maybe you are looking for
-
Install ODI 10g on 64 bit Windows 2008 server
Can we install ODI 10g on 64 bit Windows 2008 server ? if so Please provide the me the link for download Edited by: user1137989 on Oct 27, 2010 10:51 PM
-
Question 1) Itunes apps won't update all of a sudden. Either when I click on Download All Updates or try clicking on "Get Update" buttons, I get an -9808 error. Question 2) I bought an iPhone 4 and gave my wife my iPhone 3GS. Now when I sync only the
-
Publishing Server model and ER Diagrams
I want to be able to publish to (PDF or HTML) copies of the Server Model and ER Diagrams I have created. It seems from the forum that this feature is available in some releases of Designer 10G. What version do I need to upgrade to get to get access t
-
Hi, how do I set my mouse double click speed? I couldn't find an appropriate setting in xorg.conf Last edited by quaaark (2011-10-18 23:52:22)
-
Input preset (Canon HF100)
I am using a Canon HF100 PAL AVCHD camera with PE7. This camera has several settings for recording video, but i mainly use FXP which gives 1920x1080 footage. With this setting i can choose 25p of 50i. 25p doesn't look good when played back om the cam