Need towrite ABAP code in cnoverting Country like Malysia to Area like East
Hi ,
Need to write ABAP code in cnoverting Country like Malysia to Area like Ease or West.
Can anybody help me please?
Regards,
kranti
Hi,
I think you can also do it by concatenating the 2 fields data and displaying it in the result. You can go through the link below which discusses the similar issue. Not very sure which would be the best way to achieve this.
Concatenate 2 fields in a Query
hope this helps in some way.
Regards,
Gaurav
Similar Messages
-
Needs sample ABAP code for field routine
Dear Expert,
There is a field "Pay Scale Group" in my DSO which stores the data in the format
AA1/B1/CCC2/DD2/EEE1, A1/BB2/CC2/DDD3/EE2 etc. These data has to be transferred to
InfoCube where "pay Scale Group" in the InfoCube will store the data like EEE1,EE2 etc.
I need to write a field routine on the transformation between DSO and Cube.
Can any one please help me with the sample ABAP code for this scenario.
Some more examples for better understanding of the requirement:-
Data in DSO(Source) Data in Cube(Target)
=================== ===================
AA1/B1/CCC2/DD2/EEE1 EEE1
AAA1/BB2/CC1/DDD3/EE2 EE2
A2/BBB2/CC2/DDD3/EEE5 EEE5
AA2/BB1/C1/DDD3/EE3 EE3
A3/B1/CC2/DDD1/EE4 EE4
Many thanks in advance.
Regards,
Prakash
Please do not dump your code requirements in SDN
Edited by: Pravender on May 18, 2011 11:37 AMHi,
You can use the following code :
Suppose the technical name of the field coming from DSO is ZPAY_SGRP.
And also for example let me take one record, that is ZPAY_SGRP = AA1/B1/CCC2/DD2/EEE1 .
My assumption is that there will always be 4 '/'.
In the field routine write the below code
data: V1(5) type c,
V2(5) type c,
V3(5) type c,
V4(5) type c,
V5(5) type c.
data : VAR1 TYPE /BIC/OIZPAY_SGRP.
split VAR 1 at '/' into V1 V2 V3 V4 V5.
result = V5.
V5 will be having the characters after the last '/' .That is V5 = EEE1.
Hope the above reply was helpful.
Kind Regards,
Ashutosh Singh
Edited by: Ashutosh Singh on May 17, 2011 3:53 PM
Edited by: Ashutosh Singh on May 17, 2011 4:17 PM -
Hi ,
I am trying to activate an ODS but it is failing the activation process . When I look into the application log I see this error "Value 'RAM???¿????????S RAM' (hex. '4D41524B3F3F3FBF3F3F3F3F3F3F3F3F5320574F524B') of characteristic ZEUID contains invalid characters "
I am new to ABAP and I need an ABAP code to filter this value when loading data into ODS .
Thanks a lot for your helpHI,
Write the code in the start routine.
IN the start routine you have a table called SOURCE_PACKAGE.
declare work area x_souce_package type source_package
data : lv_string(100).
loop at souce_package into x_source_package.
lv_string = x_source_package-value.
TRANSLATE LV_STRING TO UPPER CASE
if lv_string CA 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' .
ELSE.
DELETE SOURCE_PACKAGE INDEX SY-TABIX.
ENDIF.
endloop -
Date range selection in abap code in infopackage
Hi!
I have a field called "OPEN_DATE".
When the infopackage is runned, I need the abap code to fint the current date, and from that, make a date range from the first day of current month to the last day of current month
Ex:
Current date = 12.12.2008
Abap code should extract 01.12.2008 - 31.12.2008
Thanks!Hi helge,
Data: l_idx like sy-tabix.
Data: date_low like sy-datum,
date_high like sy-datum.
Date_low = sy-datum.
date_low+6(2) = '01'.
CALL FUNCTION 'SLS_MISC_GET_LAST_DAY_OF_MONTH'
EXPORTING
DAY_IN = Date_low
IMPORTING
LAST_DAY_OF_MONTH = date_high
read table l_t_range with key
fieldname = 'OPEN_DATE'.
l_idx = sy-tabix.
Pass Range values to L_T_Range Table.
Move date_low to L_T_Range -Low.
Move date_high to L_T_Range -High.
L_T_Range -Sign = u2018Iu2019. *****(Here: I u2013 Include, E u2013 Exclude)
L_T_Range -Option = u2018BTu2019.****( Here: BT u2013 Between )
modify l_t_range index l_idx.
p_subrc = 0.
Regards, -
ABAP Code for summation of key figure
Hi Guys,
I am new to ABAP and my requirement is as follows-
I have an infocube containing data like
Location Item Amount Month
India TV 10 Jan
India DVD 10 Jan
India XBOX 10 Jan
US TV 10 Jan
US XBOX 15 Jan
US DVD 20 Jan
UK XBOX 30 Jan
UK TV 20 Jan
UK DVD 15 Jan
India TV 20 Feb
US DVD 20 Feb
UK XBOX 10 Feb
India TV 20 Mar
Now by using open hub, I want to extract a file which would display report as -
Output file
15-Oct-2010
Location Item Amount
India TV 50
India DVD 10
India XBOX 10
US TV 10
US DVD 40
US XBOX 15
UK TV 20
UK DVD 15
UK XBOX 40
which means it should sum based on combination of location and item and create one single row.
I need some ABAP code which could be written in expert routine so as to to calculate single rows of amount for all data packets of infocube.
Kindly suggest on how to proceed on it.
Thanks in advance
Moderator Message: Even if you are new-to-ABAP, it does not imply that you can expect others to do your work. If you are a BI consultant, take the help of an ABAP consultant or self-learn the basic concepts of ABAP. If you are an ABAPer, go back to the training center.
Edited by: kishan P on Oct 15, 2010 10:34 AMFollow this white paper .... called, "How to .... Calculate with Attributes":
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/72f4a790-0201-0010-5b89-a42a32223ffc
Brian -
ABAP Code in Start Routine for restricing the data records from ODS1 - ODS2
Hi
I need small ABAP Code in Start Routine Of Update rules Of ODS . Im in BW 3.5 .
I have records like below in first layer ODS and i want to restrict some records while going to second layer ODS ..
ODS1 :-
DocNO EventType Date
123 001 08/08/2008
123 003 08/08/2008
123 011 09/08/2008
I want one record in ODS2 for this document number whose EventType = 001 only and date of third record ... like below
Doc NO EventType From Date Todate
123 001 08/08/2008 09/08/2008
So how can i get like this record in the ODS2 which will get data from ODS1 . So i need to write the code in the start routine of the ODS2 .
So please give the me the code for start routine ....
Regards
SureshIts difficult in BW 3.5 to include this logic in START_ROUTINE as you cannot add the extra to_date field to the DATA_PACKAGE table.
You need to create a new global internal table with the same structure of DATA_PACKAGE with additional field to_date. then use the logic to fill in the global internal table
define a internal table new_data_package with the required structure like (docno, eventtype, fromdate todate)
data: l_w_datapkg_001 type data_package,
data: l_w_newdatapkg type new_data_package,
data: l_w_datapkg_011 type data_package
LOOP AT DATA_PACKAGE INTO l_w_datapkg_001 WHERE event_type = '001'.
l_w_newdatapkg-docno = l_w_datapkg_001-docno.
l_w_newdatapkg-event_type = l_w_datapkg_001-event_type.
l_w_newdatapkg-fromdate = l_w_datapkg_001-date.
MOVE CORRESPONDING FIELDS OF l_w_datapkg_001 INTO l_w_newdatapkg.
READ TABLE data_package INTO l_w_datapkg_011
WITH KEY docno = l_w_datapkg_001-docno
event_type = '011'.
l_w_newdatapkg-to_date = l_w_datapkg_011-date.
APPEND l_w_newdatapkg TO new_data_package
ENDLOOP.
Now the new datapackage contains the ODS2 data that u needed -
ABAP code used in transaction SU01
Hi all,
Can anyone tell me that whether is there any method by which I can pass the user id and can know whether that user has the SAP_ALL profile or not.
The above is done by using the transaction SU01,but I need the ABAP code that is being used in this transaction.
Regards,
Varun.YOu can query the table:
UST04
select single * from UST04 where BNAME = sy-uname
and PROFILE = 'SAP_ALL'.
if sy-subrc = 0.
write:/ 'The User' sy-uname 'has SAP_ALL profile'.
endif.
Regards,
Ravi -
What does this ABAP code do?
Hi,
I came across this ABAP code and I'd like to know what the asterisk (*) before the variable names does.
*mkpf = mkpf.
*mseg-lgort = mseg-lgort.
*ladr = ladr.
save_mkpf = *mkpf-usnam.
save_mblnr = *mkpf-mblnr.
save_budat = *mkpf-budat.
save_cpudt = *mkpf-cpudt.
save_ematn = *mseg-ematn.
save_lgort = *mseg-lgort.
save_ladr = *ladr.
*t001w = t001w.
save_werks = *t001w-werks.
save_name1 = *t001w-name1.
*ekko = ekko.
*am07m = am07m.
save_lifnr = *ekko-lifnr.
save_ebeln = *ekko-ebeln.
save_ekgrp = *ekko-ekgrp.
save_linam = *am07m-name1.
save_lina2 = *am07m-name2.
*t024 = t024.
save_eknam = *t024-eknam.
save_ektel = *t024-ektel.
*mkpf-usnam = old_mkpf.
*mkpf-mblnr = old_mblnr.
*mkpf-cpudt = old_cpudt.
*mkpf-budat = old_budat.
*mseg-ematn = old_ematn.
*mseg-lgort = old_lgort.
*ladr = old_ladr.
*t001w-werks = old_werks.
*t001w-name1 = old_name1.
*t024-eknam = old_eknam.
*t024-ektel = old_ektel.
*ekko-lifnr = old_lifnr.
*ekko-ebeln = old_ebeln.
*ekko-ekgrp = old_ekgrp.
*am07m-name1 = old_linam.
*am07m-name2 = old_lina2.
Thx.
AndyHi,
It is nothing but the Work Area. Check the below sample code.
report abcd.
tables: *vbak, vbak.
select single * from vbak into *vbak where vbeln <> space.
write *vbak-vbeln.
Regards,
Satya -
Need ABAP code to make unique hierarchy values - Request prompt help
hi
<removed>
I am new to SAP. Please help me in the following
I require an ABAP code for the following scenario
I have a simple hieraarchy. The hierarchy is
SEG -> fam -> clas -> comm
The values of the seg , fam, cla, com......all will be charecter values
But in some cases the values will be NOT_KNOWN
If the values are NOT_KNOWN i need to change them as NOT_KNOWN_1, NOT_KNOWN_2...like that unique charecter values
should be replaced for NOT_KNOWN
Example
SEG->FAM->CLA ->COM
Clothing -> Mens wear -> Designer garments -> NOT_KNOWN
Construction -> equipments -> machinery->NOT_KNOWN
Computers -> Laptops -> Imported -> NOT_KNOWN
-> desktops ->flat monitors -> Indian
-> imported -> NOT_KNOWN->
NOT_KNOWN -> baggages
This should be changed to
SEG->FAM->CLA ->COM
Clothing -> Mens wear -> Designer garments -> NOT_KNOWN_1
Construction -> equipments -> machinery->NOT_KNOWN_2
Computers -> Laptops -> Imported -> NOT_KNOWN_3
-> desktops ->flat monitors -> Indian
-> imported
-> NOT_KNOWN_4 ->
NOT_KNOWN_5 -> baggages
This is to make them unique nodes to upload them in hiereachy
Data is coming from database tables and i was not supposed to do anything in database and the incomin
data needs to finetuned like this to update them in cube
So I like to have some coding which will enable this to work in the start routine
If start routine is not the right option, where else we can do coding
<removed>
Regards
KCdata : w_suff_n(8) type n,
w_suff_c(8).
loop at data_package.
if data_package-<fieldval> = 'NOT_KNOWN'.
w_suff_n = w_suff_n + 1. w_suff_c = w_suff_n.
shift w_suff_c left deleting leading '0'.
concatenate data_package-<fieldval> w_suff_c into data_package-<fieldval>.
modify data_package.
endif.
endloop.
*Change <fieldval> in the above to the actual field name. -
Hi,
I have added 3 new fields to the datasource 0PROJETC_ATTR
fields names are : ZZPROFL , ZZPLFAZ and ZZPLSEZ
Can some body tell me the ABAP code to fill data in these 3 fields.
Thanks,
Jeetuhi Jeetu,
we need the logic,
but the code will something like following sample ...
Declaration for datasource 0MATERIAL_ATTR
DATA : BEGIN OF S_BIW_MARA_S.
INCLUDE STRUCTURE BIW_MARA_S.
DATA : END OF S_BIW_MARA_S.
*Here BIW_MARA_S corresponds to the structure of your datasource *0MATERIAL_ATTR
*then you have to declare a when with the datasource on which you want to *populate the appended new fields.
*for example :
WHEN '0MATERIAL_ATTR'.
*then do a loop across your strcuture
LOOP AT C_T_DATA INTO S_BIW_MARA_S.
*a select from the table
SELECT SINGLE * FROM MARA
WHERE MATNR = S_BIW_MARA_S-MATNR.
*a check to see if your select is ok
IF SY-SUBRC = 0.
*if it is ok then your field in your structure is corresponding to a field in the table
S_BIW_MARA_S-Z1 = MARA-Z1.
S_BIW_MARA_S-Z2 = MARA-Z2.
*the c_t_data will be updated from what you get in your structure.
MODIFY C_T_DATA FROM S_BIW_MARA_S.
ENDIF.
ENDLOOP.
hope this helps. -
Need ABAP Code to enhance the 0PRODORDER_ATTR?
I want to enhance the datasource 0PRODORDER_ATTR with the below JCDS Table fields like UDATE,STAT,OBJNR,INACT,CHGNR.
Can anyone please let me know the ABAP Code need to be written in the CMOD to populate the data for the above fields in the 0PRODORDER_ATTR?Hi,
You can use below code to enhancemnt .
You need to change the table, structure and field names
Below code you have to write in tocde CMOD if you are enhancing the master data. It applies for any master data, although, I have taken 0VENDOR_ATTR as the example. I assume that You have already added/appended the fields in the extract structure of 0VENDOR_ATTR i.e. to the structure BIW_LFA1_S. ( Check this link for how to enhance the DataSource : https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/b0af763b-066e-2910-a784-dc6731660f46 )
We have enhanced the datasorce for the following two fields from table LFA1:
ERDAT- Date on which the Record Was Created
KRAUS - Credit information number.
We have also enhaced the structure for the following fields from table LFB1.
MINDK - Minority Indicators
ZTERM - Terms of payment key
CERDT - Certification date.
Now we will poulate these two fields in the code written in CMOD tcode. Here is the code:
Go to the tcode CMOD in R3 and select the component EXIT_SAPLRSAP_002. Write this code in INCLUDE ZXLOFU01.
data : l_t_data like biw_lfa1_s.
data : l_tabix like sy-tabix.
CASE i_datasource.
WHEN '0VENDOR_ATTR'.
LOOP AT i_t_data INTO l_t_data.
l_tabix = sy-tabix.
CLEAR: l_t_data-yyerdat,
l_t_data-yykraus.
SELECT SINGLE erdat kraus FROM lfa1 INTO
( l_t_data-yyerdat, l_t_data-yykraus)
WHERE lifnr EQ l_t_data-lifnr.
SELECT SINGLE mindk zterm cerdt FROM lfb1 INTO
(l_t_data-yymindk, l_t_data-yyzterm, l_t_data-yycerdt)
WHERE lifnr = l_t_data-lifnr.
MODIFY i_t_data FROM l_t_data INDEX l_tabix.
CLEAR: l_t_data, l_tabix.
ENDLOOP.
ENDCASE.
Labels parameters -
Need ABAP code for Datasource Enhancement
Hi All,
I need no Enhance the WBS Element(PS_PSP_PNR) to2 LIS_02_ITM Datasource
the table EKKN Having WBS element
From EKKN Table We have to take the filed Append to the2LIS_02_ITM datasource
Please any one give me ABAP code which is write in CMOD
Thanks........
Regards!
MalliHi,
See SAP Help
http://help.sap.com/saphelp_nw04s/helpdata/en/6e/fe6e420f00d242e10000000a1550b0/content.htm
See the simple example code, so follow the same.Take ABAPer help, don't use select and end select.
CASE i_datasource.
Data: l_s_data1 LIKE mc13vd0itm,
l_tabix LIKE sy-tabix,
WHEN '2LIS_13_VDITM'.
LOOP AT c_t_data INTO l_s_data1.
l_tabix = sy-tabix.
SELECT SINGLE auart INTO l_s_data1-zzprdtyp FROM vbak
WHERE vbeln = l_s_data1-aubel.
IF sy-subrc = 0.
MODIFY c_t_data FROM l_s_data1 INDEX l_tabix.
ENDIF.
ENDLOOP.
ENDCASE.
Data: l_s_data18 LIKE mc12vc0itm ,
l_tabix LIKE sy-tabix.
WHEN '2LIS_12_VCITM' .
LOOP AT c_t_data INTO l_s_data18.
l_tabix = sy-tabix.
SELECT SINGLE ernam FROM ekko
INTO (l_s_data18-ernam)
WHERE ebeln = l_s_data18-vgbel .
IF sy-subrc = 0.
MODIFY c_t_data FROM l_s_data18 INDEX l_tabix.
ENDIF.
ENDLOOP.
See article on Step by Step Guide to Enhance a Data Source:
http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/00c1f726-1dc2-2c10-f891-ddfbffdb1a46?quicklink=index&overridelayout=true
Thanks
Reddy -
Help needed in writting Customer exit - ABAP Code
Hi Friends,
I have a scenario in one of the query and need to write a customer exit for the same. Here is the scenario:
I am using one input variable XXX to get input from user which feeds value to one of the charateristic lets say "CHAR1" in query. I have one more characteristic "CHAR2" which has to get the value from the same variable XXX. This is not allowed in BI7.0 as the variable is Hierarchy Node type. It gives error that "Variable XXX is used for two different characteristics."
So i need to create one more vaiable YYY which will get the value from XXX and then YYY will feed value to CHAR2. I would appreciate if some one could tell me step by step how to write customer exit and give me the piece of ABAP code i need to write in my case.
Your help will be appreciated in terms of points.
Thanks,
manmitHi Arun,
1. What should CHAR2 take - Hierarchy node variable or something else ?
--> CHAR2 is a simple charateristic
2. In your scenario - why have CHAR1 and CHAR2 ? why not have the user enter values against CHAR2 ??
--> We dont want user to enter two input as the input values for both Chars are same.
3. Did you try using a replacement path variable with the CHAR2 variable taking values from Variable on CHAR1 ?
--> In BI7.0 replacement path variable only take values from Query results. So not able to do the same.
Thanks -
Need help in ABAP code to Enhance the Extract Structure ?????
Hi all,
I want to enhance the extract structure to get KBETR & KBRUE fields of KONP table since it didnt allow me to add those fields while creating the generic extractor because of currency key problems. I want to read all KONP records into internal table with KNUMH (Key). Next, I want to fill them into ZZKBETR & ZZKBRUE of Extract Structure ZOXUR40065 in loop.
DATA:
i_t_zrebate like ZOXUR40065 occurs 0 with header line,
reb_tabix like sy-tabix.
TABLES: KONP.
Could you please help me in completing the ABAP code?
Thanks,
Venkat.Hello Manga,
I have included the following code in ZXRSAU01:
WHEN 'ZREBATE'.
PERFORM ZREBATE_EXIT TABLES C_T_DATA.
After Double click on ZREBATE_EXIT on perform statement, it created ZXRSAF01 include and the following code is added in it:
FORM ZREBATE_EXIT TABLES FP_C_T_DATA STRUCTURE ZOXUR40065.
DATA:
i_t_zrebate like ZOXUR40065 occurs 0 with header line,
reb_tabix like sy-tabix.
FIELD-SYMBOLS: <l_c_t_data> TYPE ZOXUR40065.
LOOP AT fp_c_t_data ASSIGNING <l_c_t_data>.
reb_tabix = sy-tabix.
select single KBETR KBRUE
into (<l_c_t_data>-ZZKBETR,
<l_c_t_data>-ZZKBRUE,
from KONP
where KNUMH eq <l_c_t_data>-KNUMH.
if sy-subrc eq 0.
MODIFY fp_c_t_data FROM <l_c_t_data> INDEX reb_tabix.
endif.
CLEAR:reb_tabix.
ENDLOOP.
ENDFORM.
When I tried to Activate this ZXRSAF01 include, it fails with 'The FORM "ZREBATE_EXIT" does not exist'.
Should it be FP_C_T or P_C_T? I found P_C_T in ZXRSAF01 include.
What is wrong with it, please ?
Can't I add this whole code in main include ZXRSAU01itself?
The Extractor ZREBATE is based on KONA, KONH & KONP tables. This Extractor and KONA table have the same 4000 records and KONP has 13000 records. I want to extract KBERT & KBRUE from KONP.
Thanks in advance.
Regards,
Venkat -
Need ABAP code for the below Services requirement
Hi,
We have a requirement to show all the services for a particular Purchase order number.For this I built a view on 2 tables ESLL and EKPO.Now based on the below logic I need to bring the services for the Purchase order..
1.Enter PO number,item no. and Doc category in EKPO and find the Pack no.
2.Now take the Pack no. of EKPO and give in ESLL and find the Sub pack no.
3.Now take this Subpack no. and Give this sub pack as Pack no. in ESLL
4.This will be the Service entry record for that PO number.
Can any one Please suggest me to how to write the ABAP code for the above logic.
Thanks & Regards,
DinakarHi Dinaker,
Did you find any solution for this issue. I too have a similar requirement of pulling all the service orders for a specific Purchase Order in the BW report.
Thanks,
SAPBWI
Maybe you are looking for
-
After many months of no difficulty, I suddenly cannot publish changes to one of my pages (all others work) without getting the error message 'Another instance of Contribute is doing a workflow operation. Do you want to break the workflow and continue
-
Attachments (such as pdf) in a mail merge Outlook 2010
Along with the problem of having the mail merges sent from the wrong email account, I also need to attach a PDF of a brochure for the recipient's printing. I don't see a way to do this. Can someone help? I did a search and it mentions a Visual Bas
-
6110navigator PCSuite "non-compatible mode"
Nokia 6110 Navigator Microsoft Windows XP Build 2600 Service Pack 2 Nokia PC Suite 6.84.10.3 Connectivity Cable Drivers 6.84.4.0 PC Connectivity Solution 7.22.7.1 Microsoft Bluetooth-stack 5.1.2600 Build 2180 Trying to update Route 66 with the DVD th
-
Dual network (n/g) config problems
Hi folks, I have been running my home network off a (previous gen) Airport Express. I have a new MacBook (n-compatible) and a 12" PowerBook (g-compatible). The interference in my neighborhood on the 2.4 ghz band is dreadful - lots of dropouts, inabil
-
We are users of SealedMedia Unsealer. We recently upgraded to Acrobat 9 Pro and realized the unsealer no longer works so I researched and discovered that Oracle purchased the product and upgraded it to work with Acrobat 9 Pro. I uninstalled the unsea