Help In Call Method Using types Tables.
dear gurus
im having a problem in my code please help me
TYPES: BEGIN OF itab,
vtext TYPE tvfkt-vtext,
fkart TYPE vbrk-fkart,
fkdat TYPE vbrk-fkdat,
vbeln TYPE vbrk-vbeln,
END OF itab.
DATA: itab1 TYPE itab OCCURS 0 WITH HEADER LINE.
DATA: itab2 TYPE itab OCCURS 0 WITH HEADER LINE.
SELECT *
INTO CORRESPONDING FIELDS OF TABLE itab1
FROM vbrk
INNER JOIN vbrp ON vbrp~vbeln = vbrk~vbeln
WHERE vbrk~fkart IN fkart
AND vbrk~fkdat IN fkdat
AND vbrp~vstel IN vstel
AND vbrk~kunag IN kunag
AND vbrp~matnr IN matnr.
LOOP AT itab1.
SELECT SINGLE vtext FROM tvfkt
INTO itab1-vtext WHERE fkart EQ itab1-fkart
AND spras EQ 'EN'.
IF itab1-fkart EQ 'F2'.
CONCATENATE 'Tax' itab1-vtext INTO itab1-vtext SEPARATED BY space.
ENDIF.
SELECT SINGLE bstkd FROM vbkd INTO itab1-bstkd
WHERE vbeln EQ itab1-aubel.
SELECT SINGLE name1 FROM kna1 INTO itab1-name1 WHERE
kunnr EQ itab1-kunag.
MODIFY itab1.
COLLECT itab1 INTO itab2.
MOVE-CORRESPONDING itab1 TO itab2.
CLEAR itab1.
ENDLOOP.
LOOP AT itab2.
SELECT SINGLE kbetr FROM konv INTO itab2-kbetr
WHERE kschl EQ 'PR00'
AND knumv EQ itab2-knumv.
itab2-kwert = itab2-fklmg * itab2-kbetr.
itab2-gst = itab2-kwert * 21 / 100.
itab2-sed = itab2-kwert * 1 / 100.
itab2-gt = itab2-kwert + itab2-gst + itab2-sed.
MODIFY itab2.
ENDLOOP.
CALL METHOD w_handle->insert_full
EXPORTING
n_vrt_keys = 1
n_hrz_keys = 1
n_att_cols = 3
sema = t_sema[]
hkey = t_hkey[]
vkey = t_vkey[]
online_text = t_online[]
data = itab2 " "ITAB2" is not type-compatible with formal parameter "DATA". <- ERROR
EXCEPTIONS
dim_mismatch_data = 1
dim_mismatch_sema = 2
dim_mismatch_vkey = 3
error_in_hkey = 4
error_in_sema = 5
inv_data_range = 6
error_in_vkey = 7.
Hi,
In your case, please change itab2 into itab2[].
Because you defined itab2 with header line, itab2 means header line in the method call.
Cheers,
Similar Messages
-
Help on CAST function, defining TYPE TABLE and using a REF cursor
Hi,
I have written a procedure (lookup) inside a package (lookup_pkg) as shown below.
Procedure has an output variable of type PL/SQL TABLE which is defined in the package.
I want to write a wrapper procedure lookupref to the procedure lookup to return a ref cursor.
CREATE OR REPLACE PACKAGE lookup_pkg AS
TYPE t_lookup_refcur IS REF CURSOR;
CURSOR c_lookup IS
Select columns1,2,3,....100
FROM A, B, C, D, E
WHERE ROWNUM < 1;
TYPE t_lookup IS TABLE OF c_lookup%ROWTYPE;
Procedure lookup(id Number, o_lookup OUT t_lookup);
End lookup_pkg;
CREATE OR REPLACE PACKAGE BODY lookup_pkg As
Procedure lookup(id Number, o_lookup OUT t_lookup) IS
BEGIN
END lookup;
Procedure lookupref(id Number, o_lookupref OUT t_lookup_refcur) IS
o_lookup t_lookup;
BEGIN
lookup(id, o_lookup t_lookup);
OPEN t_lookup_refcur FOR
SELECT *
FROM TABLE(CAST(o_lookup AS t_lookup));
Exception
End lookupref;
END lookup_pkg;
When I compile this procedure, I am getting invalid datatype Oracle error and
cursor points the datatype t_lookup in the CAST function.
1. Can anyone tell me what is wrong in this. Can I convert a PL/SQL collection (pl/sql table in this case) to PL/SQL datatype table or does it need to be a SQL datatype only (which is created as a type in database).
Also, to resolve this error, I have created a SQL type and table type instead of PL/SQL table in the package as shown below.
create or replace type t_lookuprec as object
(Select columns1,2,3,....100
FROM A, B, C, D, E
WHERE ROWNUM < 1);
create or replace type t_lookup_tab AS table of t_lookuprec;
CREATE OR REPLACE PACKAGE BODY lookup_pkg As
Procedure lookup(id Number, o_lookup OUT t_lookup) IS
BEGIN
END lookup;
Procedure lookupref(id Number, o_lookupref OUT t_lookup_refcur) IS
o_lookup t_lookup;
BEGIN
lookup(id, o_lookup t_lookup);
OPEN t_lookup_refcur FOR
SELECT *
FROM TABLE(CAST(o_lookup AS t_lookup_tab));
Exception
End lookupref;
END lookup_pkg;
When I compile this package, I am getting "PL/SQL: ORA-22800: invalid user-defined type" Oracle error and
points the datatype t_lookup_tab in the CAST function.
2. Can anyone tell me what is wrong. Can I create a type with a select statement and create a table type using type created earlier?
I have checked the all_types view and found that
value for Incomplete column for these two types are YES.
3. What does that mean?
Any suggestions and help is appreciated.
Thanks
Srinivascreate or replace type t_lookuprec as object
(Select columns1,2,3,....100
FROM A, B, C, D, E
WHERE ROWNUM < 1);You are correct that you need to use CREATE TYPE to use the type in SQL.
However unless I am mistaken you appear to have invented your own syntax for CREATE TYPE, suggest you refer to Oracle documentation. -
Error on Calling Methods Using an Object of a Class
I keep getting the error cannot resolve variable addStud . I can't figure out why. I've created objects of classes before this way, then called methods within that class like this and it worked fine. I can't discern any difference between the syntax of the program that worked successfully and this one. I commented the parts where the error is when I tried to send a variable to a method in the class Recieve of which addStud is an object of. If you can see something that I can't I'd appreciate it. I've checked the obvious things like making sure the class name and method name is spelled the same way in both my frame and the class file.
import java.awt.event.*;
import java.awt.*; /* Used by IntroTest3.java. */
import javax.swing.*;
public class RegFrame extends JInternalFrame
{ // Begin class RegFrame
static final int xOffset = 30, yOffset = 30;
private JLabel nameLabel, displayLabel;
private JTextField nameField;
private JTextArea displayText;
private JButton addButton;
private String name;
private int numStu;
public RegFrame() { // Begin RegFrame constructor
super(" Register a New Student ",
true, //resizable
true, //closable
true, //maximizable
true);//iconifiable
//...Create the GUI and put it in the window...
//...Then set the window size or call pack...
setSize(400,300); //Set the window's location.
setLocation(xOffset, yOffset);
Container content = getContentPane();
setBackground(Color.white);
content.setBackground(Color.white);
content.setLayout( new FlowLayout());
//* CREATE LABELS AND TEST ENTRY FIELDS FOR REGISTERING A NEW STUDENT *
* HERE IS WHERE OBJECT OF RECIEVE IS CREATED *
Recieve addStud = new Recieve();
nameLabel = new JLabel(" Enter student name: ");
nameField = new JTextField(20);
content.add ( nameLabel );
content.add ( nameField );
addButton = new JButton( "Add Student" );
content.add( addButton );
addButton.addActionListener(
new ActionListener()
{ // Open ActionListener
public void actionPerformed (ActionEvent e)
getInput();
} // Close ActionListener
} // End RegFrame Constructor
// get input
private void getInput()
numStu++;
name = nameField.getText();
JOptionPane.showMessageDialog( null, "NAME: " + name + "\n"
+ "Student number:"+ numStu );
addStud.addName( name ); /** <--- HERE IS ERROR **/
} // End class RegFrame;This is the class:
public class Recieve
{ // Begin class Recieve
private double stAssign[];
private double stLab[];
private double stProject[];
private double stQuiz[];
private double stTest[];
private String stNames[];
int snc;
public Recieve ()
stAssign = new double[10];
stLab = new double[10];
stProject = new double[10];
stQuiz = new double[10];
stTest = new double[10];
stNames = new String[10];
snc = 0; // Student Name Counter
public void addName (String stName)
stNames[snc] = stName;
snc++;
} // End class Recieve1- Add the following class variable declaration for RegFrame:
private Recieve addStud;2- Change in the RegFrame constructor:
addStud = new Recieve(); -
Need help about ref cursor using like table
Hi Guys...
I am devloping package function And i need help about cursor
One of my function return sys_refcursor. And the return cursor need to be
join another table in database . I don't have to fetch all rows in cursor
All i need to join ref cursor and another table in sql clause
like below
select a.aa , b.cc form ( ref_cursor ) A, table B
where A.dd = B.dd
I appeciate it in advanceMy understanding is that you have a function that returns a refcursor and is called by a java app.
Because this is a commonly used bit of code, you also want to reuse this cursor in other bits of sql and so you want to include it like table in a bit of sql and join that refcursor to other tables.
It's not as easy as you might hope but you can probably achieve this with pipelined functions.
Is it a direction that code should be going down? yes, eventually. I like the idea of pulling commonly used bits of code into a SQL statement especially into the WITH section, provided it could be used efficiently by the CBO.
Is it worth the effort given what you have to do currently to implement it? possibly not.
what else could you do? construct the sql statement independently of the thing that used it and reuse that sql statement rather than the refcursor it returns?
Message was edited by:
dombrooks -
I'm new to Java, trying to pass a required class so I can graduate this semester, and I need help figuring out what is wrong with the code below. My assignment is to create a program to convert celsius to fahrenheit and vice versa using Scanner for input. The program must contain 3 methods - main, convert F to C, method, and convert C to F method. Requirements of the conversion methods are one parameter which is an int representing temp, return an int representing calculated temp after doing appropriate calculation, should not display info to user, and should not take in info from user.
The main method is required to ask the user to input a 1 for converting F to C, 2 for C to F, and 3 to end the program. It must include a while loop that loops until the user enters a 3, ask the user to enter a temp, call the appropriate method to do the conversion, and display the results. I'm having trouble calling the conversion methods and keep getting the following 2 compiler errors:
cannot find symbol
symbol : method farenheitToCelsius(int)
location: class WondaPavoneTempConverter
int celsius = farenheitToCelsius(intTemp);
^
cannot find symbol
symbol : method celsiusToFarenheit(int)
location: class WondaPavoneTempConverter
int farenheit = celsiusToFarenheit(intTemp);
The code is as follows:
public static void main(String[] args) {
// Create a scanner
Scanner scanner = new Scanner(System.in);
// Prompt the user to enter a temperature
System.out.println("Enter the temperature you wish to convert as a whole number: ");
int intTemp = scanner.nextInt();
System.out.println("You entered " + intTemp + " degrees.");
// Prompt the user to enter "1" to convert to Celsius, "2" to convert to
// Farenheit, or "3" to exit the program
System.out.println("Enter 1 to convert to Celsius, 2 to convert to Farenheit, or 3 to exit.");
int intConvert = scanner.nextInt();
// Convert temperature to Celsius or Farenheit
int celsius = farenheitToCelsius(intTemp);
int farenheit = celsiusToFarenheit(intTemp);
while (intConvert >= 0) {
// Convert to Celsius
if (intConvert == 1) {
System.out.println("Celsius is " + celsius + " degrees.");
// Convert to Farenheit
else if (intConvert == 2) {
System.out.println("Farenheit is " + farenheit + " degrees.");
// Exit program
else if (intConvert == 3) {
break;
else {
System.out.println("The number you entered is invalid. Please enter 1, 2, or 3.");
//Method to convert Celsius to Farenheit
public static int celsiusToFahrenheit(int cTemp) {
return (9 / 5) * (cTemp + 32);
//Method to convert Farenheit to Celsius
public static int fahrenheitToCelsius(int fTemp) {
return (5 / 9) * (fTemp - 32);
I readily admit I'm a complete dunce when it comes to programming - digital media is my area of expertise. Can anyone point me in the right direction? This assignment is due very soon. Thanks.1) consider using a boolean variable in the while statement and converting it to true if the input is good.
while (inputNotValid)
}2) put the code to get the input within the while loop. Try your code right now and enter the number 30 when your menu requests for input and you'll see the infinite loop.... and why you need to request input within the loop.
3) Fix your equations. You are gonig to have to do some double calcs, even if you convert it back to int for the method return. Otherwise the results are just plain wrong. As a good test, put in the numbers -40, 0, 32, 100, and 212. Are the results as expected? (-40 is the only temp that is the same for both cent and fahr). I recommend doing double calcs and then casting the result to int in the return. for example:
int a = (int) (20 + 42.0 / 3); // the 42.0 forces the compiler to do double calc.4) One of your equations may still be plain wrong even with this fix. Again, run the test numbers and see.
5) Also, when posting your code, please use code tags so that your code will be well-formatted and readable. To do this, either use the "code" button at the top of the forum Message editor or place the tag [code] at the top of your block of code and the tag [/code] at the bottom, like so:
[code]
// your code block goes here.
[/code] -
Hi,
is it possible to call a method of a class from a remote system without using a RFC enabled function module?
I mean without calling a class method instantiated in a function module.
MichaelUnfortunately no. This is one of the areas not covered by ABAP OO.
The list of missing features (as of 7.0 ehp 2) is outlined in "Official ABAP Programming Guidelines" book:
- remote method invocation as a replacement for rfc
- replacement for update FMs (CALL FUNCTIOn IN UPDATE TASK)
- replacement for call of subroutines during COMMIT WORK and ROLLBACK
- OO handling of classic screens
- dynamic generation of programs (GENERATE SUBROUTINE POOL)
- direct support of background processing (SUBMIT VIA JOB) -
Re: help with calling methods
TL;DR--OK, here are 2 things for you to check
1 - are you making changes to your object in a scope as a passed by value variable?
public void myMethod(MyObject o){
o.my_int = 66;
}when you return from this method, my_int will be the same as it was before you entered.
2 - are you making changes to what you think is your object, but is a local copy?
class MyClass{
String s = "This is a test";
MyClass{
String s = "My inialized String";
}even through you changed s in your constructor (you can say any method here), you defined a local variable called s and actually modified the local variable leaving your class variable s altered.alright guys all yall who posted replies thanks.
i found out what was wrong. my program was working perfectly. I had flaws in basic math equations that made me get 0 for all those things. -
Help For Calling Method........!
I am confused about a problem. When I access the method of EJB A: such as UpdJob(),it works seccessfully,
also it is successful when access EJB B: insert(...).
But when I call the both methods at the same time in a method:
public void bothmethod(){
B.insert();..........(the method of EJB B)
A.UpdJob();........(the method of EJB A)
the result is that the B.insert() is success and the B.UpdJob failed with exception: No Resource Available,ejbStore failed,getConnection...
It looks failed to connect the database.
I don't know what's the matter,who can tell me?
Thanks in advance.you may have closed some resources in calling the B.insert(), and then not establish that resource before calling A.UpdJob()
-
Help with calling methods of different classes
I have two classes. In class A I read a line of input from the console
myVar= x.readLine();
then I call a method of the same class (A)
methodA(); i get NULLPOINTEREXCEPTION here
in this method I wish to call another method but this time of class B so I create an instance of class B in class A
private B instanceVar;
and then proceed to create the method call to class B
instanceVar.methodB(myVar); i get NULLPOINTEREXCEPTION here
What am I doing wrong?What am I doing wrong?Not posting a short snippet of java code that demonstrates your problem.
In class A I read a line of input from the console
myVar= x.readLine();
How is that related to the NPE's?
then I call a method of the same class (A)
methodA(); i get NULLPOINTEREXCEPTION hereSomething is probably wrong in methodA(). Impossible to say anything more with the information given.
private B instanceVar;
and then proceed to create the method call to class B
instanceVar.methodB(myVar); i get NULLPOINTEREXCEPTION hereDid you ever assign instanceVar to an actual object with something like instanceVar = new B(); ? -
About calling method with arguments
Hi,
I have a problem about calling method using reflection. my method is like follows:
public myMethod(Integer var1, MyObject mobj) {
I've tried to call the method using the following code,
Class[] parameterTypes = new Class[] {Integer.class, MyObject.class};
Object[] arguments = new Object[] {new Integer(2), mobj};
Method met=cl.getMethod("myMethod", parameterTypes);
But the in the last line NoSuchMethodException is thrown.
How can I send the reference of MyObject to myMethod()?
Thanx
ronyShould work ok:
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
public class Test {
static class MyObject {}
public static void main(String[] args) throws Exception {
Class c = Test.class;
Class[] parameterTypes = new Class[] {Integer.class, MyObject.class};
try {
Object[] arguments = new Object[] {new Integer(2), new MyObject()};
Method met = c.getMethod("myMethod", parameterTypes);
met.invoke(new Test(), arguments);
} catch (NoSuchMethodException e) {
System.out.println(e);
} catch (IllegalAccessException e) {
System.out.println(e);
} catch (InvocationTargetException e) {
System.out.println(e);
public void myMethod(Integer var1, MyObject mobj) {
System.out.println("myMethod");
} -
Using fieldnames table in GUI_DOWNLOAD method
Hi Experts,
I need to download an itab data with field names as headers. I am using this but getting error 'Formal parameter "FIELDNAMES" does not exist. However, the parameter "FILENAME" has a similar name'.
CALL METHOD cl_gui_frontend_services=>gui_download
EXPORTING
filename = w_filenm
filetype = c_filetype
write_field_separator = c_x
CHANGING
data_tab = i_bsak[]
fieldnames = i_field[]
EXCEPTIONS
file_write_error = 1
no_batch = 2
gui_refuse_filetransfer = 3
invalid_type = 4
no_authority = 5
unknown_error = 6
header_not_allowed = 7
separator_not_allowed = 8
filesize_not_allowed = 9
header_too_long = 10
dp_error_create = 11
dp_error_send = 12
dp_error_write = 13
unknown_dp_error = 14
access_denied = 15
dp_out_of_memory = 16
disk_full = 17
dp_timeout = 18
file_not_found = 19
dataprovider_exception = 20
control_flush_error = 21
not_supported_by_gui = 22
error_no_gui = 23
OTHERS = 24.
Please let me know how can i get file header using GUI_DOWNLOAD method.
Thanks in adv
AkashHi
Say for example I'm downloading a internal table with 4 fields namely field1, field2, field3 and field4.
I want these field name in the header, then this is the way to do it.
TYPES: BEGIN OF ty_head, "Structure for header
h(10) TYPE c,
END OF ty_head.
DATA: it_head TYPE TABLE OF ty_head WITH HEADER LINE.
"Adding header details
it_head-h = 'Field1'.
APPEND it_head.
it_head-h = 'Field2'.
APPEND it_head.
it_head-h = 'Field3'.
APPEND it_head.
it_head-h = 'Field4'.
APPEND it_head.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = p_file
filetype = 'ASC'
write_field_separator = 'X'
header = '00' "<= note this
TABLES
data_tab = it_tab
fieldnames = it_head[] "<= Pass your header table here
EXCEPTIONS
OTHERS = 1.
Hope this helps.
Thx and regrds
Durga.K -
F4-Help without using a table search help
Hi,
We´re using CRM 2007 and I have created several F4-Helps for different fields on the webui.
There it was always necessary to use an existing table search help in the GET_V-method:
CREATE OBJECT rv_valuehelp_descriptor
TYPE
cl_bsp_wd_valuehelp_f4descr
EXPORTING
iv_help_id = lv_help_id "search help name
iv_help_id_kind = if_bsp_wd_valuehelp_f4descr=>help_id_kind_name
iv_input_mapping = lt_inmap
iv_output_mapping = lt_outmap
iv_trigger_submit = abap_true.
But how can I create a f4-help without an existing search help. I have an internal table that I want to be shown like an f4-help (not as dropdown -> a dropdown-field wouldn´t be a problem).
Structure of the internal table: COML_PROD_CAT_REL_F4
Thanx for help.
Greetings,
Sven
Edited by: Sven Keller on Aug 13, 2008 4:26 PMHi Sven,
you already pasted the correct call for creating a value help. Now what you have to alter is the variable lv_help_id to reflect a F4-Valuehelp class.
CREATE OBJECT rv_valuehelp_descriptor TYPE cl_bsp_wd_valuehelp_f4descr
EXPORTING
iv_help_id = '(CL_CRM_UIU_BP_IDTYPE_2_F4)' "#EC NOTEXT
iv_help_id_kind = if_bsp_wd_valuehelp_f4descr=>help_id_kind_comp
iv_input_mapping = lt_inmap
iv_output_mapping = lt_outmap.
As you can see CL_CRM_UIU_BP_IDTYPE_2_F4 is a normal ABAP class implementing interface IF_BSP_WD_CUSTOM_F4_CALLBACK. Please take a look at it.
It should not be very hard to implement the single method
cheers Carsten -
I am getting a error while using CALL METHOD cl_ssf_xsf_utilities=>get_bds_graphic_as_bmp
The error is class "CL_SSF_XSF_UTILITIES is unknown. How to correct that?? please help I am new to object oriented programming??
Edited by: priya singh on Nov 18, 2008 2:14 PMThis is my code.
REPORT ZSAVE_FUNCTION .
D A T A D E C L A R A T I O N S *
DATA: v_bitmap TYPE xstring, "graphic data
v_file TYPE string, "file name
v_length TYPE i. "length of binary file
DATA: BEGIN OF it_bitmaps OCCURS 0,
object TYPE tdobjectgr, "object
name TYPE tdobname, "name
id TYPE tdidgr, "id
tdbtype TYPE tdbtype, "graphic type
END OF it_bitmaps.
DATA: itab TYPE TABLE OF x.
*class cl_ssf_xsf_utilities definition.
public section.
methods : get_bds_graphic_as_bmp
DATA: L_GRAPHIC_XSTR TYPE XSTRING.
*method cl_ssf_xsf_utilities
S E L E C T I O N - S C R E E N *
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME.
PARAMETERS: p_object TYPE tdobjectgr, "object
p_btype TYPE tdbtype, "graphic type
p_name TYPE tdobname, "name
p_id TYPE tdidgr. "id
SELECTION-SCREEN END OF BLOCK b1.
SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME.
PARAMETERS: p_file TYPE rlgrap-filename. "file name
SELECTION-SCREEN END OF BLOCK b2.
*A T S E L E C T I O N - S C R E E N O N V A L U E - R E Q U E S T *
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_name.
*-- Creating f4 help for the parameters
PERFORM get_f4_object_name.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
*-- Getting the current value entered
PERFORM get_current_value.
*-- Value Request Functionality For Input File Name
PERFORM f4_value_request.
S T A R T O F - S E L E C T I O N *
START-OF-SELECTION.
*--Getting the graphic as a BMP file
PERFORM get_graphic_bmp.
*--Convert the Xstring format to binary format
PERFORM convert_to_binary.
*--Download the graphic
PERFORM download_graphic.
*& Form get_current_value
Get the current file path entered
FORM get_current_value .
DATA: BEGIN OF li_dynp_value_tab OCCURS 0.
INCLUDE STRUCTURE dynpread.
DATA: END OF li_dynp_value_tab.
DATA: l_program_name LIKE d020s-prog,
l_dynpro_number LIKE d020s-dnum.
l_program_name = sy-cprog.
l_dynpro_number = sy-dynnr.
REFRESH li_dynp_value_tab.
li_dynp_value_tab-fieldname = 'P_FILE'.
APPEND li_dynp_value_tab.
CALL FUNCTION 'DYNP_VALUES_READ'
EXPORTING
dyname = l_program_name
dynumb = l_dynpro_number
TABLES
dynpfields = li_dynp_value_tab
EXCEPTIONS
invalid_abapworkarea = 04
invalid_dynprofield = 08
invalid_dynproname = 12
invalid_dynpronummer = 16
invalid_request = 20
no_fielddescription = 24
undefind_error = 28.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE 'S' NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
READ TABLE li_dynp_value_tab INDEX 1.
p_file = li_dynp_value_tab-fieldvalue.
ENDFORM. " get_current_value
*& Form f4_value_request
Provinding the f4 for the given path
FORM f4_value_request .
*-- if the file is to be downloaded to presentation server
CALL FUNCTION '/SAPDMC/LSM_F4_FRONTEND_FILE'
EXPORTING
pathname = p_file
CHANGING
pathfile = p_file
EXCEPTIONS
canceled_by_user = 1
system_error = 2
OTHERS = 3.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE 'S' NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDFORM. " f4_value_request
*& Form GET_GRAPHIC_BMP
Get the graphic as a BMP file
FORM get_graphic_bmp.
CALL METHOD cl_ssf_xsf_utilities=>get_bds_graphic_as_bmp
EXPORTING
p_object = p_object
p_name = p_name
p_id = p_id
p_btype = p_btype
RECEIVING
p_bmp = L_GRAPHIC_XSTR
EXCEPTIONS
not_found = 1
internal_error = 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.
ENDFORM. " GET_GRAPHIC_BMP
*& Form CONVERT_TO_BINARY
Converting the xstring to binary format
FORM convert_to_binary .
CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
EXPORTING
buffer = v_bitmap
IMPORTING
output_length = v_length
TABLES
binary_tab = itab.
ENDFORM. " CONVERT_TO_BINARY
*& Form DOWNLOAD_GRAPHIC
Download the graphic
FORM download_graphic .
v_file = p_file.
CONCATENATE p_file '.BMP' INTO v_file.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
bin_filesize = v_length
filename = v_file
filetype = 'BIN'
TABLES
data_tab = itab
EXCEPTIONS
file_write_error = 1
no_batch = 2
gui_refuse_filetransfer = 3
invalid_type = 4
no_authority = 5
unknown_error = 6
header_not_allowed = 7
separator_not_allowed = 8
filesize_not_allowed = 9
header_too_long = 10
dp_error_create = 11
dp_error_send = 12
dp_error_write = 13
unknown_dp_error = 14
access_denied = 15
dp_out_of_memory = 16
disk_full = 17
dp_timeout = 18
file_not_found = 19
dataprovider_exception = 20
control_flush_error = 21
OTHERS = 22.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDFORM. " DOWNLOAD_GRAPHIC
*& Form GET_F4_OBJECT_NAME
Get F4 values for object names
FORM get_f4_object_name .
DATA: dynpfld_mapping TYPE STANDARD TABLE OF dselc WITH HEADER LINE,
return_tab TYPE STANDARD TABLE OF ddshretval WITH HEADER LINE.
*--Selecting the values to be provided as f4 help
SELECT tdobject
tdname
tdid
tdbtype
FROM stxbitmaps
INTO TABLE it_bitmaps.
*--To update the values in the remaining fields
dynpfld_mapping-fldname = 'F0001'.
dynpfld_mapping-dyfldname = 'P_OBJECT'.
APPEND dynpfld_mapping.
dynpfld_mapping-fldname = 'F0002'.
dynpfld_mapping-dyfldname = 'P_NAME'.
APPEND dynpfld_mapping.
dynpfld_mapping-fldname = 'F0003'.
dynpfld_mapping-dyfldname = 'P_ID'.
APPEND dynpfld_mapping.
dynpfld_mapping-fldname = 'F0004'.
dynpfld_mapping-dyfldname = 'P_BTYPE'.
APPEND dynpfld_mapping.
*--Providing f4 help with the selected values
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
retfield = 'TDOBNAME'
dynpprog = sy-repid
dynpnr = sy-dynnr
dynprofield = 'P_NAME'
value_org = 'S'
TABLES
value_tab = it_bitmaps
dynpfld_mapping = dynpfld_mapping
EXCEPTIONS
parameter_error = 1
no_values_found = 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.
ENDFORM. " GET_F4_OBJECT_NAME -
Issue with Capturing Long text using CALL METHOD EDITOR- GET_TEXT_AS_STREAM
HI Experts,
Standard Long text is capturing using CALL METHOD EDITOR->GET_TEXT_AS_STREAM
but not working for Custom Long text – Only changes
Here is the Issue:
1) Created Custom Long text in TAB. --> Good
2) Entered few lines in custom Long text --> Good
Click on Standard Tab , Leaving Custom tab and Custom Long text-->Good
4) In PAI of Custom Tab – Changes captured using CALL METHOD 1 ( See below Code 1)--> Good
5) Entered few lines in Standard Long text in Standard Tab -->Good
6) Click another Standard Tab
7) In PAI of Standard Tab – Changes captured using CALL MEHTOD 2 ( See Below Code 2)-->Good
8) Come back to Standard Tab / Standard Long Text , Enter few more lines.
9) Change the Tab , IN PAI of Standard Tab/Standard Text , Changes Captured using CALL METHOD2 ( See Below CODE 3) --> Good
10) Go to Custom Tab , Custom Long text , Entered few more lines--> Good
11) Click on any other tab, Triggered again PAI of Custom tab / Custom Long text using Call Method1 ( See Below Code 4) -->Good triggered PAI same CALL METHOD TEXT_EDITOR1->GET_TEXT_AS_STREAM.
12) But additional lines are not captured , saying ZERO LINES in Internal Table and IF_MODIFIED = NO -->Issues lies here.
CODE1 ( Custom Long text entry capturing – First Few Lines )
Custom Long text Entries are stored in LS_OUTTAB-TEXT first time when entered few lines and LV_MOD is 1.
PAI of Custom tab
CALL METHOD TEXT_EDITOR1->GET_TEXT_AS_STREAM
EXPORTING
ONLY_WHEN_MODIFIED = CL_GUI_TEXTEDIT=>TRUE
IMPORTING
TEXT = LS_OUTTAB-TEXT ( FIlled with Lines entered in custom long text )
IS_MODIFIED = LV_MOD ( Value 1 , Modified )
EXCEPTIONS
ERROR_DP = 1
ERROR_CNTL_CALL_METHOD = 2
OTHERS = 3
CODE2 ( Standard Long Text Entry Capturing – First Few Lines )
Standard Long text Entries are stored in SELECTED_TEXT first time when entered few lines and FLAG_MODIFIED is 1.
PAI of Standard tab
CALL METHOD EDITOR->GET_TEXT_AS_STREAM
EXPORTING
ONLY_WHEN_MODIFIED = YTRUE ( Value 1 , Modified )
IMPORTING
TEXT = SELECTED_TEXT ( FIlled with Lines entered in standard long text )
IS_MODIFIED = FLAG_MODIFIED.
CODE 3 ( Standard Long Text Entry Capturing – Second time Few Lines )
Standard Long text Entries are stored in SELECTED_TEXT second time when entered few lines and FLAG_MODIFIED is 1.
PAI of Standard tab
CALL METHOD EDITOR->GET_TEXT_AS_STREAM
EXPORTING
ONLY_WHEN_MODIFIED = YTRUE
IMPORTING
TEXT = SELECTED_TEXT ( FIlled with Lines entered in standard long text )
IS_MODIFIED = FLAG_MODIFIED. ( Value 1 , Modified )
CODE4 ( Custom Long text entry capturing – Second Time Few Lines )
Custom Long text Entries are not stored in LS_OUTTAB-TEXT Second Time when entered few lines and LV_MOD is 0.
PAI of Custom tab
CALL METHOD TEXT_EDITOR1->GET_TEXT_AS_STREAM
EXPORTING
ONLY_WHEN_MODIFIED = CL_GUI_TEXTEDIT=>TRUE
IMPORTING
TEXT = LS_OUTTAB-TEXT ( ZERO ENTRIES )
IS_MODIFIED = LV_MOD ( NOT MODIFIED Flag )
EXCEPTIONS
ERROR_DP = 1
ERROR_CNTL_CALL_METHOD = 2
OTHERS = 3
Can anyone help me out of this.
With Regards,
Bala MExcellent Eitan,
Here is what I am trying to Achieve.
In Create Notification IW21 , They need 5 Long Text in Custom Tab ( Say Tab Name is MBR ).
TAB1 NOTIFICATION Standard Information , TAB2 REFERENCE OBJ , TAB 3 MalFunction , Breakdown Standard one...... TAB 7 ( Custom Tab ).
In Custom Tab , I added 5 LONG TEXT ( its 5 WHY Concept ).
When the User enters data in 5 Long text , it should store long text along with Notification number when save.
But Notification number will be generated @ the time of SAVE , but before that its just shows as
%0000000001 ( and Number will be generated 1000065479) at Save.
How to achive this .
I did this:
Added 5 Custom Container. and In PBO / PAI
PROCESS BEFORE OUTPUT.
MODULE STATUS_0100.
PROCESS AFTER INPUT.
MODULE USER_COMMAND_0100.
IN PBO
CREATE OBJECT TEXT_EDITOR1 , CREATE OBJECT TEXT_EDITOR2, CREATE OBJECT TEXT_EDITOR3 like wise 5
CALL METHOD TEXT_EDITOR1->SET_TEXT_AS_R3TABLE , CALL METHOD TEXT_EDITOR2->SET_TEXT_AS_R3TABLE .. Like wise 5 , So when the user Click on Custom Tab ( MBR ).
It give 5 Long text.
When he click tab1 or tab2 or tab3 .. and again tab MBR , still data is available.
How to store this data for future retrival ( IW22 or IW23 ) ?
Its working fine when I enter first time and goes here and there and finall save .
IN SAVE BADI , I imported the Long text and created Standard Text SO10 with Notification Number with LONG1 , LONG2 .. means 1000065479LONG1 as standard text.
But not working when I entered first time and go to tab1 and tab2 and then to MBR tab and added few more lines , its not exporting full lines and in IMPORT ( SAVE BADI ) giving ZERO Lines.
Please help and thanks for your quick response. -
Problem calling applet method using IE
I've searched through the forum and can't seem to find anything that can help me fix this. I'm trying to call an applet's method using Javascript. This is working fine under Netscape, but not IE. Everything I've read seems to indicate that I'm doing this right, but I'm getting "Object doesn't support this property or method" when I try to call the applet method from IE.
In this example method, I'm trying to call the applet's countChars method, which should return the length of the string you pass into it. Works under Netscape 6.2, but not IE 6.0
Here's my applet code:
import java.lang.String;
public class test extends java.applet.Applet {
public static int countChars(String s) {
return s.length();
And my HTML
<HTML>
<HEAD>
<script language="Javascript">
function refreshApplet()
/* i = document.forms.myForm.TestApplet.countChars();
document.forms.myForm.output.value=i; */
document.forms.myForm.output.value=document.applets["TestApplet"].countChars(document.forms.myForm.input.value);
</script>
</HEAD>
<BODY>
<APPLET CODE = "test.class" WIDTH = 400 HEIGHT = 400 ALIGN = middle NAME = "TestApplet" scriptable="true">
</APPLET>
<br>
<form name="myForm">
<input type="text" name="input">
<input type="button" value="click me" onClick="refreshApplet();">
<hr>
<input type="text" name="output">
</form>
</BODY>
</HTML>
Thanks in advance!
Craig Drabik
Sr. Programmer/Analyst
University at BuffaloI have very similar problem, my applet works OK using Netscape (6.2 and 7.0), but with IE 6.0 It only works with windows XP;
The reported error is "Object doesn't support this property or method"
Can someone please help me to solve this problem.
Cheers
Horus
This is my code:
- I call the applet using javaScript and input the method setData with two strings.
function graphic()
var dataZenith;
var dataManual;
initVariables();
dataZenith = graphicZENith(); //Call other Javascript functions
dataManual = graphicManual(); //Call other Javascript functions
document.AppletOne.setData(dataZenith,dataManual);
I run the applet with this HTML code:
<applet NAME="AppletOne" code="Appl.class" width="450" height="450"
MAYSCRIPT></applet>
//Applet code/////////////
import java.awt.*;
import java.awt.geom.*;
import java.applet.*;
import java.util.*;
public class Appl extends Applet {
private int [] myArray1 = new int [156];
private int [] myArray2 = new int [156];
private boolean flag = false;
// maxDataYAxesNumber es usado para dividir el eje de las Y
public void init()
setFont(new Font("SansSerif", Font.BOLD, 12));
setBackground (Color.white);
setSize(getSize());
// Get data and put in an array
public void setData(String data1, String data2)
final String DELIMITER = ",";
final StringTokenizer theTokens1 =
new StringTokenizer(data1, DELIMITER);
final StringTokenizer theTokens2 =
new StringTokenizer(data2, DELIMITER);
try
String dataX = data1;
for (int i = 0; i < 156; i++)
myArray1[i] = Integer.parseInt(theTokens1.nextToken().trim());
myArray2[i] = Integer.parseInt(theTokens2.nextToken().trim());
catch (NumberFormatException e) {};
flag = true; //I get the data OK
repaint();
public void paint (Graphics g){
Graphics2D g2d = (Graphics2D)g;
setData(data1, data2) ;
if (flag == true)
//Call other functions to process the graphic
else g2d.drawString(" Sorry I can get Data", 100,80);
Maybe you are looking for
-
Implicit null and explicit null
Hi, 1) If a router receives a label of 0,what is it supposed to do..? label poppoing or swapping th label with 0. 2) If a router receives the label of 3,whether it pops the label or swap the incoming label with the value of 3..? Thansk
-
Unable to complete installation of imo
unable to complete installation of imo it givs pending ...
-
The SAPinst GUI could not be started because a Java Runtime Environment
Hi all, I AM TRYING TO INSTALL THE ECC 6.0 ON HPUX AND WHILE STARTING SAPINST GETTING THIS ERROR: The SAPinst GUI could not be started because a Java Runtime Environment (JRE) could not be found. Either the JRE is not installed correctly or the envir
-
I need material on ABAP Webdynpro..
Hi Experts, I want to learn web dynpro ABAP; So please give me the materials or the links where i can get. I am looking for your help.. Regards, Kali
-
Hello All, We are dong Clock in & Clock out in ESS. I have done with configuration. But when i check in ESS for clock in & Clock out i'm getting error "There is no general processing process for rule group in period 11., error key: RFC_ERROR_SYSTEM_