Managing Hierarchy ( Leaves & Nodes ) by ABAP Code
Has someone documentation about the functions included into these function pool?
RSSHIER
RSSHMT
I need to change (or create new) leaves's position from node N to node M..... all by ABAP Code.
Ciao,
claudio
Message was edited by: Claudio Caforio
Hi Claudio,
its worth to look into function pool RSHI: It has a lot of functions to insert and delete nodes.
You have to find out the hierarchy id and nodeid of the leave you want to move. Find also the nodeids of the parents (node N and M). read the attributes of your leave. Then first delete leave under node n, then insert a new node under m and use the attributes of the deleted node. There are function modules for it. As far as I remember you have to call some hierarchy_init fms to work correctly.
Regards,
Juergen
Similar Messages
-
Create CRM customer/account hierarchy node thru abap code
Hi,
Any one can help me on how to Create CRM customer/account hierarchy node thru abap code?
Is there any Class/methods, FMs that I can use to create node in customer/account hierarchy?
Sample codes will greatly help me.
I hope someone can help me on this since this is my urgent requirements on my project.
Thanks,
jamesJames,
You can find the FM, Class Lib and APIs under the package BUPA_HIERARCHY. -
Build Hierarchy with nodes with ABAP for custom Infoobject
Hi,
Need to build hierarchy with nodes with abap for custom infoobject.
ThanksHi,
Using information from:
http://help.sap.com/saphelp_nw04/helpdata/en/fa/e92637c2cbf357e10000009b38f936/content.htm
you can bulid flat file with hierarchy data and then load in into BW...
Krzys -
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. -
Create account/customer hierarchy thru ABAP codes
Hi,
Anyone can help me on how to create a account/customer hierarchy in CRM.
How can I create node, assign BP to a account/customer hierarchy.
Can anybody share some abap codes that can do this? Or give some FMs or documentation on how to do this.
Thanks!
jamesJames,
You can find the FM, Class Lib and APIs under the package BUPA_HIERARCHY. -
How to write abap code to create manual hierarchy
Hi,
This is urgent got to write abap code to create manual hierarchy.
ThanksHi Adam
Thanks for replying.
In my scenario i have one custom zinfoobject which have lots of attributes.
So, i have to create hierarchy for this zinfoobject with three nodes. one node/charateristic is present in this zinfoobject as attribute. which will be the first node of hierarchy.
Then second custom infoobject is external not present in attribute list. which will be the second node of hierarchy.
Third node will be for which i am creating hierarchy.
So basically need solution for this first.
some one will load hierarchy info in some table and then will create view on top of that then i have to create datasource on top of that and write a program to load the data from that view in this hierarchy.
Need solution for this abap program also.
Thanks
SAPBW -
Hierarchy Child Node Insert using ABAP Program
Hi,
Requirement is to add one more child node to an existing child Node for available Custom Cost Center Hierarchy (in BI environment). To meet this requirement, ABAP Code is best solution- CMOD-Exit EXIT_SAPLRSAP_004 (ZXRSAU04).
Is there any Function modules available for inserting Hierarchy Node. I have gone to "How to Download A Hierarchy to a Flat File.pdf" document.
Any Sample Codes or any documents (on the above mentioned topic) or suggestions to achieve the result is highly appreciated.
Regards,
SanniAny chance you could share what you did here?
I am looking to read values from a hierarchy using ABAP, and am not sure where to start. Is there a standard table where hierarchy information is stored, or are custom tables created per hierarchy created?
Cheers,
Andrew -
Hierarchy Time Dependent ABAP code
Dear Experts,
I want to ask a custom BADI ABAP code to get the hierarchy of a dimension member where Time Dependent Hieararchy is implemented in that dimension.
Currently we are using Interface method IF_UJA_DIM_DATA->get_hier_of_mbr to get the hierarchy reference.
Sample Code:
DATA: o_test TYPE REF TO if_uja_dim_data.
CALL METHOD o_test->get_hier_of_mbr
EXPORTING
i_member = lv_member
* i_dateto = lv_datum
RECEIVING
ro_hier = lo_hierarchy.
However after we implement the time dependent on the dimension, this method returns nothing unless we specified the i_dateto parameter to the method (which is optional).
While my requirement is to get the hierarchy of the member with the date when this logic is executed, putting SY-DATUM to this parameter does not give me the result that I need. I need to put the i_dateto as '99991231' so the hierarchy returned by this method is the latest hierarchy, but not the current date where this logic is executed.
Is there any way to make that the time hierarchy obtained is the one when the logic is executed? Or is there any other method that is feasible to meet with my requirements?
Thanks
Regards,
SiswonoHi Siswono,
Ok, I see what you mean.
Then I would suggest that you determine the hierarchy end date first.
read the hierarchy table by determine its technical name, then find the hierarchy with your date that's between the start date and end date, then you can use the end date for the next step.
use get_hier_of_mbr with the determined end date.
Andy -
ABAP code for Hierarchy Loading from Flat File
Hi,
Can anyone give me some idea / ABAP code for generating parent - child relationships (NODEIDS) from a flat file and load into BW.
Best regards
Any insight into this development is highly appreciatedHi,
also have a look at this how to to get informations about the file structure:
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/0403a990-0201-0010-38b3-e1fc442848cb
/manfred -
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 -
How to write ABAP code behind, the OLAP navigation functions
Hi SDN Community,
We have created an artificial hierarchy within BEx, using order structure elements, or characteristic key figures as SAP calls them.
Now, the only feature that dosent seem to be present within the OLAP, is to expand all hiearchy nodes.
It allows you to expand one hierarchy node, but not all the structure element nodes.
I have tried command sequencing by specifying the technical id's of the the structure elements found via RSRT2, but this dosen't work.
I have seen that when the nodes are expanded, that there is indeed standard SAP ABAP code executing back in the datawarehouse.
Hence, do you know
- Where to make ABAP enhancements for OLAP functionality
- How to execute this ABAP (will it be by using Web API and javascript enhancements)
- Is this possible, or has it been done by anyone?
Thank you.
SimonHi Thomas,
I have been working with a brilliant ABAP'er, and together we
implemented a solution in the START method, that makes use of the
following methods and expands all the hierarchy nodes at start.
And this class can be omitted in the Print all view we have formulated
as only a collapsed view has been specified there.
thank you.
Simon
I found this all in that class interface CL_RSR_REQUEST
for N_R_REQUEST
for N_R_DATA_SET
Initial Value: Set Drilldown State of a Hierarchy
Description: 'SET_DRILL_STATE'
this looks like the method that gets executed. what do you think?
can you code this in the program
constants C_CMD_SET_DRILL_STATE type RSRCMDID
value 'SET_DRILL_STATE'. "#EC NOTEXT
methods SET_DRILL_STATE
importing
value(I_AXIS) type RRXAXIS optional
value(I_POSITION) type I optional
value(I_FOCUS_IOBJNM) type RSIOBJNM optional
value(I_DRILLSTATE) type RRXDRILLSTATE optional
value(I_TOGGLE) type RS_BOOL default RS_C_FALSE
!I_R_PARAMETER type ref to CL_RSR_PARAMETER optional
exporting
!E_KEEP_LAST_LINES type I
!E_KEEP_FIRST_LINES type I
!E_NEW_LINES_FROM type I
!E_NEW_LINES_TO type I
!E_NODE_POSITION_FROM type I
!E_NODE_POSITION_TO type I
exceptions
NO_PROCESSING
X_MESSAGE . -
Structure of abap code in fi module
Hi all
I joined like fresher could you help me how to write the abap code
structure of the abap codeCHECK THIS
I HOPE IT WILL HELP YOU.
*& Report ZDTK_FI_CRDB
*& DESCRIPTION : CREDIT DEBIT NOTE FOR CUSTOMER OR VENDOR.
REPORT ZDTK_FI_CRDB NO STANDARD PAGE HEADING
LINE-COUNT 65(5)
LINE-SIZE 80
MESSAGE-ID ZTAR_FI
*& STRUCTURE DECLARATION
TYPES : BEGIN OF TY_ADDR,
BUKRS TYPE BUKRS, "COMPANY CODE
LIFNR TYPE LIFNR, "VENDOR NO
KUNNR TYPE KUNNR, "CUSTOMJER NO
NAME1 TYPE NAME1, "NAME1
NAME2 TYPE NAME2, "NAME2
ORT01 TYPE ORT01, "CITY
ORT02 TYPE ORT02,
PSTLZ TYPE PSTLZ, "POSTAL CODE
STRAS TYPE STRAS, "STREET
ADRNR TYPE ADRNR, "ADDRESS NO
TELF1 TYPE TELF1, "TELEFHONE NO
TELF2 TYPE TELF2, "TELEFHONE NO 2
TELFX TYPE TELFX, "FAX
END OF TY_ADDR,
BEGIN OF TY_LFA1,
KUNNR TYPE KUNNR, "CUSTOMJER NO
NAME1 TYPE NAME1, "NAME1
NAME2 TYPE NAME2, "NAME2
ORT01 TYPE ORT01, "CITY
ORT02 TYPE ORT02,
PSTLZ TYPE PSTLZ, "POSTAL CODE
STRAS TYPE STRAS, "STREET
ADRNR TYPE ADRNR, "ADDRESS NO
TELF1 TYPE TELF1, "TELEFHONE NO
TELF2 TYPE TELF2, "TELEFHONE NO 2
TELFX TYPE TELFX, "FAX
END OF TY_LFA1,
BEGIN OF TY_DOCM,
GJAHR TYPE GJAHR,
BELNR TYPE BELNR_D,
BUDAT TYPE BUDAT,
BLDAT TYPE BLDAT,
BLART TYPE BLART,
BSCHL TYPE BSCHL,
SHKZG TYPE SHKZG,
XBLNR TYPE XBLNR,
DMBTR TYPE DMBTR,
SGTXT TYPE SGTXT,
REBZG TYPE REBZG,
REBZJ TYPE REBZJ,
KUNNR TYPE KUNNR,
LIFNR TYPE LIFNR,
END OF TY_DOCM.
*& TABLE DECLARATION
DATA : T_ADDR TYPE STANDARD TABLE OF TY_ADDR,
*& WORK AREA DECLARATION
W_ADDR TYPE TY_ADDR,
W_DOCM TYPE TY_DOCM,
W_LFA1 TYPE TY_LFA1,
*& GLOBLE VARIABLE DECLARATION
G_KUNNR TYPE KUNNR,
G_LIFNR TYPE LIFNR,
DCAMT TYPE DMBTR.
*& INITIALIZATION
INITIALIZATION.
CLEAR :
*REFRESH :
*& SELECTION SCREEN DECLARATION
SELECTION-SCREEN: BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
SELECTION-SCREEN SKIP 1.
PARAMETERS : S_BUKRS TYPE BSID-BUKRS OBLIGATORY DEFAULT '1000'.
PARAMETERS : S_BELNR TYPE BELNR_D OBLIGATORY DEFAULT '1600000070'.
PARAMETERS : S_GJAHR TYPE GJAHR OBLIGATORY DEFAULT '2008'.
PARAMETERS : ASON TYPE BUDAT OBLIGATORY DEFAULT SY-DATUM.
PARAMETERS : S_KUNNR TYPE KUNNR MODIF ID GP1.
PARAMETERS : S_LIFNR TYPE LIFNR MODIF ID GP2.
SELECTION-SCREEN SKIP 1.
SELECTION-SCREEN : END OF BLOCK B1.
SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE TEXT-002.
SELECTION-SCREEN SKIP 1.
SELECTION-SCREEN BEGIN OF LINE.
PARAMETERS R1 RADIOBUTTON GROUP RAO DEFAULT 'X' USER-COMMAND hit.
SELECTION-SCREEN COMMENT (50) TEXT-003 FOR FIELD R1.
PARAMETERS R2 RADIOBUTTON GROUP RAO.
SELECTION-SCREEN COMMENT (50) TEXT-004 FOR FIELD R2.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN SKIP 1.
SELECTION-SCREEN END OF BLOCK B2.
*SELECTION-SCREEN: BEGIN OF BLOCK B3 WITH FRAME TITLE TEXT-005.
*SELECTION-SCREEN SKIP 1.
*SELECTION-SCREEN BEGIN OF LINE.
*PARAMETERS R3 RADIOBUTTON GROUP RAJ DEFAULT 'X' USER-COMMAND hit.
*SELECTION-SCREEN COMMENT (50) TEXT-006 FOR FIELD R1.
*PARAMETERS R4 RADIOBUTTON GROUP RAJ.
*SELECTION-SCREEN COMMENT (50) TEXT-007 FOR FIELD R2.
*SELECTION-SCREEN END OF LINE.
*SELECTION-SCREEN SKIP 1.
*SELECTION-SCREEN : END OF BLOCK B3.
*& AT SELECTION SCREEN
AT SELECTION-SCREEN.
PERFORM VALIDATE_SELECTION.
*& AT SELECTION SCREEN OUTPUT
AT SELECTION-SCREEN OUTPUT.
PERFORM SCREEN_OUTPUT.
*& START OF SELECTION
START-OF-SELECTION.
IF R1 = 'X'.
PERFORM GET_DOCUMENT_L.
ELSEIF R2 = 'X'.
PERFORM GET_DOCUMENT_K.
ENDIF.
*& END OF SELECTION
END-OF-SELECTION.
PERFORM DISPLAY.
*& TOP OF PAGE
*TOP-OF-PAGE.
PERFORM PAGE_HEADER.
*& Form VALIDATE_SELECTION
text
form VALIDATE_SELECTION .
DATA : L_BUKRS TYPE BSID-BUKRS.
SELECT SINGLE BUKRS FROM KNB1
INTO L_BUKRS
WHERE BUKRS = S_BUKRS.
*IF SY-SUBRC <> 0.
*MESSAGE E001.
*LEAVE LIST-PROCESSING.
*ENDIF.
DATA : L_KUNNR TYPE BSID-KUNNR.
SELECT SINGLE KUNNR FROM BSID
INTO L_KUNNR
WHERE KUNNR = S_KUNNR.
*IF SY-SUBRC <> 0.
*MESSAGE E002.
*LEAVE LIST-PROCESSING.
*ENDIF.
endform. " VALIDATE_SELECTION
*& Form SCREEN_OUTPUT
text
form SCREEN_OUTPUT .
IF R1 = 'X'.
LOOP AT SCREEN.
if screen-group1 = 'GP1'.
SCREEN-active = '0'.
*SCREEN-INTENSIFIED = '0'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ELSE.
LOOP AT SCREEN.
IF SCREEN-group1 = 'GP2'.
SCREEN-active = '0'.
*SCREEN-INTENSIFIED = '1'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.
endform. " SCREEN_OUTPUT
*& Form GET_DOCUMENT_L
text
FORM GET_DOCUMENT_L .
DATA : MESSG(60).
SELECT SINGLE BUKRS
LIFNR
GJAHR
BELNR
BUDAT
BLDAT
BLART
BSCHL
SHKZG
DMBTR
SGTXT
REBZG
REBZJ FROM BSIK
INTO CORRESPONDING FIELDS OF W_DOCM
WHERE BUKRS = S_BUKRS AND
GJAHR = S_GJAHR AND
BELNR = S_BELNR.
SELECT SINGLE DMBTR FROM BSIK INTO DCAMT
WHERE BELNR = W_DOCM-REBZG AND
GJAHR = W_DOCM-REBZJ.
IF NOT W_DOCM IS INITIAL.
PERFORM GET_LFA1.
ELSE.
SELECT SINGLE BUKRS
LIFNR
GJAHR
BELNR
BUDAT
BLDAT
BLART
BSCHL
SHKZG
DMBTR
SGTXT
REBZG
REBZJ FROM BSAK
INTO CORRESPONDING FIELDS OF W_DOCM
WHERE BUKRS = S_BUKRS AND
GJAHR = S_GJAHR AND
BELNR = S_BELNR.
SELECT SINGLE DMBTR FROM BSAK INTO DCAMT
WHERE BELNR = W_DOCM-REBZG AND
GJAHR = W_DOCM-REBZJ.
IF NOT W_DOCM IS INITIAL.
PERFORM GET_LFA1.
ELSE.
CONCATENATE 'THERE IS NO DOCUMENT NO' S_BELNR S_GJAHR 'FOR VENDOR' INTO MESSG
SEPARATED BY SPACE.
MESSAGE I011 WITH MESSG.
LEAVE LIST-PROCESSING.
ENDIF.
ENDIF.
ENDFORM. " GET_DOCUMENT_L
*& Form GET_LFA1
text
FORM GET_LFA1 .
SELECT SINGLE LIFNR
NAME1
NAME2
ORT01
ORT02
PSTLZ
STRAS
ADRNR
TELF1
TELF2
TELFX FROM LFA1 INTO CORRESPONDING FIELDS OF W_ADDR
WHERE LIFNR = W_DOCM-LIFNR.
ENDFORM. " GET_LFA1
*& Form GET_DOCUMENT_K
text
FORM GET_DOCUMENT_K .
DATA : MESSG(60).
SELECT SINGLE BUKRS
KUNNR
LIFNR
GJAHR
BELNR
BUDAT
BLDAT
BLART
BSCHL
SHKZG
DMBTR
SGTXT
REBZG
REBZJ FROM BSID
INTO CORRESPONDING FIELDS OF W_DOCM
WHERE BUKRS = S_BUKRS AND
GJAHR = S_GJAHR AND
BELNR = S_BELNR.
SELECT SINGLE DMBTR FROM BSID INTO DCAMT
WHERE BELNR = W_DOCM-REBZG AND
GJAHR = W_DOCM-REBZJ.
IF NOT W_DOCM IS INITIAL.
PERFORM GET_KNA1.
ELSE.
SELECT SINGLE BUKRS
KUNNR
LIFNR
GJAHR
BELNR
BUDAT
BLDAT
BLART
BSCHL
SHKZG
DMBTR
SGTXT
REBZG
REBZJ FROM BSAD
INTO CORRESPONDING FIELDS OF W_DOCM
WHERE BUKRS = S_BUKRS AND
GJAHR = S_GJAHR AND
BELNR = S_BELNR.
SELECT SINGLE DMBTR FROM BSAD INTO DCAMT
WHERE BELNR = W_DOCM-REBZG AND
GJAHR = W_DOCM-REBZJ.
IF NOT W_DOCM IS INITIAL.
PERFORM GET_KNA1.
ELSE.
CONCATENATE 'THERE IS NO DOCUMENT NO' S_BELNR S_GJAHR 'FOR CUSTOMER' INTO MESSG
SEPARATED BY SPACE.
MESSAGE I011 WITH MESSG.
LEAVE LIST-PROCESSING.
ENDIF.
ENDIF.
ENDFORM. " GET_DOCUMENT_K
*& Form GET_KNA1
text
FORM GET_KNA1 .
SELECT SINGLE KUNNR
NAME1
NAME2
ORT01
ORT02
PSTLZ
STRAS
ADRNR
TELF1
TELF2
TELFX FROM KNA1 INTO CORRESPONDING FIELDS OF W_ADDR
WHERE KUNNR = W_DOCM-KUNNR.
ENDFORM. " GET_KNA1
*& Form DISPLAY
text
FORM DISPLAY .
LONG TEXT *************************
*DATA : BEGIN OF inline OCCURS 0,
*END OF inline.
*TYPES: BEGIN OF TY_LONGT,
tdformat TYPE tdformat,
tdline TYPE tdline,
END OF TY_LONGT.
*DATA : TLONGT TYPE STANDARD TABLE OF TY_LONGT,
WLONGT TYPE TY_LONGT.
DATA: BEGIN OF DTEXT OCCURS 50.
*DATA: MATNR LIKE PBIM-MATNR.
INCLUDE STRUCTURE TLINE.
DATA: END OF DTEXT.
DATA: BEGIN OF HTEXT.
INCLUDE STRUCTURE THEAD.
DATA: END OF HTEXT.
DATA: BEGIN OF LTEXT OCCURS 50.
INCLUDE STRUCTURE TLINE.
DATA: END OF LTEXT.
DATA: TNAME LIKE THEAD-TDNAME.
CONCATENATE S_BUKRS W_DOCM-BELNR S_GJAHR '002' INTO TNAME.
*SEPARATED BY SPACE.
DATA : W_STXL TYPE STXL.
SELECT SINGLE * FROM STXL INTO W_STXL
WHERE TDNAME = TNAME.
IF NOT W_STXL IS INITIAL.
*SELECT * FROM PBIM WHERE WERKS IN S_WERKS.
*MOVE PBIM-BDZEI TO TNAME.
CALL FUNCTION 'READ_TEXT'
EXPORTING
CLIENT = SY-MANDT
ID = W_STXL-TDID
LANGUAGE = W_STXL-TDSPRAS
NAME = TNAME
OBJECT = W_STXL-TDOBJECT
ARCHIVE_HANDLE = 0
LOCAL_CAT = ' '
IMPORTING
HEADER = HTEXT
TABLES
LINES = LTEXT
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.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
LOOP AT LTEXT.
IF LTEXT-TDLINE NE ''.
MOVE LTEXT-TDLINE TO DTEXT-TDLINE.
APPEND DTEXT.
ENDIF.
ENDLOOP.
ENDIF.
LONG TEXT *************************
CUSTOMER / VENDOR NO *************************
DATA : CUVE(10).
IF R1 = 'X'.
CUVE = W_ADDR-LIFNR.
ELSEIF R2 = 'X'.
CUVE = W_ADDR-KUNNR.
ENDIF.
CUSTOMER / VENDOR NO *************************
CR / DR DATA *************************
IF DCAMT IS INITIAL.
SELECT SINGLE DMBTR FROM BSIS INTO DCAMT
WHERE BELNR = W_DOCM-REBZG AND
GJAHR = W_DOCM-REBZJ .
( KOART = 'D' OR KOART = 'K' ).
ENDIF.
CR / DR DATA *************************
DATA: CNAME TYPE BUTXT.
SELECT SINGLE BUTXT FROM T001 INTO CNAME
WHERE BUKRS = S_BUKRS.
DATA : NAME(60),
STREET(60),
TELFX(60).
CONCATENATE W_ADDR-NAME1 W_ADDR-NAME2 INTO NAME
SEPARATED BY SPACE.
CONCATENATE W_ADDR-ORT01 W_ADDR-ORT02 'POSTAL CODE :' W_ADDR-PSTLZ INTO STREET
SEPARATED BY SPACE.
CONCATENATE 'Tel No.:' W_ADDR-TELF1 W_ADDR-TELF2 'FAX :' W_ADDR-TELFX INTO TELFX
SEPARATED BY SPACE.
DATA : CRDB(20),
CRDBA(16),
BALC TYPE DMBTR.
IF W_DOCM-SHKZG = 'S'.
CRDB = 'Debit Note No. :'.
CRDBA = 'DEBIT'.
BALC = DCAMT + W_DOCM-DMBTR.
ELSEIF W_DOCM-SHKZG = 'H'.
CRDB = 'Credit Note No. :'.
CRDBA = 'CREDIT'.
BALC = DCAMT - W_DOCM-DMBTR.
ENDIF.
SKIP 5.
*FORMAT INVERSE.
ULINE 03(77).
WRITE : 03 SY-VLINE, 80 '|',
/03 SY-VLINE, NAME, 54 'Party No.:' COLOR 7, CUVE COLOR 7, 80 '|',
/03 SY-VLINE, W_ADDR-STRAS, 80 '|',
/03 SY-VLINE, STREET, 80 '|',
/03 SY-VLINE, TELFX, 80 '|',
/03 SY-VLINE, 80 '|',
/03 SY-VLINE, 80 '|',
/03 SY-VLINE, 80 '|',
/03 SY-VLINE, 05 CNAME COLOR 2, 80 '|',
/03 SY-VLINE, 36 CRDB RIGHT-JUSTIFIED, 59 W_DOCM-BELNR, 71 W_DOCM-GJAHR, 80 '|',
/03 SY-VLINE, 58 'DATE :', W_DOCM-BUDAT, 80 '|',
/03 SY-VLINE, 80 '|'. ULINE 03(77).
WRITE : /03 SY-VLINE, 80 '|'.
IF NOT DTEXT IS INITIAL.
LOOP AT DTEXT.
WRITE : /03 SY-VLINE, 05 DTEXT-TDLINE COLOR 1, 80 '|'.
ENDLOOP.
ELSEIF W_DOCM-SGTXT NE ''.
WRITE : /03 SY-VLINE, 05 W_DOCM-SGTXT COLOR 1, 80 '|'.
ELSE.
WRITE : /03 SY-VLINE, 80 '|'.
ENDIF.
WRITE : /03 SY-VLINE, 80 '|',
*WRITE : /03 SY-VLINE, TNAME, 80 '|',
/03 SY-VLINE, 80 '|',
/03 SY-VLINE, 80 '|',
/03 SY-VLINE, 80 '|',
/03 SY-VLINE, 08 'WORKING OF INTEREST CALCULATION AS ON ' COLOR 4,
47 ASON COLOR 4, ' [ 360 DAYS BASIS ]' COLOR 4, 80 '|',
/03 SY-VLINE, 80 '|'. ULINE 03(77).
WRITE : /03 SY-VLINE, 11 'DATE', 23 'INVOICE', 41 CRDBA, 55 'BALANCE', 64 'DAYS', 70 'INTEREST', 80 '|',
/03 SY-VLINE, 23 ' AMOUNT', 41 'AMOUNT', 55' AMOUNT', 70 ' @ 8.00% ', 80 '|',
/03 SY-VLINE, 80 '|'. ULINE 03(77).
WRITE : /03 SY-VLINE, 80 '|',
/03 SY-VLINE, 06 W_DOCM-BUDAT, 15 DCAMT, 32 W_DOCM-DMBTR, 47 BALC, 80 '|',
/03 SY-VLINE, 80 '|',
/03 SY-VLINE, 80 '|',
/03 SY-VLINE, 80 '|',
/03 SY-VLINE, 80 '|',
/03 SY-VLINE, 80 '|',
/03 SY-VLINE, 80 '|',
/03 SY-VLINE, 80 '|',
/03 SY-VLINE, 80 '|',
/03 SY-VLINE, 80 '|',
/03 SY-VLINE, 80 '|'. ULINE 03(77).
WRITE : /03 SY-VLINE, 80 '|',
/03 SY-VLINE, 80 '|',
/03 SY-VLINE, 80 '|',
/03 SY-VLINE, 10 'PREPARED BY', 35 'ACCOUNTANT', 60 'MANAGER', 80 '|',
/03 SY-VLINE, 80 '|',
/03 SY-VLINE, 80 '|'. ULINE 03(77).
ENDFORM. " DISPLAY -
Regarding 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,Hi Manmit,
The following link can guide you on how to write customer exits (this has example as well)
[http://help.sap.com/saphelp_nw70/helpdata/EN/61/579b3c494d8e15e10000000a114084/frameset.htm]
Hope this helps.
Cheers,
Sumit -
Q: ABAP code from db to memory decreases performance?
Hi Gurus,
We have a problem with some ABAP code (a start routine in a BI load). Basically the situation is: we had some code that builds a hierarchy (and inserts into hierarchy table) based on an attribute load, which worked fine but was to slow.
As we do not need the hierarchy anymore we changed the code to only build the hierarchy in memory (the reason why we need it at all is because building this is the only way we can ensure to load the right records in the attribute load) and now, it is sloweru2026.which we do not understand.
In general we have replaced:
SELECT SINGLE * FROM /BIC/HZTVFKORG INTO nodelast
WHERE nodeid = lastnode2.
With:
READ TABLE VirtHierarchy INTO nodelast
WITH KEY nodeid = lastnode2.
And replaced:
UPDATE /BIC/HZTVFKORG FROM nodelast.
With:
MODIFY TABLE VirtHierarchy FROM nodelast.
And replaced:
INSERT INTO /BIC/HZTVFKORG VALUES node.
With:
APPEND node TO VirtHierarchy.
As we see it, this should increase the performance of the start routine and the load (it takes several hours for just 50000 records), but it is actually running slower now...
Does anybody have any idea about why this is not improving performance?
Thank you in advance,
MikaelDear Mikael Kilaker,
There are few reason:
1. Data overload in memory.
, if you try to execute
SELECT SINGLE * FROM /BIC/HZTVFKORG INTO nodelast
WHERE nodeid = lastnode2.
With:
READ TABLE VirtHierarchy INTO nodelast
WITH KEY nodeid = lastnode2.
And replaced:
UPDATE /BIC/HZTVFKORG FROM nodelast.
With:
MODIFY TABLE VirtHierarchy FROM nodelast.
And replaced:
INSERT INTO /BIC/HZTVFKORG VALUES node.
With:
APPEND node TO VirtHierarchy.
inside any loop conditions, this approach will make the system slow because it will load entire table into memory then system still need to cater space for selected value thus make system not really effective when you execute large volume of data.
2. Unsorted data.
It is really great practice if you sort nodelast. It is extra steps but the effect greatly decreased response time when system manipulating sorted data in the internal table.
3. Use binary search in READ table.
Try to use this code
READ TABLE VirtHierarchy INTO nodelast
WITH KEY nodeid = lastnode2 BINARY SEARCH.
this practice also will increase performance when you execute large data inside internal table.
Do reward points if this helps you -
Automatically add Internal leave node
Hello,
I'm facing a problem for automated import to hierarchy tables.
Basically I want to import values into a hierarchy table. This works quite fine. The problem now arises as I need EVERY node as an internal leave node within my repository. This should be done automatically as the hierarchy is updated once a day and may contain modifications (e.g. an additional new node).
I read in the import manager documentation that quite a similar thins can be done using the "Non Leave Trailing NULLS" setting, but this just MAPS null-values to EXISTING internal leave nodes, but I would like to create internal leave nodes on import.
Any idea is welcome. Solutions will be rewarded.
Thanks,
AndreasHello Tanveer,
thanks for the answer: So there seems no way to achieve this with standard MDM functionality.
Is there any chance you share your coding?
Regards,
Andreas
Maybe you are looking for
-
ODI repository and Java EE agent on different servers
Hi all, I ahd created ODI repository on one data server(172.18.59.67) through RCU. Now due to some memory issues i ahd to install the ODI software on another server (172.18.41.44) and also configured the java ee agent on this second server. Will that
-
I Want to purchase music and put it on my iPad 2. the store gives you options to upload. Which upload option will go to my music app on ipad2?
-
We are using session Beans in our project, to make portability across different servers (Jboss, Weblogic, Websphere) is any modifications required in the deployment descriptor specific to application servers? Currently we are using jboss application
-
The machine is equipped with NT4.0 sp5, and was using an old PC-TIO-10 with NIDAQ6.1. We decided to sobstitute the board with a PCI-6023E, as we needed some analog signal inputs. We installed NIDAQ6.8.1 (without first uninstalling 6.1 version), put a
-
AirTunes audio keeps dropping out.
I have an Airport Express connected to some speakers and every now and again the audio will simply drop out, it'll come back in a few seconds or not at all. Sometimes iTunes will give an error saying that it can't connect to the speakers and other ti