How to group data at granularity level hours and every 10 minutes?
I have sales table imported from SQL server. The date columns are are captured at granularity level such as 30-12-2013 16:50:16.
what is best way create master date table, and create relationship between the sales table and the master date table?
I am new in Power Pivot, and any complete detailed steps and links will be appreciated
Note: just clarify the requirements. The business wants to see how much sales a consultant sells in every 10, 30 minutes during normal business hour.
Hope this help
jl
Split your field:
1) A date portion related to your date dimension at the day grain
2) A time portion related to your time dimension at a 10 minute grain.
In TSQL:
SELECT
,[Date] = CAST( <datetimefield> AS DATE) -- date with no time
,[Time] = CAST( '18991230 '
+ RIGHT('0' + DATENAME(Hour, <datetimefield>), 2) + ':'
+ RIGHT( '0' + CAST( (DATEPART(MINUTE, <datetimefield>) / 10) * 10 AS NVARCHAR(2)), 2) + ':'
+ '00' AS DATETIME)
Write this in your query to populate the fact table. This will give you a field holding just the date, and one holding the time at a 10 minute granularity.
A date table is trivial to produce in SQL or in Excel.
Here's a link for doing a very basic one in SQL Server.
A time table is trivial as well:
WITH TimeCTE ([Time]) AS
(SELECT CAST('18991230 00:00:00' AS DATETIME)
UNION ALL
SELECT DATEADD(MINUTE, 10, [Time])
FROM TimeCTE
WHERE [Time] < CAST('18991230 23:50:00' AS DATETIME)
SELECT * FROM TimeCTE OPTION(MAXRECURSION 0)
This gives you the beginnings of a dimension with time intervals every 10 minutes.
You can extend this table with TSQL functions or DAX calculated columns, whichever you find more convenient.
Then, you can join your <fact table>[Date] to <date dimension>[Date], and your <fact table>[Time] to <time dimension>[Time], and do all of your filtering on those tables.
Note: I have used a full datetime field for the time dimension above. This is because Power Pivot/Tabular only know datetime as a data type. If you want to add time to a date, the time portion must be recorded on 1899-12-30 to achieve the desired result.
When importing a TIME data type into the Tabular model, the field is assigned the date of processing, which is absurdly annoying.
Similar Messages
-
How identify the data is client level,plant level or company code level
Dear sirs,
GM
How identify the data is client level,plant level or company code level?
If there is any T.code for same in SAP plz send me otherwise any procedure?
Hopeeeeeeeeee....Hi,
Once you gain experience, you will not look at any table any field or any view...You will do it just like how you use keyboard once you pass type writing....
That is why every area of work, including master data is handed over to specialized teams...that will be their work day in and out....for some one newly entering, it will be little bit tough...once you practice, you will not be worried any more. Of course, basic data at client level, purchasing data plant level etc...some thumb rules are there...still, you will take big blow by following such thumb rules because if you verify storage condition assigned in the storage location is not storage location level!!!!!!!!!!!!!!!
that is experience!! In this forum, it is good to practice rewarding...else, there may not be any more replies
Good Luck
Message was edited by:
Gopala Turaga -
How to upload data from excel to SAP and options to be used
How to upload data from excel to SAP and options to be used
thank you,
Regards,
Jagrut Bharatkumar shuklaHi Jagrut,
You can use gui_upload.
chk the sample program mentioned below.
REPORT ZFTP .
DATA: BEGIN OF I_FILE OCCURS 0,
DATA(2000) TYPE C,
END OF I_FILE.
DATA: BEGIN OF I_FILE2 OCCURS 0,
DATA(2000) TYPE C,
END OF I_FILE2.
DATA: W_COUNT TYPE I.
PARAMETERS: P_FILEN TYPE STRING,
P_FILE2 TYPE STRING,
P_NUM(4) TYPE N..
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILEN.
PERFORM F_FILE_GET USING P_FILEN TEXT-G01.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE2.
PERFORM F_FILE_GET USING P_FILE2 TEXT-G01.
START-OF-SELECTION.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = P_FILEN
FILETYPE = 'ASC'
HAS_FIELD_SEPARATOR = 'X'
HEADER_LENGTH = 0
READ_BY_LINE = 'X'
DAT_MODE = ' '
CODEPAGE = ' '
IGNORE_CERR = ABAP_TRUE
REPLACEMENT = '#'
CHECK_BOM = ' '
VIRUS_SCAN_PROFILE =
NO_AUTH_CHECK = ' '
IMPORTING
FILELENGTH =
HEADER =
tables
data_tab = I_FILE
IF SY-SUBRC <> 0.
MESSAGE E024(Z1).
ENDIF.
LOOP AT I_FILE.
W_COUNT = W_COUNT + 1.
IF NOT W_COUNT > P_NUM.
MOVE I_FILE TO I_FILE2.
APPEND I_FILE2.
ENDIF.
ENDLOOP.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
BIN_FILESIZE =
filename = P_FILE2
FILETYPE = 'ASC'
APPEND = ' '
WRITE_FIELD_SEPARATOR = 'X'
HEADER = '00'
TRUNC_TRAILING_BLANKS = ' '
WRITE_LF = 'X'
COL_SELECT = ' '
COL_SELECT_MASK = ' '
DAT_MODE = ' '
CONFIRM_OVERWRITE = ' '
NO_AUTH_CHECK = ' '
CODEPAGE = ' '
IGNORE_CERR = ABAP_TRUE
REPLACEMENT = '#'
WRITE_BOM = ' '
TRUNC_TRAILING_BLANKS_EOL = 'X'
WK1_N_FORMAT = ' '
WK1_N_SIZE = ' '
WK1_T_FORMAT = ' '
WK1_T_SIZE = ' '
IMPORTING
FILELENGTH =
tables
data_tab = I_FILE2
FIELDNAMES =
*& Form F_FILE_GET
text
-->P_P_FILEN text
-->P_TEXT_G01 text
FORM F_FILE_GET USING L_FILENA L_TEXT.
CALL FUNCTION 'WS_FILENAME_GET'
EXPORTING
DEF_FILENAME = ' '
DEF_PATH = ' '
MASK = ',.,*.TXT.'
MODE = 'O'
TITLE = L_TEXT
IMPORTING
FILENAME = L_FILENA
rc =
EXCEPTIONS
INV_WINSYS = 1
NO_BATCH = 2
SELECTION_CANCEL = 3
SELECTION_ERROR = 4
OTHERS = 5
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Reward if helpful.
Regards,
Harini.S -
How to store data from textfile to vector and delete a selected row.
Can someone teach me how to store data from textfile to vector and delete a selected row. And after deleting, i want to write the changes in my textfile.
Do someone has an idea? :)nemesisjava wrote:
Can someone teach me how to store data from textfile to vector and delete a selected row. And after deleting, i want to write the changes in my textfile.
Do someone has an idea? :)What's the problem? What have you done so far? What failed?
What you described should be pretty easy to do. -
How to Reconcile Data Between SAP Source Systems and SAP NetWeaver BI
Hi,
I just read "How to Reconcile Data Between SAP Source Systems and SAP NetWeaver BI". While I'm waiting for more authorisation to r/3 to carry it out and test this functionality.
I'd like to ask a question to anyone who has implemented this type solution. On page 10 it talks about creating a view then setting up the datasource. The solution talks about runnig a query. I suspect when we run a query I would run it for only a period(using variable) to reconcile.
My question is this. Will the datasource extractor on /r3 only select the period in our variable or will it do a full selection of the data which would then be passed to BW for filtering?
RegardsDEar Mark,
There are several avenues where you can see and reconcile your data with source system, u can see data in by tcode RSA3 for a datasource, and compare the values with actual document posted into the R/3 system. Respective fuctional consultant canhelp you a lot to confirm the data.
On BW side u can see the data in PSA and then check tranformations which subsequent change/update/reject data records based on the selective conditions.
hope this helps.
Kindly assign the points if it works.
Revert back if u need futher help/information. -
How to extract data from SAP 4.7 and upload data to SAP ECC 6.0
Hi,
How to extract data from SAP 4.7 and upload data to SAP ECC 6.0? Can i use BDC,BAPI,LSMW? Help me please.hi
good
both works not possible simultaneously.
If you want to do it in two separate task than you can use the GUI_UPLOAD function module to fulfill your requirement.
thanks
mrutyun^ -
How test the date formats M/d/yyyy and MM/dd/yyyy .
how test the date formats M/d/yyyy and MM/dd/yyyy .format should accept 3/3/1982 and 03/03/1982 dates.
please help megeorgemc wrote:
kajbj wrote:
Spoiler: Reply #3 is actually the answer to your question.Also, Bruce Willis is a ghost, the Titanic sinks and Verbal is Keyzer Soze.Only one of those endings really surprised me.
You should've heard me in that theatre when the Titanic struck that iceberg... -
How to group data and assign cell names using Excel templates
Hi all,
reading the article "Real Excel Templates 1.5" on the Tim Dexter's Blog, I found that I need hierarchical data for Excel templates. So only in this way I can group my data.
My hierarchy is composed by 3 levels:
lev 1 DESTINATION: is the higher level that groups SERVICES and COUNTRY
lev 2 SERVICES: is the level that groups the countries
lev 3 COUNTRY: is the lowest level with the COUNTRY, CALLS and CALLS_MINUTES details
An example of my hierarchy is this:
lev 1 INTERNATIONAL
lev 2 INTERNATIONAL FIXED
lev 3 Albania 90 438,15
lev 3 Armenia 1 16,95
lev 2 INTERNATIONAL MOBILE
lev 3 Albania Mobile 161 603,35
lev 3 Australia Mobile 6 34,38
lev 1 NATIONAL
lev 2 HELLAS LOCAL
lev 3 Hellas Local 186,369 707940,6
lev 2 HELLAS MOBILE
lev 3 Hellas Mobile Cosmote 31,33 43856,97
lev 3 Hellas Mobile Q-Telecom 2,398 4343,78
lev 2 HELLAS NATIONAL
lev 3 Hellas Long Distance 649 1499,55
lev 1 INTERNET
lev 2 INTERNET CALLS
lev 3 Cosmoline @Free 79 2871,3
So, my data template is the following (with exactly the hierarchy I want for my data):
<dataTemplate name="emp" description="destinations" dataSourceRef="GINO_DB">
<dataQuery>
<sqlStatement name="Q1">
<![CDATA[SELECT 1 TOTAL_CALLS, 2 TOTAL_CALLS_MIN from dual ]]>
</sqlStatement>
<sqlStatement name="Q2">
<![CDATA[SELECT dest.ID_DESTINATION, dest.DESC_DEST from ale.AAA_DESTINATION dest order by dest.ID_DESTINATION ]]>
</sqlStatement>
<sqlStatement name="Q3">
<![CDATA[SELECT ser.ID_SERVICE,
ser.ID_DEST,
ser.DESC_SERVICE,
count.ID_COUNTRY,
count.ID_SERV,
count.COUNTRY,
count.CALLS,
count.CALLS_MIN
from ale.AAA_SERVICE ser, ale.AAA_COUNTRY count
where ser.ID_SERVICE= count.ID_SERV
and ID_DEST = :ID_DESTINATION
order by ser.ID_SERVICE ]]>
</sqlStatement>
</dataQuery>
<dataStructure>
<group name="G_TOT" source="Q1">
<element name="TOTAL_CALLS" value="G_COUNTRY.CALLS" function="SUM()"/>
<element name="TOTAL_CALLS_MIN" value="G_COUNTRY.CALLS_MIN" function="SUM()"/>
<group name="G_DEST" source="Q2">
<element name="DESC_DEST" value="DESC_DEST"/>
<element name="DEST_CALLS_SUBTOTAL" value="G_COUNTRY.CALLS" function="SUM()"/>
<element name="DEST_CALLS_MIN_SUBTOTAL" value="G_COUNTRY.CALLS_MIN" function="SUM()"/>
<group name="G_SERV" source="Q3">
<element name="DESC_SERVICE" value="DESC_SERVICE"/>
<element name="SERV_CALLS_SUBTOTAL" value="G_COUNTRY.CALLS" function="SUM()"/>
<element name="SERV_CALLS_MIN_SUBTOTAL" value="G_COUNTRY.CALLS_MIN" function="SUM()"/>
<group name="G_COUNTRY" source="Q3">
<element name="COUNTRY" value="COUNTRY"/>
<element name="CALLS" value="CALLS"/>
<element name="CALLS_MIN" value="CALLS_MIN"/>
</group>
</group>
</group>
</group>
</dataStructure>
</dataTemplate>
Not considering the CALLS and CALLS_MIN details (I focused only on the COUNTRY which is as the same level), with this data template, making tests on my excel template, I noticed that I can group ONLY two nested levels using the format XDO_GROUP_?group_name?
XDO_GROUP_?G_DEST?
XDO_GROUP_?G_SERV?
or
XDO_GROUP_?G_DEST?
XDO_GROUP_?G_COUNTRY?
or
XDO_GROUP_?G_SERV?
XDO_GROUP_?G_COUNTRY
If I try to group all the three level together in this order
XDO_GROUP_?G_DEST?
XDO_GROUP_?G_SERV?
XDO_GROUP_?G_COUNTRY
I don't have the output I would like to have.....
Practically, in my excel I have 3 rows with the following labels
DESTINATION (called XDO_?DESC_DEST? - =Sheet1!$A$3
SERVICE (called XDO_?DESC_SERVICE? - =Sheet1!$A$4
COUNTRY (called XDO_?COUNTRY? - =Sheet1!$A$5)
where
XDO_GROUP_?G_DEST? (=Sheet1!$A$3:$B$5)
XDO_GROUP_?G_SERV? (=Sheet1!$A$4:$B$5)
XDO_GROUP_?G_COUNTRY (=Sheet1!$A$5:$B$5)
I noticed that if I don't use the last one (XDO_GROUP_?G_COUNTRY), my output is correct even if I don't have more than one country for each service....As soon as I put XDO_GROUP_?G_COUNTRY....I loose all the 2nd level and the most of times the 3rd level too....
So...I think that the problem is how I choose the excel cells when I assign the XDO_GROUP_?group_name?
Anybody had made some tests, or can help me ???? I'm becoming crazy.....
Any help will be appreciated
Thanks in advance
AlexBut how can I use tags XDO_GROUP_?? to group data correctly using hierarchial xml, I don't want to use flat XML.
Yep, I using Template Builder in Excel to run reports localy, and output is wrong
It's seems that groups couldn't define the level of nesting, I think...
How can I write it in XDO_METADATA sheet?
Though I have hierarchial XML and groups should define nesting level correctly.
I have no clue..... -
Help on how to group data in Answers
Hi
I need to group data on the number of times it occurs.
Below is the source data:
Table:
Order No; Product
1 A
2 A
3 A
4 B
5 B
I need to show the above data in the follwoing way:
Product 1 Occurance <2 Occurance <3 Occurance
A 0 0 3
B 0 2 0
Could you please advise on how best to do this?
Thanks
AI've created a count column in the logical layer and have tried a count in the presentation services. However I am unable to display the results they way I want them.
I want to show the number of occurrences under the specific heading, example below
Product Occ 1 Occ 2 Occ 3
A 0 0 3
where do you recommend creating the count and how can I show the count under the specific heading? -
How to group data from two tables ?
Hello,
I have two tables and i want to group data from them but two table not linked.
Table TEXT_IN : ID_IN (primary_key), DATE_IN
Table TEXT_OUT : ID_OUT(primary_key),DATE_OUT
Example :
Result :Group Date and Order by IN,OUT
And It seems a bit
confusing because we do not link
.You can give me solutions.
Thank you.SELECT MAX(CASE WHEN Rn = 1 THEN [IN] END) AS [IN1],
MAX(CASE WHEN Rn = 1 THEN [OUT] END) AS [OUT1],
MAX(CASE WHEN Rn = 2 THEN [IN] END) AS [IN2],
MAX(CASE WHEN Rn = 2 THEN [OUT] END) AS [OUT2],
MAX(CASE WHEN Rn = 3 THEN [IN] END) AS [IN3],
MAX(CASE WHEN Rn = 3 THEN [OUT] END) AS [OUT3],
MAX(CASE WHEN Rn = 4 THEN [IN] END) AS [IN4],
MAX(CASE WHEN Rn = 4 THEN [OUT] END) AS [OUT4],
MAX(CASE WHEN Rn = 5 THEN [IN] END) AS [IN5],
MAX(CASE WHEN Rn = 5 THEN [OUT] END) AS [OUT5],
FROM
SELECT COALESCE(m.DATE_IN,n.DATE_IN) AS DATE_IN,
COALESCE(m.Seq,n.Seq) AS Seq,
ID_IN AS [IN],
ID_OUT AS [OUT],
ROW_NUMBER() OVER (PARTITION BY Seq ORDER BY COALESCE(m.DATE_IN,n.DATE_IN)) AS Rn
FROM
SELECT ROW_NUMBER() OVER (PARTITION BY DATE_IN ORDER BY DATE_IN) AS Seq,*
FROM TEXT_IN
)m
FULL OUTER JOIN
SELECT ROW_NUMBER() OVER (PARTITION BY DATE_IN ORDER BY DATE_IN) AS Seq,*
FROM TEXT_OUT
)n
ON n.Seq = m.Seq
AND n.DATE_IN = m.DATE_IN
)t
GROUP BY Seq
to make it dynamic see
http://sqlblogcasts.com/blogs/madhivanan/archive/2007/08/27/dynamic-crosstab-with-multiple-pivot-columns.aspx
Please Mark This As Answer if it solved your issue
Please Mark This As Helpful if it helps to solve your issue
Visakh
My MSDN Page
My Personal Blog
My Facebook Page -
How do we fetch the top-level users and groups for a particular resource
Hi Experts,
I need to fetch the top level users and groups (permissions) for a particular resource, Currently i am able to fetch the effective users list.
Thanks.To elaborate...
Here we need the users and groups who have direct access to the resource. We dont want to resolve groups.
Please help us with the apis to use in our java code to fetch the users and groups. -
Have trouble creating formula using FormCalc that will calculate difference in time (hours and minutes) from a Start Date/Time field and End Date/Time field.
I am using to automatically calculate total time in hours and minutes only of an equipment outage based on a user entered start date and time and end date and time.
For example a user enters start date/time of an equipment outage as 14-Oct-12 08:12 AM and then enters an end date/time of the outage of 15-Oct-12 01:48 PM. I need a return that automatically calculates total time in hours and minutes of the equipment outage.
Thanks ChrisHi,
In JavaScript you could do something like;
var DateTimeRegex = /(\d\d\d\d)-(\d\d)-(\d\d)T(\d\d):(\d\d)/;
var d1 = DateTimeRegex.exec(DateTimeField1.rawValue);
if (d1 !== null)
var fromDate = new Date(d1[1], d1[2]-1, d1[3], d1[4], d1[5]);
var d2 = DateTimeRegex.exec(DateTimeField2.rawValue);
if (d2 !== null)
var toDate = new Date(d2[1], d2[2]-1, d2[3], d2[4], d2[5]);
const millisecondsPerMinute = 1000 * 60;
const millisecondsPerHour = millisecondsPerMinute * 60;
const millisecondsPerDay = millisecondsPerHour * 24;
var interval = toDate.getTime() - fromDate.getTime();
var days = Math.floor(interval / millisecondsPerDay );
interval = interval - (days * millisecondsPerDay );
var hours = Math.floor(interval / millisecondsPerHour );
interval = interval - (hours * millisecondsPerHour );
var minutes = Math.floor(interval / millisecondsPerMinute );
console.println(days + " days, " + hours + " hours, " + minutes + " minutes");
This assumes that the values in DateTimeField1 and DateTimeField2 are valid, which means the rawValue will be in a format like 2009-03-15T18:15
Regards
Bruce -
How to group data based on date
In my program the internal table is returning several values based on date.
for example for the first pernr in the image below there are four records. i need to delete the first record which is between the dates 20 and 30 .
and also i need to get the difference between the dates as the record 23 and 28 i need to get separate dates as 24, 25..28.I am not sure if I understood your question correctly.
From what I have understood, you can use the following logic.
This logic will move all the records from lt_fields2 to another table lt_fields1 with begda between 20 and 30 of any month, except for the first record. It will also move records for every date between begda and endda of each record.
You can alter the logic based on your exact requirement.
declare another table lt_fields1 like lt_fields2.
data del_flag.
data prev_month(2) type c.
sort lt_fields by pernr begda.
clear del_flag.
loop at lt_fields2 into wa_fields where begda+6(2) GE 20.
* Delete the first record having date greater than 20 in a month for each pernr.
at new pernr.
clear del_flag.
endat.
if begda+4(2) NE prev_month.
clear del_flag.
endif.
if del_flag is initial.
del_flag = 'X'.
continue. " This record will not be moved to the final internal table.
endif.
* Add records for each date between begda and endda.
append wa_fields to lt_fields1.
prev_month = begda+4(2)
while wa_fields-begda LT wa_fields-endda.
wa_fields-begda = wa_fields-begda+1.
append wa_fields to lt_fields1.
endwhile.
endloop. -
HFM Extended Analytics Extract - Only for Data at Review Level 6 and up?
Hello, I have a requirement to Extract Data from HFM as Flat Files in order for them to be picked up by a separate process.
In order to do this I have used Extended Analytics to create the extracts I require.
The issue I have is that users are only supposed to be able to extract data that has been approved up to Review Level 6 and above, and at the moment they can choose any POV regardless of the Review Level the combination of the 4 dimensions has.
Is there a recommended or easy way to achieve this?
I have looked into a few possibilities including:
1. Restricting the LOV drop-downs (via re-creating metadata via a custom script)
2. Having a process "catch" the fact that the POV is not approved upon export (perhaps using a taskflow with a "Process Management Action" stage, or by creating a Rule that can be applied to the EA Exract?)
3. Including in the Extracted data file a "header" row with the POV Review Level value (so the next process in the chain can handle validating this)
4. A custom API method
I am quite in-experienced with HFM so any advice or pointers would be very much appreciated.
Many Thanks,
MartinTerri,
Doesn't EIS require a parent-child/recrusive table for the dimensions? If it could read HFM EA's tables as they are natively organized, then I guess EIS would be an approach although unfortunately it is not possible in the environment in question. I am at a loss as to why HFM EA doesn't output tables as required for Essbase, especially given the Essbase option in exporting, but it is what it is.
I got an answer over on Network54 suggesting how to build those tables in Oracle. Again, unfortunately, I'm in a SS 2000 environment so that means extra work for my SQL resource as I think it requires a stored procedure (am not, never have, and will likely never claim to have more than a 'SELECT * FROM' level of SQL knowledge) but at least it's a start.
The original thought I had was to get these Essbase-ready parent-child dimension tables and build the cubes from them. Are you interested in EIS because it has better automation?
Regards,
Cameron Lackpour -
How to display data with the same text and key in the drop down list?
Hi All,
Would like so to seek for you advice on the above mention topic. How to display the data with the same text and key using function module 'VRM_SET_VALUES'. From my testing by writing a program, this function module will only show the text and key if both have different data. Please find the coding as below. Is the normal behaviour of this function module? How to overcome this problem? Thanks in advance.
REPORT ZTESTING.
TYPE-POOLS: VRM.
DATA: NAME TYPE VRM_ID,
LIST TYPE VRM_VALUES,
VALUE LIKE LINE OF LIST,
c(20) type c.
* c = 'select any'.
data:begin of itab occurs 0,
kunnr like kna1-kunnr,
name1 like kna1-name1,
end of itab.
data:begin of jtab occurs 0,
kunnr like kna1-kunnr,
land1 like kna1-land1,
end of jtab.
PARAMETERS: p_list(20) AS LISTBOX VISIBLE LENGTH 20
default 'SELECT'.
AT SELECTION-SCREEN OUTPUT.
NAME = 'p_list'.
VALUE-KEY = 'Name'. "---> Data for key is the same with text
VALUE-TEXT = 'Name'. "--> Data for text is the same with key
APPEND VALUE TO LIST.
VALUE-KEY = '2'.
VALUE-TEXT = 'Country'.
APPEND VALUE TO LIST.
CALL FUNCTION 'VRM_SET_VALUES' EXPORTING ID = NAME VALUES = LIST.
start-of-selection.
select kunnr name1 up to 20 rows from kna1 into table itab.
select kunnr land1 up to 20 rows from kna1 into table jtab.
case p_list.
when '1'.
loop at itab.
write:/ itab-kunnr,itab-name1.
endloop.
when '2'.
loop at jtab.
write:/ jtab-kunnr,jtab-land1.
endloop.
endcase.
<Added code tags>
Moderator Message: Please use the "code" tags to format your code snippet.
Edited by: Suhas Saha on Nov 17, 2011 11:19 AMshawnTan wrote:
Hi All,
>
> Would like so to seek for you advice on the above mention topic. How to display the data with the same text and key using function module 'VRM_SET_VALUES'. From my testing by writing a program, this function module will only show the text and key if both have different data. Please find the coding as below. Is the normal behaviour of this function module? How to overcome this problem? Thanks in advance.
>
>
REPORT ZTESTING.
>
> TYPE-POOLS: VRM.
>
> DATA: NAME TYPE VRM_ID,
> LIST TYPE VRM_VALUES,
> VALUE LIKE LINE OF LIST,
> c(20) type c.
>
> * c = 'select any'.
>
> data:begin of itab occurs 0,
> kunnr like kna1-kunnr,
> name1 like kna1-name1,
> end of itab.
>
> data:begin of jtab occurs 0,
> kunnr like kna1-kunnr,
> land1 like kna1-land1,
> end of jtab.
>
> PARAMETERS: p_list(20) AS LISTBOX VISIBLE LENGTH 20
> default 'SELECT'.
>
> AT SELECTION-SCREEN OUTPUT.
>
> NAME = 'p_list'.
>
> VALUE-KEY = 'Name'. "---> Data for key is the same with text
> VALUE-TEXT = 'Name'. "--> Data for text is the same with key
> APPEND VALUE TO LIST.
>
> VALUE-KEY = '2'.
> VALUE-TEXT = 'Country'.
> APPEND VALUE TO LIST.
>
> CALL FUNCTION 'VRM_SET_VALUES' EXPORTING ID = NAME VALUES = LIST.
>
> start-of-selection.
> select kunnr name1 up to 20 rows from kna1 into table itab.
> select kunnr land1 up to 20 rows from kna1 into table jtab.
>
> case p_list.
> when '1'.
> loop at itab.
> write:/ itab-kunnr,itab-name1.
> endloop.
>
> when '2'.
> loop at jtab.
> write:/ jtab-kunnr,jtab-land1.
> endloop.
> endcase.
>
> <Added code tags>
>
> Moderator Message: Please use the "code" tags to format your code snippet.
>
> Edited by: Suhas Saha on Nov 17, 2011 11:19 AM
This surely seems to be a bug to me(if not by design), did you check for any SAP notes? Perhaps a front end trace can help(Note 407743) !
-Rajesh.
Maybe you are looking for
-
Can't install catalyst on windows 7 64 bit
Hi, I'm a newbie to adobe and just got production suite which has catalyst, I had to upgrade from xp to windows 7 64 bit which was A clean Install so lost everything. I have issues with catalyst not installing at all with it saying there are errors,
-
ABAP program is cancel , Function ROLLBACK on connection failed
We have an ABAP program (Z), the following program executes this task: 1.-Read table A (about 3 million records) 2.-Read table B (about 6 million records) 3.-Instert in to B table the match between A and B table When the program run in batch or dialo
-
Processors of Mac mini and Macbook different?
On Benchmark song 2 thread, Mac mini 1.66 gives as many tracks (16) as my Macbook. But the processor of Macbook is 2.0GHz compared to 1.66 of Mac mini?! Are they different processors?
-
I don´t know why Iphoto doesn´t works in my new macbook... I open it and few seconds later it close...
-
Restrict Data for a user without VPD
I have read some posts, and maybe there are no better solutions, but I will try. For a particular user (User_A) I have to limit the data the user can see by Data_ID. Data_ID avialbe to User_A is 1, 2, 3. I know I can create a View for each Table and