Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
Former Member
0 Kudos

If you want to map the characteristics or Key figures or Navigational attributes from Similar cubes. e.g. You have year wise cubes for 2012 and 2013, you want to map all fields from 2013 cube similar to 2012 cube in the Selected multiprovider then you can refer the below code. This will save much of your time as you need to go on mapping all fields and you might miss some one. This will map Chars, Key figures as well as Navigational attributes.

*&---------------------------------------------------------------------*

*& Report --- Name of program

*&

*&---------------------------------------------------------------------*

*&

*&

*&---------------------------------------------------------------------*

REPORT  Name of program.

TABLES : RSDICMULTIIOBJ.

DATA : IT TYPE STANDARD TABLE OF RSDICMULTIIOBJ,

        WA TYPE RSDICMULTIIOBJ.

DATA : IT2 TYPE STANDARD TABLE OF RSDICMULTIIOBJ,

        WA2 TYPE RSDICMULTIIOBJ.

SELECTION-SCREEN BEGIN OF BLOCK B WITH FRAME TITLE TEXT-001.

PARAMETERS : MULTI TYPE RSINFOPROV OBLIGATORY.

SELECTION-SCREEN COMMENT /33(60) V_MPT. "Object Text

PARAMETERS : EXISTING TYPE RSPARTPROV OBLIGATORY.

PARAMETERS : NEW TYPE RSPARTPROV OBLIGATORY.

SELECTION-SCREEN END OF BLOCK B.

AT SELECTION-SCREEN.

   SELECT SINGLE TXTLG

       INTO V_MPT

       FROM RSDCUBET

       WHERE LANGU = SY-LANGU

         AND INFOCUBE = MULTI

         AND OBJVERS = 'A'.

START-OF-SELECTION.

SELECT * FROM RSDICMULTIIOBJ INTO TABLE IT WHERE INFOCUBE = MULTI.

   LOOP AT IT INTO WA WHERE PARTCUBE = EXISTING.

     WA2-INFOCUBE = WA-INFOCUBE.

     WA2-OBJVERS = WA-OBJVERS.

     WA2-IOBJNM = WA-IOBJNM.

     WA2-PARTCUBE = NEW.

     WA2-PARTIOBJ = WA-PARTIOBJ.

*INSERT WA2 INTO TABLE RSDICMULTIIOBJ.

INSERT RSDICMULTIIOBJ FROM WA2.

CLEAR WA2.

ENDLOOP.

IF sy-subrc = 0.

MESSAGE : 'RECORD CREATED SUCCESFULLY' TYPE 'I'.

Else.

   MESSAGE : 'RECORD NOT CREATED' TYPE 'I'.

ENDIF.

You can modify the same based on your requirements.

Regards,

Dinesh

Labels in this area