How to replace a variable in SO10
Hi,
I need to replace a variable &data& in SO10 to his value but it doesn't work.
I use the FM 'TEXT_SYMBOL_REPLACE' to replace the words in the SO10.
Could you help me please?
In the transaction SO10, we have &eric&.
DATA:
lt_text TYPE STANDARD TABLE OF tline.
data : eric type char30 value 'Test'.
CALL FUNCTION 'READ_TEXT'
EXPORTING
object = 'TEXT'
id = 'ST'
name = 'EMAIL'
language = sy-langu
IMPORTING
header = header
TABLES
lines = lines
EXCEPTIONS
not_found = 1
OTHERS = 2.
CALL FUNCTION 'TEXT_SYMBOL_REPLACE'
EXPORTING
header = header
program = sy-repid
REPLACE_TEXT = 'X'
TABLES
lines = lines.
Regards,
Shushu
Edited by: Shushu93 on Jul 6, 2010 2:42 PM
Edited by: Shushu93 on Jul 6, 2010 2:45 PM
Edited by: Shushu93 on Jul 6, 2010 2:46 PM
Edited by: Shushu93 on Jul 6, 2010 2:46 PM
Edited by: Shushu93 on Jul 6, 2010 2:47 PM
Hi,
I threw this code together quickly for you:
REPORT ZFM_TEST.
DATA: ls_head TYPE thead,
lt_lines TYPE STANDARD TABLE OF tline,
ls_lines TYPE tline,
l_total_lines TYPE i.
CALL FUNCTION 'READ_TEXT'
EXPORTING
ID = 'ST'
LANGUAGE = 'E'
NAME = 'ZTEXT'
OBJECT = 'TEXT'
IMPORTING
HEADER = ls_head
TABLES
LINES = lt_lines
EXCEPTIONS
ID = 1
LANGUAGE = 2
NAME = 3
NOT_FOUND = 4
OBJECT = 5
REFERENCE_CHECK = 6
WRONG_ACCESS_TO_ARCHIVE = 7
OTHERS = 8.
IF SY-SUBRC = 0.
LOOP AT lt_lines INTO ls_lines.
Write: 'Unformatted:', ls_lines-tdline.
ENDLOOP.
DESCRIBE TABLE lt_lines LINES l_total_lines.
CALL FUNCTION 'TEXT_SYMBOL_REPLACE'
EXPORTING
endline = l_total_lines
header = ls_head
TABLES
lines = lt_lines.
IF SY-SUBRC = 0.
LOOP AT lt_lines INTO ls_lines.
Write:/ 'Formatted:', ls_lines-tdline.
ENDLOOP.
ENDIF.
ENDIF.
Regards,
Phil
Similar Messages
-
How to replace one variable with another in large number of queries
Hello guys!
I have this situation: our company needs to use one variable instead of another for certain amount of queries.
Is there some way to automatically replace one variable with another for a certain characteristic in big number of queries ( like 150 - 200 ) ? Doing this manually would take lots of time)
Apreciate your help!you could try (at your own risk) the following:
1. search the technical id (ELTUID) of your variable in table RSZELTDIR
2. see where this variable is used in table RSZELTXREF (by filling RSZELTDIR-ELTUIID in RSZELTXREF-TELTUID)
3. add similar entries for your new variable
4. delete the entries for the old variable (they're part of the key, so you can't simply "change" them) -
How to get a replacement path variable working in same query
Hi All
I have a query in which the user enters a value for the 0fiscper variable. Our users want to display for the last 12 months the previous year same period sales.
I do this by putting a value range offset restriction on 0fiscper varianle to -12 to 0fscper variable value. I have 0fiscper as drill down on the rows.
Fiscal Year period LY Month Sales
010/2010 9999.89
011/2010 8888.99
To get the LY Month Sales I would like to set up a replacement path variable on 0fiscper so if the value of 0fiscper on the
row is available in the replacement path var I can offset it ti -12 to get the LY Month Sales.
Can someone share ideas how I can set up this replacement path variable.
Thanks
KarenHi,
Why u want to go for replacement path. You can attain your result bu just offsetting the fiscyear period variable.
Regards,
Raghavendra. -
How to use Replacement Path Variables to perform Date Calculations
Hi Experts,
Can anyone make me clear about:How to use Replacement Path Variables to perform Date Calculations???????
Thankyou in advance..
shankarIn left panel select the time Dimension
Then hit new variable in that
give the Name and Description for the Variable
In processing by hit Replacement Path
In reference characterisitcs use Calendar Day...
As ur intention is to use it for Date
Then in adjacent tab use
Replace variable with Query / Variable
Then u can use Offset length and offset start for controoling the display of your variable.
Use as single, multiple single, interval, selection option as uwish
HIt okey
and you are good to go -
How to replace variable value of a sql query dynamically
Hi all,
Trying to execute sql queries present in Oracle table and the query it self contains the ODI variable #EMP_NO.
At the run time we thought of passing the variable values.
table contains query like
update table <table name> set <column name>= 5000 where emp_no = #EMP_NO
We need to execute the sql query using a ODI procedure, to pick the sql query from table we use another variable #varSQLID and in the command on source tab wrote like
select sql_query varSQL from emp_sql where query_id=#varSQLID
Command on target
#varSQL
when ever I tried to execute I am getting error please let me know what changes are required .
The question is whether it's possible to replace the variable value present in the above sql ?
regards,
Palash ChatterjeeThanks Siddhartha,
Actually we have been doing the same, means half of the query has been kept in the table and rest is being added in the " command on source " tab of the procedure .
But the problem is , the "where" condition is not same for all SQL queries,
to provide 27 different sqls queries for 27 packages we have to create 27 procedures (as "where" condition may take other column values along with "EMPNO" for the JOIN condition ) .
Any suggestion of keeing SQL along with the variable and storing it in the table may resolve our problem and work of 27 procedures can be performed by a single procedure .
regards,
Palash Chatterjee -
How use replace all grid row with variable value
hi master
sir i have master detail form
in detail form i have 5 column grid thate have 25 row at time
one column name id
such as id have value 23
but i want replace all id row with 555
how i replace all id in grid with 555 befor commit_form
how i use loop for grid
or any other method
please give me idea
thank's
aamirGo_Block('Detail');
First_Record;
Loop
:detail.item := '...' ;
Exit when :system.last_Record = 'TRUE' ;
Next_record;
End loop;
First_Record ;Francois -
Replacement Path Variable with Another Variable
Hi,
I am currently trying to create a report that would need me to have the same values for different characteristics (e.g. clearing date, posting date, net due date). I have seen that there is a way in the replacement path variable that would replace its value with another variable that is ready for input. I also looked into SAP help but I can't seem to figure out on how to do it specifically. Does anyone know a step-by-step process on how to do this? How does this work?
Thank you in advance!take an e.g.
u have characteristic say ch1
u want to restrict it with replacement path variable
first of all create a variable var1
click what it is based upon for e.g. 0calday, 0material etc.
make it user entry variable
select single or multiple entry
make it mandatory
save it and hit okey
click on ch1
right click and say restrict
in new window create a new variable
give its name and technical name
processing path is replacement path
go to next tab of replacement path
select several ooptions
replace variable with another variable
select a variable called var1
change the offset length and offset start with different parameters.
hit okey
this way u have restricted ch1 with replacement path variable var1
now when u run report u have to enter value of var1
which will then further feeded to ch1
this way u can create replacement path variables at lots of instances and then u can always feed the value from var1 at different time
make sure as this ur requirement is date
try to use 0calday as reference infoobject all the times.... -
Replacement path variable with offsets
Hi experts,
I have the requirement to report receivables (open items) historically by fiscal year / period.
More precisely, each period should show the open items that are open at the end of the period.
Example:
001.2010 (shows open items from 31.01.2010)
002.2010 (shows open items from 28.02.2010)
...etc.
The idea is that the user enters a fiscal year/period using a manual entry variable.
The open items should be calculated as follows:
KF: Amount
Posting Date <= Variable
Clearing > Variable or unassigned
Variable is a replacement variable that is replaced by attribute "Date To" from the user entry Variable (Fiscal year period)
E.g. if the user enters 008.2010, then this value is automatically replaced by 31.08.2010.
Generally this works.
However, to view the values for the last 12 months, a structure is needed consisting of 12 elements with offsets in order to show the 12 months prior to the selected period (e.g. 001.2010 - 002.2010 - 003.2010 ....etc.)
The problem is that the replacement only considers the user's variable entry and ignors the offsets.
Example:
User enters 008.2010.
In the column strucure I show 3 months 006.2010, 007.2010, 008.2010.
Then all columns would show items open on 008.2010 - the offsets are ignored.
Any idea, why this happens and how it can be resolved?
This problem has given me a headache for days.
Your help is much appreciated.
Thanks and regards,
Alex
The user should be able to enter a fiscal year / period andtake an e.g.
u have characteristic say ch1
u want to restrict it with replacement path variable
first of all create a variable var1
click what it is based upon for e.g. 0calday, 0material etc.
make it user entry variable
select single or multiple entry
make it mandatory
save it and hit okey
click on ch1
right click and say restrict
in new window create a new variable
give its name and technical name
processing path is replacement path
go to next tab of replacement path
select several ooptions
replace variable with another variable
select a variable called var1
change the offset length and offset start with different parameters.
hit okey
this way u have restricted ch1 with replacement path variable var1
now when u run report u have to enter value of var1
which will then further feeded to ch1
this way u can create replacement path variables at lots of instances and then u can always feed the value from var1 at different time
make sure as this ur requirement is date
try to use 0calday as reference infoobject all the times.... -
Hi There,
Please can someone tell me how to specify a variable in the path prefix of an External HTTP (RFC) connection in transaction SM59?
For example if my path prefix is /invoke/test/example?input=XYZ; how do I replace "XYZ" with a variable so that I can pass in any value after "=" ?
Thanks,
BrendonHi,
This is SAP Business one system administration forum. Please find correct forum and repost above discussion to get quick assistance.
Please close this thread here with helpful answer.
Thanks & Regards,
Nagarajan -
Replacement Path variable cannot be used in filter
After creating a variable of type replacement path with query I get the error message:
Errors: Variable ... cannot be used in 'Filter' 'Default Values'; remove
Does anyone know what is causing this message and how to prevent it?
Thanks.
Regards,
József.Thanks for your response Bhargava,
Your answer did help me find the solution. When using a replacement path variable with query, you can only use the variable in the Characteristic Restrictions part of the Filters (not in the Default Values).
The characteristic itself can still be used for navigation.
p.s. Found that when copying a query some links to structures, like restricted key-figures, are kept in the metadata repository, even after removing them from the query. This can also cause error messages.
Regards,
József. -
How to pass a variable for a SQL query in OLEDB source?
Hi All,
I am new to SSIS and working on it past few days. Can anyone please help me getting through a scenario where I need to pass a variable in the SQL statement in OLEDB source connection. Please find below for the details.
eg:
1) I have a SQL table with the columns SerialNumber, Name, IsValid, FileName with multiple rows.
2) I have the file Name in a variable called Variable1.
3) I want to read the data from my SQL table filtering based on the FileName (Variable1) within a data flow task and pull that data to the destination table.
Question: In the data flow task, added source and destination DB connection with a script component in between to perform my validations. When trying to retrieve the data from source using the variable (i.e. SQL Query with variable), I am not able to add
the query as the SQL statement box is disabled. How to filter the data based on the variable in the source DB ?
Any help/suggestions would be of great help.
Thanks,
SriJust to add with Vaibhav comment .
SQL Command : SQL query either with SQL variable or any condition or simple Sql statement
Like ;
Select * from dimcustomer
SQL Command using Varible :
Sometimes we design our dynamic query in variable and directly use that variable name in oledb source.
If you Sql query needs a condition based on SSIS variable .
you can find a Example here :
http://www.toadworld.com/platforms/sql-server/b/weblog/archive/2013/01/17/ssis-replace-dynamic-sql-with-variables.aspx
http://www.select-sql.com/mssql/how-to-use-a-variable-inside-sql-in-ssis-data-flow-tasks.html
Thanks
Please Mark This As Answer or vote for Helpful Post if this helps you to solve your question/problem. http://techequation.com -
How to use bind variables in the following query
CREATE OR REPLACE PROCEDURE MMDB.test IS
sel_qtn VARCHAR2 (10);
CURSOR PT_QUANTITY IS select * from mmdb.product_tree WHERE QUANTITY_CHECK ='E'
AND run_id = 100
a PT_QUANTITY%ROWTYPE;
BEGIN
FOR i IN PT_QUANTITY
loop
sel_qtn := i.quanttity-1;
While sel_qtn>=1
loop
insert into mmdb.product_tree (BILLING_ACCOUNT_NO ,S_CODE) values (i.BILLING_ACCOUNT_NO ,i.S_CODE||'E');
sel_qtn :=sel_qtn -1;
End loop;
commit;
end;Don't duplicate threads: How to use bind variables in the following query
-
How to ignore a variable defined in a query when the query gets executed
Hi SAP guru, I am creating a query, which has a user input variable, say A, and a replacement path variable, say B, Bu2019s value is determined by A and the whole purpose of A is letting user entering an initial value and A must be ignored when the query gets executed. How can I achieve this in query designer?
ThanksHi, thanks for the reply. Actually this is not my problem. My problem is the query should be filtered by a variable, say B, but B is not allowed to be entered directly by user (i.e. B could be a replacement path variable or user exit type). So B has to be derived from another user input variable, say A. However if I defined A in the query, A is by default used as one of the filters, which is not desirable because A is a subset of B in my case and should be ignored.
Is there options (settings) that allow the query ignore a specified variable (A) ? If not is there other ways to get around this?
Thanks
MichScott -
How to arrange the variables in Selection Screen (Query)
Hi,
I am having Query-A (Contains 4 variables, among those, one is mandatory and one is Replacement Variable)
Using Replacement Variable am calling Query-B (Contain one mandatory Variable).
Now when am executing Query-A, in Variable screen its shows
Query-A--Mandatory Variable
Query-A--*********
Query-A--*********
Query-B--Mandatory Variable. (like this)
But i need the Query-B--Mandatory Variable to be position in top. how to achieve this.
Regards,
Jackie.Hi Friends,
Thanks for your quick replies, but like Dieu said i need to rearrange Variable between Query-A and Query-B.
Query-A Variables
Query-A--Mandatory Variable
Query-A--********
Query-A--********
Query-B Variables
Query-B--Mandatory Variable
I have join both the Query using Replacement Path Variable.
Now when i execute Query-A, it shows the variables in Query-B also. Like this
Query-A--Mandatory Variable
Query-A--********
Query-A--********
Query-B--Mandatory Variable
But i need to like the following
Query-A--Mandatory Variable
Query-B--Mandatory Variable
Query-A--********
Query-A--********
Regards,
Jackie
Edited by: Jackie on Aug 11, 2008 12:04 PM
Edited by: Jackie on Aug 11, 2008 12:05 PM -
How to refresh ODI variables from file
Hi,
I followed the fillowing links to implement the dynamic file parameter passing in to the resource name of a datastore.
part-1. http://odiexperts.com/how-to-refresh-odi-variables-from-file-%E2%80%93-part-1-%E2%80%93-just-one-value
part-2. http://odiexperts.com/how-to-refresh-odi-variables-from-file-%e2%80%93-part-2-%e2%80%93-getting-all-lines-once-at-time
For me first part is working fine where as in second part i made canvas looks like
Vlinevariable(refreshing variable)------------------dyanamicfile(refereshing variable)--------------------- interface.
Interface looks like Flatfile to db ,km's are lkm file------sql and ikm is sql incremental update
Vlinevariable is working fine where i am getting numbers in sequence manner to assign in to code of dynamicfile variable and in dynamicfile is not taking that value in to that code and causing session failed.
The code which i put in a refreshing code of dynamicfile is followed below
select samplefile1_csv C1_SAMPLEFILE1_CSV
from TABLE
/*$$SNPS_START_KEYSNP$CRDWG_TABLESNP$CRTABLE_NAME=code_generationSNP$CRLOAD_FILE=C:\file/my_test_file.txtSNP$CRFILE_FORMAT=DSNP$CRFILE_SEP_FIELD=0x0009SNP$CRFILE_SEP_LINE=0x000D0x000ASNP$CRFILE_FIRST_ROW=1SNP$CRFILE_ENC_FIELD=SNP$CRFILE_DEC_SEP=SNP$CRSNP$CRDWG_COLSNP$CRCOL_NAME=samplefile1_csvSNP$CRTYPE_NAME=STRINGSNP$CRORDER=1SNP$CRLENGTH=50SNP$CRPRECISION=50SNP$CRACTION_ON_ERROR=0SNP$CR$$SNPS_END_KEY*/
For the firstrow the number has to get from vlinevariable where in my case not working .
In session while loading the interface (load data) i am getting error like
message-------------- ODI-1227: Task SrcSet0 (Loading) fails on the source FILE connection file_tgt.
Caused By: java.sql.SQLException: File not found: C:\file/
at com.sunopsis.jdbc.driver.file.FileResultSet.<init>(FileResultSet.java:160)
at com.sunopsis.jdbc.driver.file.impl.commands.CommandSelect.execute(CommandSelect.java:57)
at com.sunopsis.jdbc.driver.file.CommandExecutor.executeCommand(CommandExecutor.java:33)
at com.sunopsis.jdbc.driver.file.FilePreparedStatement.executeQuery(FilePreparedStatement.java:131)
at com.sunopsis.sql.SnpsQuery.executeQuery(SnpsQuery.java:602)
at com.sunopsis.dwg.dbobj.SnpSessTaskSql.executeQuery(SnpSessTaskSql.java:3078)
at com.sunopsis.dwg.dbobj.SnpSessTaskSql.execCollOrders(SnpSessTaskSql.java:571)
at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTaskTrt(SnpSessTaskSql.java:2815)
at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTask(SnpSessTaskSql.java:2515)
at com.sunopsis.dwg.dbobj.SnpSessStep.treatAttachedTasks(SnpSessStep.java:534)
at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep(SnpSessStep.java:449)
at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java:1954)
at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor$2.doAction(StartSessRequestProcessor.java:322)
at oracle.odi.core.persistence.dwgobject.DwgObjectTemplate.execute(DwgObjectTemplate.java:224)
at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor.doProcessStartSessTask(StartSessRequestProcessor.java:246)
at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor.access$0(StartSessRequestProcessor.java:237)
at oracle.odi.runtime.agent.processor.impl.StartSessRequestProcessor$StartSessTask.doExecute(StartSessRequestProcessor.java:794)
at oracle.odi.runtime.agent.processor.task.AgentTask.execute(AgentTask.java:114)
at oracle.odi.runtime.agent.support.DefaultAgentTaskExecutor$2.run(DefaultAgentTaskExecutor.java:82)
at java.lang.Thread.run(Thread.java:619)
source code is select a C1_A,
b C2_B
from TABLE
/*$$SNPS_START_KEYSNP$CRDWG_TABLESNP$CRTABLE_NAME=sample1SNP$CRLOAD_FILE=C:\file/#PROJECT1.FILENAMESNP$CRFILE_FORMAT=DSNP$CRFILE_SEP_FIELD=0x002cSNP$CRFILE_SEP_LINE=0x000D0x000ASNP$CRFILE_FIRST_ROW=1SNP$CRFILE_ENC_FIELD=SNP$CRFILE_DEC_SEP=SNP$CRSNP$CRDWG_COLSNP$CRCOL_NAME=aSNP$CRTYPE_NAME=NUMERICSNP$CRORDER=1SNP$CRLENGTH=50SNP$CRPRECISION=12SNP$CRACTION_ON_ERROR=0SNP$CRSNP$CRDWG_COLSNP$CRCOL_NAME=bSNP$CRTYPE_NAME=NUMERICSNP$CRORDER=2SNP$CRLENGTH=50SNP$CRPRECISION=12SNP$CRACTION_ON_ERROR=0SNP$CR$$SNPS_END_KEY*/
target code insert into STAGING.C$_0SAMPLE1
C1_A,
C2_B
values
:C1_A,
:C2_B
KIndly help me and thanks in advance.ODI is complaning it cannot locate the file. Try replacing the '/' character with a '\' after file in the designated filepath.
Maybe you are looking for
-
Since the Mountain Lion OS update today I've had issues with internet connection and e-mail, has anyone else?
-
Still image with motion has flicker pulsating problem
I use FCP 5.0.4 I have read the many threads about this subject and am still not able to succeed in getting rid of the flicker/pulsating in a still image with motion. I would say about 25% of the stills with motion have the jitters; all the rest look
-
Late 2005 iBook G4 with kernal panic
Hi all, I cannot find any instructions for replacing or checking the Airport card in my late 2005 iBook G4. I'm trying to follow Dr. Smoke's instructions but can't find any DIY manual or pics of the Airport card in this notebook. I've found several t
-
Is it possible to create a rotating object in Muse?
Is it possible to create a rotating object in Muse? I have a round logo and I want it rotating.
-
In the new Safari, when I begin to type a search query, the box below the search field suggests websites, bookmarks, and previous history. I really do not want people to see my previous history when they start to type a search query. There doesn't se