Pass thousand seperator to string ?
hello,
i am trying to export a quantity value to a string with thousand seperator. i tried the FM below.
REPORT TEST.
DATA: L_VALUE_IN(6) TYPE P DECIMALS 2,
L_VALUE_OUT TYPE BAPICURR-BAPICURR,
L_VALUE_OUT_S TYPE STRING.
L_VALUE_IN = '69936.57'.
CALL FUNCTION 'BAPI_CURRENCY_CONV_TO_EXTERNAL'
EXPORTING
CURRENCY = 'INR'
AMOUNT_INTERNAL = L_VALUE_IN
IMPORTING
AMOUNT_EXTERNAL = L_VALUE_OUT.
L_VALUE_OUT_S = L_VALUE_OUT.
WRITE / L_VALUE_OUT.
BREAK-POINT.
when i pass the string to the GUI_DOWNLOAD FM it doesnt work.
what should i do to pass it to the txt file as a string// (because this value is used in a concatenate)?
p.s: write statment works at first step.
ths in advance.
Hello,
Try like this,
DATA: L_VALUE_IN(6) TYPE P DECIMALS 2,
L_VALUE_OUT(10) TYPE c.
L_VALUE_IN = '69936.57'.
data: begin of itab OCCURS 0,
f1(10) type c,
end of itab.
write l_value_in to l_value_out.
itab-f1 = l_value_out.
append itab.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
FILENAME = 'c:\test.txt'
FILETYPE = 'ASC'
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.
BREAK-POINT.
Vikranth
Similar Messages
-
How to print space as thousand seperator and comma as decimal seperator
Hi All,
I have requirement where I need to print the amounts with space as thousand seperator and comma as decimal seperator.
I have a field wrshb which is of type mhnd-wrshb. currently I am printing this. In the adobe layout I have declared this coloumn as Decimal field.
Now in the output it is printing as comma as thousand seperator and dot as decimal seperator.
For example ,currently the value is printing as 32,811.41
but I want the amount as 32 811,41
I have declared the variable as char16, using write statement in the interface I moved the value from currency field to char field.
Then in debugging i checked the value comes as 32,811.41 and it goes to dump with teh reason-cannot interpret as a number.
Can anyone help me in fixing this?
Thanks and Regards,
Karthik Ganti.Hi Adam,
As per initial requirement, I have set the format such that the amount is printing in below format as required.
Locale---Italian.
Space as thousand seperator and comma as decimal seperator.
for example 1 234,45
As some of the Currencies will not have decimals, now users would like to print amount without decimals. For example in my case amount printing in KRW ( Korean currency ) is also similar to the above format which is wrong.
for example Now amount is printing as 55 000,00. But actually it should be 550 000. Similarly for JPY currency also, as it doesnot haves decimals ( checked in TCURX table ).
I have written some logic in the interface. below is the logic.
WRITE:
wa_mhnd1-wrshb to wa_item-wrshb CURRENCY WA_ITEM-WAERS.
*READ TABLE lt_tcurx INTO lwa_tcurx WITH KEY currkey = wa_item-waers BINARY SEARCH.
IF sy-subrc = 0.
IF lwa_tcurx-currdec = '0'.
REPLACE ',' WITH SPACE INTO WA_ITEM-WRSHB.
REPLACE ',' WITH SPACE INTO WA_ITEM-WRSHB.
else.
REPLACE ',' WITH SPACE INTO WA_ITEM-WRSHB.
REPLACE ALL OCCURRENCES OF '.' in wa_item-wrshb WITH ','.
endif.
ENDIF.
a. when the write statement gets executed amount will be in ,. ( 1,234.45 )format. Then my logic gets executed correctly. In this company code is CH10 ( EUR ) and KR10.
b. But sometimes after the write statement gets executed amount will be in ., format ( 1.234.45 ). In this case my logic works, but gives the wrong value. In this case company code is VN10 ( EUR )
In both the cases currency is EUR.
Will the decimal format change accordingly based on the company code code currency.Can you please tell me why write statement behaved differently.
Do I need to change any locale in the adobe form, or any other logic to be written in interface. ? I am trying it out from long time, but not able to fix it.
Can you please help me how to achieve this ?
Thanks and Regards,
Karthik Ganti. -
Using JNI to pass an array of Strings to C and back from C
I have some C code that I want to integrate with a new Java application and I need to be able to pass an array of strings to the C program and then the C program needs to be able to build an array of strings that is passed back to the Java program. I've got the first part working so that I can pass an array of strings to the C program and display them, but I can't figure out how to build the strings in C so that that when Java gets back control, it can display the strings tha were built in the C program.
Has anyone done this? Do you have some sample code?I have a program which is written in C. I can give you the whole project as it is in a zip file. You'll need VC to work with it. By the way, I am using Windows for development. Should you need it, I'll mail you the same. Give me your mail address.
-
Spreadsheet probem with thousand seperator in excel
Hi ,
I have spread sheet table in my dashbaord , This spread sheet table is linked with a radio button having three labels buttons.
My first radio button selection contains negative values . These negative values are shown in red colour using thousand seperator in excel .
Now I clicked on second radio button , But now i dont have negative values for this selection . but still values are showing in red colour (but not in brackets ) .
Why the colour is applying for positive values also . Is there any problem with spread sheet .
Please help me out . I cannot use SCore card component as i dont have control on row height .
Many thanks in advance for reading my post .
Reagrds,
DirasaHi,
The format of the spreadsheet table is applied when you link your Excel data to the component. When the data change in the table, the format will NOT change. Thus colors and number format will be the same as when you created the table in Xcelsius.
If data does not change with the dashboard but only you want to show different format capabilities, then you should use multiple table components and use dynamic visability to go with the radio button. -
Validate integer with a comma thousands seperator using struts Validator
Using struts validator.
have to validate the user entered value.
The value entered should be a positive integer with a comma thousands seperator. the number need not be in thousands.
I have as below to check for positive integer without comma seperator. but not sure how to validate if the user entered value with a comma seperator?
i.e value like 25,349 // how to validate this?
<field property="hrs" depends="integer,validwhen">
<msg name="integer" key="errors.notvalid"/>
<msg name="validwhen" key="errors.notvalid"/>
<var>
<var-name>test</var-name>
<var-value>(*this* >= 0)</var-value>
</var>
</field>
how to validate the user entered value with a comma seperator? Thanks.Found this in Struts' Building View Components section: Note: If your required form property is one of the Java object representations of primitive types (ie. java.lang.Integer), you must set the ActionServlet's convertNull init. parameter to true. Failing to do this will result in the required validation not being performed on that field because it will default to 0. This seems to be part of my problem. With it turned on, Validator picks up that the value is required. Now to figure out the issue with putting in a double value instead of an Integer.
-
Dear All.
Help Me...
English is not very good. Google translator is used.
How do I pass an array of strings?
Please refer to the VB program
===========================================
Private Sub m_btn_Click()
Dim nReturn As Long
Dim sPpid As String
Dim sMdln As String
Dim sSoftRev As String
Dim nCount As Long
Dim saCCodes(2) As String
Dim naPCount(2) As Long
Dim saPNames(10) As String
sPpid = "PPID001"
sMdln = "Mdln"
sSoftRev = "Rev001"
nCount = 2
saCCodes(0) = "1"
naPCount(0) = 5
saPNames(0) = "Param001"
saPNames(1) = "Param002"
saPNames(2) = "Param003"
saPNames(3) = "Param004"
saPNames(4) = "Param005"
saCCodes(1) = "2"
naPCount(1) = 5
saPNames(5) = "Param006"
saPNames(6) = "Param007"
saPNames(7) = "Param008"
saPNames(8) = "Param009"
saPNames(9) = "Param010"
nReturn = m_XGem.GEMReqSend(sPpid, sMdln, sSoftRev, nCount, saCCodes(0), naPCount(0), saPNames(0))
If (nReturn = 0) Then
Call Me.AddMessage("[EQ ==> XGEM] GEMReqSend successfully")
Else
Call Me.AddMessage("[EQ ==> XGEM] Fail to GEMReqSend (" & nReturn & ")")
End If
End Sub
=================================================
nCount, naPCount enough saCCodes, saPNames value must be sent.
How to handle an array of strings in LabView is impatient.
I want to VB program implemented in LabView.Have you actually tried to right click on the according node parameter and select Create->Constant or Create-Control??
And I don't see any string array in the parameter list. That are all simple strings and the VB code in your first post clearly shows that the call to the function only indexes the first element of those arrays to be passed to the function, not the entire array.
If the function really reads arrays despite being declared as only taking strings then it is using some weirdo VB trickery and there will be no way to replicate that in LabVIEW.
Rolf Kalbermatter
CIT Engineering Netherlands
a division of Test & Measurement Solutions -
JSP Tag- Passing an array of string as an Attribute
Can I pass an array of String as an attribute to a JSP Tag? I read the specification but It does not say any thing about this.
Thanks in Advance.I thought JSP tags had to deal strictly with string values?
-
Pass values other than string to applet
Can you pass values other than strings via the <param> tag to an applet?
I guess I didn't make my question clear enough. I know that you can pass integers and floats and what not because you can always call parsing functions. What i meant was can you pass java objects like Image objects, or session objects, things that cannot be parsed from strings
-
How to pass line text into string of 72 characters
Hi,
I need to to pass material text lines to a file for processing into different SAP system.
Currently i am having multiple text lines stored in an internal table. I am looping that table and checking the string length of a first line.If it is less than 72 characters then i need to add spaces at the end of the text and make it 72 and pass it to workarea-field.
However, while passing the next line text it is overwriting the spaces of first line and that is making the text meaning difficult to understand when passed to the other SAP system.
Let me know how to approach.
Thanks,
AnkurHi,
This will not work as it splits the text as per the position.
However what i would need is if i am entering text like this.
Material ABCD --> Line 1
This is finished product 9-series material used for high-value equipments. ---> Line 2
Currently, when transferring this data over the file it goes to the other system as
Material ABCDthis is finished product---> upto 72 characters
9 series material used for high-value ---> upto 72 characters
equipments.
So if there is less than 72 characters in the first line it takes 2nd line text. However it is ok if the text has more than 72 characters as it goes into the next line and still makes the meaning intact. -
Passing and Consuming Action string in a method
public static class ActionClass
public static void TestActionParam(object actionParam)
try
Action<string> action = (Action<string>)actionParam;
action("???"); //how do I capture lambdaParameter of the method MyStringMethod
finally {}
class Program
{ public static void MyStringMethod(string lambdaParameter)
Console.WriteLine(lambdaParameter);
static void Main(string[] args)
string actionlambdaParamater = "actionlambdaParamater";
Action<string> ActionlambdaParamater = (lambdaParameter) => { MyStringMethod(lambdaParameter); };
ActionlambdaParamater(actionlambdaParamater);
ActionClass.TestActionParam(actionParam: ActionlambdaParamater);
Hi,
I have a method named TestActionParam.
I need to pass an Action<string> delegate to it. I am able to declare the Action<string> delegate ActionlambdaParamater
and pass it to the method
TestActionParam. However, inside of TestActionParam, I need to capture the parameter
lambdaParameter of the Method MyStringMethod, which I have denoted by ???. How do I capture this value?I think you are confused as to what an Action<T> is. It is a method pointer or delegate that does not return a result (void). Action<string> takes a string as a parameter. You can capture this parameter inside the body of the method that Action<string>
points to OR at the moment that something calls the Action<string> then the caller could log it.
public void CallMyMethod(Action<string> myMethod)
myMethod("hi there"); // you need to know the parameter you are passing in, here you could record that parameter
// the entry point for this example
public void Main()
Action<string> myMethodPointer = (strParam) => {
Console.WriteLine("My method pointer was called with parameter: {0}", strParam);
// passing in a lamda as action
CallMyMethod(myMethodPointer);
// passing in a method directly which gets converted to an Action<string> as the signatures match
CallMyMethod(DoSomething);
public void DoSomething(string parameter)
// can also be a normal method
Console.WriteLine("my normal method called with parameter {0}", parameter);
Mark as answer or vote as helpful if you find it useful | Igor -
How to Identify the count , If multiple parameters are passed using Pipe Delimited string
Hi,
We are passing Pipe delimited string to the parameter and I want to know how many values we are passing to the parameter.
Here is the example
Parameter.Grant: 24|34|54|67
I am using below expression, but it is not giving the right values. Please let me know if I am missing anything or is it possible.
=iif(parameters!Grant.Count>1,"Multiple value selected",parameters!Grant.Value)Hi NaveenCR,
According to your description, you used pipe delimited multi-value parameter in the report, you want to know how many values passed to the parameter. If that is the case, please refer to the following steps:
In Design view, click Text Box in the Toolbox.
On the design surface, click and then drag a box to the desired size of the text box.
Right-click inside of the text box, then click Expression.
In Expression text box, type the expression like below:
=iif(split(Parameters! Grant.Value,"|").Length>1," Multiple value selected",Parameters!Grant.Value)
The following screenshots are for your reference:
If you have any more questions, please feel free to ask.
Thanks,
Wendy Fu
If you have any feedback on our support, please click
here.
Wendy Fu
TechNet Community Support -
Can we pass more than a string as SECURITY_PRINCIPAL to an EJB?
Hi there,
I am wondering if we could pass more than just a String as a
SECURITY_PRINCIPAL to an EJB?
For example, if I have EJB_1 on server_A that calls EJB_2 on server_B, when
EJB_1 creates the InitialContext, I will need to pass in "Username" and
"Password" as the SECURITY_PRINCIPAL and SECURITY_CREDENTIAL. From EJB_2, I
could get the SECURITY_PRINCIPAL in the form of a java.security.Principal
principalObject.getName() right? What if I my security principal is more
than just a username, could I make this work?
Thanks!
StevenHey Sri,
Thanks for the reply. This sounds like a pretty serious flaw? I mean what if
the authentication involves more than just a username? Or if it was a
biometric scan or something?
In my case, I just wanted to pass in things like client machine name, ip
address for logging on the server side and such without having to create an
additional parameter on each of my EJB methods. Is there any other way that
I could do so?
Best Rgds,
Steven.
"Sri" <[email protected]> wrote in message news:[email protected]..
>
There is no way in J2EE to piggy back objects on pricipal; you can onlyget caller
name. However you can piggy back stringified object on your caller name. Ibelieve
this is true for WLS too.
S
"Steven" <[email protected]> wrote:
Hi there,
I am wondering if we could pass more than just a String as a
SECURITY_PRINCIPAL to an EJB?
For example, if I have EJB_1 on server_A that calls EJB_2 on server_B,
when
EJB_1 creates the InitialContext, I will need to pass in "Username" and
"Password" as the SECURITY_PRINCIPAL and SECURITY_CREDENTIAL. From EJB_2,
I
could get the SECURITY_PRINCIPAL in the form of a java.security.Principal
principalObject.getName() right? What if I my security principal is more
than just a username, could I make this work?
Thanks!
Steven -
hi Guys,
i make the application, in which lots of data record with id, whenever i clicked to the SUBMIT button, it wil forwarded to the next page.
But The problem is.....when we pass the 30 id in a query string parameter that' fine but when it is incresing it is not transfaring to the next page. how i can do this.
As per the concept EVERY BROWSER HAVING THE LIMITATION..
hope all of u help me.
saMhey all of you are saying right..!!
But you know the doPost() method having the limitation, that is
1 MB. so how can i used this method.
I know the second way....Like make the hidden control with mantain the session, but i can not use this(Client do't want this).
so please guys help me........
saM -
Passing Values to search strings, odd behavior
Greetings,
I've encountered an issue in a script of mine while trying to repair a search function that is boggling my mind, I'm hoping for some expert opinion as to why this is happening and what I may be missing here.
In short, I'm trying to add a function to a script that allows users to search for a user by a custom AD attribute (employee number).At first I tried this:
If ($SearchTypeComboBox.Text -eq "Employee Number")
$EESearchResult = Get-QADuser -service <REMOVED> -ldapfilter "(&(objectCategory=person)(objectClass=user)(employeenumber=$Searchinput.text))"
Write-Host $EESearchResult.samaccountname
Now, $Searchinput comes from a textbox within a form, this is passed in numerous other areas of the script just fine. However when I use it like I did above, no data is passed to the LDAP search string and it comes up empty.
HOWEVER, if I add this:
$WTF = $Searchinput.text
Then use that in the search string:
Get-QADuser -service <REMOVED> -ldapfilter "(&(objectCategory=person)(objectClass=user)(employeenumber=$WTF))"
It works...
Why?! I don't understand... While I have overcome this issue, the fix really bothers me. Any insight would be awesome!
Thanks!Try changing $Searchinput.text to be $($Searchinput.text). You are trying to access a property of an object, so you must enclose it in parens to tell Powershell, execute this first, and then the results will be expanded via the $ in front of the parens,
which will result in the data that the property contains.
If you find that my post has answered your question, please mark it as the answer. If you find my post to be helpful in anyway, please click vote as helpful.
Don't Retire Technet -
Are globals the best way to pass a collection of strings?
I have an ATE application that is used on several models of the same
product. The models have optioning commands and status screen layouts
that use different terms for the same function. For example: "LBO" on
one model might be labeled "EQ" on another. I capture the screen
output as serial data and then parse it for the string I need to read.
In order to use the same code on different models I have a config file
that loads the correct strings into global variables based on the
model I'm testing. The globals are then read by the sub-VIs. This
works well, but I use over a hundred globals to do this and I worry
that some day the overhead will catch up to me.
Does anyone know a better way to do this? The re
quirement is that the
strings be kept in a central location for maintainability, yet be
accessable to several sub-VIs.
I'm running LV 6i, but I could upgrade to 6.1 if necessary.
EdCould you pass them in via a cluster of strings?
"Ed Ward" wrote in message
news:[email protected]..
> I have an ATE application that is used on several models of the same
> product. The models have optioning commands and status screen layouts
> that use different terms for the same function. For example: "LBO" on
> one model might be labeled "EQ" on another. I capture the screen
> output as serial data and then parse it for the string I need to read.
>
> In order to use the same code on different models I have a config file
> that loads the correct strings into global variables based on the
> model I'm testing. The globals are then read by the sub-VIs. This
> works well, but I use over a hundred glob
als to do this and I worry
> that some day the overhead will catch up to me.
>
> Does anyone know a better way to do this? The requirement is that the
> strings be kept in a central location for maintainability, yet be
> accessable to several sub-VIs.
>
> I'm running LV 6i, but I could upgrade to 6.1 if necessary.
>
> Ed
Maybe you are looking for
-
I have an iphone 4s on my itunes account & added my daughter's new ipod touch 5th generation. Now everything from my iphone is on her ipod & still on my phone too, even my phone # shows up as her ipod. How do I separate the 2 devices? Do I need to re
-
Save File-Dialog not responding
In every document-style app (Pages, TextEdit etc.) the save file dialog suggests iCloud as default destination to save to. When I click the Drop-Down to select another location the whole application hangs and shows me the marvelous marble of death. I
-
HOW TO SET ITEM MASTER IN ITEM GROUP AUTHORIZATION
Hello, Using Sap Business One 2007 B how to solve this item master authorization issue. Kind regards, Karunagaranjanani.
-
How to create a clickable row in a table
hi all I'm trying to use the onclick prop of a tr elem in table. At the moment I'm using the same h:commandLink inside each column (td) I have. How can I place in the onclick tr prop. the same onclick funcion generated by the h:commandLink component?
-
Optimizing 780ti CUDA for Adobe premiere cs5.5, cs6, and CC
I Finally got my video card for my new rig . Found a great deal for the Zotac GeForce GTX 780 Ti OC The only thing now is optimizing the GPU acceleration. I would like to believe that I have performed the cuda hack correctly, but a few things leave m