How to find number from text string??
Hi All,
Can you tell me how to find/ fetch number from string?
is there any function module for this.?
for example , I have string like "+++++1000000589+++"
and I need to fetch the invoice no 1000000589 from the above string..then How to do that? Letters may come first or number may come first and latter text...
Regards,
Mrunal
You can do like this.
The below mentioned is code separate material
DO 18 TIMES.
LV_C = LV_C + 1.
LV_C1 = LV_C - 1.
IF GW_MATNR-MATNR+LV_C1(1) CN '0,1,2,3,4,5,6,7,8,9' .
IF ( ( LV_MAT EQ SPACE ) ) ." and ( lv_prefix eq space ) ) .
LV_PREFIX = 'X'.
CONCATENATE GW_TEMP-PREFIX GW_MATNR-MATNR+LV_C1(1) INTO
GW_TEMP-PREFIX.
ELSE.
LV_SUFFIX = 'X'.
CONCATENATE GW_TEMP-SUFFIX GW_MATNR-MATNR+LV_C1(1) INTO
GW_TEMP-SUFFIX.
ENDIF.
ELSEIF ( ( LV_SUFFIX EQ SPACE ) ) .
LV_MAT = 'X'.
CONCATENATE GW_TEMP-MATNR1 GW_MATNR-MATNR+LV_C1(1) INTO
GW_TEMP-MATNR1.
ELSEIF ( ( LV_MAT EQ 'X' ) ) .
CONCATENATE GW_TEMP-SUFFIX GW_MATNR-MATNR+LV_C1(1) INTO
GW_TEMP-SUFFIX.
ENDIF.
ENDDO.
Similar Messages
-
Windows PowerShell is a powerful command tool and we can use it for management and operations. In this article we introduce the detailed steps to use Windows PowerShell to find and replace test string in the
shapes in Excel Object.
Since the Excel.Application
is available for representing the entire Microsoft Excel application, we can invoke the relevant Properties and Methods to help us to
interact with Excel document.
The figure below is an excel file:
Figure 1.
You can use the PowerShell script below to list the text in the shapes and replace the text string to “text”:
$text = “text1”,”text2”,”text3”,”text3”
$Excel
= New-Object -ComObject Excel.Application
$Excel.visible = $true
$Workbook
= $Excel.workbooks.open("d:\shape.xlsx")
#Open the excel file
$Worksheet
= $Workbook.Worksheets.Item("shapes")
#Open the worksheet named "shapes"
$shape = $Worksheet.Shapes
# Get all the shapes
$i=0
# This number is used to replace the text in sequence as the variable “$text”
Foreach ($sh in $shape){
$sh.TextFrame.Characters().text
# Get the textbox in the shape
$sh.TextFrame.Characters().text =
$text[$i++]
#Change the value of the textbox in the shape one by one
$WorkBook.Save()
#Save workbook in excel
$WorkBook.Close()
#Close workbook in excel
[void]$excel.quit()
#Quit Excel
Before invoking the methods and properties, we can use the cmdlet “Get-Member” to list the available methods.
Besides, we can also find the documents about these methods and properties in MSDN:
Workbook.Worksheets Property (Excel):
http://msdn.microsoft.com/en-us/library/office/ff835542(v=office.15).aspx
Worksheet.Shapes Property:
http://msdn.microsoft.com/en-us/library/office/ff821817(v=office.15).aspx
Shape.TextFrame Property:
http://msdn.microsoft.com/en-us/library/office/ff839162(v=office.15).aspx
TextFrame.Characters Method (Excel):
http://msdn.microsoft.com/en-us/library/office/ff195027(v=office.15).aspx
Characters.Text Property (Excel):
http://msdn.microsoft.com/en-us/library/office/ff838596(v=office.15).aspx
After running the script above, we can see the changes in the figure below:
Figure 2.
Please click to vote if the post helps you. This can be beneficial to other community members reading the thread.Thank you for the information, but does this thread really need to be stuck to the top of the forum?
If there must be a sticky, I'd rather see a link to a page on the wiki that has links to all of these ForumFAQ posts.
EDIT: I see this is no longer stuck to the top of the forum, thank you.
Don't retire TechNet! -
(Don't give up yet - 13,085+ strong and growing) -
How to find a specific text(string) in a list (100) programs
Dear All,
Wish tou a very happy new year 2009!!!
please let me know how we can find a specific word(eg: "barrel") in a list of programs/reports/bdc/user exits/field exits/function modules.
Thanks in advance.
Kumar.hi kumar,
open EWK1 transaction and search for the word or string according to your requirement.
Cheers
Gautham -
How Can I replace newScale Text Strings with Custom Values?
How Can I replace newScale Text Strings with Custom Values?
How can I replace newScale text strings with custom values?
All newScale text is customizable. Follow the procedure below to change the value of any text string that appears in RequestCenter online pages.
Procedure
1. Find out the String ID of the text string you would like to overwrite by turning on the String ID display:
a) Navigate to the RequestCenter.ear/config directory.
b) Open the newscale.properties file and add the following name-value pair at the end of the file:res.format=2
c) Save the file.
d) Repeat steps b and c for the RmiConfig.prop and RequestCenter.prop files.
e) Stop and restart the RequestCenter service.
f) Log in to RequestCenter and browse to the page that has the text you want to overwrite. In front of the text you will now see the String ID.
g) Note down the String ID's you want to change.
2. Navigate to the directory: /RequestCenter.ear/RequestCenter.war/WEB-INF/classes/com/newscale/bfw.
3. Create the following sub-directory: res/resources
4. Create the following empty text files in the directory you just created:
RequestCenter_0.properties
RequestCenter_1.properties
RequestCenter_2.properties
RequestCenter_3.properties
RequestCenter_4.properties
RequestCenter_5.properties
RequestCenter_6.properties
RequestCenter_7.properties
5. Add the custom text strings to the appropriate RequestCenter_<Number>.properties file in the following manner (name-value pair) StringID=YourCustomTextString
Example: The StringID for "Available Work" in ServiceManager is 699.
If you wanted to change "Available Work" to "General Inbox", you would add the following line to the RequestCenter_0.properties file
699=General Inbox
Strings are divided into the following files, based on their numeric ID:
Strings are divided into the following files, based on their numeric ID:
String ID File Name
0 to 999 -> RequestCenter_0.properties
1000 to 1999 -> RequestCenter_1.properties
2000 to 2999 -> RequestCenter_2.properties
3000 to 3999 -> RequestCenter_3.properties
4000 to 4999 -> RequestCenter_4.properties
5000 to 5999 -> RequestCenter_5.properties
6000 to 6999 -> RequestCenter_6.properties
7000 to 7999 -> RequestCenter_7.properties
6. Turn off the String ID display by removing (or commenting out) the line "res.format=2" from the newscale.properties, RequestCenter.prop and RmiConfig.prop files
7. Restart RequestCenter.
Your customized text should be displayed.I've recently come across this information and it was very helpful in changing some of the inline text.
However, one place that seemed out of reach with this method was the three main buttons on an "Order" page. Specifically the "Add & Review Order" button was confusing some of our users.
Through the use of JavaScript we were able to modify the label of this button. We placed JS in the footer.html file that changes the value of the butt -
How to find number of files in a folder using pl/sql
please someone guide as to how to find number of files in a folder using pl/sql
RegardsThe Java option works well.
-- results table that will contain a file list result
create global temporary table directory_list
directory varchar2(1000),
filename varchar2(1000)
on commit preserve rows
-- allowing public access to this temp table
grant select, update, insert, delete on directory_list to public;
create or replace public synonym directory_list for directory_list;
-- creating the java proc that does the file listing
create or replace and compile java source named "ListFiles" as
import java.io.*;
import java.sql.*;
public class ListFiles
public static void getList(String directory, String filter)
throws SQLException
File path = new File( directory );
final String ExpressionFilter = filter;
FilenameFilter fileFilter = new FilenameFilter() {
public boolean accept(File dir, String name) {
if(name.equalsIgnoreCase(ExpressionFilter))
return true;
if(name.matches("." + ExpressionFilter))
return true;
return false;
String[] list = path.list(fileFilter);
String element;
for(int i = 0; i < list.length; i++)
element = list;
#sql {
insert
into directory_list
( directory, filename )
values
( :directory, :element )
-- creating the PL/SQL wrapper for the java proc
create or replace procedure ListFiles( cDirectory in varchar2, cFilter in varchar2 )
as language java
name 'ListFiles.getList( java.lang.String, java.lang.String )';
-- punching a hole in the Java VM that allows access to the server's file
-- systems from inside the Oracle JVM (these also allows executing command
-- line and external programs)
-- NOTE: this hole MUST be secured using proper Oracle security (e.g. AUTHID
-- DEFINER PL/SQL code that is trusted)
declare
SCHEMA varchar2(30) := USER;
begin
dbms_java.grant_permission(
SCHEMA,
'SYS:java.io.FilePermission',
'<<ALL FILES>>',
'execute, read, write, delete'
dbms_java.grant_permission(
SCHEMA,
'SYS:java.lang.RuntimePermission',
'writeFileDescriptor',
dbms_java.grant_permission(
SCHEMA,
'SYS:java.lang.RuntimePermission',
'readFileDescriptor',
commit;
end;
To use:
SQL> exec ListFiles('/tmp', '*.log' );
PL/SQL procedure successfully completed.
SQL> select * from directory_list;
DIRECTORY FILENAME
/tmp X11_newfonts.log
/tmp ipv6agt.crashlog
/tmp dtappint.log
/tmp Core.sd-log
/tmp core_intg.sd-log
/tmp da.sd-log
/tmp dhcpclient.log
/tmp oracle8.sd-log
/tmp cc.sd-log
/tmp oms.log
/tmp OmniBack.sd-log
/tmp DPISInstall.sd-log
12 rows selected.
SQL> -
Find and Replace text string in HTML
Opps... I hope this forum is not just for Outlook. My Html files reside on my hard-drive. I am looking for VBA code to open specified file names ####File.html and then find and replace text strings within the html for example "####Name" replaced
with "YYYYY"
I drive the "####File.html" names and the find and replace text strings from an Excel sheet. I am an artist and this Sub would give me time to paint instead of find and replace text. Thank you!
[email protected]Hello Phil,
The current forum is for developers and Outlook related programming questions. That's why I'd suggest hiring anybody for developing the code for you. You may find freelancers, for example. Try googling for any freelance-related web sites and asking such
questions there.
If you decide to develop an Outlook macro on your own, the
Getting Started with VBA in Outlook 2010 article is a good place to start from. -
How to find number of lines in an internal table
Dear all,
how to find number of records present in an internal table.DESCRIBE TABLE
Syntax
DESCRIBE TABLE itab [KIND knd] [LINES lin] [OCCURS n].
Extras:
1. ... KIND knd
2. ... LINES lin
3. ... OCCURS n
Effect
This statement determines some properties of the internal table itab and assigns them to the specified variables. The various additions enable you to determine the table type, the number of currently filled rows and the initial memory requirement.
In addition, the system fields sy-tfill and sy-tleng are filled with the current number of table rows and the length of a table row in bytes.
Notes
For detailed information about an internal table, you should use the methods of RTTS of the DESCRIBE TABLE statement.
Without the specification of an addition, the statement DESCRIBE TABLE only sets the system fields sy-tfill and sy-tleng.
Addition 1
... KIND knd
Effect
The table type of the internal table itab is determined and a corresponding one-digit identification is assigned to the data object knd. A character-type data type is expected for the data object. The identifications are "T" for standard tables, "S" for sorted tables and "H" for hashed tables. These values are also defined as constants sydes_kind-standard, sydes_kind-sorted, and sydes_kind-hashed in the type group SYDES.
Addition 2
... LINES lin
Effect
The current number of table rows of the internal table itab is determined and is assigned to the data object lin.The data type i is expected for the data object.
Note
As of release 6.10, the current number of rows of an internal table can also be determined using the in-built function lines.
Addition 3
... OCCURS n
Effect
The initial memory requirement defined during the creation of the internal table with the addition INITIAL SIZE or the obsolete addition OCCURS is determined and assigned to the data object n. The data type i is expected for the data object.
Example
Descending sorting of a generically typed internal table in a subprogram. Since sorted tables cannot be sorted in a descending order, the table type is checked to avoid an exception that cannot be handled.
TYPE-POOLS sydes.
FORM sort_descending CHANGING itab TYPE ANY TABLE.
DATA tabkind(1) TYPE c.
DESCRIBE TABLE itab KIND tabkind.
IF tabkind = sydes_kind-standard OR
tabkind = sydes_kind-hashed.
SORT itab DESCENDING.
ELSEIF tabkind = sydes_kind-sorted.
MESSAGE '...' TYPE 'E'.
ELSE.
MESSAGE '...' TYPE 'E'.
ENDIF.
ENDFORM.
DESCRIBE FIELD INTO
Note
This statement is for internal use only.
It cannot be used in application programs.
Syntax
DESCRIBE FIELD dobj INTO td.
Effect
All characteristics of the field f, its components , sub-components etc. are displayed in the field td (type description). td has to be of the type SYDES_DESC, defined in Type Group SYDES. Because of this, the type group SYDES must be integrated into the ABAP-program with a TYPE-POOLS statement .
The structure SYDES_DESC has two table-type components TYPES and NAMES:
In TYPES, the tree structure of the type belonging to f is displayed. The components of a node are stored in the table TYPES in a continuous manner. Beginning and end of the line area that represents the components are stored in TYPES-FROM and TYPES-TO. The reference to the superior node can be found in TYPES-BACK. If no superior resp. subordinate node exists, then this is marked by the value 0 (For the relevance of further components, refer to the following sections).
The names of components, types etc. are not stored directly in TYPES. Instead, the components TYPES-IDX_... hold an index in the name table NAMES. The value 0 indicates that there is no reference to the name table.
NAMES contains the possibly fragmented names in the component NAMES-NAME. If a name continues in the following line, this is indicated by an asterisk ('*') in the component NAMES-CONTINUE.
The type description table (TYPES) not only stores information about the tree structure but also further information about the type of f resp. its components. This includes especially all information that can be determined using the usual additions to DESCRIBE FIELD. In detail, TYPES contains the following columns:
IDX_NAME
Component Name
IDX_USER_TYPE
Name of a user-defined type, i.e., a type that was defined through its TYPES-statement. Derived types (... TYPE A-B) and structures from the ABAP-Dictionary are not considered to be user-defined types.
CONTEXT
For user-defined types only: The context, in which the type is defined. Possible values are defined in the constant SYDES_CONTEXT of the type group SYDES. Please only use these constants to carry out a comparison. In detail, we distinguish between the following type contexts:
SYDES_CONTEXT-PROGRAM: Program-global type
SYDES_CONTEXT-FORM : FORM-local type
SYDES_CONTEXT-FUNCTION: FUNCTION-local type
SYDES_CONTEXT-METHOD : METHOD-local type
IDX_CONTEXT_NAME
For user-defined types only:
With a local context: The name of the FORM or FUNCTION, whose type was defined. The name of the associated program is then the first entry in the name table.
With a global context: The name of the program in which the type was defined.
IDX_EDIT_MASK
Conversion routine from the ABAP-Dictionary, is in accordance with the addition EDIT MASK at simple DESCRIBE.
IDX_HELP_ID
Help-Id when referencing to fields from the ABAP-Dictionary
LENGTH
Internal length, corresponds to the addition LENGTH at simple DESCRIBE
OUTPUT_LENGTH
Output length, corresponds to the addition OUTPUT-LENGTH at simple DESCRIBE
DECIMALS
Number of decimal digits, corresponds to the addition DECIMALS at simple DESCRIBE
TYPE
ABAP-Type, corresponds to the addition TYPE at simple DESCRIBE
TABLE_KIND
A table type is stored here for the components which represent an internal table. The same values are returned as with the variant DESCRIBE TABLE itab KIND k. Components which do not represent a table get the return value set to SYDES_KIND-UNDEFINED (see type group SYDES).
Example
Example definition of the complex data type EMPLOYEE_STRUC:
PROGRAM DESCTEST.
TYPES: BEGIN OF name_struc,
first TYPE c LENGTH 20,
last TYPE c LENGTH 20,
END OF name_struc,
BEGIN OF absence_time_struc,
day TYPE d,
from TYPE t,
to TYPE t,
END OF absence_time_struc,
phone_number TYPE n LENGTH 20,
BEGIN OF employee_struc,
id LIKE sbook-customid,
name TYPE name_struc,
BEGIN OF address,
street TYPE c LENGTH 30,
zipcode TYPE n LENGTH 4,
place TYPE c LENGTH 30,
END OF address,
salary_per_month TYPE p LENGTH 10 DECIMALS 3,
absent TYPE STANDARD TABLE OF absence_time_struc
WITH NON-UNIQUE DEFAULT KEY,
phone TYPE STANDARD TABLE OF phone_number
WITH NON-UNIQUE DEFAULT KEY,
END OF employee_struc.
You can determine the structure of the type EMPLOYEE_STRUC by collecting the type group SYDES as follows:
TYPE-POOLS: sydes.
DATA: employee TYPE employee_struc,
td TYPE sydes_desc.
DESCRIBE FIELD employee INTO td.
The following table shows a few selected columns of the type description table TD-TYPES. For a better overview, the names of the columns IDX_NAME, IDX_UERR_TYPE and IDX_EDIT_MASK have been shortened:
|FROM| TO |BACK|NAME|UTYP|EMSK|TYPE
|--||||||--
1 | 2 | 7 | 0 | 0 | 2 | 0 | v
2 | 0 | 0 | 1 | 6 | 0 | 4 | N
3 | 8 | 9 | 1 | 7 | 5 | 0 | u
4 | 10 | 12 | 1 | 8 | 0 | 0 | u
5 | 0 | 0 | 1 | 9 | 0 | 0 | P
6 | 13 | 13 | 1 | 11 | 0 | 0 | h
7 | 17 | 17 | 1 | 12 | 0 | 0 | h
8 | 0 | 0 | 3 | 13 | 0 | 0 | C
9 | 0 | 0 | 3 | 14 | 0 | 0 | C
10 | 0 | 0 | 4 | 15 | 0 | 0 | C
11 | 0 | 0 | 4 | 16 | 0 | 0 | N
12 | 0 | 0 | 4 | 17 | 0 | 0 | C
13 | 14 | 16 | 6 | 0 | 18 | 0 | u
14 | 0 | 0 | 13 | 20 | 0 | 0 | D
15 | 0 | 0 | 13 | 21 | 0 | 0 | T
16 | 0 | 0 | 13 | 22 | 0 | 0 | T
17 | 0 | 0 | 7 | 0 | 0 | 0 | N
Please note that the entries in rows 6 and 7 represent internal tables (ABAP-Type h). There is always an entry for the corresponding row type (rows 13 and 17) to an internal table.
The indices in the rows 5 to 7 refer to entries in the name table TD-NAMES. If you look, e.g., at row 3, you find the corresponding component name in TD-NAMES from row 7 (NAME) onward and the corresponding user type from row 5 (NAME_STRUC) onward.
In the name table TD-NAMES you find the following entries. Note that the names SALARY_PER_MONTH and ABSENCE_TIME_STRUC are stored in two parts:
|CONTINUE|NAME |CONTINUE|NAME
|--| -||--
1 | |DESCTEST 12 | |PHONE
2 | |EMPLOYEE_STRUC 13 | |FIRST
3 | |SBOOK-CUSTOMID 14 | |LAST
4 | |==ALPHA 15 | |STREET
5 | |NAME_STRUC 16 | |ZIPCODE
6 | |ID 17 | |PLACE
7 | |NAME 18 | * |ABSENCE_TIME_ST
8 | |ADDRESS 19 | |RUC
9 | * |SALARY_PER_MONT 20 | |DAY
10 | |H 21 | |FROM
11 | |ABSENT 22 | |TO -
Where can I find the appropriate text string for China Time zone?
Hi,
Where can I find the appropriate text string for China Time zone?Hi,
The following timezone strings are supported in Oracle8i 8.1.7:
AST, ADT: Atlantic Standard or Daylight Time
BST, BDT: Bering Standard or Daylight Time
CST, CDT: Central Standard or Daylight Time
EST, EDT: Eastern Standard or Daylight Time
GMT: Greenwich Mean Time
HST, HDT: Alaska-Hawaii Standard Time or Daylight Time.
MST, MDT: Mountain Standard or Daylight Time
NST: Newfoundland Standard Time
PST, PDT: Pacific Standard or Daylight Time
YST, YDT: Yukon Standard or Daylight Time
Since your's isn't one of these, I'm hoping this is in reference to the Web Agent's ORDWEBUTL package, in which case, you can use an offset from GMT instead. For example, here in New Hampshire, USA, we are 5 hours behind GMT, so the offset would be -5, while in France, it would be +1 as they are one hour in front of GMT. According to my Windows clock, Beijing is GMT +8. Of course, you'll have to figure daylight-savings time into the equation, if you have to deal with such changes.
Regards,
Simon
null -
How to find and replace any string between " "
Hi everyone,
Here my sample
String szTest;
szTest = "Yellow banana";
szTest = "Blue monkey";
szTest = "Red mango";
szTest is only needed when it's in testing progress. Now I want to put all of that in the /*comment*/ so the released program won't run those code any more (but still keep szTest so I can use it for future develop testing).
So Here what I want after using the Find and Replace Box:
//String szTest; //Manual
/*szTest = "Yellow banana";*/ //use find and replace
/*szTest = "Blue monkey";*/ //use find and replace
/*szTest = "Red mango";*/ //use find and replace
I think I can do this with Regular expressions or Wildcards. But I don't know how to find and replace any string between " and ".
Find: szTest = " ??Any string?? ";
Replace with: /*szTest = " ??Any string?? ";*/
Thanks for reading.Hi Nathan.j.Smith,
Based on your issue, I suggest you can try the Joel's suggestion check your issue again. In addition, I find a MSDN document about how to use the Regex.Replace Method to match a regular expression pattern with a specified replacement string,
maybe you will get some useful message.
https://msdn.microsoft.com/en-us/library/xwewhkd1(v=vs.110).aspx
If the above suggestion still could not provide you, could you please tell me what language you use to create the program for finding and replace any string using regular expression so that we will find the correct programming develop forum to support this
issue?
Best Regards,
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey. -
How to find tables from database having no partition
Hello Sir,
How to find tables from oracle database having no partitions?
Thank you.
-Mal@SB,
SQL> SELECT OWNER, TABLE_NAME FROM DBA_TABLES
2 MINUS
3 SELECT OWNER, TABLE_NAME FROM DBA_TAB_PARTITIONS;
SELECT OWNER, TABLE_NAME FROM DBA_TAB_PARTITIONS
ERROR at line 3:
ORA-00904: "OWNER": invalid identifier@OP,
select table_name,partitioned from dba_tables where partitioned='YES';
select table_name,partitioned from dba_tables where partitioned='NO';
Regards
Girish Sharma
Edited by: Girish Sharma on Jul 1, 2011 9:27 AM -
How to find largest number from text file
I am using the "Read from text file" block to read the data from my .txt file into labview. It is now in string format. I have many numbers in the file.
For example:
0.45
0.35
0.12
1.354
1.56
2.89
5.89
0.56
That is what a text file might look like. I want to find which of these numbers is largest, and do calculations with that number. I am having trouble with strings/number formats/arrays, etc. Thanks
Solved!
Go to Solution.The spreadsheet functions and VIs typically work on strings representing numbers separated by delimiters. This is a typical way to save a "spreadsheet" (of numbers) to a text file, for example .csv files. These are quite versatile and powerful functions. Spend a bit of time becoming familiar with them because you may find yourself using them a lot.
Lynn -
How to find Payment term text from Terms of payment.
Dear All,
in table VBRK I can see a field Terms of Payments - ZTERM. Now I need to find the table where I can find Payment term text field ? Can someone tell me how to research this ?
Also if I know address from Kna1 ( field name adrnr ) how can i find the fields linking to table ADRC ?
Many Thanks,
AshimHi,
Payment term table already answered by Anil. Use function module "ADDR1_EXTRACT_TABLES" to extract address information. Pass address number as an input to this function module.
Regards
Vinod -
How to find number of characters in a character string
Hi,
Can anyone please tell me about how to find the number of characters in a character string type variable.
Reagards,
Sivahi,
Use STRLEN for Calculating String Length..
Assign it to integer variable for Further Use.Suppse u need to find string length for "hai".. this piece of code will help u
data: var type string value 'hai',
len type i.
len = strlen(var).
write len. -
In XI mapping, how to get number from a number_range object in SAP R/3
HI All,
I have a scenario where I need to read a Number_range object in SAP R/3 or ABAP XI and retreive the current number.
I need to use this number during the message mapping.
(I read about JCO and RFC, but am a little confused about how-to and what is the correct approach)
Just to let you know, I do not want to pass this number in the original IDOC coming from IDOC, so I need this lookup.
Scenario:
In MM, make a call to SAP.
Get the latest number from SNRO( number-range object)
Use this number in mapping.
Any help pointers, greatly appreciated.
Many thanks
ShirinShrin,
Please find the parameters you need to specify while creating UDF
Imports:javax.xml.transform.stream.StreamResult;com.sap.aii.mapping.lookup.;javax.xml.transform.dom.DOMSource;javax.xml.parsers.DocumentBuilder;java.io.;javax.xml.parsers.;org.w3c.dom.;org.xml.sax.;javax.xml.transform.;
The Template for RFC Lookup
String content = "";
MappingTrace importanttrace;
importanttrace = container.getTrace() ;
//Filling the string with our RFC-XML (With Values)
String m = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><ns0:<Function Module name>xmlns:ns0=\"urn:sap-com:document:sap:rfc:functions\"></ns0:ZFI_GET_RUNID> ";
RfcAccessor accessor = null;
ByteArrayOutputStream out = null;
try
//1. Determine a channel (Business System, Communication channel)
Channel channel = LookupService.getChannel("<Business System Name>","Communication channel name");
//2. Get a RFC accesor for a channel.
accessor = LookupService.getRfcAccessor(channel);
//3. Create a xml input stream representing the FM request message.
InputStream inputstream = new ByteArrayInputStream(m.getBytes());
//4. Create xml Payload
XmlPayload payload = LookupService.getXmlPayload(inputstream);
//5. Execute Lookup
Payload result = accessor.call(payload);
InputStream in = result.getContent();
//This are the extra step which i dont know what it mean
//out = new ByteArrayOutputStream(1024);
//byte[] buffer = new byte[1024];
//for (int read = in.read(buffer); read > 0; read = in.read(buffer))
//out.write(buffer,0,read);
//content = out.toString();
try {
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
Document document = builder.parse(in);
NodeList list = document.getElementsByTagName( "REsult" );
Node node = list.item(0);
if (node != null)
node = node.getFirstChild();
if (node != null)
content = node.getNodeValue();
} catch (Exception e) {
importanttrace.addWarning("Error while closing accesor" + e.getMessage());
catch (LookupException e)
importanttrace.addWarning("Error While lookup" + e.getMessage());
//This exception is not to be catch at this step as there is no try step before this
//catch (IOException e)
//importanttrace.addWarning("Error" + e.getMessage());
finally
if(out!=null)
try{
out.close();
} catch (IOException e) {
importanttrace.addWarning("Error while closing system" + e.getMessage());
//7. close the accessor in order to free resources
if (accessor!=null) {
try{
accessor.close();
} catch (Exception e) {
importanttrace.addWarning("Error while closing accesor" + e.getMessage());
return content;
Have mentioned in genric where u need to specify the communication channel name, business service etc.,
Moreover there is a field result, which is the output returned from the FM -
I am trying to find a number in a string from my database to replace it. Here is my funciton:
function findUserID($friendsString, $userToFind){
echo $friendsString . " " . $userToFind;
$pos = strpos($friendsString,$userToFind);
if($pos){
return true;
return false;
it returns "25,29 25". How can it not find 25 in that string?I understand that it starts at 0. it should still work. i had it working before. i must've changed something.
here is my code for passing to the function:
$query = mysql_query("SELECT friends, pendingFriendRequest
FROM members
WHERE username = '$userID'");
if (mysql_affected_rows() > 0) {
$row = mysql_fetch_array($query) or die(mysql_error());
$friends = $row['friends'];
$pendingFriends = $row['pendingFriendRequest'];
// If the user exists in the waiting list, then
//continue (we must confirm that they are first by checking the DB
$test = findUserID($pendingFriends, "25");
if($test){
// If they are, then continue to add them
$test = confirmFriend($pendingFriends, "25");
if($test) {
echo "<br />You have confirmed " . findUserName(24) . "as a friend.";
} else {
echo "<br />Error: Please try again, or contact us.";
} else {
echo "<br />Error: You either have this person as a friend already, or there was an internal error.";
Maybe you are looking for
-
Broadband dropping out with Homehub 3
A normal 6Mb/s + service drops out several times an hour with no connection for several minutes. I have spoken to a BT customer care engineer, restarted the modem etc with no success. Wireless indicates a strong signal at all times. Same problem wi
-
All this lingo makes my head want to explode! All I want to do is download my Louis C.K. show But it is not. . Their websites states: The downloadable video files are H.264 encoded in an MP4 container. Audio files come in two formats: lossless FLAC a
-
Live chat seems to be closed every time I try to use it. I live on the east coast
I need to update my Shockwave Flash, but I am using Firefox version 3.6 and Adobe Flash player version 10.0. What do I need to do to make sure my computer can handle these updates?
-
The Mysteriously Appearing Photos That Were In The Trash Bin
Hello; I have a conventional digital camera that connects to my mac USB and downloads my photos onto my desktop. I frequently toss out photos I do not want. Last night I tossed out a bunch of my photos and emptied the trash bin. But just a minute ago
-
Idea Please about lock...
How do set lock and unlock to the file and pls give me any sample and basic idea about lock...