Skip to Content

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 TEXT001.

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 SELECTIONSCREEN.

   SELECT SINGLE TXTLG

       INTO V_MPT

       FROM RSDCUBET

       WHERE LANGU = SYLANGU

         AND INFOCUBE = MULTI

         AND OBJVERS = ‘A’.

STARTOFSELECTION.

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

   LOOP AT IT INTO WA WHERE PARTCUBE = EXISTING.

     WA2INFOCUBE = WAINFOCUBE.

     WA2OBJVERS = WAOBJVERS.

     WA2IOBJNM = WAIOBJNM.

     WA2PARTCUBE = NEW.

     WA2PARTIOBJ = WAPARTIOBJ.

*INSERT WA2 INTO TABLE RSDICMULTIIOBJ.

INSERT RSDICMULTIIOBJ FROM WA2.

CLEAR WA2.

ENDLOOP.

IF sysubrc = 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

To report this post you need to login first.

Be the first to leave a comment

You must be Logged on to comment or reply to a post.

Leave a Reply