Remove '/' in the field value
Hi all,
I have a field 'GS_CURR' of type KOEIN. Which normally has the values like 'USD' or 'EUR'. But somtimes I may get values like '/USD' in to this field. In such a case I want to take out the '/' from the value and change the value in GS_CURR from '/USD' to 'USD'.
PLease help me with some quick solution. Thanks
Couple of ways to do it.
If it is always in the first position. You can do this.
if GS_CURR+0(1).
shift GS_CURR left by 1 places.
endif.
Or....
replace '/' with space into GS_CURR.
condense GS_CURR no-gaps.
or...
translate GS_CURR using '/ '.
condense GS_CURR no-gaps.
Regards,
Rich Heilman
Similar Messages
-
Report query not returning the field value from external table
hi
I have an issue regarding reports. I have a query having 4 fields from external table and remaining from db tables. the report query returns all the fields from the db tables and only 2 fields from external table. but the same query if I tried in plsql developer it returns all the fields values.
Can anyone please help me in this issue.
Thanks and Regards
kkDuplicate post?
value not displaying in report whereas it returns in plsql developer
value not displaying in report whereas it returns in plsql developer
Please log a SR if you do not get any reply to your thread instead of creating new one.
Thanks,
Hussein -
How to get the Output File Name as One of the Field Value From Payload
Hi All,
I want to get the Output file name as one of the Field value from payload.
Example:
Source XML
<?xml version="1.0" encoding="UTF-8" ?>
- <ns0:MT_TEST xmlns:ns0="http://sample.com">
- <Header>
<NAME>Bopanna</NAME>
</Header>
</ns0:MT_TEST>
I want to get the Output file name as " Bopanna.xml"
Please suggest me on this.
Regards
BopannaHi,
There are couple of links already available for this. Just for info see the below details,
The Output file name could be used from the field value of payload. For this you need to use the UDF DynamicFile name with below code,
// Description: Function to create dynamic Filename
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File" , "FileName");
conf.put(key,a);
return "";
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File" , "FileName");
conf.put(key,a);
return "";
With this udf map it with the MessageType as
(File Name field from Payload) > DynamicFileConfiguration>MTReceiver
Thanks
Swarup -
Create Excel file in application server but the field value is incorrect
Hi Experts,
i am facing a problem when create excel file in application server using OPEN DATASET command.
the internal table have 4 field and one of those field contains 19 digit number --> ICCID.
the code running well, successfully create EXCELfile in application server but the problem is SAP only copy exactly first 15 digit numeric only and the rest became zero 0
Example :
the field value in internal table is 8962118800000447654 but when i opened in the excel file the value became 8962118800000440000.
and if i add alphabet like a8962118800000447654 then it is correct.
is there is anything wrong with my code?
here is my code
CONSTANTS: c_tab TYPE abap_char1 VALUE cl_abap_char_utilities=>horizontal_tab. "Tab Char
Data : begin of lt_zdsdmmdt00005 occurs 0,
SERNR (18) type c,
MSISDNl(20) type c,
BOX1 (20) type c,
ICCID(30) type c,
end of lt_zdsdmmdt00005.
data : ld_temp(100) type c.
i_file = '/usr/sap/DM/test_excel.xls'.
open dataset i_file for output in legacy text mode.
loop at lt_zdsdmmdt00005.
move lt_zdsdmmdt00005-ICCID to ld_iccid .
concatenate lt_zdsdmmdt00005-sernr lt_zdsdmmdt00005-MSISDN lt_zdsdmmdt00005-BOX1 ld_iccid
into ld_temp separated by c_tab.
transfer ld_temp to i_file.
endloop.
close dataset i_file.
Best Regard,
Akbar.Hi Naveen,
thanks for your reply,
i already tried and the result still the same. any idea?
Best Regard,
Akbar. -
UDF for Checking the field value
Hi
I want to check the whether the fiels conatins any value or not in mapping ... if not i want to raise the exception using the UDF
DO any one have sample code for writing the UDF
SVHi SV
what is your requirement first that should br clear.
i am giving you two UDF
1) i have written this uDF for string and comparing the field value XYZ
2) i am entering a string and its returning aa string which starts from the index of your input fixed length
int len = a.length();
String res = "";
String temp = "";
if ( len >= 10)
temp = a.substring(0,10);
if ( temp.equals("XYZ"))
res = temp;
else
res = "";
return res;
=======================================
String fixed = "ABCD";
String res = "";
int index = -1;
index = a.indexOf(fixed);
if (index == -1)
res = "NO INDEX FOUND";// or if u wanna set it as null res = "";
else
res = b.substring(index4,index12);
return res;
===
hope these may solve your problem
Thanks
Sandeep sharma
If helpful reward points -
Excluding the alpha charactes in the field value
Hi All,
I have a requirement where I need to delete all the character values in a field..
Ex: If the field value of ABC123a....then i need to delete the 'ABC' and i shuld retain wid 123a.
Please do the need ful.
Thanks,
ShivaHi Shiv,
take a variable of type n and move this into thatvariable.
Data:
w_char(20) type c value 'ABC123a',
w_num(20) type n.
w_num = w_char.
w_num will have 123.
or
Data:
w_str(20) type strin value 'ABC123a',
w_num(20) type c,
w_len type i.
w_len = strlen( w_str ).
do w_len times.
if w_str+sy-index(1) ca '0123456789'.
concatenate w_num w_str+sy-index(1) into w_num.
endif.
enddo. -
How to transfer the field values in MA form RFX
Hi
We have two fields ( extended field of date type ) in Rfx page . Now client wants that this two field value will be transferred to Master Agreement page while creating MA form Rfx award .
Is there any possible way to do this ?
Regards
Sudipta
Edited by: Sudipta62 on Dec 20, 2011 10:38 AMSudipta, Vikram,
If names are the same, are the fields transferred automatically? Or do we still write code?
Thanks,
MP -
How to validate the field values in module pool program?
Hi Guys
I am working with module pool programming.
Here I want to validate the fields like below.
with out filling all the fields if I click SAVE option it has to show a message that all fields has to be filled. This can be done by checking all the fields individually.
I think it can be done through <b>LOOP AT SCREEN ......ENDLOOP</b>. sequence.
If it is possible, can anyone help me?You need to write the Module in between the CHAIN and ENDCHAIN statment in SE51
If you send a warning or error message from a module <mod> that you called using a FIELD statement as follows:
CHAIN.
FIELD: <f1>, <f 2>,...
MODULE <mod1>.
FIELD: <g1>, <g 2>,...
MODULE <mod2>.
ENDCHAIN.
all of the fields on the screen that belong to the processing chain (all of the fields listed in the field statements) are made ready for input again. Other fields are not ready for input. Whenever the MODULE statement appears within a processing chain, even if there is only one FIELD attached to it, all of the fields in the chain (not only the affected field) are made ready for input again, allowing the user to enter new values. If the fields in the processing chain are only checked once, the PAI processing continues directly after the FIELD statement, and the preceding modules are not called again.
Look at the DEMO program DEMO_DYNPRO_FIELD_CHAIN.
ashish -
How to read the field value from Table Control
Hello Experts,
I am creating my first Table Control Screen. Basically I have to create a screen (102) with a table control which has 2 fields: A_QTY, B_QTY and 2 Buttons: SAVE, EXIT.
When Clicked on 'SAVE' the data (MATNR) from a previous screen (101) and the data (A_QTY, B_QTY) from the new screen (102) should be saved into a Z-table.
Internal table t_data has 3 fields.
MATNR
A_QTY
B_QTY.
Table Control TC_RACK was declared like this:
controls tc_rack type tableview using screen 0102.
I/0 Fields:
A_QTY type ZQTY.
B_QTY type ZQTY.
The screen Flow Logic:
process before output.
module status_0102.
loop at t_data into w_data with control tc_rack.
endloop.
process after input.
module exit_0102 at exit-command.
loop at tc_rack.
endloop.
module user_command_0102.
module status_0102output.
set pf-status 'STATUS_102'.
set titlebar 'TITLE_102'.
describe table t_rack lines tc_rack-lines.
endmodule. "status_0102 output
process after input.
module user_command_0615 input.
case ok_code.
when 'SAVE_RK'.
when others.
endcase.
endmodule. "user_command_0102 input
Now for eg, when the users enter values for A_QTY and B_QTY like this:
A_QTY B_QTY
1000 2000
3000 4000
How can I read these values and pass them to T_DATA so that I can save it into Z-table?
I greatly appreciate your help.
I've gone through some previously posted threads and could not understand because my knowledge in this area is preliminary.
Thanks a lot.
Could you please let me know
Edited by: dev a on Jan 13, 2010 2:46 PMHi dev a
You should use
DATA: lv_name(30) TYPE c.
FIELD-SYMBOLS: <QTY> type ZQTY.
GET CURSOR FIELD lv_name. "Get the field name in table control
check sy-subrc = 0.
assign (lv_name) to <QTY>. "Here you get the value in <QTY>
check sy-subrc = 0.
Also use <your table control>-current_line to get the table index uo're currently on.
Hint: Do not use GET CURSOR LINE if you want to get table index since this gives you the line relative to dialog screen
Good luck
Dean Q.
Edited by: Dean Q on Jan 13, 2010 11:11 PM -
How to keep the field value in the forms for one week
I have an application that when the user logs on to it , it shows all the documents that are in the current dept.
the form has the following fields:
document no
sent date
assigned to
dep_LOV
and a check box
if a user clicks the check box and assignes the document to another dept by cliking the LOv then the assigned to field should be populated with the new value and the sent date should be today's date(sysdate). the requirment is that once the user assignes the documnet to certain depts (for example sales dept) the assigned to field and the sent date should show up in the form for one week and the user should be able to see that data in the form the next time she /he logs onto the application. the one week time is to make sure the documcnt has reached the assigned dept. after one week from today's date the updated assigned_to field and the document no should not display on the form. During the one week if the user logs on to the form again that particular document and the assigned to and sent to fields shoould be grayed out and shhould not be updatable. I will greatly appreciate any suggetion as of what to do to solve this problem. it is urgent. Pleade help-> so you are saying that I should have a block level post_query trigger and put the where clause in it?
No. Post-query trigger runs AFTER the query has been executed, and it runs once for each row fetched. It is for other purposes, NOT for setting a where clause.
-> Plus i want to be able to gray out the field once populated with the sales dept.I have come up with the following code:
Your Set_item_instance_property is almost correct. And THAT line would go into the Post-Query trigger. This is what you might use:
<pre><font face = "Lucida Console, Courier New, Courier, Fixed" size = "1" color = "navy"> Set_item_instance_property ('docs.assigned_to',:system.trigger_record, Enabled,Property_False);</font></pre>
Please watch your use of underscore, dashes, commas and parentheses: _ - , ( )
The way to set your default where clause would be the following, and you should do it in the key-exeqry trigger, or someplace similar:
<pre><font face = "Lucida Console, Courier New, Courier, Fixed" size = "1" color = "navy"> set_block_property('DOCS', default_where,
'NVL(sent_date,sysdate) >= sysdate-7' );
Go_block('DOCS');
Execute_Query;</font></pre>
I used the NVL function so your select will show rows where sent_date is null OR sent_date has a value that is within 7 days prior to the current date.
What is the field :docs.assigned_to used for? If you want to include ONLY rows that are assigned to a particular person, then your where clause might be:
<pre><font face = "Lucida Console, Courier New, Courier, Fixed" size = "1" color = "navy"> 'assigned_to = :ctrl.assigned_to and NVL(sent_date,sysdate) >= sysdate-7' </font></pre>
and you should have a control block with the assigned_to field in it, where the user can enter a value before querying the DOCS block. -
Reports-- to validate the field values in a selection screen
How to validate a Particular field ..... in the selection screen ...!
that is how to determine the values of the field in the selction screen .....Hi,
Check the code below:
<b>at selection-screen</b>.
SELECT SINGLE * FROM MSEG WHERE
MBLNR = IMBLNR.
IF SY-SUBRC <> 0.
MESSAGE E016(PG) WITH 'Please select valid Material Document Number'.
ENDIF.
I used it in my program.
Hope this helps.
Reward if helpful.
Regards,
Sipra -
IF l_v_ucomm = c_click.
IF fp_selfield-fieldname = c_matnr.
IF fp_selfield-value IS NOT INITIAL.
SET PARAMETER ID mak FIELD sd_selfield-value.
i want to clear the value of sd_selfield but i am not able to clear since it is not an internal table of occurs 0. how can i refresh the body of the field here.
SET PARAMETER ID ctd FIELD fp_selfield-value.
CALL TRANSACTION c_ms05 AND SKIP FIRST SCREEN.
ENDIF.
ENDIF.
thanks
reddyTry:
sd_selfield-value = space. -
Accessing the field values in different fields for calculation
Hi,
I am creating a report in which I have used breaks for grouping the customers by their category. I have used summary on the amount field to calculate the sum in the individual category and also for total amount.
Now, I also want to add an column which could display the percentages of individual contributions.
So, its like I have to write a query accessing the total percentage, categorized percentage and individual amount.
My question: How can I access the various fields values in the query of some other field specifically sum and total sum( because it shows the sum([Amount]) for category sum and total sum both)
-BOBJuserHmmm, I assume you are talking about WebIntelligence here...
Ok, so let's go: you can access every "object" in the report simply by it's name. Every cell contains either a constant value (e.g. some text) or a formula, the simplest one can be just the value of an "object" from the query.
There is a formula bar on top which you can activate, where you can easily see the content of a specific cell and also copy/paste the formula from the cell, as well as access all the built-in functions.
WebI has a built-in calculator which works very similar to a "micro" olap engine, so you can access every sort of aggregate (of a measure) via a correspondig formula, irrelevant in which cell you are using it.
Nevertheless, there is a "computation context" which depends on the place where you put the formula, e.g. summary row, detail row, etc.
for more info: see the manual )
hth, Walter -
Replacing Comma in the field values
Hi Friends,
I have some data like " ,1,2,3,4 " in my table
I want to remove the first comma alone and to list the data values.
How can i do this?Hi!
hope this code will help u -
SQL> select substr(',1,2,3,4',2) from dual;
SUBSTR(
1,2,3,4Regards.
Satyaki De. -
Getting the field value of a clicked on pie slice in a pie chart?
I have tried and searched for hours and can not get this
simple little thing to work.
I have a pie chart with the following event handler:
itemClick="chart_click(event)"
The pie series comes from a simple httpservice that has a
country and a count:
<mx:PieSeries
field="count"
nameField="value"
labelPosition="callout"
calloutGap="5"
labelFunction="display"
showDataEffect="{interpolate}">
All I want to do is capture the value of the nameField (EG:
Canada)
I have no problem getting the index of the selected series
but I can not get the nameField value of that slice. This is what I
have:
public function chart_click(e:ChartItemEvent):void
Alert.show(searchByPieChart.series[e.hitData.chartItem.index].nameField);
All I get is the string "value" which is the name of the xml
tag bound to the nameField. What do I need to do ?Uggg.
I got it:
Alert.show(e.hitData.item.value);
Maybe you are looking for
-
Running APEX 3.1.2 and 4.0.2 on one server
We currently have a Solaris server running an Oracle 10g R2 DB with APEX 3.1.2 installed. Oracle Application Server 10g (Apache) is used as HTTP server. This server is used for development and UAT. We want to upgrade to APEX 4.0.2. and first want to
-
How to open a link in dashboard in a new window ?
Can anyone help me out in this ? Thanks
-
When using the numeric conversion functions, such as to I16, what determines whether a number greater than the upper limit is coerced to the upper limit or is wrapped around from the lower limit?
-
What services are added to the Windows system?
After installing of Oracle Coherence, configuring the members and adding the ReplicatedCaches on the Windows XP system, what services are added to the Windows system? Thank you
-
How do you know where you are in the Lion queue??
Can someone tell me how you know where you are in the queue for the Lion download? I am just left with the waiting signal over the lions head?