How to remove leading 'S' in target field
hi
i have to remove the leading 'S' in the target field, can some on help me with this reqmnt.
regards
manoj
Hi Manoj,
Check out : http://help.sap.com/saphelp_nw04/helpdata/en/d9/3033f96c79674f90e3ab8d101a595b/frameset.htm
Activities
1. To create a new user-defined function, choose Create New Function (This graphic is explained in the accompanying text) in the data-flow editor at the bottom of the screen, on the left-hand side.
2. Specify the attributes of the new function in the subsequent window:
Name:
Technical name of the function. The name is displayed in the function chooser and on the data-flow object.
Description:
Description of how the function is used.
Cache:
Function type (see above).
Arguments:
In this table, you specify the number of input values the function can process, and name them. All functions are of type String.
3. In the subsequent window, you can create Java source code:
a. You can import Java packages to your methods from the Imports input field, by specifying them separated by a comma or semi-colon:
You do not need to import the packages java.lang.*, java.util.*, java.io.*, and java.lang.reflect.* since all message mappings require these packages and therefore import them. You should be able to access standard JDK and J2EE packages of the SAP Web Application Server by simply specifying the package under Import. In other words, you do not have to import it as an archive into the Integration Repository. You can also access classes of the SAP XML Toolkit, the SAP Java Connector, and the SAP Logging Service (see also: Runtime Environment (Java-Mappings)).
In addition to the standard packages, you can also specify Java packages that you have imported as archives and that are located in the same, or in an underlying software component version as the message mapping.
b. Create your Java source text in the editor window or copy source text from another editor.
4. Confirm with Save and Close.
5. User-defined functions are limited to the message mapping in which you created the function. To save the new function, save the message mapping.
6. To test the function, use the test environment.
The new function is now visible in the User-Defined function category. When you select this category, a corresponding button is displayed in the function chooser pushbutton bar. To edit, delete, or add the function to the data-flow editor, choose the arrow next to the button and select from the list box displayed.
Thanks,
Pooja
Similar Messages
-
How to remove leading Zeroes in all fields in Payload
Hi,
How can I remove the leading Zeroes in every Filed I have in whole Payload Structure.there are around 10000 fields that have to be removed the leading Zeroes.any good idea please.
<POSNR>000010</POSNR>
<MATNR>000002465640</MATNR>
<ARKTX>000012 KG D107</ARKTX>
<MATKL>00030010000</MATKL>
<WERKS>0000ORGC</WERKS>
<LGORT>0000GC55</LGORT>
<CHARG>000TEST</CHARG>
like this mutliple segments and multiple Fields.so I can take as whole payload with multiple fields should not have leading Zeroes.I can handle if they are 10 0r 20 fileds,but not like whole pay load/1000 fields right.
thank you,
PremHi
You can have an additional XSLT mapping, to your existing one..
use copy-of & apply-templates to copy the whole tree & make changes recursively.
below is a sample code , the marked line is where you need to try your logic of trimming Zeros. (this code does upper case)
add this below code in your interface mapping object, as XSLT mapping, which does the job (only try putting your logic)
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="2.0">
<xsl:output method="xml"
indent="yes"
omit-xml-declaration="yes"/>
<xsl:template match="*">
<xsl:copy>
<xsl:copy-of select="@*"/>
<xsl:apply-templates/>
</xsl:copy>
</xsl:template>
<xsl:template match="text()">
<xsl:value-of select="upper-case(.)"/>
</xsl:template>
</xsl:stylesheet>
hope this fixes your issue
Regards
Vishnu -
Removing Leading Spaces in the field to be displayed
Hi,
Could you please tell me how to remove leading spaces in currency field in write statement?
the length of the field cannot be changed by writing fieldname(length).
is there any other method to do the same. the length should vary according to the amount in the field.
Ragards,
Krutikahi,
please use "SPLIT " or condense .
eg: SPLIT wa_bseg-hzuon at space into wa_bseg1-hzuon l_space.
to better understand refer this code:
IF it_mhnd IS NOT INITIAL.
SELECT hzuon bukrs gjahr augdt augbl
FROM Bseg
INTO TABLE it_bseg
FOR ALL ENTRIES IN it_mhnd
WHERE belnr = it_mhnd-belnr
AND bukrs = it_mhnd-bukrs
AND gjahr = it_mhnd-gjahr
AND umskz = 'E'.
endif.
data: l_space type char6.
loop at it_bseg into wa_bseg.
SPLIT wa_bseg-hzuon at space into wa_bseg1-hzuon l_space.
wa_bseg1-bukrs = wa_bseg-bukrs.
wa_bseg1-hzuon = wa_bseg-belnr.
wa_bseg1-hzuon = wa_bseg-gjahr.
wa_bseg1-hzuon = wa_bseg-umskz.
append wa_bseg1 to it_bseg1.
clear: l_space, wa_bseg1.
endloop.
IF it_bseg1 IS NOT INITIAL.
SELECT belnr bldat
FROM bsad into table it_bsad
FOR ALL ENTRIES IN it_bseg1
WHERE belnr = it_bseg1-hzuon
AND bukrs = it_bseg1-bukrs
AND augbl = it_bseg1-belnr.
endif.
regards
rahul
Edited by: RAHUL SHARMA on Jan 5, 2009 12:19 PM
Edited by: RAHUL SHARMA on Jan 5, 2009 12:20 PM -
How to remove leading zeros from variable
hi,
how to remove leading zeros from variable like it_vbap-matnr.
value in it_vbap-matnr is 000000000000000358
i want to remove leading zeros so that it become 358
regards
deepakYou can use Function Module <b>'CONVERSION_EXIT_MATN1_OUTPUT'</b>
This Function Module will eliminate leading Zeros.
For each MATNR Value read form DB Table,u can eliminate Leading zeros and then modify ur Internal table.
I think u will not get leading Zeros into utr Internal table when u read from VBAP.
Bcoz MATNR in VBAP itself have Conversion routine.
If u r getting leading zeros,U can use following Logic.
tables:
vbap.
data:
t_vbap like standard table of vbap.
select matnr
from vbap
into corresponding fields of table t_vbap.
loop at t_vbap into vbap.
CALL FUNCTION 'CONVERSION_EXIT_MATN1_OUTPUT'
EXPORTING
INPUT = vbap-matnr
IMPORTING
OUTPUT = vbap-matnr
modify t_vbap from vbap transporting matnr.
endloop.
Hope this will work..... -
How to remove the check from ShpmntCostsRel. (field VTTK- FRKRL)
Hi Experts,
Can you please tell me to how to remove the check from ShpmntCostsRel. (field VTTK- FRKRL) when saving of the shipment document.shipment cost calculation only on the Leg level and not on header level. Currently a lot of confusion happened after creating the shipment cost document and found that the status is u201CBu201D.
now we intend to define detailed specifications to how to create this new user exit to update the shipment cost relevancy at shipment header.
The main functionality of the user exit to be created is to remove the check from ShpmntCostsRel. (field VTTK- FRKRL).can u pls tell how to do this. -
How to remove leading zero from Material Number
Hello Everyone,
I need to figure it out how to remove leading zero from material number. Cureently extractor is sending material number as 100663. But when comes into BI i am getting as "000000000000100663" and similariy in report it is appearing as "000000000000100663". Now my client wants me to exclude preceeding zero for a material in all the reports.
Is there any setting in query desinger to handle this issure or in the backend.
Need your inputs.
Thanks,
Lasya.Hi
you can use the function Module
CONVERSION_EXIT_ALPHA_OUTPUT in the start routine
to test this go to SE37 --- give the CONVERSION_EXIT_ALPHA_OUTPUT -
>display -
> F8
in the input give 000000456
and execute
the out put will be 456
for getting Zeros you can use
CONVERSION_EXIT_ALPHA_INPUT--- to remove leading zeros
Santosh
Edited by: Santhosh Nagaraj on Oct 29, 2009 10:52 PM
Edited by: Santhosh Nagaraj on Oct 29, 2009 10:54 PM -
How to remove leading zeros for an item number within quickviewer
how to remove leading zeros for an item number within quickviewer. Pls help
ask your abap guy to do it. not portal guys business.
-
How to remove leading zeroes of a coloumn in a table
can someone tell me how to remove the leading zeroes in a table's coloumn .... its a NUMC data type..
i tried with abap statement shift leading zeroes, but its not working for me.... the sorting is missing..
in properties is there any option to remove the leading zerores>
nirajaHi Niraja,
I am displaying a table with information from SFLIGHT. The CONNID field is of type NUMC and so it too used to contain the leading zeroes. I so deleted the leading zeroes in my WDDOINIT method before binding the internal table to the context node. The table now does not display the leading zeroes as earlier. Find my coding as shown below:
METHOD wddoinit .
DATA: lr_node TYPE REF TO if_wd_context_node,
wa_sflight TYPE ig_componentcontroller=>element_node,
lt_sflight TYPE ig_componentcontroller=>elements_node.
SELECT * FROM sflight INTO TABLE lt_sflight.
LOOP AT lt_sflight INTO wa_sflight.
SHIFT wa_sflight-connid LEFT DELETING LEADING '0'.
MODIFY lt_sflight FROM wa_sflight TRANSPORTING connid.
ENDLOOP.
lr_node = wd_context->get_child_node( name = ig_componentcontroller=>wdctx_node ).
lr_node->bind_table( new_items = lt_sflight ).
ENDMETHOD.
Regards,
Uday -
How to remove leading zero in a inputfield
I have a inputfield UI element which is bind to a NUM type context. When it display a number, it always come with leading zero, like '001'. Can anyone teach me how to remove the leading zero.
http://help.sap.com/saphelp_nw70ehp1/helpdata/en/3a/2232666aeb45f4b759848a4caf9c8b/frameset.htm
Use the Display leading zeros formatting option in the context attribute properties.
The other option is to use a data dictionary domain for the field that has a built in field conversion exit. The ALPHA conversion exit is commonly used on NUMC fields like Sales Order number to suppress leading zeros. The WD runtime will automatically use the underlying DDIC Domain Field Conversion Exit. You don't need to do anything except use that DDic to define the context. -
I have a field 'Bill No.' of Character(10) type in my dialog program. Once I input and save value e.g. '1' in this it gets saved as 1 but in the internal table it gets stored as '0000000001'. Pls let me know how to remove these leading zeros: perhaps I'll have to use LTRIM but I am not sure.
deepak.Hi
Use the fm CONVERSION_EXIT_ALPHA_OUTPUT.
DATA: P(10) VALUE '0000000001'.
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
EXPORTING
INPUT = P
IMPORTING
OUTPUT = P.
WRITE P.
Max -
APD - How to remove leading zero's in a String?
Hello All,
I have been stumped by this challenge for a few hours now, so would appreciate your suggestions.
I am using APD to produce a CSV file where the source is a query. The output requires 0MATERIAL and this is delivered by the source query. The issue is that the CSV file must not retain any leading zero's that may exist in the 0MATERIAL value.
e.g.
example # original material code desired output
========= ====================== ==============
a 000000000000015931 15931
b 000000000001001037 1001037
c 000000000008945420 8945420
d 000000000080889200 80889200
e 0000000000L0293500 L0293500
Initialy, I believed I could simply output the value of 0MATERIAL to an integer field. This would remove all leading zero's but not all 0MATERIAL codes are purely numeric in value (see example (e));
Someone had a similar requirement w/ SQL Server and solved it by replacing all zero's with a space, trimming leading spaces, then replacing remaining spaces back to zero's! [url]http://www.sql-server-helper.com/functions/trim-leading-zeros.aspx[url]
So the logic is something like this:
1. Replace each 0 with a space: REPLACE('0','',[0MATERIAL])
2. Use the L_TRIM string function to trim leading spaces: L_TRIM(<result from Step #1>)
3. Replace all spaces back to 0: REPLACE('','0',<result from Step #2>)
Formula Builder looks like this:
L_TRIM(REPLACE_ALL('0','',0MATERIAL))
I attempted this using the
REPLACE()
function (available in the APD Formula builder) to replace all zero's with an empty string. This too created a problem because as in examples (a) through to (e), the function replaces all zero's in the string not just the leading ones! e.g.
REPLACE('0', '',000000000001001037)
gives 1137 !
The problem here is that when you specify a space in the
REPLACE()
function by saying
it thinks you meant no spaces at all! Therefore I am no longer able to execute step 3!
I'm stumped now and would appreciate the communities help on this.
Thanks,Thanks Akshay,
I took 0MATERIAL as the source field
I specified ZMATLWOLDZERO as the target field (type same as 0MATERIAL).
In the code section i wrote this:
DATA: ls_source TYPE y_source_fields,
ls_target TYPE y_target_fields.
loop at it_source into ls_source.
move-corresponding ls_source to ls_target.
call function 'CONVERSION_EXIT_ALPHA_OUTPUT'
EXPORTING
output = ls_target-ZMATLWOLDZERO
IMPORTING
input = ls_source-material.
append ls_target to et_target.
endloop.
compiles fine but on test execution, the code termnates saying that "Incorrect parameter with CALL FUNCTION"
Forgive me this is a first attempt I have tried but I fear my logic is incorrect in the code somewhere... -
How to remove namespace prefix from target payload when using HTTP in PI7.0
Hi,
i have a requirement to remove namespace prefix from target payload when receiver receives the payload by an HTTP request.
i am not able to use XML Anonymizer Bean as in HTTP channel its not possiile.
Target structure after mapping now is:
<?xml version="1.0" encoding="UTF-8"?>
<ns3:Order xmlns:ns3="urn:xxx-com:pi:project">
fields
</ns3:Order>
i need the target structure after mapping should look like:
<?xml version="1.0" encoding="UTF-8"?>
<Order xmlns:="urn:xxx-com:pi:project">
fields
<Order>
i removed namespace from source and target Message Type of message mapping but still getting "ns3" prefix. My requirement is to just have this ns3 removed.
Please reply if anyone has solved this problem before.
ThanksHi ,
>>>i removed namespace from source and target Message Type of message mapping but still getting "ns3" prefix. My requirement is to just have this ns3 removed.
Which process you've used for removing namespace...java/xslt mapping. In case of java mapping plese remove ns3 while creating the target element. Please go through the below blog it may help you.
Quick Tips: Dealing with Namespaces in XI/PI
Regards,
Priyanka -
How to remove leading zeroes of string
Hello All,
I have a scenario where Partnumber string type shows 00000000012345 format, I want to remove leading zeroe and displ only 12345 .
How to do it,
SuggestHi Pradeep,
Please go through this wiki. [https://www.sdn.sap.com/irj/scn/wiki?path=/display/java/remove%252bleading%252band%252btrailing%252bzeros%252bfrom%252ba%252bstring]
It explains how to remove zeros from strings.
extract from the wiki. This is an efficient way.
public java.lang.String removeLeadingZeros( java.lang.String str ){
if (str == null){
return null;
char[] chars = str.toCharArray();
int index = 0;
for (; index < str.length();index++){
if (chars[index] != '0'){
break;
return (index == 0) ? str :str.substring(index);
If you want to show this string in a table instead of the ones with zeros you can create a calculated attribute of type string on the same node and in the getter method read the string with zeros using getAttributeValue() api and pass the string to the above method and return that string value.
You can also have another approach if you will only have numbers in your string. Have a calculated attribute of type int. In the getter method read the String using getAttributeValue() api and then convert it to an int using Integer.parseInt(String) and return the int value.
Regards,
Sanyev -
How to remove the automatically generated text fields from the InfoSet
I followed the procedure by SAP help.
Automatically generated text fields are marked with a 'T' on the icon in the InfoSet. You can remove the automatically generated text fields from the InfoSet in the initial screen of the InfoSet maintenance under Further Functions -> Delete Text Fields. Cancel the DataSource creation on the next screen and delete the text fields in the InfoSet maintenance transaction.
I know that there is an option "No automatic text recognition" when I create a new InfoSet, however, I couldn't find out how to change an existed InfoSet. I checked menu Goto->Global Properties, but that option is disabled. Is there a way to remove text fields from an existed InfoSet?Hi,
In the initial screen (when you enter transaction code SQ02) type your infoset name and goto menu: Infoset -> More functions -> Delete text fields. this will delete all text fields.
I hope this helps to resolve the issue.
Ram -
How to reduce the pdf version & how to remove all the pre-delivered field from a pdf file.
Hi Team,
1) Please help me to reduce the version of a pdf file which is v1.7 as my BI Publisher support only pdf version upto Version1.5.
2)This pdf file 1.7 contains some pre-delivered fields, i want to remove all the pre-delivered fields. Please suggest.
PFA link:-
http://www.uscis.gov/files/form/i-539.pdf
Please guide to remove the pre-delivered fields from this pdf & how to reduce the version.A lot depends on what you want to do with the file. The encryption has limited most options on the form. If you are wanting to simply post a view of the form, then you might try a screen capture. Of course there is always the question of what you want to do with the form and any legal aspects related to that use. Other than answering potential legal questions of your use, we might be able to help more if we were aware of the desired use. At the moment, the screen capture is my only suggestion. There may be other work arounds, but probably not appropriate for discussion on this forum.
If you are wanting the form for publication as an example in some document, I would strongly suggest you contact the gov't agency and discuss your intent and try to get a version you can use with their approval. Overall, that is the cleanest way to do whatever you are after for a legit purpose. Even a graphic version should have the permission of the government agency.
Maybe you are looking for
-
Call Dynamic Form Wizard via a POST data
Is it possible to call a Dynamic Form Wizard form via POST from another form? I can get my form to work for an Update and Delete transaction, but I can't get it to work with an Insert - I can't prime fields. Conversely, I can get it to work with an I
-
Getting ram installed in store
i have to questions. can you upgrade from the 512 to the 1 gig in the store? or can you only do that online? i would like to get my computer from the store and i was wondering if they do that for you. i heard that they do from one post and they dont
-
Accrual for Interest rate SWAP
i want to know how acrual for Interest rate SWAP works from account assignment point of view i would really apprecaite if any1 can give me information or docuents for setting interest rate swap accrul
-
Ant or what tool to compile Java Classes
For the past year I have been using Windows command window to compile Java Classes for my Servlets, Java Beans and Helper classes. I use Cold Fusion studio as my IDE for creating the Java classes. All of my Web Applications use MVC for Forms feeding
-
DNG files have no OS 10.8.4 Finder thumbnails
I can see thumbnails of the RW2 files imported from my Panasonic DMCG6 in the Mac OS10.8.4 Finder. However, when I convert the RW2s to DNGs after processing, there are no longer any thumbnails. I have installed the latest RAW updates from Apple. At t